廖井涛
2024-03-15 5a5e59f8aaa2a030511ef245886bf6d1db9bf774
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -11,10 +11,22 @@
        <result property="thisProcess" column="this_process"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="previousProcessQuantity" column="previous_process_quantity"/>
        <result property="reportingWorkTime" column="reporting_work_time"/>
        <result property="thisCompletedQuantity" column="this_completed_quantity"/>
        <result property="thisWornQuantity" column="this_worn_quantity"/>
        <result property="deviceName" column="device_name"/>
        <result property="teamsGroupsName" column="teams_groups_name"/>
        <result property="reviewedState" column="reviewed_state"/>
        <result property="reportingWorkId" column="reporting_work_id"/>
        <result property="processId" column="process_id"/>
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
            <result property="customerName" column="customer_name"/>
            <result property="project" column="project"/>
            <result property="batch" column="batch"/>
        </association>
        <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard">
            <result property="orderId" column="order_id"/>
@@ -22,6 +34,9 @@
        </association>
        <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail">
            <result property="completedQuantity" column="completed_quantity"/>
        </association>
        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
            <result property="area" column="area"/>
        </association>
    </resultMap>
@@ -89,8 +104,9 @@
            od.shape,
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num_count as completed,
            odpd.broken_num as onceBroken
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
            sd.order_detail AS od
        LEFT JOIN sd.order_glass_detail AS ogd
@@ -133,9 +149,10 @@
            od.shape,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity,
            odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as completedQuantity,
            odpd.reporting_work_num_count as completed,
            odpd.reporting_work_num as completed,
            odpd.broken_num as onceBroken,
            ogd.`group`
            ogd.`group`,
            if(fc.quantity -odpd.reporting_work_num = 0 ,true,false) as saveFlag -- 判断是否已经完成,已经完成不序号和同序号数量相同才能提交
        FROM
@@ -326,6 +343,7 @@
            a.completed_quantity as 'completedQuantity', -- 完工数
            a.breakage_quantity as 'breakageQuantity', -- 破损数
            f.completed_quantity as thisQuantitySum ,-- 本工序完工和
            if(c.quantity-f.completed_quantity = 0 ,true,false) as saveFlag,
            <if test="nextProcess != null and nextProcess != ''">  -- 非最后一道工序
                ifnull(g.completed_quantity,0) as nextQuantitySum,  -- 后工序已完成
                if((f.completed_quantity
@@ -335,18 +353,18 @@
                    0,
                   (a.completed_quantity-f.completed_quantity
                       +ifnull(g.completed_quantity,0))
                    )  as minQuantity1 -- 修改最小数
                    )  as minQuantity -- 修改最小数
            </if>
            <if test="nextProcess == null or nextProcess == ''">  -- 最后一道工序
              c.received_quantity, -- 已入库数量
              c.inventory_quantity, -- 库存数量
#               c.received_quantity, -- 已入库数量
#               c.inventory_quantity, --   库存数量
              if(ifnull(inventory_quantity,0)
                 -ifnull(c.received_quantity,0)
                 &gt;= a.completed_quantity,0,
                (a.completed_quantity-(ifnull(c.inventory_quantity,0)
                    -ifnull(c.received_quantity,0)))
                )
                as minQuantity2 -- 修改最小数
                as minQuantity -- 修改最小数
            </if>
            -- e.thisQuantitySum
        from
@@ -401,7 +419,7 @@
        </if>
        where a.reporting_work_id = #{reportingWorkId}
    </select>
 <select id="selectReportingWorkMp" resultMap="reportingWorkMap">
<select id="selectReportingWorkMp" resultMap="reportingWorkMap">
        select rw.reporting_work_id,
               (rw.reporting_work_time) as reporting_work_time,
               o.order_id,