From 60fe5c865883332194b071ec57930efc48e990fd Mon Sep 17 00:00:00 2001 From: yanps Date: Wed, 25 Sep 2024 16:42:49 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E7=BB=84=E7=9B=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=AD=E7=94=9F=E6=88=90=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ext/fab/service/impl/FabServiceImpl.java | 5 +- ...SchBaseVehiclematerialgroupController.java | 9 ++ .../ISchBaseVehiclematerialgroupService.java | 7 ++ ...chBaseVehiclematerialgroupServiceImpl.java | 27 ++++ .../service/impl/SchBasePointServiceImpl.java | 4 +- .../impl/SchBaseRegionServiceImpl.java | 2 + .../tasks/pcoperation/PcOperationCMTask.java | 3 +- .../tasks/pcoperation/PcOperationSNTTask.java | 6 +- .../src/views/wms/sch/group/index.vue | 116 ++++++++++++------ .../sch/group/schBaseVehiclematerialgroup.js | 18 ++- 10 files changed, 151 insertions(+), 46 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java index 73533cb..74e0a57 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/fab/service/impl/FabServiceImpl.java @@ -141,11 +141,12 @@ public class FabServiceImpl { pcOperationSMTTask.apply(param); break; case "snt": - Assert.noNullElements(new Object[]{form.getString("device_code"), form.getString("region_code")}, "参数不能为空!"); + Assert.noNullElements(new Object[]{form.getString("device_code")}, "参数不能为空!"); SendVehicleVo sendVehicleVo = form.toJavaObject(SendVehicleVo.class); SchBasePoint schBasePoint = iSchBasePointService.selectByPointCode(sendVehicleVo.getDevice_code()); + sendVehicleVo.setRegion_code(schBasePoint.getRegion_code()); param.put("device_code", sendVehicleVo.getDevice_code()); - param.put("region_code", sendVehicleVo.getRegion_code()); + param.put("region_code", schBasePoint.getRegion_code()); param.put("config_code", "PcOperationSNTTask"); param.put("vehicle_code", schBasePoint.getVehicle_code()); param.put("vehicle_type", schBasePoint.getVehicle_type()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java index aa6cf28..086c0c2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/controller/SchBaseVehiclematerialgroupController.java @@ -80,4 +80,13 @@ public class SchBaseVehiclematerialgroupController { public ResponseEntity selectByVehicleCode(@RequestBody JSONObject entity){ return new ResponseEntity<>(schBaseVehiclematerialgroupService.selectByVehicleCode(entity), HttpStatus.OK); } + + + + @PostMapping("/createTask") + @Log("根据载具物料信息创建任务") + @ApiOperation("根据载具物料信息创建任务") + public ResponseEntity createTask(@RequestBody JSONObject entity){ + return new ResponseEntity<>(schBaseVehiclematerialgroupService.createTask(entity), HttpStatus.OK); + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java index d8c26f7..f4c777a 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/group/service/ISchBaseVehiclematerialgroupService.java @@ -87,4 +87,11 @@ public interface ISchBaseVehiclematerialgroupService extends IService selectByVehicleCode(JSONObject entity); + + /** + * 根据载具号创建任务 + * @param entity + * @return + */ + Object createTask(JSONObject entity); } 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 3b41af6..53cee77 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 @@ -16,10 +16,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.nl.common.domain.query.PageQuery; +import org.nl.common.enums.GoodsEnum; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.wms.database.material.service.IMdBaseMaterialService; import org.nl.wms.database.material.service.dao.MdBaseMaterial; +import org.nl.wms.ext.fab.service.dto.CallMaterVo; import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; import org.nl.wms.sch.group.service.dao.mapper.SchBaseVehiclematerialgroupMapper; import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; @@ -28,6 +30,7 @@ import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.process_flow.service.ProcessFlowService; import org.nl.wms.sch.task.service.ISchBaseTaskService; +import org.nl.wms.sch.task_manage.task.tasks.pcoperation.PcOperationCMTask; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -52,6 +55,10 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { @@ -84,6 +91,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl 0) { SchBasePoint schBasePoint = schBasePoints.get(0); - schBasePoint.setVehicle_code(vehicleCode); schBasePoint.setIs_lock(true); update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) @@ -278,10 +277,9 @@ public class SchBasePointServiceImpl extends ServiceImpl Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq()))); if (CollUtil.isNotEmpty(schBasePoints1) && schBasePoints1.size() > 0) { + schBasePoints1.stream().sorted(Comparator.comparingInt(schBasePoint -> Math.abs(schBasePoint1.getRegion_seq() - schBasePoint.getRegion_seq()))); SchBasePoint schBasePoint = schBasePoints1.get(0); - schBasePoint.setVehicle_code(vehicleCode); schBasePoint.setIs_lock(true); update(Wrappers.lambdaUpdate(SchBasePoint.class) .eq(SchBasePoint::getPoint_code, schBasePoint.getPoint_code()) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java index ddbea58..97755ec 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/region/service/impl/SchBaseRegionServiceImpl.java @@ -100,6 +100,7 @@ public class SchBaseRegionServiceImpl extends ServiceImpl - + @@ -227,6 +227,37 @@ 确认 + + + + + + + + + + 取 消 + 确 定 + + - - - + - - - - - - @@ -272,31 +286,27 @@ - - - - - - - -