From e1edf3e831f693b6d4716fe8d5b0af8ef8b6afdd Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Wed, 17 Apr 2024 08:43:52 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E6=89=8B=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/hand/amb/rest/HFHandController.java | 2 +- .../mes/service/impl/WmsToMesServiceImpl.java | 2 - .../nl/wms/pda/controller/PdaController.java | 6 ++ .../org/nl/wms/pda/service/PdaService.java | 7 +++ .../pda/service/dao/dto/BindVehicleDto.java | 1 + .../wms/pda/service/dao/mapper/PdaMapper.java | 9 ++- .../wms/pda/service/dao/mapper/PdaMapper.xml | 20 ++++++ .../wms/pda/service/impl/PdaServiceImpl.java | 61 +++++++++++++++---- .../dao/SchBaseVehiclematerialgroup.java | 11 ---- ...chBaseVehiclematerialgroupServiceImpl.java | 3 - 10 files changed, 91 insertions(+), 31 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java b/acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java index ce34051..679a83d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java +++ b/acs/nladmin-system/src/main/java/org/nl/hand/amb/rest/HFHandController.java @@ -27,7 +27,7 @@ import java.util.Map; @RestController @RequiredArgsConstructor @Api(tags = "手持接口") -@RequestMapping("/api/hand") +@RequestMapping("/api/pda") @Slf4j public class HFHandController { private final HFHandService handService; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java index caf89e5..b04d076 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java @@ -271,7 +271,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { gdyMaterialInDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialInDto.setSTOCK("未知"); gdyMaterialInDto.setDEVICE(GeneralDefinition.YES); - gdyMaterialInDto.setIN_DATE(vehiclematerialgroup.getInto_kiln_time()); gdyMaterialInDto.setCREATE_TM(DateUtil.now()); gdyMaterialInDto.setOP_FLAG(GeneralDefinition.NO); log.info("入窑数据:{}", gdyMaterialInDto); @@ -314,7 +313,6 @@ public class WmsToMesServiceImpl implements WmsToMesService { gdyMaterialOutDto.setFCONVERTRATE(mesWorkOrderDto.getFCONVERTRATE()); gdyMaterialOutDto.setSTOCK("未知"); gdyMaterialOutDto.setDEVICE("1"); - gdyMaterialOutDto.setOUT_DATE(vehiclematerialgroup.getOut_kiln_time()); gdyMaterialOutDto.setCREATE_TM(DateUtil.now()); gdyMaterialOutDto.setOP_FLAG(GeneralDefinition.NO); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java index db0fad4..248be03 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -78,6 +78,12 @@ public class PdaController { return new ResponseEntity<>(pdaService.link(requestParam), HttpStatus.OK); } + @PostMapping("/queryExistGroup") + @Log("查询已配盘的组盘信息") + public ResponseEntity queryExistGroup() { + return new ResponseEntity<>(pdaService.queryExistGroup(), HttpStatus.OK); + } + @PostMapping("/fullVehicleIn") @Log("入库") public ResponseEntity fullVehicleIn(@Validated @RequestBody CommonPointQueryDto requestParam) { diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java index 45bd2eb..4cf93fd 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java @@ -379,4 +379,11 @@ public interface PdaService { List queryDevice(); PdaResponseVo taskConfirm(FullVehicleOutDto requestParam); + + /** + * 查询已配盘的组盘信息 + * + * @return + */ + List queryExistGroup(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java index d62ed70..8bc5649 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/BindVehicleDto.java @@ -10,5 +10,6 @@ import lombok.Data; @Data public class BindVehicleDto { private String point_code; + private String vehicle_type; private String vehicle_code; } \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java index a68fdcd..6631aa3 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.java @@ -22,7 +22,6 @@ public interface PdaMapper { List queryVehicleGroup(); - List getDeviceInfo(); /** @@ -97,5 +96,11 @@ public interface PdaMapper { List requestInfo(); - + /** + * 查询已经配盘的组盘信息 + * 可用于入库或打印 + * + * @return + */ + List queryExistGroup(); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml index b870555..583c241 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml @@ -191,4 +191,24 @@ WHERE pr.is_delete = false ORDER BY pr.create_time ASC + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index cecc1e9..710dbce 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -92,13 +92,35 @@ public class PdaServiceImpl implements PdaService { return pdaMapper.queryVehicleGroup(); } + @Override + public List queryExistGroup() { + List vehicleLinkVoList = pdaMapper.queryExistGroup(); + Iterator iterator = vehicleLinkVoList.iterator(); + while (iterator.hasNext()) { + VehicleLinkVo vehicleLinkVo = iterator.next(); + String point_code = vehicleLinkVo.getPoint_code(); + SchBasePoint point = pointService.getById(point_code); + if (ObjectUtil.isEmpty(point) || !point.getRegion_code().equals(RegionEnum.ZP.getRegion_code())) { + iterator.remove(); + } + } + return vehicleLinkVoList; + } + @Override @Transactional(rollbackFor = Exception.class) public PdaResponseVo manualCreateByPda(ManualGroupDto entity) { Assert.notNull(entity, "参数不能为空!"); SchBaseVehiclematerialgroup groupInfo = vehiclematerialgroupService.getGroupInfo(entity.getVehicle_code(), entity.getVehicle_type(), GroupBindMaterialStatusEnum.BOUND.getValue()); - Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息已存在"); + Assert.isFalse(ObjectUtil.isNotEmpty(groupInfo), "组盘信息(载具编码)已存在"); + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(SchBaseVehiclematerialgroup::getPoint_code, entity.getPoint_code()) + .eq(SchBaseVehiclematerialgroup::getGroup_bind_material_status, GroupBindMaterialStatusEnum.BOUND.getValue()); + SchBaseVehiclematerialgroup one = vehiclematerialgroupService.getOne(lqw); + if (ObjectUtil.isNotEmpty(one)) { + throw new BadRequestException("该点位已存在组盘信息!"); + } // 获取点位 SchBasePoint basePoint = pointService.getById(entity.getPoint_code()); // 获取物料 @@ -256,7 +278,7 @@ public class PdaServiceImpl implements PdaService { .eq(SchBasePoint::getPoint_status, PointStatusEnum.EMPTY_POINT.getCode()); SchBasePoint point = pointService.getOne(lqw); if (ObjectUtil.isEmpty(point)) { - throw new BadRequestException("点位:" + requestParam.getPoint_code() + "状态不为空位!"); + throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不存咋或点位状态不为空位!"); } if (!RegionEnum.ZP.getRegion_code().equals(point.getRegion_code())) { throw new BadRequestException("点位:" + requestParam.getPoint_code() + "不属于组盘区域,无法进行空托盘入库!"); @@ -276,7 +298,9 @@ public class PdaServiceImpl implements PdaService { @Override public List queryLinkMaterial(MaterialQueryDto requestParam) { Assert.notNull(requestParam, "参数不能为空!"); - Assert.notBlank(requestParam.getMaterial_id(), "物料ID不能为空!"); + if (StrUtil.isEmpty(requestParam.getMaterial_id())) { + return new ArrayList<>(); + } MdBaseMaterial material = materialService.getById(requestParam.getMaterial_id()); Assert.notNull(material, "物料信息有误!未查询出对应的物料信息,物料编码:" + requestParam.getMaterial_code()); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); @@ -315,7 +339,11 @@ public class PdaServiceImpl implements PdaService { Assert.notBlank(requestParam.getPoint_code1(), "起始点位不能为空!"); Assert.notNull(pointService.getById(requestParam.getPoint_code1()), requestParam.getPoint_code1() + ",对应的点位信息不存在!"); Assert.notBlank(requestParam.getPoint_code2(), "出库点位不能为空!"); - Assert.notNull(pointService.getById(requestParam.getPoint_code2()), requestParam.getPoint_code2() + ",对应的点位信息不存在!"); + SchBasePoint point2 = pointService.getById(requestParam.getPoint_code2()); + Assert.notNull(point2, requestParam.getPoint_code2() + ",对应的点位信息不存在!"); + if (!point2.getPoint_status().equals(PointStatusEnum.EMPTY_POINT.getCode())) { + throw new BadRequestException("出库点位不为空位!"); + } JSONObject param = new JSONObject(); param.put("device_code", requestParam.getPoint_code1()); param.put("device_code2", requestParam.getPoint_code2()); @@ -339,11 +367,12 @@ public class PdaServiceImpl implements PdaService { if (ObjectUtil.isEmpty(vehiclematerialgroup)) { return new VehicleLinkVo(); } + MdBaseMaterial material = materialService.getById(vehiclematerialgroup.getMaterial_id()); VehicleLinkVo vo = new VehicleLinkVo(); vo.setPoint_code(vehiclematerialgroup.getPoint_code()); vo.setMaterial_id(vehiclematerialgroup.getMaterial_id()); - vo.setMaterial_code(vehiclematerialgroup.getMaterial_code()); - vo.setMaterial_name(vehiclematerialgroup.getMaterial_name()); + vo.setMaterial_code(material.getMaterial_code()); + vo.setMaterial_name(material.getMaterial_name()); vo.setPcsn(vehiclematerialgroup.getPcsn()); vo.setMaterial_qty(vehiclematerialgroup.getMaterial_qty()); return vo; @@ -446,12 +475,19 @@ public class PdaServiceImpl implements PdaService { @Override public List queryEndPointsByStart(FullVehicleOutDto requestParam) { Assert.notNull(requestParam, "请求参数不能为空!"); - Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!"); + if (StrUtil.isEmpty(requestParam.getPoint_code1())) { + return new ArrayList<>(); + } + //Assert.notBlank(requestParam.getPoint_code1(), "当前点位不能为空!"); SchBasePoint point = pointService.getById(requestParam.getPoint_code1()); - Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!"); + if (ObjectUtil.isEmpty(point)) { + return new ArrayList<>(); + } + // Assert.notNull(point, requestParam.getPoint_code1() + "对应的点位信息不存在!"); List regions = Arrays.asList(RegionEnum.ZP.getRegion_code(), RegionEnum.JLHC.getRegion_code(), RegionEnum.YCL.getRegion_code()); if (regions.contains(point.getRegion_code())) { - throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!"); + return new ArrayList<>(); + //throw new BadRequestException("当前点位信息有误,请检查该点位是否为任务流传所属区域!"); } List list = new ArrayList<>(); if (StrUtil.isEmpty(point.getNext_point_code())) { @@ -494,8 +530,8 @@ public class PdaServiceImpl implements PdaService { .eq(SchBaseVehiclematerialgroup::getLink_status, LinkStatusEnum.LINK_FINISH.getType()); SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getOne(lqw); if (ObjectUtil.isNotEmpty(vehiclematerialgroup)) { - vehiclematerialgroup.setPoint_code(null); - vehiclematerialgroup.setPoint_name(null); + vehiclematerialgroup.setPoint_code(""); + vehiclematerialgroup.setPoint_name(""); vehiclematerialgroupService.update(vehiclematerialgroup); } SchBasePoint point = pointService.getById(requestParam.getPoint_code()); @@ -530,6 +566,7 @@ public class PdaServiceImpl implements PdaService { } point.setPoint_status(point_status); point.setVehicle_code(requestParam.getVehicle_code()); + point.setVehicle_type(requestParam.getVehicle_type()); point.setVehicle_qty(1); pointService.update(point); return PdaResponseVo.pdaResultOk("绑定成功"); @@ -589,6 +626,7 @@ public class PdaServiceImpl implements PdaService { return PdaResponseVo.pdaResultOk("创建定点任务请求成功"); } + @Override public List copyPointVoList(List list) { List pointVoList = new ArrayList<>(); @@ -696,7 +734,6 @@ public class PdaServiceImpl implements PdaService { throw new BadRequestException("请选择需要设置静置的料盅!"); } SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(forcedRestingDto.getGroup_id()); - vehiclematerialgroup.setStanding_time(forcedRestingDto.getStand_time()); vehiclematerialgroupService.updateById(vehiclematerialgroup); return PdaResponseVo.pdaResultOk("设置静置时长完成"); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java index 11da9ce..2480545 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/dao/SchBaseVehiclematerialgroup.java @@ -52,20 +52,13 @@ public class SchBaseVehiclematerialgroup implements Serializable { private Boolean is_full; - private Boolean is_firing; - private String pcsn; - private String mix_times; - private String instorage_time; - private Integer standing_time; - - private String material_qty; @@ -147,10 +140,6 @@ public class SchBaseVehiclematerialgroup implements Serializable { private String update_time; - private String out_kiln_time; - - private String into_kiln_time; - @TableField(exist = false) private String material_name; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java index 6a34554..8670f54 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/impl/SchBaseVehiclematerialgroupServiceImpl.java @@ -67,9 +67,6 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl