|
|
|
@ -720,14 +720,23 @@ public class AgvTaskServiceImpl implements AgvTaskService { |
|
|
|
if (task.getToLocation() == null || task.getToLocation().trim().isEmpty()) { |
|
|
|
throw new RuntimeException("任务没有目标站点,不能重发补盘"); |
|
|
|
} |
|
|
|
if (task.getPalletType() == null || task.getPalletType().trim().isEmpty()) { |
|
|
|
throw new RuntimeException("任务没有托盘类型,不能重发补盘"); |
|
|
|
// 任务上没有托盘类型时,用托盘号查托盘当前类型。两种都没有就还没取消,避免空报文把任务取消掉 - rqrq |
|
|
|
String wmsPalletType = task.getPalletType() == null ? "" : task.getPalletType().trim(); |
|
|
|
if (wmsPalletType.isEmpty()) { |
|
|
|
if (task.getPalletId() == null || task.getPalletId().trim().isEmpty()) { |
|
|
|
throw new RuntimeException("任务没有托盘类型,也没有托盘号,不能重发补盘"); |
|
|
|
} |
|
|
|
Pallet pallet = wcsIntegrationMapper.getPalletByCode(task.getSite(), task.getPalletId().trim()); |
|
|
|
if (pallet == null || pallet.getPalletType() == null || pallet.getPalletType().trim().isEmpty()) { |
|
|
|
throw new RuntimeException("托盘【" + task.getPalletId().trim() + "】不存在或没有托盘类型,不能重发补盘"); |
|
|
|
} |
|
|
|
wmsPalletType = pallet.getPalletType().trim(); |
|
|
|
} |
|
|
|
|
|
|
|
// 用任务所属工厂查托盘类型主数据,取出 WCS 整型托盘类型和底托类型。查不到就不能拼报文,此时还没取消 - rqrq |
|
|
|
PalletType palletType = wcsIntegrationMapper.getPalletType(task.getSite(), task.getPalletType().trim()); |
|
|
|
PalletType palletType = wcsIntegrationMapper.getPalletType(task.getSite(), wmsPalletType); |
|
|
|
if (palletType == null || palletType.getWcsPalletType() == null || palletType.getWcsBasePalletType() == null) { |
|
|
|
throw new RuntimeException("托盘类型【" + task.getPalletType().trim() + "】未配置WCS托盘类型或底托类型,不能重发补盘"); |
|
|
|
throw new RuntimeException("托盘类型【" + wmsPalletType + "】未配置WCS托盘类型或底托类型,不能重发补盘"); |
|
|
|
} |
|
|
|
|
|
|
|
// 走现有取消。TUSK 失败时取消结果仍是成功,WMS 任务、站点和 calling_flag 会按原逻辑处理;这里不因 TUSK 失败中断 - rqrq |
|
|
|
|