fix: hold blocked outbound before WCS dispatch
This commit is contained in:
@@ -51,6 +51,11 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
mydoJobParam.setInOut("2");
|
||||
List<MydoJob> outMydoJobs = mydoJobService.selectMydoJobListApi(mydoJobParam);
|
||||
for (MydoJob outMydoJob : outMydoJobs) {
|
||||
// HTTP success only confirms receipt. A rear outbound stays in status 1 until
|
||||
// every deeper position in its own lane is physically clear.
|
||||
if (mydoJobService.isOutboundDispatchBlocked(outMydoJob.getJobId())) {
|
||||
continue;
|
||||
}
|
||||
RequestLog requestLog = requestLogService.getRequestLog(PUSH_OUT_MYDO_JOB, JSONUtil.toJsonStr(outMydoJob), "推送出库任务","wms","wcs");
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
outMydoJob.setStatus("3");
|
||||
|
||||
@@ -95,4 +95,6 @@ public interface MydoJobMapper
|
||||
void updateLedError(HashMap<String, Object> map);
|
||||
|
||||
Integer selectBySpare4OrCargo(InStockinDetail inStockinDetail);
|
||||
|
||||
int countOutboundDispatchBlockers(@Param("jobId") String jobId);
|
||||
}
|
||||
|
||||
@@ -111,4 +111,7 @@ public interface IMydoJobService
|
||||
List<MydoJob> getInJobBySerial(String serial);
|
||||
|
||||
void ykCompleted(MydoJob outJob);
|
||||
|
||||
/** True while a deeper position in the same lane blocks this outbound. */
|
||||
boolean isOutboundDispatchBlocked(String jobId);
|
||||
}
|
||||
|
||||
@@ -540,4 +540,9 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
log.info("移库任务处理成功 jobId:[{}] trayCode:[{}]", outJob.getJobId(), outJob.getTrayCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOutboundDispatchBlocked(String jobId) {
|
||||
return mydoJobMapper.countOutboundDispatchBlockers(jobId) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +271,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select * from mydo_job where task_no = #{taskNo}
|
||||
</select>
|
||||
|
||||
<select id="countOutboundDispatchBlockers" parameterType="String" resultType="int">
|
||||
select count(1)
|
||||
from mydo_job job
|
||||
join bas_cargo_space source_space on source_space.cargo_space_id = job.cargo_space_id
|
||||
where job.job_id = #{jobId}
|
||||
and try_convert(int, job.in_or_out) >= 20
|
||||
and exists (
|
||||
select 1
|
||||
from bas_cargo_space outer_space
|
||||
where outer_space.warehouse_id = source_space.warehouse_id
|
||||
and outer_space.group_coding_no = source_space.group_coding_no
|
||||
and try_convert(int, outer_space.group_coding) > try_convert(int, source_space.group_coding)
|
||||
and (
|
||||
isnull(outer_space.status, '') <> '1'
|
||||
or isnull(outer_space.locked, '') <> 'N'
|
||||
or nullif(ltrim(rtrim(outer_space.tray_code)), '') is not null
|
||||
or exists (select 1 from bas_stock stock where stock.cargo_space_id = outer_space.cargo_space_id)
|
||||
or exists (
|
||||
select 1 from mydo_job outer_job
|
||||
where outer_job.job_id <> job.job_id
|
||||
and (outer_job.cargo_space_id = outer_space.cargo_space_id
|
||||
or outer_job.target_cargo_space_id = outer_space.cargo_space_id)
|
||||
)
|
||||
)
|
||||
)
|
||||
</select>
|
||||
|
||||
|
||||
<select id="allotInJobSpace" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_allot_space(
|
||||
|
||||
Reference in New Issue
Block a user