|
|
|
@ -64,49 +64,49 @@ public class IoCodeLostController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("warehouse/inout/saveTabCode")
|
|
|
|
|
public BaseResponse saveCode(@RequestBody IoCodeTempEntity codeTempEntity) {
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo()) && codeTempEntity.getSerialNo().length() > 20) {
|
|
|
|
|
return ResultVOUtils.error(500, "无效条码!序列号超出最大范围,不予缓存");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getBatchNo()) && codeTempEntity.getBatchNo().length() > 20) {
|
|
|
|
|
return ResultVOUtils.error(500, "无效条码!批次号超出最大范围,不予缓存");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isBlank(codeTempEntity.getSerialNo()) && StrUtil.isBlank(codeTempEntity.getBatchNo())) {
|
|
|
|
|
return ResultVOUtils.error(500, "批次号不能为空!,不予缓存");
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
return ResultVOUtils.error(500, "有序列号不予缓存");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IoCodeLostEntity codeLostEntity = codeLostService.findByCode(codeTempEntity.getCode());
|
|
|
|
|
IoCodeLostEntity insertEntity = null;
|
|
|
|
|
if (codeLostEntity == null) {
|
|
|
|
|
insertEntity = new IoCodeLostEntity();
|
|
|
|
|
insertEntity.setCreateTime(new Date());
|
|
|
|
|
} else {
|
|
|
|
|
insertEntity = codeLostEntity;
|
|
|
|
|
}
|
|
|
|
|
insertEntity.setCode(codeTempEntity.getCode());
|
|
|
|
|
insertEntity.setBatchNo(codeTempEntity.getBatchNo());
|
|
|
|
|
insertEntity.setProduceDate(codeTempEntity.getProduceDate());
|
|
|
|
|
insertEntity.setExpireDate(codeTempEntity.getExpireDate());
|
|
|
|
|
insertEntity.setSerialNo(codeTempEntity.getSerialNo());
|
|
|
|
|
insertEntity.setSupId(codeTempEntity.getSupId());
|
|
|
|
|
insertEntity.setUpdateTime(new Date());
|
|
|
|
|
insertEntity.setCreateTime(new Date());
|
|
|
|
|
if (codeLostEntity != null) {
|
|
|
|
|
codeLostService.update(insertEntity);
|
|
|
|
|
} else {
|
|
|
|
|
insertEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
codeLostService.insert(insertEntity);
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success("修改成功!");
|
|
|
|
|
}
|
|
|
|
|
// @AuthRuleAnnotation("")
|
|
|
|
|
// @PostMapping("warehouse/inout/saveTabCode")
|
|
|
|
|
// public BaseResponse saveCode(@RequestBody IoCodeTempEntity codeTempEntity) {
|
|
|
|
|
//
|
|
|
|
|
// if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo()) && codeTempEntity.getSerialNo().length() > 20) {
|
|
|
|
|
// return ResultVOUtils.error(500, "无效条码!序列号超出最大范围,不予缓存");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (StrUtil.isNotEmpty(codeTempEntity.getBatchNo()) && codeTempEntity.getBatchNo().length() > 20) {
|
|
|
|
|
// return ResultVOUtils.error(500, "无效条码!批次号超出最大范围,不予缓存");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// if (StrUtil.isBlank(codeTempEntity.getSerialNo()) && StrUtil.isBlank(codeTempEntity.getBatchNo())) {
|
|
|
|
|
// return ResultVOUtils.error(500, "批次号不能为空!,不予缓存");
|
|
|
|
|
// }
|
|
|
|
|
// if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
// return ResultVOUtils.error(500, "有序列号不予缓存");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// IoCodeLostEntity codeLostEntity = codeLostService.findByCode(codeTempEntity.getCode());
|
|
|
|
|
// IoCodeLostEntity insertEntity = null;
|
|
|
|
|
// if (codeLostEntity == null) {
|
|
|
|
|
// insertEntity = new IoCodeLostEntity();
|
|
|
|
|
// insertEntity.setCreateTime(new Date());
|
|
|
|
|
// } else {
|
|
|
|
|
// insertEntity = codeLostEntity;
|
|
|
|
|
// }
|
|
|
|
|
// insertEntity.setCode(codeTempEntity.getCode());
|
|
|
|
|
// insertEntity.setBatchNo(codeTempEntity.getBatchNo());
|
|
|
|
|
// insertEntity.setProduceDate(codeTempEntity.getProduceDate());
|
|
|
|
|
// insertEntity.setExpireDate(codeTempEntity.getExpireDate());
|
|
|
|
|
// insertEntity.setSerialNo(codeTempEntity.getSerialNo());
|
|
|
|
|
// insertEntity.setSupId(codeTempEntity.getSupId());
|
|
|
|
|
// insertEntity.setUpdateTime(new Date());
|
|
|
|
|
// insertEntity.setCreateTime(new Date());
|
|
|
|
|
// if (codeLostEntity != null) {
|
|
|
|
|
// codeLostService.update(insertEntity);
|
|
|
|
|
// } else {
|
|
|
|
|
// insertEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
// codeLostService.insert(insertEntity);
|
|
|
|
|
// }
|
|
|
|
|
// return ResultVOUtils.success("修改成功!");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取验收单据业务详情
|
|
|
|
|