|
|
|
@ -92,24 +92,31 @@ public class IoOrderMutiController {
|
|
|
|
|
if (StrUtil.isNotBlank(udiEntity.getSerialNo())) {
|
|
|
|
|
//包含
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("udiCode", ioOrderMutiEntity.getUdiCode());
|
|
|
|
|
ew.eq("nameCode", udiEntity.getUdi());
|
|
|
|
|
ew.eq("batchNo", udiEntity.getBatchNo());
|
|
|
|
|
ew.eq("produceDate", udiEntity.getProduceDate());
|
|
|
|
|
ew.eq("expireDate", udiEntity.getExpireDate());
|
|
|
|
|
ew.eq("serialNo", udiEntity.getSerialNo());
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntityOne = ioOrderMutiService.getOne(ew);
|
|
|
|
|
//查询是否被使用过
|
|
|
|
|
if (ioOrderMutiEntityOne != null) {
|
|
|
|
|
if (ioOrderMutiEntityOne.getStatus() == 1) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品已使用多次出库提交!");
|
|
|
|
|
}
|
|
|
|
|
if (ioOrderMutiEntityOne.getReCount() == 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "该产品库存不足!");
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success(ioOrderMutiEntityOne.getId());
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(ioOrderMutiEntity.getMark())){
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew1=new QueryWrapper<>();
|
|
|
|
|
ew1.eq("mark",ioOrderMutiEntity.getMark());
|
|
|
|
|
if (StrUtil.isNotBlank(ioOrderMutiEntity.getMark())) {
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew1 = new QueryWrapper<>();
|
|
|
|
|
ew1.eq("mark", ioOrderMutiEntity.getMark());
|
|
|
|
|
long count = ioOrderMutiService.count(ew1);
|
|
|
|
|
if(count>0){
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "标记已存在!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(999, "标记不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -180,14 +187,14 @@ public class IoOrderMutiController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(ioOrderMutiEntity.getMark())){
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew=new QueryWrapper<>();
|
|
|
|
|
ew.eq("mark",ioOrderMutiEntity.getMark());
|
|
|
|
|
if (StrUtil.isNotBlank(ioOrderMutiEntity.getMark())) {
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew = new QueryWrapper<>();
|
|
|
|
|
ew.eq("mark", ioOrderMutiEntity.getMark());
|
|
|
|
|
long count = ioOrderMutiService.count(ew);
|
|
|
|
|
if(count>0){
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
return ResultVOUtils.error(999, "标记已存在!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(999, "标记不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -220,14 +227,14 @@ public class IoOrderMutiController {
|
|
|
|
|
@PostMapping("/udiwms/inout/order/muti/updateOrderMuti")
|
|
|
|
|
public BaseResponse updateOrderMuti(@RequestBody IoOrderMutiEntity ioOrderMutiEntity) {
|
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(ioOrderMutiEntity.getMark())){
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew1=new QueryWrapper<>();
|
|
|
|
|
ew1.eq("mark",ioOrderMutiEntity.getMark());
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntityOne= ioOrderMutiService.getOne(ew1);
|
|
|
|
|
if(!ioOrderMutiEntityOne.getId().equals(ioOrderMutiEntity.getId())){
|
|
|
|
|
if (StrUtil.isNotBlank(ioOrderMutiEntity.getMark())) {
|
|
|
|
|
QueryWrapper<IoOrderMutiEntity> ew1 = new QueryWrapper<>();
|
|
|
|
|
ew1.eq("mark", ioOrderMutiEntity.getMark());
|
|
|
|
|
IoOrderMutiEntity ioOrderMutiEntityOne = ioOrderMutiService.getOne(ew1);
|
|
|
|
|
if (!ioOrderMutiEntityOne.getId().equals(ioOrderMutiEntity.getId())) {
|
|
|
|
|
return ResultVOUtils.error(999, "标记已存在!");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(999, "标记不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,7 +259,7 @@ public class IoOrderMutiController {
|
|
|
|
|
if (ioOrderMutiSetEntity == null) {
|
|
|
|
|
return ResultVOUtils.error(999, "请设置补单条件!");
|
|
|
|
|
}
|
|
|
|
|
orderNo=ioOrderMutiService.insterOrder(ioOrderMutiEntity,ioOrderMutiSetEntity);
|
|
|
|
|
orderNo = ioOrderMutiService.insterOrder(ioOrderMutiEntity, ioOrderMutiSetEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -329,8 +336,8 @@ public class IoOrderMutiController {
|
|
|
|
|
public BaseResponse addMutiDetail(@RequestBody IoOrderMutiUseEntity ioOrderMutiUseEntity) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ioOrderMutiUseEntity.getCheckType() !=null && ioOrderMutiUseEntity.getCheckType() == 1) {
|
|
|
|
|
IoOrderMutiRequest ioOrderMutiRequest=new IoOrderMutiRequest();
|
|
|
|
|
if (ioOrderMutiUseEntity.getCheckType() != null && ioOrderMutiUseEntity.getCheckType() == 1) {
|
|
|
|
|
IoOrderMutiRequest ioOrderMutiRequest = new IoOrderMutiRequest();
|
|
|
|
|
ioOrderMutiRequest.setStatus(0);
|
|
|
|
|
ioOrderMutiRequest.setUdiCode(ioOrderMutiUseEntity.getUdiCode());
|
|
|
|
|
ioOrderMutiRequest.setMark(ioOrderMutiUseEntity.getMark());
|
|
|
|
@ -378,8 +385,8 @@ public class IoOrderMutiController {
|
|
|
|
|
ioOrderMutiUseService.save(ioOrderMutiUseEntity);
|
|
|
|
|
|
|
|
|
|
//更新主表数量
|
|
|
|
|
ioOrderMutiEntity.setUseCount(ioOrderMutiEntity.getUseCount()+1);
|
|
|
|
|
ioOrderMutiEntity.setReCount(ioOrderMutiEntity.getReCount()-1);
|
|
|
|
|
ioOrderMutiEntity.setUseCount(ioOrderMutiEntity.getUseCount() + 1);
|
|
|
|
|
ioOrderMutiEntity.setReCount(ioOrderMutiEntity.getReCount() - 1);
|
|
|
|
|
ioOrderMutiEntity.setUpdateTime(new Date());
|
|
|
|
|
ioOrderMutiService.updateById(ioOrderMutiEntity);
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|