From 9f3102f0bce6ca498feaf5a321cd82a0bd525565 Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Wed, 23 Apr 2025 11:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B0=81=E8=A3=85=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-yun.yml | 6 +-- shkj-admin/src/main/resources/application.yml | 2 +- .../controller/busin/WcsTaskController.java | 52 ++++--------------- .../java/com/shkj/wcs/plc/PlcEventTask.java | 6 +-- .../java/com/shkj/wcs/third/rcs/RCSUtil.java | 6 +-- 5 files changed, 19 insertions(+), 53 deletions(-) diff --git a/shkj-admin/src/main/resources/application-yun.yml b/shkj-admin/src/main/resources/application-yun.yml index 422f7c2..ecdc3ae 100644 --- a/shkj-admin/src/main/resources/application-yun.yml +++ b/shkj-admin/src/main/resources/application-yun.yml @@ -12,7 +12,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://120.77.94.227:3306/sc-wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://120.77.94.227:3306/sc_wcs?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: CTlTwKgIrRVTsEHqxxx # 从库数据源 @@ -71,7 +71,7 @@ spring: # 数据库索引 database: 3 # 密码 - password: rvGUoUFAIg4nESp9 + password: # 连接超时时间 timeout: 10s lettuce: @@ -93,7 +93,7 @@ third: uploadWCSTaskStatusUrl: http://127.0.0.1:8081/api/toWzWcs/uploadWCSTaskStatus # agv接口 agvCreateTaskUrl: http://127.0.0.1:8081/rest/common/createTask - agvStatesUrl: http://127.0.0.1:8081/rest/robots/states + agvStatesUrl: http://127.0.0.1:8081/api/robot/controller/robot/query agvCancelTaskUrl: http://127.0.0.1:8081/rest/common/cancelTask queryAckByTaskUrl: http://127.0.0.1:8081/rest/common/queryAckByTaskId # ess接口 diff --git a/shkj-admin/src/main/resources/application.yml b/shkj-admin/src/main/resources/application.yml index fc83ead..39c840e 100644 --- a/shkj-admin/src/main/resources/application.yml +++ b/shkj-admin/src/main/resources/application.yml @@ -45,7 +45,7 @@ spring: # 国际化资源文件路径 basename: i18n/messages profiles: - active: pro146 + active: yun # 文件上传 servlet: multipart: diff --git a/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java index d66e2aa..29751f9 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/controller/busin/WcsTaskController.java @@ -91,52 +91,18 @@ public class WcsTaskController { } - @Log(title = "wz-wcs任务下发", businessType = BusinessType.UPDATE) - @PostMapping("/toWzWcs/wcsIncomingTrayCheck") + @Log(title = "查询库区状态", businessType = BusinessType.UPDATE) + @PostMapping("/toWzWcs/queryAreaStatus") @RepeatSubmit - public WcsResponseVo wcsIncomingTrayCheck(WcsCreateTaskDto bo) { - if (bo != null) { - List body = bo.getBody(); - if (!body.isEmpty()) { - for (WcsCreateTaskBody by : body) { - String taskId = by.getTaskId(); - String trayCode = by.getTrayCode(); - String taskType = by.getTaskType(); - String fromBinCode = by.getFromBinCode(); - String toBinCode = by.getToBinCode(); - String dataChange = by.getDataChange(); - String priority = by.getPriority(); - LambdaQueryWrapper lqwDataTask = new LambdaQueryWrapper() - .eq(BusinDataTask::getContainerId, trayCode) - .in(BusinDataTask::getTaskStatus, "1", "2"); - BusinDataTask one = iBusinDataTaskService.getOne(lqwDataTask); - if (dataChange.equals("1")) { - if (one != null) { - return WcsResponseVo.error(500, "该托盘" + trayCode + "存在未完成的任务"); - } - BusinDataTask businDataTask = new BusinDataTask(); - businDataTask.setTaskCode(taskId); - businDataTask.setTaskType(taskType); - businDataTask.setContainerId(Long.valueOf(trayCode)); - businDataTask.setFromSide(fromBinCode); - businDataTask.setToSide(toBinCode); - businDataTask.setCreateTime(DateUtils.getNowDate()); - businDataTask.setPriority(priority); - boolean save = iBusinDataTaskService.save(businDataTask); - if (save) { - //调用下游接口下任务 + public WcsResponseVo queryAreaStatus(WcsCreateTaskDto dto) { + if (dto != null) { + String businessType = dto.getHeader().getBusinessType(); + if(businessType.equals("queryAreaStatus")){ - } - } else if (dataChange.equals("2")) { - if (one == null) { - return WcsResponseVo.error(500, "未查询到该托盘" + trayCode + "存在未完成的任务"); - } - one.setTaskStatus("6"); - iBusinDataTaskService.updateById(one); - //推送给下游 + } + List body = dto.getBody(); + if (!body.isEmpty()) { - } - } } } diff --git a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java index 4a206f1..440c608 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/plc/PlcEventTask.java @@ -85,7 +85,7 @@ public class PlcEventTask { @Autowired IBusinDataTaskService iBusinDataTaskService; - @Scheduled(fixedDelay = 5000) + //@Scheduled(fixedDelay = 5000) public void init() { //查询需要连接的PLC,初始化连接对象 List plcList =(List) redisTemplate.opsForValue().get(RedisConstant.redisPlcListConnect); @@ -107,7 +107,7 @@ public class PlcEventTask { //输送线心跳 - @Scheduled(fixedDelay = 4000) + //@Scheduled(fixedDelay = 4000) public void writePlcheartbeatDps() { //根据连接的plcId获取属性 PlcOperate plcOperate = plcInit.getPlcOperate_dps(); @@ -136,7 +136,7 @@ public class PlcEventTask { } //堆垛机心跳 - @Scheduled(fixedDelay = 4000) + //@Scheduled(fixedDelay = 4000) public void writePlcheartbeatStk() { //根据连接的plcId获取属性 PlcOperate plcOperate = plcInit.getPlcOperate_stk(); diff --git a/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java b/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java index bc4f4c2..43c7c3d 100644 --- a/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wcs/third/rcs/RCSUtil.java @@ -206,11 +206,11 @@ public class RCSUtil { /** * 获取AGV实时状态信息 * - * @param mapId bo + * @param singleRobotCode bo * @return {@code Result} */ - public Result rcsRobotsStates(String mapId) { - String json = JSONObject.toJSONString(mapId); + public Result rcsRobotsStates(String singleRobotCode) { + String json = JSONObject.toJSONString(singleRobotCode); try { Map headerMap = getHeaderMap(); String res = HttpRequest.post(agvStatesUrl)