From bd58043d19100f2d3c794ea32a2103b38b597478 Mon Sep 17 00:00:00 2001
From: ynhfasrs <ynhfasrs@qq.com>
Date: 星期一, 26 五月 2025 14:58:52 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 49 ++++++++++++++++++-------------------------------
1 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index f46ce75..06b5c39 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -152,7 +152,7 @@
&& staProtocol.isInEnable()
&& !staProtocol.isEmptyMk()
&& staProtocol.isPakMk()
- && staProtocol.getWorkNo() == 9999
+ && (staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9998)
) {
// 鑾峰彇鏉$爜鎵弿浠俊鎭�
BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
@@ -695,37 +695,24 @@
if (taskWrkMapper.updateById(taskWrk) == 0) {
log.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", taskWrk.getWrkNo());
}
- String response = "";
- Boolean bool=false;
- HashMap<String, Object> headParam = new HashMap<>();
- headParam.put("TaskNo", taskWrk.getTaskNo());
- try {
- response = new HttpHandler.Builder()
- // .setHeaders(headParam)
- .setUri(wmsUrl)
- .setPath(taskExecCallback)
- .setJson(JSON.toJSONString(headParam))
- .build()
- .doPost();
- JSONObject jsonObject = JSON.parseObject(response);
- if(jsonObject.get("ReturnStatus").equals(0)){
- bool = true;
- taskWrk.setStatus(2);
- taskWrkMapper.updateById(taskWrk);
- }
- } catch (Exception e) {
- log.error("wcs娲惧彂绉诲簱搴撲换鍔′笂鎶ms澶辫触", taskWrk);
-// throw new CoolException("wcs娲惧彂绉诲簱搴撲换鍔′笂鎶ms澶辫触");
- }finally {
- apiLogService.save("wcs娲惧彂绉诲簱浠诲姟涓婃姤wms"
- , wmsUrl + taskExecCallback
- , null
- , "127.0.0.1"
- , JSON.toJSONString(headParam)
- , response
- , bool
- );
+ //涓婃姤-绉诲簱浠诲姟寮�濮嬫椂锛學CS鍥炶皟WMS
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:ss:mm");
+ HashMap<String, Object> hashMap = new HashMap<>();
+ hashMap.put("taskNo", taskWrk.getTaskNo());
+ hashMap.put("status", TaskStatusType.DISTRIBUTE.id);
+ hashMap.put("ioType", 3);
+ hashMap.put("barcode", taskWrk.getBarcode());
+ hashMap.put("reportTime", format.format(new Date()));
+
+ NotifyCustomDataDto customDataDto = new NotifyCustomDataDto();
+ customDataDto.setUri(wmsUrl);
+ customDataDto.setPath(taskExecCallback);
+ customDataDto.setData(JSON.toJSONString(hashMap));
+ boolean notifyResult = notifyUtils.notify("task", 1, String.valueOf(taskWrk.getWrkNo()), taskWrk.getTaskNo(), NotifyMsgType.TASK_START, JSON.toJSONString(taskWrk), true, customDataDto);
+ if(notifyResult) {
+ taskWrk.setStatus(2);
+ taskWrkService.updateById(taskWrk);
}
}
--
Gitblit v1.9.1