diff --git a/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml b/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml index e198d1f..c10e45e 100644 --- a/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml +++ b/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 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}) - 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' AND ( h.order_no LIKE CONCAT('%', #{searchCode}, '%') diff --git a/src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml b/src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml index 57c61bf..4d05052 100644 --- a/src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml +++ b/src/main/resources/mapper/productionInbound/ProductionInboundMapper.xml @@ -17,10 +17,10 @@ sum(D.required_qty) as labelCount --需入库总数 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 - 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}) - 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' AND ( h.order_no LIKE CONCAT('%', #{searchCode}, '%') @@ -48,8 +48,8 @@ SUM(D.required_qty) as labelCount --需入库总数 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 - 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 h.site = #{site} AND h.bu_no = #{buNo} diff --git a/src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml b/src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml index 4fa06cf..98409c8 100644 --- a/src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml +++ b/src/main/resources/mapper/productionPicking/ProductionPickingMapper.xml @@ -14,7 +14,7 @@ 0 as totalLabels, 0 as availableLabels, 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, 0 AS pickedLabels, 0 AS pickedQty @@ -22,14 +22,10 @@ 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 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' AND (b.NotifyNo LIKE CONCAT('%', #{searchCode}, '%') or D.SOOrderNo LIKE CONCAT('%', #{searchCode}, '%')) - - - GROUP BY b.site, b.NotifyNo, b.bu ,b.NotifyDate ORDER BY b.NotifyDate DESC @@ -46,7 +42,7 @@ 0 as totalLabels, 0 as availableLabels, 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, 0 AS pickedLabels, 0 AS pickedQty, diff --git a/src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml b/src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml index 09da8e2..8c971f0 100644 --- a/src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml +++ b/src/main/resources/mapper/salesOutbound/SalesOutboundMapper.xml @@ -15,7 +15,7 @@ 0 as totalLabels, 0 as availableLabels, 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 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 @@ -23,17 +23,14 @@ AND h.order_type = '销售出库' AND h.close_flag = 'N' AND h.order_status = '待出库' - AND d.out_warehouse = #{warehouseId} + AND d.out_warehouse = #{warehouseId} and d.show_flag = 'Y' AND ( h.order_no LIKE CONCAT('%', #{searchCode}, '%') OR d.related_order_no LIKE CONCAT('%', #{searchCode}, '%') ) - - - - 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 @@ -49,14 +46,14 @@ 0 as totalLabels, 0 as availableLabels, 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 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 WHERE h.order_no = #{outboundNo} AND h.site = #{site} 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 diff --git a/src/main/resources/mapper/salesReturn/SalesReturnMapper.xml b/src/main/resources/mapper/salesReturn/SalesReturnMapper.xml index 14497f9..392c6b8 100644 --- a/src/main/resources/mapper/salesReturn/SalesReturnMapper.xml +++ b/src/main/resources/mapper/salesReturn/SalesReturnMapper.xml @@ -14,7 +14,7 @@ d.required_qty AS totalQty, 0 AS labelinCount, -- 已入库标签数 0 AS totalLabels, -- 需入库标签数 - 0 AS totalinLabels, -- 已入库物料总数 + ISNULL(d.actual_in_qty, 0) AS totalinLabels, -- 已入库物料总数 ISNULL(d.required_qty, 0) AS labelCount, -- 需入库总数 d.related_order_no AS relatedOrderNo, -- 关联单号 d.related_order_line_no AS relatedOrderLineNo -- 关联行号 @@ -39,7 +39,8 @@ h.required_inbound_date, d.required_qty, 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 @@ -55,7 +56,7 @@ d.required_qty as totalQty, 0 as labelinCount, --已入库标签数 0 as totalLabels, --需入库标签数 - 0 as totalinLabels,--已入库物料总数 + ISNULL(d.actual_in_qty, 0) AS totalinLabels, -- 已入库物料总数 SUM(CAST(D.required_qty AS float)) as labelCount, --需入库总数 d.related_order_no as relatedOrderNo, --关联单号 d.related_order_line_no as relatedOrderLineNo --关联行号 @@ -66,7 +67,7 @@ AND h.bu_no = #{buNo} AND h.order_no = #{returnNo} 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