chenlu
2024-03-18 c577b4a49b6520ffce8cc9fc63aa23a85dac052b
north-glass-erp/target/classes/mapper/pp/ReportingWork.xml
@@ -22,6 +22,7 @@
        <result property="completedArea" column="completedArea"/>
        <result property="wornArea" column="wornArea"/>
        <result property="qualityInspector" column="quality_inspector"/>
        <result property="qualityInsTime" column="quality_ins_time"/>
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result property="customerId" column="customer_id"/>
@@ -63,6 +64,7 @@
    </resultMap>
<!--    查询当前工序的表头数据-->
    <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap">
        select o.order_id,
               fc.production_id,
@@ -126,8 +128,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
@@ -170,9 +173,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
@@ -318,7 +322,7 @@
            and c.technology_number = a.technology_number
        where
            a.process_id=SUBSTR(#{processId} from 1 for 13)
            a.process_id=SUBSTR(#{processId} from 1 for 14)
            and a.order_number = #{orderNumber}
            and a.technology_number = #{technologyNumber}
    </select>
@@ -342,7 +346,7 @@
                                   and c.technology_number = a.technology_number
        where
            a.process_id=SUBSTR(#{processId} from 1 for 13)
            a.process_id=SUBSTR(#{processId} from 1 for 14)
          and a.order_number = #{orderNumber}
          and a.technology_number = #{technologyNumber}
    </select>
@@ -363,6 +367,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
@@ -375,8 +380,8 @@
                    )  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,
@@ -447,9 +452,9 @@
               o.batch,
               rw.this_process,
               rw.this_completed_quantity,
               (ogd.area * rw.this_completed_quantity) as completedArea,
               round(ogd.area * rw.this_completed_quantity,2) as completedArea,
               rw.this_worn_quantity,
               (ogd.area * rw.this_worn_quantity)      as wornArea,
               round(ogd.area * rw.this_worn_quantity,2)      as wornArea,
               rw.device_name,
               rw.teams_groups_name,
               rw.reviewed_state
@@ -591,6 +596,7 @@
               rw.previous_process,
               rw.next_process,
               rw.quality_inspector,
               rw.quality_ins_time,
               dd.quality_ins_status
        from sd.order as o
                 left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id