入库绑定校验优化
This commit is contained in:
@@ -233,15 +233,32 @@ public class PdaServiceImpl implements IPdaService {
|
|||||||
|
|
||||||
//======================生成绑定信息======================
|
//======================生成绑定信息======================
|
||||||
String trayCode = bindTrayMsg.getTrayCode();
|
String trayCode = bindTrayMsg.getTrayCode();
|
||||||
|
|
||||||
|
//检查条码长度
|
||||||
|
if (trayCode.length() != 8){
|
||||||
|
log.warn("【入库绑定失败】条码长度错误,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:{}", trayCode);
|
||||||
|
return AjaxResult.error("【入库绑定失败】条码长度错误,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:" + trayCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查入库绑定时该托盘是否有未完成的任务
|
||||||
|
MydoJob mydoJobExist = mydoJobService.selectMydoJobByTrayCode(trayCode);
|
||||||
|
if (ObjUtil.isNotNull(mydoJobExist)){
|
||||||
|
log.warn("【入库绑定失败】当前条码有未结束的任务,无法执行绑定操作,请检查该托盘的任务状态,条码:{}", trayCode);
|
||||||
|
return AjaxResult.error("【入库绑定失败】当前条码有未结束的任务,无法执行绑定操作,请检查该托盘的任务状态,当前条码:" + trayCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取绑定状态,【新建绑定】或【原有库存】
|
||||||
int trayMsgStatus =
|
int trayMsgStatus =
|
||||||
ObjUtil.isNull(basStockInfoService.selectBasStockInfoByTrayCode(trayCode)) ? InTrayMsgCode.STATUS_NEW :InTrayMsgCode.STATUS_EXIST;
|
ObjUtil.isNull(basStockInfoService.selectBasStockInfoByTrayCode(trayCode)) ? InTrayMsgCode.STATUS_NEW :InTrayMsgCode.STATUS_EXIST;
|
||||||
|
|
||||||
|
//校验托盘类型
|
||||||
int trayType = mydoJobService.getTrayTypeByTrayCode(trayCode);
|
int trayType = mydoJobService.getTrayTypeByTrayCode(trayCode);
|
||||||
if (trayType == 0){
|
if (trayType == 0){
|
||||||
log.warn("【入库绑定失败】托盘类型异常,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:{}", trayCode);
|
log.warn("【入库绑定失败】托盘类型异常,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:{}", trayCode);
|
||||||
return AjaxResult.error("【入库绑定失败】托盘类型异常,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:" + trayCode);
|
return AjaxResult.error("【入库绑定失败】托盘类型异常,无法执行绑定操作,请检查当前托盘的条码格式,当前条码:" + trayCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//检查是否进行了绑定操作
|
||||||
if (bindTrayMsg.getItems().size() == 0){
|
if (bindTrayMsg.getItems().size() == 0){
|
||||||
log.warn("【入库绑定失败】无版辊信息,请扫描版辊信息绑定重试,执行绑定的托盘:{}", trayCode);
|
log.warn("【入库绑定失败】无版辊信息,请扫描版辊信息绑定重试,执行绑定的托盘:{}", trayCode);
|
||||||
return AjaxResult.error("【入库绑定失败】无版辊信息,请扫描版辊信息绑定重试,执行绑定的托盘:" + trayCode);
|
return AjaxResult.error("【入库绑定失败】无版辊信息,请扫描版辊信息绑定重试,执行绑定的托盘:" + trayCode);
|
||||||
@@ -333,6 +350,15 @@ public class PdaServiceImpl implements IPdaService {
|
|||||||
.build()
|
.build()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//整托确认出库后生成的空托回流,可能继续帮顶版辊入库
|
||||||
|
// 生成版辊绑定信息后自动移除该条码的【空托】绑定信息
|
||||||
|
List<InTrayMsg> msgs = inTrayMsgService.selectInTrayMsgList(
|
||||||
|
new InTrayMsg().builder().trayCode(bindTrayMsg.getTrayCode()).productId(ProductType.EMPTY_TRAY).build()
|
||||||
|
);
|
||||||
|
if (!msgs.isEmpty()){
|
||||||
|
inTrayMsgService.deleteInTrayMsgByRollerNumber(ProductType.EMPTY_TRAY);
|
||||||
|
}
|
||||||
|
|
||||||
//>>>扣减子单的【扫码数量】
|
//>>>扣减子单的【扫码数量】
|
||||||
detail.setScanNum(BigDecimal.valueOf(1));
|
detail.setScanNum(BigDecimal.valueOf(1));
|
||||||
inStockinDetailService.updateInStockinDetail(detail);
|
inStockinDetailService.updateInStockinDetail(detail);
|
||||||
|
|||||||
Reference in New Issue
Block a user