insert into SOIssueNotifyOrderList(notify_no,site,item_no,fgpart_no,soorder_no,issure_qty,out_work_order_flag,need_date,release_no,sequence_no,order_type)
values(#{notifyNo},#{site},#{itemNo},#{fgPartNo},#{soorderNo},#{issureQty,jdbcType=DECIMAL},#{outWorkOrderFlag}
,#{needDate},#{releaseNo},#{sequenceNo},#{orderType})
delete from SOIssueNotifyOrderMaterialList where site=#{site} and notify_no=#{notifyNo} and item_no=#{itemNo}
insert into SOIssueNotifyOrderMaterialList (notify_no,site,item_no,BOM_item_no,component_part_no,qty_to_issue,qty_to_issue_original,issue_type,remark,order_type)
values
(#{item.notifyNo},#{item.site},#{item.itemNo},#{item.bOMItemNo},#{item.componentPartNo},#{item.qtyToIssue,jdbcType=DECIMAL},#{item.qtyToIssueOriginal,jdbcType=DECIMAL},#{item.issueType},rtrim(#{item.remark}),#{item.orderType})
UPDATE SOIssueNotifyHeader WITH (ROWLOCK)
SET status = #{status}, remark = #{closeRemark}
WHERE site = #{site} AND notify_no = #{notifyNo}
UPDATE SOIssueNotifyHeader WITH (ROWLOCK)
SET push_wcs_flag = '已完成'
WHERE site = #{site} AND notify_no = #{notifyNo}
UPDATE handling_unit WITH (ROWLOCK)
SET reserve_flag = 'Y',
reserve_order_ref1 = #{notifyNo},
reserve_order_ref2 = CAST(#{itemNo} AS VARCHAR(50)),
reserve_order_ref3 = #{productionOrderNo}
WHERE site = #{site}
AND unit_id IN
#{serialNo}
UPDATE pallet WITH (ROWLOCK)
SET calling_flag = 'Y',
remark = #{remark},
updated_by = 'WMS_SYSTEM',
updated_time = GETDATE()
WHERE site = #{site}
AND pallet_id IN
#{palletId}
INSERT INTO SOIssueNotifyOrderMaterialList_detail
(site, notify_no, item_no, BOM_item_no, serialNo, task_ref, task_item, task_seq, out_wcs_flag, issure_flag, order_type)
VALUES
(#{item.site}, #{item.notifyNo}, #{item.itemNo}, #{item.bomItemNo}, #{item.serialNo},
#{item.taskRef}, #{item.taskItem}, #{item.taskSeq}, #{item.outWcsFlag}, #{item.issureFlag}, #{item.orderType})
UPDATE SOIssueNotifyOrderList WITH (ROWLOCK)
SET push_wms_flag = 'Y'
WHERE site = #{site}
AND notify_no = #{notifyNo}
AND item_no = #{itemNo}
UPDATE SOIssueNotifyHeader WITH (ROWLOCK)
SET push_wcs_flag = #{pushWcsFlag}
WHERE site = #{site}
AND notify_no = #{notifyNo}