opt:增加子卷质检相关校验。
This commit is contained in:
@@ -801,21 +801,44 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
return result;
|
||||
}
|
||||
//"空","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 (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("合格品"))) {
|
||||
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"))) {
|
||||
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("合格品"))) {
|
||||
subpackagerelationService.createSubTest(whereJson);
|
||||
dto.setIvt_status(PackageInfoIvtEnum.IVT_STATUS.code("合格品"));
|
||||
dto.setContainer_name(whereJson.getString("container_name"));
|
||||
updateWrapper.set("container_name", whereJson.getString("container_name"));
|
||||
updateWrapper.set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品"));
|
||||
} else {
|
||||
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "该点位只能放复称的合格品!");
|
||||
@@ -829,22 +852,19 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
|
||||
result.put("message", "该点位只能设置为合格品,空载具或空点位,如需设置合格品,需要先扫描子卷号");
|
||||
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 {
|
||||
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "请输入子卷号或管制点位信息!");
|
||||
return result;
|
||||
}
|
||||
if (dto == null) {
|
||||
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "子卷号或管制点位信息有误,请核对是否存在!");
|
||||
return result;
|
||||
}
|
||||
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);
|
||||
updateWrapper.eq("point_code", dtoList.get(0).getPoint_code());
|
||||
updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId()));
|
||||
updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName());
|
||||
updateWrapper.set("update_time", DateUtil.now());
|
||||
bstIvtPackageinfoivtMapper.update(null, updateWrapper);
|
||||
result.put("status", org.springframework.http.HttpStatus.OK.value());
|
||||
result.put("message", "检验成功!");
|
||||
return result;
|
||||
|
||||
@@ -126,13 +126,14 @@ public class DjqTask extends AbstractAcsTask {
|
||||
if (schBaseTask.getRequest_param().equals("98")) {
|
||||
//管制区送空载具任务
|
||||
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")) {
|
||||
//管制品重新质检
|
||||
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 {
|
||||
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 {
|
||||
ivtStatus = PackageInfoIvtEnum.IVT_STATUS.code("有子卷");
|
||||
}
|
||||
@@ -183,9 +184,9 @@ public class DjqTask extends AbstractAcsTask {
|
||||
throw new BadRequestException("业务类型不能为空");
|
||||
}
|
||||
String vehicleCode = form.getString("vehicle_code");
|
||||
if (StrUtil.isBlank(vehicleCode)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
// if (StrUtil.isBlank(vehicleCode)) {
|
||||
// throw new BadRequestException("载具号不能为空");
|
||||
// }
|
||||
String pointCode1 = form.getString("point_code1");
|
||||
if (StrUtil.isBlank(pointCode1)) {
|
||||
throw new BadRequestException("起点不能为空");
|
||||
|
||||
@@ -75,7 +75,6 @@ public class AutoSendGzqToDjq {
|
||||
pointCode4 = packageList.get(0).getPoint_code();
|
||||
task1.put("task_type", PackageInfoIvtEnum.TASK_TYPE.code("管制区->待检区"));
|
||||
task1.put("vehicle_code2", PackageInfoIvtEnum.AGV_ACTION_TYPE.code("普通任务"));
|
||||
task1.put("vehicle_code", "空载具");
|
||||
task1.put("point_code1", pointCode3);
|
||||
task1.put("point_code2", pointCode4);
|
||||
task1.put("request_param", "98");
|
||||
|
||||
Reference in New Issue
Block a user