From fc51b3c1c8a6763c151d2c3682cd02a078d81c27 Mon Sep 17 00:00:00 2001
From: pjb <123456>
Date: 星期五, 20 六月 2025 09:07:47 +0800
Subject: [PATCH] Merge branch 'ycds-wms-dev' of http://47.97.1.152:5880/r/zy-asrs-master into ycds-wms-dev
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/schedule/ScheduleJobs.java | 3 -
zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java | 97 ++++++++++++++++++++++++------------------------
2 files changed, 48 insertions(+), 52 deletions(-)
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/schedule/ScheduleJobs.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/schedule/ScheduleJobs.java
index 36a5692..3b63449 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/schedule/ScheduleJobs.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/schedule/ScheduleJobs.java
@@ -109,9 +109,6 @@
}
} catch (Exception ex) {
log.error(ex.getMessage());
- } finally {
- //濡傛灉寮傚父淇敼绂佺敤鐘舵��
- // taskService.update(new LambdaUpdateWrapper<Task>().set(Task::getStatus, 0).eq(Task::getId, task.getId()));
}
});
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
index dce43a8..91532e1 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WcsApiServiceImpl.java
@@ -1,9 +1,13 @@
package com.zy.asrs.wms.apis.wcs.services.Impl;
+import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.cfg.CoercionAction;
+import com.fasterxml.jackson.databind.cfg.CoercionInputShape;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.apis.wcs.entity.domain.SystemProperties;
@@ -19,6 +23,8 @@
import com.zy.asrs.wms.asrs.service.*;
import io.jsonwebtoken.lang.Collections;
import lombok.extern.slf4j.Slf4j;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -278,56 +284,49 @@
return R.error("瀹瑰櫒鐮佷换鍔¢敊璇紒锛�");
}
tasks.forEach(task -> {
- // try {
-// ConveyorStarParam conveyorStarParam = new ConveyorStarParam();
-// conveyorStarParam.setSlotCode(task.getOriginLoc())
-// .setContainerCode(task.getBarcode());
-// if (task.getTaskType() == 101) { //浠诲姟绫诲瀷涓�101鍏ㄧ洏鍑哄簱锛岀洿鎺ュ彇涓嬪鍣紝浼�200
-// conveyorStarParam.setDirection("200");
-// } else if (task.getTaskType() == 103) { //濡傛灉涓轰换鍔$被鍨嬩负103锛岄渶璧板洖搴撴搷浣滐紝浼�100
-// conveyorStarParam.setDirection("100");
-// }
-// //璋冪敤涓夋柟鎺ュ彛锛屽皢浠诲姟鎺ㄩ�佽嚦ESS骞冲彴
-// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
-// // 璁剧疆璇锋眰鍙傛暟
-// params.add("params", JSONObject.toJSONString(conveyorStarParam));
-// log.info("璇锋眰鍦板潃锛歿}锛岃姹傚弬鏁帮細{}", Constant.CONVEYOR_START, JSONObject.toJSONString(conveyorStarParam));
-// HttpHeaders headers = new HttpHeaders();
-// headers.add("Content-Type", "application/json");
-// HttpEntity httpEntity = new HttpEntity<>(params, headers);
-// // 璇锋眰
-// ResponseEntity<String> exchange = restTemplate.exchange(Constant.CONVEYOR_START, HttpMethod.POST, httpEntity, String.class);
-// log.info("涓嬪彂娴佸姩閫氱煡 杩斿洖缁撴灉锛歿}", exchange);
-// if (exchange.getBody() == null) {
-// throw new CoolException("涓嬪彂娴佸姩閫氱煡澶辫触锛侊紒");
-// } else {
-// CommonReponse commonReponse = JSON.toJavaObject(JSON.parseObject(exchange.getBody()), CommonReponse.class);
-// if (commonReponse.getCode() == 0) {
- //娴佸姩閫氱煡涓嬪彂瀹屾垚鍚庯紝淇敼浠诲姟鐘舵�佷负杈撻�佺嚎娴佸姩涓�傘��
- //TODO 鍒ゆ柇浠诲姟鏄惁涓�103鎷f枡鍑哄簱锛�103鎷f枡娴佸姩鍚庝慨鏀逛负4锛圧CS瀹瑰櫒娴佸姩浠诲姟宸蹭笅鍙戯級
- if (task.getTaskType() == 103) {
- //TODO 闇�鎵炬捣鏌旂‘璁ゆ槸鍚﹂渶瑕侀噸鏂拌皟鐢ㄥ叆搴撴帴鍙�
- //鏇存柊搴撳瓨淇℃伅,淇敼浠诲姟鐘舵�佷负4 锛圧CS瀹瑰櫒娴佸姩浠诲姟宸蹭笅鍙戯級
- workService.pickTask(task.getId());
-// taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getId, task.getId()).set(Task::getTaskSts, TaskStsType.WCS_CONVEYOR_START))
- } else {
- taskService.update(new LambdaUpdateWrapper<Task>()
- .eq(Task::getId, task.getId())
- .set(Task::getTaskSts, TaskStsType.COMPLETE_OUT.id));
+ try {
+ ConveyorStarParam conveyorStarParam = new ConveyorStarParam();
+ conveyorStarParam.setSlotCode(task.getOriginLoc())
+ .setContainerCode(task.getBarcode());
+ if (task.getTaskType() == 101) { //浠诲姟绫诲瀷涓�101鍏ㄧ洏鍑哄簱锛岀洿鎺ュ彇涓嬪鍣紝浼�200
+ conveyorStarParam.setDirection("200");
+ } else if (task.getTaskType() == 103 || task.getTaskType() == 107) { //濡傛灉涓轰换鍔$被鍨嬩负103锛岄渶璧板洖搴撴搷浣滐紝浼�100
+ conveyorStarParam.setDirection("100");
+ }
+ //璋冪敤涓夋柟鎺ュ彛锛屽皢浠诲姟鎺ㄩ�佽嚦ESS骞冲彴
+ MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
+ // 璁剧疆璇锋眰鍙傛暟
+ params.add("params", JSONObject.toJSONString(conveyorStarParam));
+ log.info("璇锋眰鍦板潃锛歿}锛岃姹傚弬鏁帮細{}", HttpEssUtils.CONVEYOR_START, JSONObject.toJSONString(conveyorStarParam));
+ HttpHeaders headers = new HttpHeaders();
+ headers.add("Content-Type", "application/json");
+ HttpEntity httpEntity = new HttpEntity<>(params, headers);
+ // 璇锋眰
+ ResponseEntity<String> exchange = restTemplate.exchange(HttpEssUtils.CONVEYOR_START, HttpMethod.POST, httpEntity, String.class);
+ log.info("涓嬪彂娴佸姩閫氱煡 杩斿洖缁撴灉锛歿}", exchange);
+ if (exchange.getBody() == null) {
+ throw new CoolException("涓嬪彂娴佸姩閫氱煡澶辫触锛侊紒");
+ } else {
+ CommonReponse commonReponse = JSON.toJavaObject(JSON.parseObject(exchange.getBody()), CommonReponse.class);
+ if (commonReponse.getCode() == 0) {
+ //娴佸姩閫氱煡涓嬪彂瀹屾垚鍚庯紝淇敼浠诲姟鐘舵�佷负杈撻�佺嚎娴佸姩涓�傘��
+ if (task.getTaskType() == 103 || task.getTaskType() == 107) {
+ //鏇存柊搴撳瓨淇℃伅,淇敼浠诲姟鐘舵�佷负4 锛圧CS瀹瑰櫒娴佸姩浠诲姟宸蹭笅鍙戯級
+ workService.pickTask(task.getId());
+ // taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getId, task.getId()).set(Task::getTaskSts, TaskStsType.WCS_CONVEYOR_START))
+ } else {
+ taskService.update(new LambdaUpdateWrapper<Task>()
+ .eq(Task::getId, task.getId())
+ .set(Task::getTaskSts, TaskStsType.COMPLETE_OUT.id));
+ }
+ log.info(task.getTaskNo() + "涓嬪彂娴佸姩閫氱煡" + commonReponse.getMsg());
+ } else {
+ throw new CoolException("涓嬪彂娴佸姩閫氱煡澶辫触锛侊紒");
+ }
+ }
+ } catch (Exception ex) {
+ log.error(ex.getMessage());
}
-// log.info(task.getTaskNo() + "涓嬪彂娴佸姩閫氱煡" + commonReponse.getMsg());
-// } else {
-// throw new CoolException("涓嬪彂娴佸姩閫氱煡澶辫触锛侊紒");
-// }
-// }
-// } catch (Exception ex) {
-// log.error(ex.getMessage());
-// } finally {
-// //濡傛灉寮傚父淇敼绂佺敤鐘舵��
-// taskService.update(new LambdaUpdateWrapper<Task>().set(Task::getStatus, 0)
-// .set(Task::getUpdateTime, new Date())
-// .eq(Task::getId, task.getId()));
-// }
});
return R.ok();
}
--
Gitblit v1.9.1