|
|
|
@ -1271,39 +1271,9 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------工位上货相关-----校验工位存量是否存在----
|
|
|
|
|
if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)) {
|
|
|
|
|
IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null);
|
|
|
|
|
if (fifoCodeEntity != null && StrUtil.isNotEmpty(fifoCodeEntity.getSerialNo())) {
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已存在!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code);
|
|
|
|
|
if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已存在拆零库存!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验码表是否已经存在追溯码 io_code_temp
|
|
|
|
|
IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction());
|
|
|
|
|
if (codeTempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN)) {
|
|
|
|
|
IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null);
|
|
|
|
|
if (fifoCodeEntity == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前追溯码未上货或已出库完毕!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code);
|
|
|
|
|
if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已经拆零,无法退货!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验码表是否已经存在追溯码 io_code_temp
|
|
|
|
|
IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction());
|
|
|
|
|
if (codeTempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!");
|
|
|
|
|
}
|
|
|
|
|
BaseResponse handleSplitOutAndSplitReturnResponse = handleSplitOutAndSplitReturn(code, udiEntity, bussinessTypeEntity);
|
|
|
|
|
if (handleSplitOutAndSplitReturnResponse.getCode() != 20000){
|
|
|
|
|
return handleSplitOutAndSplitReturnResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1812,6 +1782,37 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
return packLevel >= compareLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private BaseResponse handleSplitOutAndSplitReturn(String code, UdiEntity udiEntity,BasicBussinessTypeEntity bussinessTypeEntity) {
|
|
|
|
|
IoSplitFifoCodeEntity fifoCodeEntity = fifoCodeService.findByCode(code, null);
|
|
|
|
|
IoSplitCodeEntity splitCodeEntity = splitCodeService.findByCode(code);
|
|
|
|
|
//校验码表是否已经存在追溯码 io_code_temp
|
|
|
|
|
IoCodeTempEntity codeTempEntity = codeTempService.selectByCode(code, udiEntity.getBatchNo(), bussinessTypeEntity.getAction());
|
|
|
|
|
if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_OUT)){
|
|
|
|
|
if (fifoCodeEntity != null && StrUtil.isNotEmpty(fifoCodeEntity.getSerialNo())) {
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已存在!");
|
|
|
|
|
}
|
|
|
|
|
if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已存在拆零库存!");
|
|
|
|
|
}
|
|
|
|
|
if (codeTempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!");
|
|
|
|
|
}
|
|
|
|
|
}else if (bussinessTypeEntity.getAction().equals(ConstantType.SPLIT_RETURN)){
|
|
|
|
|
if (fifoCodeEntity == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前追溯码未上货或已出库完毕!");
|
|
|
|
|
}
|
|
|
|
|
if (splitCodeEntity != null) {//&& StrUtil.isNotEmpty(splitCodeEntity.getSerialNo())
|
|
|
|
|
return ResultVOUtils.error(533, "当前追溯码已经拆零,无法退货!");
|
|
|
|
|
}
|
|
|
|
|
if (codeTempEntity != null) {
|
|
|
|
|
return ResultVOUtils.error(533, "扫码重复或当前追溯码已存在草稿单据中!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getMaxGroupNumber() {
|
|
|
|
|
Integer groupNumber = codeTempService.selectMaxGroupNumber();
|
|
|
|
|