diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java index 398d3e3..37cd079 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/rest/InstructionController.java @@ -37,9 +37,6 @@ public class InstructionController { @ApiOperation("查询指令") //@PreAuthorize("@el.check('instruction:list')") public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { - if(ObjectUtil.isEmpty(whereJson.get("status"))) { - whereJson.put("status", "1"); - } return new ResponseEntity<>(instructionService.queryAll(whereJson, page), HttpStatus.OK); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index e2a6ead..b7fbb05 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -87,7 +87,6 @@ public class InstructionServiceImpl extends CommonServiceImpl instructions = new CopyOnWriteArrayList(); -// List instructions_mybatis = new CopyOnWriteArrayList(); @Autowired DeviceAppService deviceAppService; @Autowired @@ -196,6 +195,7 @@ public class InstructionServiceImpl extends CommonServiceImpl instructionMybatis.like(InstructionMybatis::getStart_point_code,point_code).or().like(InstructionMybatis::getNext_point_code,point_code)); wrapper.eq(StringUtils.isNotBlank(instruction_type),InstructionMybatis::getInstruction_type,instruction_type); + wrapper.le(InstructionMybatis::getInstruction_status, 1); if (!StrUtil.isEmpty(is_over)) { if (StrUtil.equals(is_over,"1")){ wrapper.ge(InstructionMybatis::getInstruction_status,2); @@ -203,6 +203,7 @@ public class InstructionServiceImpl extends CommonServiceImpl insPage = instructionMapper.selectPage(queryPage,wrapper); final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(insPage, InstructionDto.class)); return json; @@ -311,10 +312,6 @@ public class InstructionServiceImpl extends CommonServiceImpl(instructionMapper) .eq(InstructionMybatis::getTask_code, code) .one(); @@ -339,15 +336,6 @@ public class InstructionServiceImpl extends CommonServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(InstructionMybatis::getTask_id,id); @@ -456,9 +444,6 @@ public class InstructionServiceImpl extends CommonServiceImpl(taskMapper) .eq(Task::getTask_id,insttaskid) @@ -990,14 +963,7 @@ public class InstructionServiceImpl extends CommonServiceImpl { */ List queryAll(Map whereJson); - /** - * 根据ID查询 - * - * @param task_id ID - * @return AcsTask - */ -// TaskDto findById(String task_id); /** * 查询所有未完成任务 diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 2426a37..794b40f 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -165,87 +165,6 @@ public class TaskServiceImpl extends CommonServiceImpl impleme return this.removeByIds(set); } - /* - private void delCaches(String id) { - redisUtils.delByKey(CACHE_KEY + "::id:", id); - } - - private void delCaches(Set ids) { - for (String id: ids) { - delCaches(id); - } - }*/ - - /* - @Override - public void download(List all, HttpServletResponse response) throws IOException { - List> list = new ArrayList<>(); - for (TaskDto task : all) { - Map map = new LinkedHashMap<>(); - map.put("任务外部标识", task.getExtTaskId()); - map.put("任务号", task.getTaskCode()); - map.put("载具号", task.getVehicleCode()); - map.put("载具类型", task.getVehicleType()); - map.put("任务类型", task.getTaskType()); - map.put("任务状态", task.getTaskStatus()); - map.put("复合任务", task.getCompoundTask()); - map.put("复合任务数据", task.getCompoundTaskData()); - map.put("再次请求", task.getRequestAgain()); - map.put("再次请求成功", task.getRequestAgainSuccess()); - map.put("关联编号", task.getLinkNum()); - map.put("是否下发", task.getIsSend()); - map.put("物料类型", task.getMaterial()); - map.put("物料数量", task.getQuantity()); - map.put("任务优先级", task.getPriority()); - map.put("创建类型", task.getCreateType()); - map.put("完成类型", task.getFinishType()); - map.put("执行描述编码", task.getExecuteCode()); - map.put("执行描述信息", task.getExecuteMessage()); - map.put("起始点位编码", task.getStartPointCode()); - map.put("起始设备编码", task.getStartDeviceCode()); - map.put("放货点位编码", task.getPutPointCode()); - map.put("放货设备编码", task.getPutDeviceCode()); - map.put("起始点位编码2", task.getStartPointCode2()); - map.put("起始设备编码2", task.getStartDeviceCode2()); - map.put("目标点位编码", task.getNextPointCode()); - map.put("目标设备编码", task.getNextDeviceCode()); - map.put("目标点位编码2", task.getNextPointCode2()); - map.put("目标设备编码2", task.getNextDeviceCode2()); - map.put("排", task.getFromX()); - map.put("列", task.getFromY()); - map.put("层", task.getFromZ()); - map.put("排", task.getPutX()); - map.put("列", task.getPutY()); - map.put("层", task.getPutZ()); - map.put("排", task.getToX()); - map.put("列", task.getToY()); - map.put("层", task.getToZ()); - map.put("排2", task.getFromX2()); - map.put("列2", task.getFromY2()); - map.put("层2", task.getFromZ2()); - map.put("排2", task.getToX2()); - map.put("列2", task.getToY2()); - map.put("层2", task.getToZ2()); - map.put("路由方案名称", task.getRoutePlanName()); - map.put("路由方案编码", task.getRoutePlanCode()); - map.put("是否需要反馈上位系统", task.getIsNeedfeedback()); - map.put("空盘数量", task.getEmptypalletNum()); - map.put("备注", task.getRemark()); - map.put("是否启用", task.getIsActive()); - map.put("是否删除", task.getIsDelete()); - map.put("创建者", task.getCreateBy()); - map.put("创建时间", task.getCreateTime()); - map.put("修改者", task.getUpdateBy()); - map.put("修改时间", task.getUpdateTime()); - map.put("重量", task.getWeight()); - map.put("agv系统类型", task.getAgvSystemType()); - map.put("立库任务类型", task.getStorageTaskType()); - map.put("温度", task.getTemperature()); - map.put("时间", task.getOvenTime()); - list.add(map); - } - FileUtil.downloadExcel(list, response); - }*/ /** * 获取未完成任务 @@ -441,20 +360,8 @@ public class TaskServiceImpl extends CommonServiceImpl impleme return ConvertUtil.convertList(taskList,TaskDto.class); } -// @Override -// public TaskDto findById(String task_id) { -// WQLObject wo = WQLObject.getWQLObject("acs_task"); -// JSONObject json = wo.query("task_id ='" + task_id + "'").uniqueResult(0); -// final TaskDto obj = json.toJavaObject(TaskDto.class); -// return obj; -// } - @Override public List queryAllUnfinished(Map whereJson) { -// WQLObject wo = WQLObject.getWQLObject("acs_task"); -// JSONArray arr = wo.query("task_status < 2 ").getResultJSONArray(0); -// List list = arr.toJavaList(TaskDto.class); -// return list; List taskList= new LambdaQueryChainWrapper<>(taskMapper) .lt(Task::getTask_status,"2") .list(); @@ -463,10 +370,6 @@ public class TaskServiceImpl extends CommonServiceImpl impleme @Override public TaskDto findByCode(String code) { -// WQLObject wo = WQLObject.getWQLObject("acs_task"); -// JSONObject json = wo.query("task_code ='" + code + "'").uniqueResult(0); -// final TaskDto obj = json.toJavaObject(TaskDto.class); -// return obj; Task task= new LambdaQueryChainWrapper<>(taskMapper) .eq(Task::getTask_code,code) .one(); @@ -849,15 +752,6 @@ public class TaskServiceImpl extends CommonServiceImpl impleme Task task = ConvertUtil.convert(dto, Task.class); taskMapper.updateById(task); - Iterator iterator = tasks.iterator(); -// while (iterator.hasNext()) { -// TaskDto task = iterator.next(); -// if (task.getTask_code().equals(dto.getTask_code())) { -// iterator.remove(); -// } -// } - - removeByCodeFromCache(entity.getTask_code()); if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) { diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java index 8da8e35..bb69741 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/quartz/task/AutoCreateInst.java @@ -17,8 +17,10 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.common.exception.BadRequestException; import org.nl.config.SpringContextHolder; import org.nl.system.service.param.ISysParamService; +import org.nl.system.service.param.dao.Param; import org.springframework.stereotype.Component; import java.util.Arrays; @@ -69,7 +71,12 @@ public class AutoCreateInst { continue; } List instructions = instructionService.queryAll("instruction_status < 2"); - String maxInstnumber = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER).getValue(); + Param maxInstNumber_param = acsConfigService.findByCode(AcsConfig.MAXINSTNUMBER); + if(ObjectUtils.isEmpty(maxInstNumber_param)){ + log.info("未查询到系统参数"+AcsConfig.MAXINSTNUMBER+"相关配置,请检查相关设置!"); + throw new BadRequestException("未查询到系统参数"+AcsConfig.MAXINSTNUMBER+"相关配置,请检查相关设置!"); + } + String maxInstnumber = maxInstNumber_param.getValue(); if (ObjectUtils.isNotEmpty(maxInstnumber)) { if (instructions.size() >= Integer.parseInt(maxInstnumber)) { log.info("已达到系统参数配置的最大指令数 [" + maxInstnumber + "] ,无法生成指令。"); @@ -77,6 +84,9 @@ public class AutoCreateInst { taskserver.updateByCodeFromCache(acsTask); continue; } + }else{ + log.info("系统参数"+AcsConfig.MAXINSTNUMBER+"相关配置异常,请检查相关设置!"); + throw new BadRequestException("系统参数"+AcsConfig.MAXINSTNUMBER+"相关配置异常,请检查相关设置!"); } @@ -147,8 +157,12 @@ public class AutoCreateInst { // StandardEmptyPalletSiteDeviceDriver standardEmptsyPalletSiteDeviceDriver; // LampThreecolorDeviceDriver lampThreecolorDeviceDriver; // LnshFoldDiscSiteDeviceDriver lnshFoldDiscSiteDeviceDriver; - - String createTaskCheck = acsConfigService.findByCode(AcsConfig.CREATETASKCHECK).getValue(); + Param createTaskCheck_param = acsConfigService.findByCode(AcsConfig.CREATETASKCHECK); + if(ObjectUtils.isEmpty(createTaskCheck_param)){ + log.info("未查询到系统参数"+AcsConfig.CREATETASKCHECK+"相关配置,请检查相关设置!"); + throw new BadRequestException("未查询到系统参数"+AcsConfig.CREATETASKCHECK+"相关配置,请检查相关设置!"); + } + String createTaskCheck = createTaskCheck_param.getValue(); if (StrUtil.equals(createTaskCheck, "1")) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue index 5bd1312..afb76e2 100644 --- a/acs/nladmin-ui/src/views/acs/instruction/index.vue +++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue @@ -145,20 +145,9 @@ - - - - - - - - - - - diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index 523dfea..c7313e9 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -276,36 +276,7 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -331,7 +302,6 @@ {{ dict.label.task_type[scope.row.task_type] }} -