From e86234f638734eaf5a86e6abb52f800a3190c573 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 20 Aug 2024 20:20:55 +0800 Subject: [PATCH] fix: 1 --- .../impl/BstIvtPackageinfoivtServiceImpl.java | 83 ++++++------------- 1 file changed, 26 insertions(+), 57 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java index e7505e354..9ae705db3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java @@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.nl.b_lms.pda.service.PrintTableTwoService; import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService; @@ -27,9 +28,6 @@ import org.nl.common.domain.query.PageQuery; import org.nl.common.enums.PackageInfoIvtEnum; import org.nl.common.utils.SecurityUtils; import org.nl.modules.common.exception.BadRequestException; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.SpringContextHolder; -import org.nl.system.service.param.impl.SysParamServiceImpl; import org.nl.wms.ext.mes.service.LmsToMesService; import org.nl.wms.sch.manage.TaskStatusEnum; import org.redisson.api.RLock; @@ -76,6 +74,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl + * + * @param ivtType 点位类型 + * @param ivtStatus 库存状态 + * @param pointCode 取货还是放货 + * @param sortType 点位排序规则1:升序2:降序 + * @param taskType 任务类型 + * @return List */ @Override public List checkEndPointTask(String ivtType, String ivtStatus, String pointCode, String sortType, String taskType) { @@ -299,7 +299,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl point != null && !point.trim().isEmpty() ) + .filter(point -> point != null && !point.trim().isEmpty()) .collect(Collectors.toSet()); } else if (pointCode.equals(PackageInfoIvtEnum.TASK_POINT_TYPE.code("四个点任务分配"))) { pointSets = taskList.stream() @@ -330,7 +330,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl point != null && !point.trim().isEmpty() ) + .filter(point -> point != null && !point.trim().isEmpty()) .collect(Collectors.toSet()); } else { pointSets = taskList.stream() @@ -340,7 +340,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl point != null && !point.trim().isEmpty() ) + .filter(point -> point != null && !point.trim().isEmpty()) .collect(Collectors.toSet()); } //符合条件的库存点位过滤掉已存在任务的点位 @@ -490,8 +490,6 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl updateWrapper1 = new UpdateWrapper<>(); updateWrapper1.eq("task_id", baseTask.getTask_id()); updateWrapper1.set("car_no", PackageInfoIvtEnum.TASK_ACTION_TYPE.code("放货完成")); - taskService.update(null,updateWrapper1); + taskService.update(null, updateWrapper1); log.info("一楼装箱区二次放货完成" + baseTask.getTask_code() + ",放货完成执行成功,放货信息:点位:" + baseTask.getPoint_code2() + "子卷号为:" + baseTask.getVehicle_code()); } else { throw new BadRequestException("该点位已有库存!"); @@ -608,7 +604,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl updateWrapper1 = new UpdateWrapper<>(); updateWrapper1.eq("task_id", baseTask.getTask_id()); updateWrapper1.set("request_param", PackageInfoIvtEnum.TASK_ACTION_TYPE.code("取货完成")); - taskService.update(null,updateWrapper1); + taskService.update(null, updateWrapper1); log.info("一楼装箱区二次分配取货完成" + baseTask.getTask_code() + ",取货完成信号接收成功,点位:" + pointCode + "子卷号:" + baseTask.getVehicle_code()); } @@ -665,7 +661,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl vehicleList,List kzjIvtList) { + private static BstIvtPackageinfoivt getBstIvtPackageinfoivt(List vehicleList, List kzjIvtList) { boolean hasEmptyVehicle; BstIvtPackageinfoivt newPoint = new BstIvtPackageinfoivt(); if (CollectionUtils.isNotEmpty(vehicleList)) { @@ -776,8 +772,6 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl dtoList; UpdateWrapper updateWrapper = new UpdateWrapper<>(); //LMS获取MES称重后子卷信息 - JSONObject jo =new JSONObject(); + JSONObject jo = new JSONObject(); //子卷质检合格品和管制品 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("有子卷"))) { @@ -829,7 +822,7 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl().eq(BstIvtPackageinfoivt::getContainer_name, whereJson.getString("container_name"))); - if (CollectionUtils.isEmpty(dtoList)) { + if (ObjectUtils.isEmpty(dtoList)) { result.put("status", org.springframework.http.HttpStatus.BAD_REQUEST.value()); result.put("message", "子卷号或点位信息有误,请核对是否存在!"); return result; @@ -845,36 +838,11 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl().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")); + lmsToMesService.getInspectionResult(jo); //子卷下料信息MES传递给LMS iPdmBiContainerinfoService.createSubInfoByContainer(whereJson.getString("container_name")); - jo.put("container_name",whereJson.getString("container_name")); - lmsToMesService.getInspectionResult(jo); updateWrapper.set("container_name", whereJson.getString("container_name")); updateWrapper.set("ivt_status", PackageInfoIvtEnum.IVT_STATUS.code("合格品")); } else {