feat: add outbound WCS retry dispatch

This commit is contained in:
zgw
2026-07-16 10:02:45 +08:00
parent aa6728e52b
commit 9158a5fa54
18 changed files with 845 additions and 91 deletions

View File

@@ -176,8 +176,10 @@ external:
'02': ${WCS_02_BASE_URL:${WCS_DEFAULT_BASE_URL:http://172.16.4.63:8084}}
'03': ${WCS_03_BASE_URL:${WCS_DEFAULT_BASE_URL:http://172.16.4.63:8084}}
apis:
sendPutawayTask: /wcs/api/receiveWmsJob
sendRetrieveTask: /wcs/api/receiveWmsJob
sendPutawayTask: ${WCS_PUTAWAY_PATH:/wcs/api/receiveWmsJob}
sendRetrieveTask: ${WCS_OUTBOUND_PATH:/wcs/api/receiveWmsOutJob}
sendLocationOutboundTask: ${WCS_LOCATION_OUTBOUND_PATH:/wcs/api/receiveWmsLocationOutJob}
sendRelocationTask: ${WCS_RELOCATION_PATH:/wcs/api/receiveWmsMoveJob}
queryDeviceStatus: /device/status
sendCraneMove: /crane/move
cancelTask: /task/cancel

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.out.dense.mapper.DenseLaneMapper">
<select id="isCurrentOutermost" resultType="java.lang.Integer">
select case
when source_space.warehouse_id != '03'
or source_space.group_coding is null
or ltrim(rtrim(source_space.group_coding)) = '' then 1
when not exists
(
select 1
from bas_cargo_space occupied
cross apply
(
select min(lane_space.the_column) as min_column,
max(lane_space.the_column) as max_column
from bas_cargo_space lane_space
where lane_space.warehouse_id = source_space.warehouse_id
and lane_space.group_coding = source_space.group_coding
and lane_space.the_floor = source_space.the_floor
) lane_boundary
where occupied.warehouse_id = source_space.warehouse_id
and occupied.group_coding = source_space.group_coding
and occupied.the_floor = source_space.the_floor
and occupied.cargo_space_id != source_space.cargo_space_id
and occupied.status in ('2', '3', '4')
and occupied.tray_code is not null
and ltrim(rtrim(occupied.tray_code)) != ''
and
(
(isnull(area_config.direction_type, '1') = '1'
and occupied.the_column &gt; source_space.the_column)
or (area_config.direction_type = '2'
and occupied.the_column &lt; source_space.the_column)
or (area_config.direction_type = '3'
and case
when occupied.the_column - lane_boundary.min_column
&lt;= lane_boundary.max_column - occupied.the_column
then occupied.the_column - lane_boundary.min_column
else lane_boundary.max_column - occupied.the_column
end
&lt; case
when source_space.the_column - lane_boundary.min_column
&lt;= lane_boundary.max_column - source_space.the_column
then source_space.the_column - lane_boundary.min_column
else lane_boundary.max_column - source_space.the_column
end)
)
) then 1
else 0
end
from bas_cargo_space source_space
left join bas_cargo_area_config area_config
on area_config.warehouse_id = source_space.warehouse_id
and area_config.cargo_area_code = source_space.this_cargo_area
and area_config.is_active = '1'
where source_space.cargo_space_id = #{cargoSpaceId}
</select>
</mapper>

View File

@@ -60,6 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where job_id = #{jobId}
and version_no = #{versionNo}
and dispatch_status in ('PENDING', 'BLOCKED', 'RETRY_WAIT', 'EXHAUSTED', 'SENDING')
and (dispatch_status != 'SENDING'
or last_attempt_time &lt;= dateadd(minute, -5, #{attemptTime}))
and (#{trigger} != 'AUTO_RETRY' or auto_retry_count &lt; 5)
</update>
@@ -67,27 +69,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update wcs_job_dispatch
set dispatch_status = 'BLOCKED', last_error = #{lastError}, next_retry_time = #{nextRetryTime},
update_time = #{updateTime}, version_no = version_no + 1
where job_id = #{jobId} and dispatch_status != 'SUCCESS'
where job_id = #{jobId}
and version_no = #{versionNo}
and dispatch_status != 'SUCCESS'
</update>
<update id="markRetryWait" parameterType="map">
update wcs_job_dispatch
set dispatch_status = 'RETRY_WAIT', last_error = #{lastError}, next_retry_time = #{nextRetryTime},
update_time = #{updateTime}, version_no = version_no + 1
where job_id = #{jobId} and dispatch_status = 'SENDING'
where job_id = #{jobId}
and version_no = #{versionNo}
and dispatch_status = 'SENDING'
</update>
<update id="markSuccess" parameterType="map">
update wcs_job_dispatch
set dispatch_status = 'SUCCESS', last_error = null, next_retry_time = null,
success_time = #{successTime}, update_time = #{successTime}, version_no = version_no + 1
where job_id = #{jobId} and dispatch_status = 'SENDING'
where job_id = #{jobId}
and version_no = #{versionNo}
and dispatch_status = 'SENDING'
</update>
<update id="markExhausted" parameterType="map">
update wcs_job_dispatch
set dispatch_status = 'EXHAUSTED', last_error = #{lastError}, next_retry_time = null,
update_time = #{updateTime}, version_no = version_no + 1
where job_id = #{jobId} and dispatch_status = 'SENDING'
where job_id = #{jobId}
and version_no = #{versionNo}
and dispatch_status in ('SENDING', 'BLOCKED', 'RETRY_WAIT')
</update>
</mapper>