opt:增加子卷质检相关校验。

This commit is contained in:
2024-07-20 01:16:20 +08:00
parent 4f304aed13
commit 8ed0f989b0
3 changed files with 42 additions and 22 deletions

View File

@@ -801,21 +801,44 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
return result; return result;
} }
//"空","0","空载具","1","有子卷","2","合格品","3","管制品","4" //"空","0","空载具","1","有子卷","2","合格品","3","管制品","4"
BstIvtPackageinfoivt dto = null; List<BstIvtPackageinfoivt> dtoList;
//子卷质检 UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
//子卷质检合格品和管制品
if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isBlank(whereJson.getString("pointCode"))) { if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isBlank(whereJson.getString("pointCode"))) {
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("")) || 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;
}
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
if (CollectionUtils.isEmpty(dtoList)) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "子卷号或点位信息有误,请核对是否存在!");
return result;
}
if (dtoList.size() > 1) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "存在多个相同子卷号或点位信息有误,请核对是否存在!");
return result;
}
if (dtoList.get(0).getPoint_code().equals("ZXQ_135") || dtoList.get(0).getPoint_code().equals("ZXQ_136")) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "请选择点位信息!");
return result;
}
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) { if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
subpackagerelationService.createSubTest(whereJson); subpackagerelationService.createSubTest(whereJson);
} }
dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name"))); updateWrapper.set("container_name", dtoList.get(0).getContainer_name());
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
} }
//复称 //复称
else if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isNotBlank(whereJson.getString("pointCode"))) { else if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isNotBlank(whereJson.getString("pointCode"))) {
dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1")?"ZXQ_135":"ZXQ_136")); dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1") ? "ZXQ_135" : "ZXQ_136"));
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) { if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
subpackagerelationService.createSubTest(whereJson); subpackagerelationService.createSubTest(whereJson);
dto.setIvt_status(PackageInfoIvtEnum.IVT_STATUS.code("合格品")); updateWrapper.set("container_name", whereJson.getString("container_name"));
dto.setContainer_name(whereJson.getString("container_name")); updateWrapper.set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品"));
} else { } else {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value()); result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "该点位只能放复称的合格品!"); result.put("message", "该点位只能放复称的合格品!");
@@ -829,22 +852,19 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
result.put("message", "该点位只能设置为合格品,空载具或空点位,如需设置合格品,需要先扫描子卷号"); result.put("message", "该点位只能设置为合格品,空载具或空点位,如需设置合格品,需要先扫描子卷号");
return result; return result;
} }
dto = bstIvtPackageinfoivtMapper.selectOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getPoint_code, whereJson.getString("pointCode").equals("1") ? "ZXQ_135" : "ZXQ_136")); 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"));
} else { } else {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value()); result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "请输入子卷号或管制点位信息!"); result.put("message", "请输入子卷号或管制点位信息!");
return result; return result;
} }
if (dto == null) { updateWrapper.eq("point_code", dtoList.get(0).getPoint_code());
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value()); updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId()));
result.put("message", "子卷号或管制点位信息有误,请核对是否存在!"); updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName());
return result; updateWrapper.set("update_time", DateUtil.now());
} bstIvtPackageinfoivtMapper.update(null, updateWrapper);
dto.setIvt_status(whereJson.getString("ivt_status"));
dto.setUpdate_optid(Long.valueOf(SecurityUtils.getCurrentUserId()));
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
dto.setUpdate_time(DateUtil.now());
bstIvtPackageinfoivtMapper.updateById(dto);
result.put("status", org.springframework.http.HttpStatus.OK.value()); result.put("status", org.springframework.http.HttpStatus.OK.value());
result.put("message", "检验成功!"); result.put("message", "检验成功!");
return result; return result;

View File

@@ -126,13 +126,14 @@ public class DjqTask extends AbstractAcsTask {
if (schBaseTask.getRequest_param().equals("98")) { if (schBaseTask.getRequest_param().equals("98")) {
//管制区送空载具任务 //管制区送空载具任务
ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("空载具"); ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("空载具");
packageinfoivtService.update(null,new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
} else if (schBaseTask.getRequest_param().equals("99")) { } else if (schBaseTask.getRequest_param().equals("99")) {
//管制品重新质检 //管制品重新质检
ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("合格品"); ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("合格品");
packageinfoivtService.update(null,new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
} else { } else {
ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("有子卷"); ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("有子卷");
} }
packageinfoivtService.update(null,new UpdateWrapper<BstIvtPackageinfoivt>().set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("")).set("container_name", null).eq("point_code", schBaseTask.getPoint_code1()));
} else { } else {
ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("有子卷"); ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("有子卷");
} }
@@ -183,9 +184,9 @@ public class DjqTask extends AbstractAcsTask {
throw new BadRequestException("业务类型不能为空"); throw new BadRequestException("业务类型不能为空");
} }
String vehicleCode = form.getString("vehicle_code"); String vehicleCode = form.getString("vehicle_code");
if (StrUtil.isBlank(vehicleCode)) { // if (StrUtil.isBlank(vehicleCode)) {
throw new BadRequestException("载具号不能为空"); // throw new BadRequestException("载具号不能为空");
} // }
String pointCode1 = form.getString("point_code1"); String pointCode1 = form.getString("point_code1");
if (StrUtil.isBlank(pointCode1)) { if (StrUtil.isBlank(pointCode1)) {
throw new BadRequestException("起点不能为空"); throw new BadRequestException("起点不能为空");

View File

@@ -75,7 +75,6 @@ public class AutoSendGzqToDjq {
pointCode4 = packageList.get(0).getPoint_code(); pointCode4 = packageList.get(0).getPoint_code();
task1.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区")); task1.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区"));
task1.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务")); task1.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
task1.put("vehicle_code", "空载具");
task1.put("point_code1", pointCode3); task1.put("point_code1", pointCode3);
task1.put("point_code2", pointCode4); task1.put("point_code2", pointCode4);
task1.put("request_param", "98"); task1.put("request_param", "98");