Browse Source

2026-03-03

pda数量优化
master
fengyuan_yang 4 days ago
parent
commit
6dc79a158f
  1. 2
      src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml
  2. 10
      src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml
  3. 10
      src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml
  4. 13
      src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml
  5. 9
      src/main/resources/mapper/salesReturn/SalesReturnMapper.xml

2
src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml

@ -21,7 +21,7 @@
INNER JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no INNER JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no
LEFT JOIN po_order_roll_no pr ON d.site = pr.site and d.bu_no = pr.bu_no and d.inspection_no = pr.inspection_no AND d.part_no = pr.part_no LEFT JOIN po_order_roll_no pr ON d.site = pr.site and d.bu_no = pr.bu_no and d.inspection_no = pr.inspection_no AND d.part_no = pr.part_no
WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName}) WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName})
and h.order_type = '采购入库' and h.close_flag = 'N' AND h.order_status = '待入库' and d.in_warehouse = #{warehouseId}
and h.order_type = '采购入库' and h.close_flag = 'N' AND h.order_status = '待入库' and d.in_warehouse = #{warehouseId} and d.show_flag = 'Y'
<if test="searchCode != null and searchCode != ''"> <if test="searchCode != null and searchCode != ''">
AND ( AND (
h.order_no LIKE CONCAT('%', #{searchCode}, '%') h.order_no LIKE CONCAT('%', #{searchCode}, '%')

10
src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml

@ -17,10 +17,10 @@
sum(D.required_qty) as labelCount --需入库总数 sum(D.required_qty) as labelCount --需入库总数
FROM inbound_notification_head h FROM inbound_notification_head h
LEFT JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no LEFT JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no
INNER JOIN ShopOrder sh ON d.site = sh.site and d.bu_no = sh.bu_no and d.related_order_no = sh.OrderNo and d.part_no = sh.PartNo
INNER JOIN SFDC_Rolls pr ON sh.site = pr.site and sh.bu_no = pr.bu_no and sh.OrderNo = pr.OrderNo AND D.roll_no = PR.RollNo
INNER JOIN ShopOrder sh ON d.site = sh.site and d.bu_no = sh.bu_no and d.related_order_no = sh.OrderNo and d.part_no = sh.PartNo
INNER JOIN SFDC_Rolls pr ON sh.site = pr.site and sh.bu_no = pr.bu_no and sh.OrderNo = pr.OrderNo AND D.roll_no = PR.RollNo
WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName}) WHERE h.site = #{site} and h.bu_no in (select bu_no from AccessBu where username = #{userName})
AND h.order_type = '生产入库' and d.in_warehouse = #{warehouseId} AND h.order_status = '待入库'
AND h.order_type = '生产入库' and d.in_warehouse = #{warehouseId} AND h.order_status = '待入库' and d.show_flag = 'Y'
<if test="searchCode != null and searchCode != ''"> <if test="searchCode != null and searchCode != ''">
AND ( AND (
h.order_no LIKE CONCAT('%', #{searchCode}, '%') h.order_no LIKE CONCAT('%', #{searchCode}, '%')
@ -48,8 +48,8 @@
SUM(D.required_qty) as labelCount --需入库总数 SUM(D.required_qty) as labelCount --需入库总数
FROM inbound_notification_head h FROM inbound_notification_head h
LEFT JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no LEFT JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no
INNER JOIN ShopOrder sh ON d.site = sh.site and d.bu_no = sh.bu_no and d.related_order_no = sh.OrderNo and d.part_no = sh.PartNo
INNER JOIN SFDC_Rolls pr ON sh.site = pr.site and sh.bu_no = pr.bu_no and sh.OrderNo = pr.OrderNo
INNER JOIN ShopOrder sh ON d.site = sh.site and d.bu_no = sh.bu_no and d.related_order_no = sh.OrderNo and d.part_no = sh.PartNo
INNER JOIN SFDC_Rolls pr ON sh.site = pr.site and sh.bu_no = pr.bu_no and sh.OrderNo = pr.OrderNo AND D.roll_no = PR.RollNo
WHERE WHERE
h.site = #{site} h.site = #{site}
AND h.bu_no = #{buNo} AND h.bu_no = #{buNo}

10
src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml

@ -14,7 +14,7 @@
0 as totalLabels, 0 as totalLabels,
0 as availableLabels, 0 as availableLabels,
SUM(CAST(a.QtyToIssue AS float)) as totalQty, SUM(CAST(a.QtyToIssue AS float)) as totalQty,
0 as availableQty ,
SUM(CAST(a.actual_out_qty AS float)) as availableQty ,
b.NotifyDate as required_outbound_date, b.NotifyDate as required_outbound_date,
0 AS pickedLabels, 0 AS pickedLabels,
0 AS pickedQty 0 AS pickedQty
@ -22,14 +22,10 @@
INNER JOIN SOIssueNotifyOrderMaterialList a ON A.SITE = B.SITE AND A.NotifyNo = B.NotifyNo INNER JOIN SOIssueNotifyOrderMaterialList a ON A.SITE = B.SITE AND A.NotifyNo = B.NotifyNo
INNER JOIN SOIssueNotifyOrderList D ON A.SITE = D.SITE AND A.NotifyNo = D.NotifyNo AND D.ItemNo = A.ItemNo INNER JOIN SOIssueNotifyOrderList D ON A.SITE = D.SITE AND A.NotifyNo = D.NotifyNo AND D.ItemNo = A.ItemNo
where a.site = #{site} and b.bu in (select bu_no from AccessBu where username = #{userName}) where a.site = #{site} and b.bu in (select bu_no from AccessBu where username = #{userName})
AND b.Status = '待出库'
AND a.warehouse_id = #{warehouseId}
AND b.Status = '待出库' AND a.warehouse_id = #{warehouseId} and a.show_flag = 'Y'
<if test="searchCode != null and searchCode != ''"> <if test="searchCode != null and searchCode != ''">
AND (b.NotifyNo LIKE CONCAT('%', #{searchCode}, '%') or D.SOOrderNo LIKE CONCAT('%', #{searchCode}, '%')) AND (b.NotifyNo LIKE CONCAT('%', #{searchCode}, '%') or D.SOOrderNo LIKE CONCAT('%', #{searchCode}, '%'))
</if> </if>
<!-- <if test="searchCode == null or searchCode == ''">-->
<!-- AND CONVERT(DATE, b.NotifyDate) = CONVERT(DATE, GETDATE())-->
<!-- </if>-->
GROUP BY GROUP BY
b.site, b.NotifyNo, b.bu ,b.NotifyDate b.site, b.NotifyNo, b.bu ,b.NotifyDate
ORDER BY b.NotifyDate DESC ORDER BY b.NotifyDate DESC
@ -46,7 +42,7 @@
0 as totalLabels, 0 as totalLabels,
0 as availableLabels, 0 as availableLabels,
SUM(CAST(a.QtyToIssue AS float)) as totalQty, SUM(CAST(a.QtyToIssue AS float)) as totalQty,
0 as availableQty ,
SUM(CAST(a.actual_out_qty AS float)) as availableQty ,
b.NotifyDate as required_outbound_date, b.NotifyDate as required_outbound_date,
0 AS pickedLabels, 0 AS pickedLabels,
0 AS pickedQty, 0 AS pickedQty,

13
src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml

@ -15,7 +15,7 @@
0 as totalLabels, 0 as totalLabels,
0 as availableLabels, 0 as availableLabels,
SUM(CAST(d.required_qty AS float)) as totalQty, SUM(CAST(d.required_qty AS float)) as totalQty,
ISNULL(d.actual_out_qty,0) as availableQty,
SUM(CAST(d.actual_out_qty AS float)) as availableQty,
h.required_outbound_date AS createDate h.required_outbound_date AS createDate
FROM outbound_notification_head h FROM outbound_notification_head h
INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no
@ -23,17 +23,14 @@
AND h.order_type = '销售出库' AND h.order_type = '销售出库'
AND h.close_flag = 'N' AND h.close_flag = 'N'
AND h.order_status = '待出库' AND h.order_status = '待出库'
AND d.out_warehouse = #{warehouseId}
AND d.out_warehouse = #{warehouseId} and d.show_flag = 'Y'
<if test="searchCode != null and searchCode != ''"> <if test="searchCode != null and searchCode != ''">
AND ( AND (
h.order_no LIKE CONCAT('%', #{searchCode}, '%') h.order_no LIKE CONCAT('%', #{searchCode}, '%')
OR d.related_order_no LIKE CONCAT('%', #{searchCode}, '%') OR d.related_order_no LIKE CONCAT('%', #{searchCode}, '%')
) )
</if> </if>
<!-- <if test="searchCode == null or searchCode == ''">-->
<!-- AND CONVERT(DATE, h.required_outbound_date) = CONVERT(DATE, GETDATE())-->
<!-- </if>-->
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no, d.actual_out_qty
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no
ORDER BY h.required_outbound_date DESC ORDER BY h.required_outbound_date DESC
</select> </select>
@ -49,14 +46,14 @@
0 as totalLabels, 0 as totalLabels,
0 as availableLabels, 0 as availableLabels,
SUM(CAST(d.required_qty AS float)) as totalQty, SUM(CAST(d.required_qty AS float)) as totalQty,
ISNULL(d.actual_out_qty,0) as availableQty,
SUM(CAST(d.actual_out_qty AS float)) as availableQty,
h.required_outbound_date AS createDate h.required_outbound_date AS createDate
FROM outbound_notification_head h FROM outbound_notification_head h
INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no INNER JOIN outbound_notification_detail d ON h.order_no = d.order_no AND h.site = d.site and h.bu_no = d.bu_no
WHERE h.order_no = #{outboundNo} WHERE h.order_no = #{outboundNo}
AND h.site = #{site} AND h.site = #{site}
AND h.bu_no = #{buNo} AND h.bu_no = #{buNo}
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no, d.actual_out_qty
GROUP BY h.site, h.order_no, h.bu_no, h.required_outbound_date, d.related_order_no, d.related_order_line_no
</select> </select>
<!-- 验证标签与销售出库单是否匹配 --> <!-- 验证标签与销售出库单是否匹配 -->

9
src/main/resources/mapper/salesReturn/SalesReturnMapper.xml

@ -14,7 +14,7 @@
d.required_qty AS totalQty, d.required_qty AS totalQty,
0 AS labelinCount, -- 已入库标签数 0 AS labelinCount, -- 已入库标签数
0 AS totalLabels, -- 需入库标签数 0 AS totalLabels, -- 需入库标签数
0 AS totalinLabels, -- 已入库物料总数
ISNULL(d.actual_in_qty, 0) AS totalinLabels, -- 已入库物料总数
ISNULL(d.required_qty, 0) AS labelCount, -- 需入库总数 ISNULL(d.required_qty, 0) AS labelCount, -- 需入库总数
d.related_order_no AS relatedOrderNo, -- 关联单号 d.related_order_no AS relatedOrderNo, -- 关联单号
d.related_order_line_no AS relatedOrderLineNo -- 关联行号 d.related_order_line_no AS relatedOrderLineNo -- 关联行号
@ -39,7 +39,8 @@
h.required_inbound_date, h.required_inbound_date,
d.required_qty, d.required_qty,
d.related_order_no, d.related_order_no,
d.related_order_line_no
d.related_order_line_no,
d.actual_in_qty
ORDER BY h.required_inbound_date DESC ORDER BY h.required_inbound_date DESC
</select> </select>
@ -55,7 +56,7 @@
d.required_qty as totalQty, d.required_qty as totalQty,
0 as labelinCount, --已入库标签数 0 as labelinCount, --已入库标签数
0 as totalLabels, --需入库标签数 0 as totalLabels, --需入库标签数
0 as totalinLabels,--已入库物料总数
ISNULL(d.actual_in_qty, 0) AS totalinLabels, -- 已入库物料总数
SUM(CAST(D.required_qty AS float)) as labelCount, --需入库总数 SUM(CAST(D.required_qty AS float)) as labelCount, --需入库总数
d.related_order_no as relatedOrderNo, --关联单号 d.related_order_no as relatedOrderNo, --关联单号
d.related_order_line_no as relatedOrderLineNo --关联行号 d.related_order_line_no as relatedOrderLineNo --关联行号
@ -66,7 +67,7 @@
AND h.bu_no = #{buNo} AND h.bu_no = #{buNo}
AND h.order_no = #{returnNo} AND h.order_no = #{returnNo}
AND h.order_type = '销售退货' AND h.order_type = '销售退货'
GROUP BY h.order_no, h.site, h.bu_no, d.in_batch_no, d.required_qty, d.related_order_no, d.related_order_line_no
GROUP BY h.order_no, h.site, h.bu_no, d.in_batch_no, d.required_qty, d.related_order_no, d.related_order_line_no,d.actual_in_qty
</select> </select>
<!-- 验证标签是否存在于库存中且状态为出库状态,并获取退货单信息 --> <!-- 验证标签是否存在于库存中且状态为出库状态,并获取退货单信息 -->

Loading…
Cancel
Save