From 720699bdd5c57d87300ab7505f88b1e30bb687af Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Mon, 15 Jan 2024 08:54:50 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/instruction/service/dto/InstructionDto.java | 2 +- .../service/impl/InstructionServiceImpl.java | 2 +- .../main/java/org/nl/acs/task/service/dto/TaskDto.java | 2 +- .../org/nl/acs/task/service/impl/TaskServiceImpl.java | 10 +++++++--- .../nl/modules/quartz/task/AutoCreateAgvOneInst.java | 2 ++ .../system/service/impl/GenCodeServiceImpl.java | 2 ++ 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java index 3cd6bc30..722d2127 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/dto/InstructionDto.java @@ -279,7 +279,7 @@ public class InstructionDto implements Serializable { /** * 载具类型 */ - private String vehicle_type; + private String vehicle_type = "1"; /** * agv车号 diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 38f65ea2..2185d7a1 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -444,7 +444,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu resp=acsToLiKuService.create(createRequest); } createRequest.setGroupPriority(Integer.parseInt(dto.getPriority())); - if(ObjectUtil.isNotEmpty(resp) && StrUtil.equals(resp.getCode(),"true")){ + if(ObjectUtil.isNotEmpty(resp) && StrUtil.equals(resp.getCode(),"0")){ dto.setSend_status("1"); } else { dto.setSend_status("2"); diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index 19e3c11e..5d0745ed 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -37,7 +37,7 @@ public class TaskDto implements Serializable { /** * 载具类型 */ - private String vehicle_type; + private String vehicle_type = "1"; /** * 任务类型 diff --git a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 52d879b8..06e8b1c7 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -77,7 +77,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { private DeviceAssignedService deviceAssignedService; @Autowired private InstructionService instructionService; -// private LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class); + + // private LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class); @Override public void autoInitial() throws Exception { this.reload(); @@ -98,6 +99,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { List list = arr.toJavaList(TaskDto.class); return list; } + @Override public TaskDto findByStartCodeAndReady(String device_code) { Iterator var3 = tasks.iterator(); @@ -114,6 +116,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } return null; } + @Override public Map queryAll(Map whereJson, Pageable page) { HashMap map = new HashMap<>(); @@ -372,6 +375,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { dto.setRoute_plan_code(route_plan_code); dto.setTask_status(StatusEnum.INST_READY.getCode()); dto.setPut_device_code(dto.getPut_point_code()); + dto.setVehicle_type(dto.getVehicle_type() == null ? "1" : dto.getVehicle_type()); String plan_code = dto.getRoute_plan_code(); if (routeLineService .getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code) @@ -565,9 +569,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { InstructionDto instdto = instructionService.findByTaskId(id, "instruction_status <2 "); if (instdto != null) { // lucene.deviceExecuteLog(new LuceneLogDto(id,"任务号关联的指令状态instruction_status <2:"+instdto.getInstruction_status())); - log.info("任务号{}关联的指令状态instruction_status <2:{}",id,instdto.getInstruction_status()); + log.info("任务号{}关联的指令状态instruction_status <2:{}", id, instdto.getInstruction_status()); throw new BadRequestException("有指令未完成!"); - }else { + } else { entity.setTask_status(StatusEnum.INST_FINISH.getCode()); this.update(entity); } diff --git a/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAgvOneInst.java b/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAgvOneInst.java index 7e40c36a..4c579d48 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAgvOneInst.java +++ b/wcs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateAgvOneInst.java @@ -39,6 +39,7 @@ public class AutoCreateAgvOneInst { try { instructionService.create(instructionService.createInstDtoByTask(taskDto, link_no)); } catch (Exception e) { + log.error("自动创建指令失败:任务号{},失败原因:{}", taskDto.getTask_code(), e.getMessage()); taskDto.setRemark(e.getMessage()); taskService.updateByCodeFromCache(taskDto); continue; @@ -46,6 +47,7 @@ public class AutoCreateAgvOneInst { //创建指令后修改任务状态 taskDto.setTask_status(StatusEnum.TASK_RUNNING.getCode()); taskService.update(taskDto); + log.info("自动创建指令成功,任务号:{}", taskDto.getTask_code()); } } } diff --git a/wcs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java b/wcs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java index 5364f275..8fabaf0f 100644 --- a/wcs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java +++ b/wcs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.cache.annotation.CacheConfig; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; +import javax.transaction.Transactional; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -98,6 +99,7 @@ public class GenCodeServiceImpl implements GenCodeService { } @Override + @Transactional(Transactional.TxType.REQUIRES_NEW) public String codeDemo(Map form) { String code = (String) form.get("code"); String id = this.queryIdByCode(code);