Fancy
2024-08-27 5e75ef24e5dd45ae934dc7f03f6c7736ca73c9ff
fix order search
4个文件已修改
22 ■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java
@@ -38,7 +38,7 @@
    public Long proId;
    @TableField(exist = false)
    public String proName;
    public String name;
    /**
    * 生产数量
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -11,7 +11,7 @@
            <result property="number" column="number" jdbcType="INTEGER"/>
            <result property="completeNumber" column="complete_number" jdbcType="INTEGER"/>
            <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" />
            <result property="proName" column="pro_id" jdbcType="VARCHAR"/>
            <result property="name" column="pro_id" jdbcType="VARCHAR"/>
           <!-- <association property="proName" column="pro_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager"/>-->
    </resultMap>
@@ -38,6 +38,16 @@
        ON oi.pro_id = pp.id
        GROUP BY oi.id,oi.order_id,oi.pro_id,oi.number) aa
    </select>
    <select id="selectDistinctPro"  parameterType="java.lang.Long" resultMap="BaseResultMap">
        <!--Distinct出order_id中的产品   Base_Column_List-->
        select DISTINCT(oi.order_id),oi.pro_id,pp.`name`
        from (SELECT * from  pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi
        LEFT JOIN plt_product pp
        ON oi.pro_id = pp.id
        GROUP BY oi.order_id,oi.pro_id
        ORDER BY oi.order_id
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from pr_order_item
        where  id = #{id,jdbcType=BIGINT} 
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
@@ -21,6 +21,9 @@
    <resultMap id="BaseResultMap2" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap">
        <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="com.dy.pmsGlobal.daoPr.PrOrderItemMapper.selectItems" column="id" />
    </resultMap>
    <resultMap id="BaseResultMap3" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap">
        <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="com.dy.pmsGlobal.daoPr.PrOrderItemMapper.selectDistinctPro" column="id" />
    </resultMap>
    <sql id="Base_Column_List">
        id,`name`,customer_name,project_name,
        director,d_mobile,delivery_date,
@@ -107,7 +110,8 @@
            </if>
        </trim>
    </select>
    <select id="selectAll" resultMap="BaseResultMap2">
    <!--下拉菜单 实现订单 产品联动效果-->
    <select id="selectAll" resultMap="BaseResultMap3">
        select
        <include refid="Base_Column_List" />
        from pr_order p
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
@@ -124,7 +124,7 @@
    }
    private void changeRate(PrOrder prOrder) {
        if (prOrder.items != null) {
        if (prOrder != null && prOrder.items != null) {
            List<PrOrderItem> items = prOrder.items;
            for (int i = 1; i < items.size(); i++) {
                for (int j = i - 1; j >= 0; j--) {