INSERT INTO wms_transport_task (
site, task_no, source_type, source_bill_no, source_line_id, part_no, qty,
batch_no, serial_no, from_location, to_location, pallet_id, agv_code,
priority, status, wms_send_time,
error_code, error_msg, created_by, created_time, wcs_task_id,
finish_qty, wms_status,item_no
) VALUES
(
#{item.site}, #{item.taskNo}, #{item.sourceType}, #{item.sourceBillNo}, #{item.sourceLineId},
#{item.partNo}, #{item.qty}, #{item.batchNo}, #{item.serialNo}, #{item.fromLocation},
#{item.toLocation}, #{item.palletId}, #{item.agvCode}, #{item.priority}, #{item.status},
#{item.wmsSendTime},
#{item.errorCode}, #{item.errorMsg}, #{item.createdBy}, #{item.createdTime},
#{item.wcsTaskId}, #{item.finishQty}, '未执行', #{item.itemNo}
)
INSERT INTO wms_order_task (
site, task_no, source_type, source_bill_no, source_line_id, part_no, qty,
batch_no, serial_no, from_location, to_location, pallet_id, agv_code,
priority, status, wms_send_time,
error_code, error_msg, created_by, created_time, wcs_task_id,
finish_qty, wms_status,item_no
) VALUES
(
#{item.site}, #{item.taskNo}, #{item.sourceType}, #{item.sourceBillNo}, #{item.sourceLineId},
#{item.partNo}, #{item.qty}, #{item.batchNo}, #{item.serialNo}, #{item.fromLocation},
#{item.toLocation}, #{item.palletId}, #{item.agvCode}, #{item.priority}, #{item.status},
#{item.wmsSendTime},
#{item.errorCode}, #{item.errorMsg}, #{item.createdBy}, #{item.createdTime},
#{item.wcsTaskId}, #{item.finishQty}, #{item.wmsStatus}, #{item.itemNo}
)
INSERT INTO wms_order_task_detail (
site,task_no,item_no,seq_no,action_type,[comment],from_location,to_location,agv_code,[status],start_time,
error_code,error_msg,pallet_id,wms_status
) VALUES
(
#{item.site}, #{item.taskNo}, #{item.itemNo}, #{item.seqNo}, #{item.actionType}, #{item.comment},
#{item.fromLocation}, #{item.toLocation}, #{item.agvCode}, #{item.status}, getdate(),
#{item.errorCode}, #{item.errorMsg}, #{item.palletId}, #{item.wmsStatus}
)
INSERT INTO pallet_detail (site, pallet_id, position, layer, serial_no, part_no, create_date, create_by, wcs_flag)
VALUES (#{site}, #{palletId}, #{position}, #{layer}, #{serialNo}, #{partNo}, GETDATE(), #{createBy}, 1)
DELETE FROM pallet_detail
WHERE site = #{site} AND pallet_id = #{palletId} AND serial_no = #{serialNo}
DELETE FROM pallet_detail
WHERE site = #{site} AND serial_no = #{serialNo}
UPDATE pallet_detail
SET position = #{newPosition},
layer = #{newLayer},
wcs_flag = 1
WHERE site = #{site}
AND pallet_id = #{palletId}
AND serial_no = #{serialNo}
UPDATE pallet
SET calling_flag = #{callingFlag},
updated_by = #{updatedBy},
updated_time = GETDATE()
WHERE site = #{site}
AND pallet_id = #{palletId}
UPDATE pallet
SET empty_flag = #{emptyFlag},
updated_by = #{updatedBy},
updated_time = GETDATE()
WHERE site = #{site} AND pallet_id = #{palletId}
INSERT INTO wms_transport_task (
site, task_no, item_no, source_type, source_bill_no, source_line_id,
part_no, qty, batch_no, serial_no, from_location, to_location,
pallet_id, agv_code, priority, status, wms_send_time,
created_by, created_time, updated_time,wms_status
) VALUES (
#{site}, #{taskNo}, #{itemNo}, #{sourceType}, #{sourceBillNo}, #{sourceLineId},
#{partNo}, #{qty}, #{batchNo}, #{serialNo}, #{fromLocation}, #{toLocation},
#{palletId}, #{agvCode}, #{priority}, #{status}, #{wmsSendTime},
#{createdBy}, #{createdTime}, #{updatedTime},N'未执行'
)
INSERT INTO wms_order_task (
site, task_no, item_no, source_type, source_bill_no, source_line_id,
part_no, qty, batch_no, serial_no, from_location, to_location,
pallet_id, agv_code, priority, status, wms_send_time,
created_by, created_time, updated_time
) VALUES (
#{site}, #{taskNo}, #{itemNo}, #{sourceType}, #{sourceBillNo}, #{sourceLineId},
#{partNo}, #{qty}, #{batchNo}, #{serialNo}, #{fromLocation}, #{toLocation},
#{palletId}, #{agvCode}, #{priority}, #{status}, #{wmsSendTime},
#{createdBy}, #{createdTime}, #{updatedTime}
)
UPDATE wms_transport_task
SET status = #{status}, updated_time = GETDATE()
WHERE id = #{id}
UPDATE wms_transport_task
SET status = #{status}, updated_time = GETDATE()
WHERE task_no = #{taskNo}
UPDATE pallet_detail
SET wcs_flag = 0
WHERE site = #{site}
AND pallet_id = #{palletId}
AND wcs_flag = 1
insert into wms_transport_task_detail(
site,task_no,item_no,seq_no,action_type,[comment],from_location,to_location,agv_code,[status],start_time,
error_code,error_msg
) values (
#{site}, #{taskNo}, #{itemNo}, #{seqNo}, #{actionType}, #{comment}, #{fromLocation}, #{toLocation}, #{agvCode}, #{status}, #{startTime},
#{errorCode}, #{errorMsg}
)
insert into wms_order_task_detail(
site,task_no,item_no,seq_no,action_type,[comment],from_location,to_location,agv_code,[status],start_time,
error_code,error_msg
) values (
#{site}, #{taskNo}, #{itemNo}, #{seqNo}, #{actionType}, #{comment}, #{fromLocation}, #{toLocation}, #{agvCode}, #{status}, #{startTime},
#{errorCode}, #{errorMsg}
)
update wms_transport_task set [status]=#{status} where site=#{site} and task_no=#{taskNo}
update wms_transport_task_detail set [status]=#{status} where id=#{id}
update wms_order_task_detail set [status]=#{status} where id=#{id}
INSERT INTO wcs_callback_task (
site, pallet_id, trans_type_desc, to_warehouse_id, to_location_id,
status, created_time, retry_count, remark, task_no, item_no, to_station
) VALUES (
#{site}, #{palletId}, #{transTypeDesc}, #{toWarehouseId}, #{toLocationId},
#{status}, #{createdTime}, #{retryCount}, #{remark}, #{taskNo}, #{itemNo}, #{toStation}
)
update wcs_callback_task
set status = #{status}
, process_start_time = #{processStartTime}
, process_end_time = #{processEndTime}
, error_msg = #{errorMsg}
where id = #{id}
UPDATE wcs_callback_task
SET status = #{newStatus},
process_start_time = #{processStartTime}
WHERE id = #{id}
AND status = #{oldStatus}
update pallet set location_code = #{location},updated_by='wms_sys',updated_time=getdate()
where site = #{site} and pallet_id = #{palletId}
update wcs_callback_task set retry_count = #{retryCount} where id = #{id}
update wms_order_task
set status = #{status}, wms_status = #{wmsStatus}
where id = #{id}
update wms_order_task_detail
set status = #{status} ,wms_status = #{wmsStatus}
where task_no = #{taskNo}
update wms_order_task
set error_code = #{errorCode},
error_msg = #{errorMsg}
where id = #{id}
UPDATE agv_station
SET status_db = #{statusDb},
status = #{status}
WHERE station_code = #{stationCode}
UPDATE pallet
SET pallet_type = #{palletType},
auto_sort = #{autoSort},
updated_time = GETDATE()
WHERE site = #{site}
AND pallet_id = #{palletId}
AND is_deleted = '0'