diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 3a5410c..72d9c3b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -346,15 +346,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public Object feedTaskStatus(JSONObject param) { - if(ObjectUtil.isNotEmpty(param)){ + if (ObjectUtil.isNotEmpty(param)) { String task_code = param.getString("task_code"); String task_status = param.getString("task_status"); - if(StrUtil.isEmpty(task_code) || StrUtil.isEmpty(task_status)){ + if (StrUtil.isEmpty(task_code) || StrUtil.isEmpty(task_status)) { throw new BadRequestException("task_code或task_status为空!"); } SchBaseTask schBaseTask = taskService.getOne(Wrappers.lambdaQuery(SchBaseTask.class) .eq(SchBaseTask::getTask_code, task_code).in(SchBaseTask::getTask_status, TaskStatus.EXECUTING.getCode(), TaskStatus.ISSUED.getCode())); - if(ObjectUtil.isEmpty(schBaseTask)) throw new BadRequestException("任务不存在!task_code:" + task_code); + if (ObjectUtil.isEmpty(schBaseTask)) throw new BadRequestException("任务不存在!task_code:" + task_code); switch (task_status) { case "1": //执行中 @@ -369,7 +369,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { break; default: break; - } + } } return null; @@ -385,9 +385,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { //TODO:空料容放货完成反馈给Connector if (!is_empty) { finishTask(schBaseTask.getTask_code(), schBaseTask.getPoint_code2()); - }else { + } else { finishTask(schBaseTask.getTask_code(), schBaseTask.getPoint_code1()); - if ("1".equals(is_connector)) { JSONObject json = new JSONObject(); json.put("vehicle_code", schBaseTask.getVehicle_code()); @@ -411,8 +410,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private void finishTask(String task_code, String point_code) { pointService.update(Wrappers.lambdaUpdate(SchBasePoint.class).eq(SchBasePoint::getPoint_code, point_code) .set(SchBasePoint::getIs_lock, false)); - /*taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, task_code) - .set(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()));*/ } /** @@ -425,7 +422,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { //TODO:取货完成创建第二条任务:补空托盘 String vehicle_code = schBaseTask.getVehicle_code(); if ("1".equals(is_connector)) { - List list = taskService.list(Wrappers.lambdaQuery(SchBaseTask.class).eq(SchBaseTask::getPoint_code2, schBaseTask.getPoint_code1()) + List list = taskService.list(Wrappers.lambdaQuery(SchBaseTask.class) + .eq(SchBaseTask::getPoint_code2, schBaseTask.getPoint_code1()) .in(SchBaseTask::getTask_status, TaskStatus.APPLY.getCode(), TaskStatus.CREATED.getCode(), TaskStatus.ISSUED.getCode(), TaskStatus.EXECUTING.getCode())); if (CollectionUtils.isEmpty(list)) { MdBaseVehicle mdBaseVehicle = iMdBaseVehicleService.getOne(new QueryWrapper().eq("vehicle_code", vehicle_code)); @@ -496,6 +494,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { taskService.update(Wrappers.lambdaUpdate(SchBaseTask.class).eq(SchBaseTask::getTask_code, schBaseTask.getTask_code()) .set(SchBaseTask::getJob_name, connectorDto.getJobname())); } + } else { + throw new BadRequestException("LMS向Connector请求取货"); } } if ("2".equals(is_connector)) { @@ -532,6 +532,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (acsResponse.getStatus() != 200 || StringUtils.isNotEmpty(acsResponse.getErrMsg())) { throw new BadRequestException("申请失败,"+ acsResponse.getErrMsg()); } + }else if("1".equals(is_connector)){ + JSONObject json = new JSONObject(); + json.put("vehicle_code", schBaseTask.getVehicle_code()); + json.put("status", status); + json.put("device_code", schBaseTask.getPoint_code2()); + json.put("task_code", schBaseTask.getTask_code()); + AcsResponse acsResponse = connectorService.feedAgvTaskStatus(json); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java index 59f7c01..b642570 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/controller/ConnectorToWmsController.java @@ -31,7 +31,6 @@ public class ConnectorToWmsController { @SaIgnore @PostMapping("/wms/task") public ResponseEntity createTaskByConnector(@RequestBody JSONArray jsonArray){ - Object taskByConnector = connectorService.createTaskByConnector(jsonArray); return new ResponseEntity(connectorService.createTaskByConnector(jsonArray), HttpStatus.OK); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java index 9b87615..db2bd99 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/connector/service/impl/ConnectorToWmsServiceImpl.java @@ -68,7 +68,7 @@ public class ConnectorToWmsServiceImpl implements ConnectorToWmsService { if (ObjectUtil.isEmpty(schBasePoint)) { map1.put("task_code", task_code); map1.put("status", HttpStatus.HTTP_INTERNAL_ERROR); - map1.put("message", start_device_code + "起点设备不存在!"); + map1.put("message", start_device_code + "点位设备不存在!"); objects.add(map1); continue; } else if (schBasePoint.getIs_lock()) { diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java index 904e251..a2995ab 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java @@ -246,9 +246,6 @@ public class SchBasePointServiceImpl extends ServiceImpl findUnFinishTasksByTaskConfig(String config_code, String device_code, String direction) { - Assert.notNull(config_code, "任务配置编码不能为空!"); + Assert.noNullElements(new Object[]{config_code, device_code, direction}, "任务配置编码不能为空!"); LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); lam.eq(SchBaseTask::getConfig_code, config_code) .lt(SchBaseTask::getTask_status, TaskStatus.FINISHED.getCode()) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java index 78b3964..9240615 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java @@ -234,6 +234,12 @@ public abstract class AbstractTask { Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn, "该点位申请的任务未完成数已超过上限,无法申请任务"); + // 校验同个点位,同种任务是否多次请求创建任务(固定只能1个任务) + List applyPointTask = taskService.findUnFinishTasksByTaskConfig( + taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction()); + if (applyPointTask.size() == 1) { + throw new BadRequestException("已创建相同点位任务,不可重复创建!"); + } // 获取对接位点位对象 SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper() .eq(SchBasePoint::getPoint_code, apply_point_code)); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/CNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/CNTTask.java index f44e42f..984d777 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/CNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/CNTTask.java @@ -65,8 +65,8 @@ public class CNTTask extends AbstractTask { SchBasePoint schBasePoint = null; if (TaskType.CARRY_TASK.getValue().equals(task.getTask_type())) { schBasePoint = schBasePointService.selectByRegionCode(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(), task.getVehicle_code()); - } else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())){ - schBasePoint = schBasePointService.selectByReassign(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(),task.getVehicle_code()); + } else if (TaskType.REASSIGN_TASK.getValue().equals(task.getTask_type())) { + schBasePoint = schBasePointService.selectByReassign(RegionEnum.TRUBEND_SHELVES_3_1_1.getRegion_code(), task.getVehicle_code()); } if (ObjectUtil.isEmpty(schBasePoint)) { task.setRemark("未找到所需点位!"); @@ -83,6 +83,11 @@ public class CNTTask extends AbstractTask { task.setRemark(""); task.setTask_status(TaskStatus.CREATED.getCode()); taskService.updateById(task); + + schBasePoint.setIng_task_code(task.getTask_code()); + schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); + PointUtils.setUpdateByAcs(schBasePoint); + pointService.updateById(schBasePoint); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/FTGTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/FTGTask.java index ceb8280..2dd4ece 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/FTGTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/cnt/FTGTask.java @@ -71,11 +71,6 @@ public class FTGTask extends AbstractTask { continue; } - /*SchBaseVehiclematerialgroup schBaseVehiclematerialgroup = new SchBaseVehiclematerialgroup(); - schBaseVehiclematerialgroup.setVehicle_code(task.getVehicle_code()); - schBaseVehiclematerialgroup.setPoint_code(schBasePoint.getPoint_code()); - schBaseVehiclematerialgroupService.create(schBaseVehiclematerialgroup);*/ - // 设置终点并修改创建成功状态 task.setPoint_code1(schBasePoint.getPoint_code()); task.setVehicle_type(schBasePoint.getCan_vehicle_type()); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java index 0556133..b604de6 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCMTTask.java @@ -77,7 +77,9 @@ public class SortingCMTTask extends AbstractTask { .set("task_status",TaskStatus.CREATED.getCode()) .set("point_code1",structPoint.getPoint_code()) .eq("task_id",task.getTask_id())); - pointService.update(new UpdateWrapper().set("ing_task_code",task.getTask_code()) + pointService.update(new UpdateWrapper() + .set("ing_task_code",task.getTask_code()) + .set("is_lock",true) .eq("point_code",structPoint.getPoint_code())); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java index 631ce12..3866eba 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingCNTTask.java @@ -34,7 +34,7 @@ import java.util.List; @Component(value = "SortingCNTTask") public class SortingCNTTask extends AbstractTask { - private static String Vehicle_Type = VehicleEnum.S.getCode(); + private static String Vehicle_Type = VehicleEnum.XL.getCode(); private static final String TASK_CONFIG_CODE = "SortingCNTTask"; @Autowired diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java index f05126c..f28b03e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSMTTask.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import jdk.nashorn.internal.scripts.JS; import lombok.extern.slf4j.Slf4j; +import org.nl.common.enums.GoodsEnum; import org.nl.common.enums.region.RegionEnum; import org.nl.common.exception.BadRequestException; import org.nl.system.service.notice.ISysNoticeService; @@ -102,6 +103,8 @@ public class SortingSMTTask extends AbstractTask { task.setTask_status(TaskStatus.CREATED.getCode()); taskService.updateById(task); + //更新点位 + schBasePoint.setPoint_status(GoodsEnum.IN_STOCK.getValue()); schBasePoint.setIng_task_code(task.getTask_code()); PointUtils.setUpdateByAcs(schBasePoint); pointService.updateById(schBasePoint); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java index cf2d5c3..bf4e6b2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/sorting/SortingSNTTask.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.extern.slf4j.Slf4j; +import org.nl.common.enums.GoodsEnum; import org.nl.common.enums.region.RegionEnum; import org.nl.common.exception.BadRequestException; import org.nl.system.service.notice.ISysNoticeService; @@ -86,9 +87,12 @@ public class SortingSNTTask extends AbstractTask { .set("task_status",TaskStatus.CREATED.getCode()) .set("point_code2",schBasePoint.getPoint_code()) .eq("task_id",task.getTask_id())); - pointService.update(new UpdateWrapper() - .set("ing_task_code",task.getTask_code()) - .eq("point_code",schBasePoint.getPoint_code())); + + //更新点位信息 + schBasePoint.setIng_task_code(task.getTask_code()); + schBasePoint.setPoint_status(GoodsEnum.EMPTY_PALLETS.getValue()); + PointUtils.setUpdateByAcs(schBasePoint); + pointService.updateById(schBasePoint); } } diff --git a/lms/nladmin-ui/src/views/wms/sch/task/index.vue b/lms/nladmin-ui/src/views/wms/sch/task/index.vue index d29d07d..ed4cd0a 100644 --- a/lms/nladmin-ui/src/views/wms/sch/task/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/task/index.vue @@ -182,9 +182,9 @@ - - - + + + - - + + @@ -227,12 +227,12 @@ :disabled="scope.row.task_status==='5' || scope.row.task_status==='6'" @click="doOperate(scope.row, 'a')" >完成 - 取消 + >取消 --> @@ -247,7 +247,6 @@ import crudSchBaseTask from './schBaseTask' import CRUD, { crud, form, header, presenter } from '@crud/crud' import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' -import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' const defaultForm = { @@ -285,7 +284,7 @@ const defaultForm = { export default { name: 'Task', dicts: ['vehicle_type', 'create_mode', 'finished_type'], - components: { pagination, crudOperation, rrOperation, udOperation }, + components: { pagination, crudOperation, rrOperation }, mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({