fix:管制区点位设为空生成任务问题

This commit is contained in:
zhangzq
2025-01-19 14:00:25 +08:00
parent 60c9524821
commit 5341d91b3b

View File

@@ -963,9 +963,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
public JSONObject update(JSONObject whereJson) {
JSONObject result = new JSONObject();
if (StringUtils.isBlank(whereJson.getString("ivt_status"))) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "子卷检验结果为空");
return result;
throw new BadRequestException("子卷检验结果为空");
}
//"空","0","空载具","1","有子卷","2","合格品","3","管制品","4"
List<BstIvtPackageinfoivt> dtoList;
@@ -981,9 +979,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
}
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
if (ObjectUtils.isEmpty(dtoList)) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "子卷号或点位信息有误,请核对是否存在!");
return result;
throw new BadRequestException("子卷号或点位信息有误,请核对是否存在!");
}
if (dtoList.size() > 1) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
@@ -1051,15 +1047,12 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
//取放空载具
else if (StringUtils.isNotBlank(whereJson.getString("pointCode")) && StringUtils.isBlank(whereJson.getString("container_name"))) {
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品")) || whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "该点位只能设置为合格品,空载具或空点位,如需设置合格品,需要先扫描子卷号");
return result;
throw new BadRequestException("人工管制点只能设置空载具或空点位");
}
String pointCode = whereJson.getString("pointCode");
if (StringUtils.isEmpty(pointCode)){
throw new BadRequestException("人工管制点不能为空");
}
HashMap of = MapOf.of("1", "ZXQ_135", "2", "ZXQ_136");
// "ZXQ_135" : "ZXQ_136";
JSONObject task = new JSONObject();
@@ -1069,10 +1062,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
.eq("point_code1", of.get(pointCode))
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
if (count>0){
throw new BadRequestException("当前人工管制点已经存在任务,请勿重复下发");
throw new BadRequestException("当前人工管制点存在任务,稍后操作");
}
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))){
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
}
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1") ? "ZXQ_135" : "ZXQ_136"));
updateWrapper.set("container_name", null);
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));