opt:优化结构

This commit is contained in:
zhangzq
2026-04-23 20:04:39 +08:00
parent 340355a66b
commit 190f21d99b
8 changed files with 86 additions and 145 deletions

View File

@@ -65,7 +65,7 @@
<version>0.0.1</version> <version>0.0.1</version>
<scope>system</scope> <scope>system</scope>
<systemPath> <systemPath>
${project.basedir}/libs/language-all.jar ${project.basedir}/libs/language-all-0.0.1.jar
</systemPath> </systemPath>
<!-- 移除 system 范围,使用默认的 compile 范围 --> <!-- 移除 system 范围,使用默认的 compile 范围 -->
</dependency> </dependency>

View File

@@ -67,23 +67,25 @@ public class VehicleTwoController {
@PostMapping("/updatePackageInfo") @PostMapping("/updatePackageInfo")
@Log("一楼待检区-管制区子卷质检") @Log("待检区-子卷质检")
@SaIgnore @SaIgnore
public ResponseEntity<Object> updatePackageInfo(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> updatePackageInfo(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(bstIvtPackageInfoIvtService.update(whereJson), HttpStatus.OK); bstIvtPackageInfoIvtService.updateQC(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/updatePackageInfo2") @PostMapping("/updatePackageInfo2")
@Log("一楼待检区-管制点管理") @Log("待检区-地面点管理")
@SaIgnore @SaIgnore
public ResponseEntity<Object> updatePackageInfo2(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> updatePackageInfo2(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(bstIvtPackageInfoIvtService.update2(whereJson), HttpStatus.OK); bstIvtPackageInfoIvtService.allReginPoint(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
} }
@PostMapping("/toEndSub") @PostMapping("/toEndSub")
@Log("二期子卷包装解绑") @Log("子卷包装解绑")
@SaIgnore @SaIgnore
public ResponseEntity<Object> toEndSub(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> toEndSub(@RequestBody JSONObject whereJson) {
Map result = subpackagerelationService.toEndSubpackagerelation(whereJson.getString("container_name")); Map result = subpackagerelationService.toEndSubpackagerelation(whereJson.getString("container_name"));

View File

@@ -279,9 +279,9 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} }
/** /**
* 子卷装箱 * 子卷装箱
* * 提前呼叫木箱,将子卷送到装箱区域
* @param whereJson 分配信息 * 子卷可以多卷装一箱所以扫码时会扫多卷
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@@ -486,8 +486,10 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
.orderByAsc("update_time")); .orderByAsc("update_time"));
if (CollUtil.isEmpty(bstIvtBoxstacks)) { if (CollUtil.isEmpty(bstIvtBoxstacks)) {
// 查询缓存区木箱,先送数量少的 // 查询缓存区木箱,先送数量少的
List<BstIvtBoxstack> bstIvtBoxstacks1 = boxstackMapper.selectList(new QueryWrapper<BstIvtBoxstack>().eq("box_spec", whereJson.getString("checked")) List<BstIvtBoxstack> bstIvtBoxstacks1 = boxstackMapper.selectList(new QueryWrapper<BstIvtBoxstack>()
.eq("point_status", BoxStackEnum.POINT_STATUS.code("缓存区")).orderByAsc("current_layer_count")); .eq("box_spec", whereJson.getString("checked"))
.eq("point_status", BoxStackEnum.POINT_STATUS.code("缓存区"))
.orderByAsc("current_layer_count"));
if (CollUtil.isEmpty(bstIvtBoxstacks1)) { if (CollUtil.isEmpty(bstIvtBoxstacks1)) {
throw new BadRequestException("缓存区无可用木箱,请新建备货计划"); throw new BadRequestException("缓存区无可用木箱,请新建备货计划");
} }
@@ -508,7 +510,8 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
} else { } else {
createTask(whereJson, bstIvtBoxstacks1); createTask(whereJson, bstIvtBoxstacks1);
} }
} else { }
else {
InBoxTrussTask inBoxTrussTask = new InBoxTrussTask(); InBoxTrussTask inBoxTrussTask = new InBoxTrussTask();
JSONObject taskParam = new JSONObject(); JSONObject taskParam = new JSONObject();

View File

@@ -67,18 +67,18 @@ public interface IbstIvtPackageinfoivtService extends IService<BstIvtPackageinfo
* *
* @param whereJson / * @param whereJson /
*/ */
JSONObject update(JSONObject whereJson); void updateQC(JSONObject whereJson);
/** /**
* 管制点管理 * 整体区域点管理
* *
* @param whereJson / * @param whereJson /
*/ */
JSONObject update2(JSONObject whereJson); void allReginPoint(JSONObject whereJson);

View File

@@ -376,167 +376,95 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
/** /**
* 手持子卷质检 * 手持子卷质检
* 26-4-23变更
* 该功能之前包括管制点状态设置,子卷质检设置,先功能只包含子卷质检设置,点位设置需另外开发
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) public void updateQC(JSONObject whereJson) {
public JSONObject update(JSONObject whereJson) {
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
if (StringUtils.isBlank(whereJson.getString("ivt_status"))) { if (StringUtils.isBlank(whereJson.getString("ivt_status"))) {
throw new BadRequestException("子卷检验结果为空"); throw new BadRequestException("子卷检验结果为空");
} }
//"空","0","空载具","1","有子卷","2","合格品","3","管制品","4",人工卷,"5" final String containerName = whereJson.getString("container_name");
List<BstIvtPackageinfoivt> dtoList; if (StringUtils.isEmpty(containerName)){
throw new BadRequestException("container_name不能为空");
}
//"合格品","3","管制品","4"
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
//是否开启mes质检 //是否开启mes质检
String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_mes_package").getValue(); String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_mes_package").getValue();
//子卷质检合格品和管制品 //子卷质检合格品和管制品
if (StringUtils.isNotBlank(whereJson.getString("container_name"))) { if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))) {
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("有子卷"))) { PdmBiSubpackagerelation one = subpackagerelationService.getOne(new QueryWrapper<PdmBiSubpackagerelation>()
throw new BadRequestException("质检结果只能为合格品或管制品"); .eq("container_name", containerName));
if (one!=null){
throw new BadRequestException("包装关系存在,请先解绑MES及LMS包装关系");
} }
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))) {
PdmBiSubpackagerelation one = subpackagerelationService.getOne(new QueryWrapper<PdmBiSubpackagerelation>()
.eq("container_name", whereJson.getString("container_name")));
if (one!=null){
throw new BadRequestException("包装关系存在,请先解绑MES及LMS包装关系");
}
}
dtoList = bstIvtPackageinfoivtMapper.selectList(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name")));
if (ObjectUtils.isEmpty(dtoList)) {
throw new BadRequestException("子卷号或点位信息有误,请核对是否存在!");
}
if (dtoList.size() > 1) {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "存在多个相同子卷号或点位信息有误,请核对是否存在!");
return result;
}
BstIvtPackageinfoivt packageinfoivt = dtoList.get(0);
String pointCode = packageinfoivt.getPoint_code();
if (pointCode.equals("ZXQ_135") || pointCode.equals("ZXQ_136")) {
throw new BadRequestException("管制点设置子卷状态时需要选择点位");
}
if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
if (packageinfoivt.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))){
throw new BadRequestException("当前子卷已设置为管制品");
}
//获取子卷最新信息
jo.put("container_name", whereJson.getString("container_name"));
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
lmsToMesService.getInspectionResult(jo);
//子卷下料信息MES传递给LMS
iPdmBiContainerinfoService.createSubInfoByContainer(whereJson.getString("container_name"));
}
}
PdmProductSpecServiceImpl.doRecord(SpecEnum.ZJ,MapOf.of("质检结果",whereJson.getString("ivt_status")),Boolean.TRUE,null, packageinfoivt.getContainer_name());
updateWrapper.set("container_name", packageinfoivt.getContainer_name());
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
} else {
result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value());
result.put("message", "请输入子卷号或管制点位信息!");
return result;
} }
String pointCode = dtoList.get(0).getPoint_code(); BstIvtPackageinfoivt packageinfoivt = this.getOne(new LambdaQueryWrapper<BstIvtPackageinfoivt>().eq(BstIvtPackageinfoivt::getContainer_name, containerName));
if (dtoList.get(0).getPoint_status().equals(PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"))){ if (packageinfoivt == null) {
throw new BadRequestException("满轴缓存位无法设置子卷状态"); throw new BadRequestException("子卷号或点位信息有误,请核对是否存在!");
} }
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode); List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(packageinfoivt.getPoint_code());
if (!CollectionUtils.isEmpty(schBaseTasks)){ if (!CollectionUtils.isEmpty(schBaseTasks)){
throw new BadRequestException("当前点位"+dtoList.get(0).getPoint_name()+"正在执行搬运任务"+schBaseTasks.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(","))); throw new BadRequestException("当前点位"+packageinfoivt.getPoint_code()+"正在执行搬运任务"+schBaseTasks.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
} }
updateWrapper.eq("point_code", pointCode); if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("合格品"))) {
if (packageinfoivt.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("管制品"))){
throw new BadRequestException("当前子卷已设置为管制品");
}
//获取子卷最新信息
jo.put("container_name", containerName);
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
lmsToMesService.getInspectionResult(jo);
//子卷下料信息MES传递给LMS-同步子卷包装关系
iPdmBiContainerinfoService.createSubInfoByContainer(containerName);
}
}
updateWrapper.set("container_name", packageinfoivt.getContainer_name());
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
updateWrapper.eq("point_code", packageinfoivt.getPoint_code());
updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId())); updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId()));
updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName()); updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName());
updateWrapper.set("update_time", DateUtil.now()); updateWrapper.set("update_time", DateUtil.now());
bstIvtPackageinfoivtMapper.update(null, updateWrapper); bstIvtPackageinfoivtMapper.update(null, updateWrapper);
result.put("status", org.springframework.http.HttpStatus.OK.value()); PdmProductSpecServiceImpl.doRecord(SpecEnum.ZJ,MapOf.of("质检结果",whereJson.getString("ivt_status")),Boolean.TRUE,null, packageinfoivt.getContainer_name());
result.put("message", "检验成功!");
return result;
} }
/**
* 整体子卷区域点管理
* 4-24变更
* 1.管制点作用:空载具拉回,点位释放,管制点不做复合动作
* 2.印尼管制区管制点为整个区域,需要通过扫码方式而不是选点
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) public void allReginPoint(JSONObject whereJson) {
public JSONObject update2(JSONObject whereJson) { //"空","0","空载具","1","有子卷","2"
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
if (StringUtils.isBlank(whereJson.getString("ivt_status"))) { if (StringUtils.isBlank(whereJson.getString("ivt_status"))) {
throw new BadRequestException("子卷检验结果为空"); throw new BadRequestException("子卷检验结果为空");
} }
//"空","0","空载具","1","有子卷","2","合格品","3","管制品","4",人工卷,"5" if (StringUtils.isNotBlank(whereJson.getString("pointCode"))){
List<BstIvtPackageinfoivt> dtoList; throw new BadRequestException("子卷检验结果为空");
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
JSONObject jo = new JSONObject();
//是否开启mes
String isOnMes = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_on_mes").getValue();
//复称
if (StringUtils.isNotBlank(whereJson.getString("container_name")) && StringUtils.isNotBlank(whereJson.getString("pointCode"))) {
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("合格品"))) {
//获取子卷最新信息
jo.put("container_name", whereJson.getString("container_name"));
if (isOnMes.equals(IOSEnum.IS_NOTANDYES.code(""))) {
lmsToMesService.getInspectionResult(jo);
//子卷下料信息MES传递给LMS
iPdmBiContainerinfoService.createSubInfoByContainer(whereJson.getString("container_name"));
} else {
packageData(whereJson);
}
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", "该点位只能放复称的合格品!");
return result;
}
} }
//取放空载具 List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(whereJson.getString("pointCode"));
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("管制品"))) {
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();
task.put("point_code1", of.get(pointCode));
int count = taskService.count(new QueryWrapper<SchBaseTask>()
.eq("is_delete", "0")
.eq("point_code1", of.get(pointCode))
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
if (count>0){
throw new BadRequestException("当前人工管制点存在任务,稍后操作");
}
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;
}
String pointCode = dtoList.get(0).getPoint_code();
if (dtoList.get(0).getPoint_status().equals(PackageInfoIvtEnum.POINT_STATUS.code("满轴缓存位"))){
throw new BadRequestException("满轴缓存位无法设置子卷状态");
}
List<SchBaseTask> schBaseTasks = taskService.checkHaveTask(pointCode);
if (!CollectionUtils.isEmpty(schBaseTasks)){ if (!CollectionUtils.isEmpty(schBaseTasks)){
throw new BadRequestException("当前点位"+dtoList.get(0).getPoint_name()+"正在执行搬运任务"+schBaseTasks.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(","))); throw new BadRequestException("当前点位"+whereJson.getString("pointCode")+"正在执行搬运任务"+schBaseTasks.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
} }
updateWrapper.eq("point_code", pointCode); if (whereJson.getString("ivt_status").equals(PackageInfoIvtEnum.IVT_STATUS.code("有子卷"))
&& StringUtils.isEmpty(whereJson.getString("container_name"))) {
throw new BadRequestException("设置有子卷时需输入子卷号");
}
UpdateWrapper<BstIvtPackageinfoivt> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("container_name", whereJson.getString("container_name"));
updateWrapper.set("ivt_status", whereJson.getString("ivt_status"));
updateWrapper.eq("point_code", whereJson.getString("pointCode"));
updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId())); updateWrapper.set("update_optid", Long.valueOf(SecurityUtils.getCurrentUserId()));
updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName()); updateWrapper.set("update_optname", SecurityUtils.getCurrentNickName());
updateWrapper.set("update_time", DateUtil.now()); updateWrapper.set("update_time", DateUtil.now());
bstIvtPackageinfoivtMapper.update(null, updateWrapper); bstIvtPackageinfoivtMapper.update(null, updateWrapper);
result.put("status", org.springframework.http.HttpStatus.OK.value());
result.put("message", "检验成功!");
return result;
} }

View File

@@ -113,10 +113,18 @@ public enum IOSEnum {
OUT_HANGER(MapOf.of("行架位1", "CK2013","行架位2", "CK2017")), OUT_HANGER(MapOf.of("行架位1", "CK2013","行架位2", "CK2017")),
// 点位 // 点位
POINT_CODE(MapOf.of("退货入库位", "THRKDJW1", "2020","CK2020", "2022","CK2022","木箱装箱位","CK2024")), POINT_CODE(MapOf.of("退货入库位", "THRKDJW1", "2020","CK2020", "2022","CK2022","木箱装箱开盒盖","CK2024")),
//acs申请任务 //acs申请任务
ACSTOLMS_TYPE(MapOf.of("成品入库任务", "1","空盘入库","2","空盘出库","3","异常处理位","4","木箱入库","5","退货入库","6","贴标","1","捆扎","2","子卷装箱","7")), ACSTOLMS_TYPE(MapOf.of("成品入库任务", "1"
,"空盘入库","2","空盘出库"
,"3","异常处理位","4"
,"木箱入库","5"
,"退货入库","6"
,"贴标","1"
,"捆扎","2"
,"木箱装箱开盒盖位","7"
,"退货异常申请行架对接位至NG位","9")),
// acs外部系统用户 // acs外部系统用户
EXT_ACS(MapOf.of("acs", "2","kc","康成")), EXT_ACS(MapOf.of("acs", "2","kc","康成")),

View File

@@ -1428,7 +1428,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
whereJson.put("material_barcode", material_barcodes); whereJson.put("material_barcode", material_barcodes);
inBussManageService.inTask(whereJson); inBussManageService.inTask(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("子卷装箱"))) { } else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("木箱装箱开盒盖位"))) {
//校验 //校验
List<PdmBiSubpackagerelation> pdmBiSubpackagerelations = pdmBiSubpackagerelationMapper.selectList(new QueryWrapper<PdmBiSubpackagerelation>().eq("package_box_sn", whereJson.getString("material_barcode")).eq("status", "0")); List<PdmBiSubpackagerelation> pdmBiSubpackagerelations = pdmBiSubpackagerelationMapper.selectList(new QueryWrapper<PdmBiSubpackagerelation>().eq("package_box_sn", whereJson.getString("material_barcode")).eq("status", "0"));
if (ObjectUtil.isEmpty(pdmBiSubpackagerelations)){ if (ObjectUtil.isEmpty(pdmBiSubpackagerelations)){
@@ -1441,7 +1441,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject jsonParam = new JSONObject(); JSONObject jsonParam = new JSONObject();
jsonParam.put("start_device_code",whereJson.getString("device_code")); jsonParam.put("start_device_code",whereJson.getString("device_code"));
jsonParam.put("next_device_code",IOSEnum.POINT_CODE.code("木箱装箱位")); jsonParam.put("next_device_code",IOSEnum.POINT_CODE.code("木箱装箱开盒盖"));
jsonParam.put("vehicle_code2",mdPdStorageVehicleInfo.getStoragevehicle_code()); jsonParam.put("vehicle_code2",mdPdStorageVehicleInfo.getStoragevehicle_code());
jsonParam.put("vehicle_code",whereJson.getString("material_barcode")); jsonParam.put("vehicle_code",whereJson.getString("material_barcode"));
jsonParam.put("task_status", TaskStatusEnum.START_AND_POINT.getCode()); jsonParam.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());