|
|
|
@ -60,6 +60,7 @@ |
|
|
|
a.part_no, |
|
|
|
a.part_desc, |
|
|
|
a.unit, |
|
|
|
c.umName, |
|
|
|
a.required_qty, |
|
|
|
a.in_warehouse, |
|
|
|
b.WareHouseName as inWarehouseName, |
|
|
|
@ -71,9 +72,11 @@ |
|
|
|
a.order_qty, |
|
|
|
a.related_order_no, |
|
|
|
a.related_order_line_no, |
|
|
|
a.actual_in_qty as actualStockInQty |
|
|
|
a.actual_in_qty as actualStockInQty, |
|
|
|
a.roll_no |
|
|
|
FROM inbound_notification_detail as a |
|
|
|
left join WareHouse as b on a.site = b.site and a.bu_no = b.bu_no and a.in_warehouse = b.WareHouseID |
|
|
|
left join um as c on a.site = c.site and a.unit = c.UMID |
|
|
|
<where> |
|
|
|
a.site = #{site} and a.bu_no = #{buNo} and a.order_no = #{orderNo} |
|
|
|
<if test = "partNo != null and partNo != ''"> |
|
|
|
@ -86,18 +89,21 @@ |
|
|
|
<delete id="deleteInboundDetail" parameterType="com.gaotao.modules.inboundNotification.entity.vo.InboundNotificationDetailVo"> |
|
|
|
DELETE FROM inbound_notification_detail |
|
|
|
WHERE site = #{site} and bu_no = #{buNo} and order_no = #{orderNo} and part_no = #{partNo} |
|
|
|
<if test="rollNo != null and rollNo != ''"> |
|
|
|
AND roll_no = #{rollNo} |
|
|
|
</if> |
|
|
|
</delete> |
|
|
|
|
|
|
|
<insert id="saveInboundDetails"> |
|
|
|
INSERT INTO inbound_notification_detail |
|
|
|
(site, bu_no, order_no, part_no, part_desc, unit, required_qty, |
|
|
|
in_warehouse, in_batch_no, created_by, created_date, order_qty, |
|
|
|
related_order_no, related_order_line_no, inspection_no, order_item_no) |
|
|
|
related_order_no, related_order_line_no, inspection_no, order_item_no, roll_no) |
|
|
|
VALUES |
|
|
|
<foreach collection="list" item="detail" separator=","> |
|
|
|
(#{detail.site}, #{detail.buNo}, #{detail.orderNo}, #{detail.partNo}, #{detail.partDesc}, #{detail.unit}, #{detail.requiredQty,jdbcType=FLOAT}, |
|
|
|
#{detail.inWarehouse}, #{detail.inBatchNo}, #{detail.createdBy}, GETDATE(), #{detail.orderQty,jdbcType=FLOAT}, |
|
|
|
#{detail.relatedOrderNo}, #{detail.relatedOrderLineNo}, #{detail.inspectionNo}, #{detail.orderItemNo}) |
|
|
|
#{detail.relatedOrderNo}, #{detail.relatedOrderLineNo}, #{detail.inspectionNo}, #{detail.orderItemNo}, #{detail.rollNo}) |
|
|
|
</foreach> |
|
|
|
</insert> |
|
|
|
|
|
|
|
@ -134,19 +140,19 @@ |
|
|
|
SET |
|
|
|
required_qty = CASE |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN part_no = #{item.partNo} THEN #{item.requiredQty,jdbcType=DOUBLE} |
|
|
|
WHEN roll_no = #{item.rollNo} THEN #{item.requiredQty,jdbcType=DOUBLE} |
|
|
|
</foreach> |
|
|
|
ELSE required_qty |
|
|
|
END, |
|
|
|
in_warehouse = CASE |
|
|
|
<foreach item="item" index="index" collection="list" open="" close="" separator=" "> |
|
|
|
WHEN part_no = #{item.partNo} THEN #{item.inWarehouse} |
|
|
|
WHEN roll_no = #{item.rollNo} THEN #{item.inWarehouse} |
|
|
|
</foreach> |
|
|
|
ELSE in_warehouse |
|
|
|
END |
|
|
|
WHERE part_no IN |
|
|
|
WHERE roll_no IN |
|
|
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")"> |
|
|
|
#{item.partNo} |
|
|
|
#{item.rollNo} |
|
|
|
</foreach> |
|
|
|
AND site = #{list[0].site} and bu_no = #{list[0].buNo} and order_no = #{list[0].orderNo} |
|
|
|
</update> |
|
|
|
@ -172,15 +178,16 @@ |
|
|
|
c.PartDescription as partDesc, |
|
|
|
c.UMID as unit, |
|
|
|
a.status, |
|
|
|
a.LotSize as order_qty , |
|
|
|
sum(pr.RollQty) as requiredQty, -- 可入库数量 |
|
|
|
count(RollNo) as countRollNo -- 可入库卷数 |
|
|
|
a.LotSize as order_qty, |
|
|
|
pr.RollNo as rollNo, |
|
|
|
pr.RollQty as requiredQty, |
|
|
|
pr.remark |
|
|
|
FROM ShopOrder a |
|
|
|
LEFT JOIN inbound_notification_detail b ON a.Site = b.site AND a.bu_no = b.bu_no AND a.OrderNo = b.related_order_no AND a.PartNo = b.part_no |
|
|
|
INNER JOIN SFDC_Rolls pr ON a.site = pr.site and a.bu_no = pr.bu_no and a.OrderNo = pr.OrderNo |
|
|
|
inner join Part c on a.Site = c.Site and a.bu_no = c.bu_no and a.PartNo = c.PartNo |
|
|
|
where a.site = #{query.site} and a.bu_no = #{query.buNo} and pr.status ='待入库' AND B.SITE IS NULL and isnull(pr.status,'*') <![CDATA[<>]]> '*' |
|
|
|
and a.PartNo not in |
|
|
|
INNER JOIN SFDC_Rolls pr ON a.site = pr.site AND a.bu_no = pr.bu_no AND a.OrderNo = pr.OrderNo |
|
|
|
LEFT JOIN inbound_notification_detail b ON pr.Site = b.site AND pr.bu_no = b.bu_no AND pr.OrderNo = b.related_order_no AND pr.RollNo = b.roll_no |
|
|
|
INNER JOIN Part c on a.Site = c.Site and a.bu_no = c.bu_no and a.PartNo = c.PartNo |
|
|
|
WHERE a.site = #{query.site} and a.bu_no = #{query.buNo} and pr.status = '待入库' AND b.site IS NULL AND pr.RollType <![CDATA[<>]]> '删除卷' |
|
|
|
AND pr.RollNo NOT IN |
|
|
|
<foreach collection="query.arr" close=")" open="(" item="item" separator=","> |
|
|
|
#{item} |
|
|
|
</foreach> |
|
|
|
@ -196,7 +203,7 @@ |
|
|
|
<if test = "query.status != null and query.status != ''"> |
|
|
|
AND a.status = #{query.status} |
|
|
|
</if> |
|
|
|
GROUP BY a.Site, a.bu_no, a.OrderNo, a.PartNo, a.LotSize, c.PartDescription, c.UMID, a.status |
|
|
|
ORDER BY a.OrderNo, pr.RollNo |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="getMaxLineNo" resultType="java.lang.Integer"> |
|
|
|
|