From a418388d302d3b3a944adc67f60986ea86fc727f Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期五, 14 十一月 2025 10:52:44 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/controller/LocDetlController.java | 74 +++++++++++++++++++-----------------
1 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/LocDetlController.java b/src/main/java/com/zy/asrs/controller/LocDetlController.java
index 87c2902..ca83d92 100644
--- a/src/main/java/com/zy/asrs/controller/LocDetlController.java
+++ b/src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -391,46 +391,50 @@
@RequestMapping(value = "/synchronize/mes/locDetl/report/auth")
@ManagerAuth(memo = "鍚屾搴撳瓨鑷矼ES")
public R synchronizeLocDetlMes() {
- List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>());
- if (locDetlList.isEmpty()) {
- return R.error("搴撳瓨涓虹┖锛侊紒锛�");
- }
+ try{
+ List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>());
+ if (locDetlList.isEmpty()) {
+ return R.error("搴撳瓨涓虹┖锛侊紒锛�");
+ }
- OrderMesXGHYParam orderMesXGHYParam = new OrderMesXGHYParam(locDetlList,"in","鎴愬搧鍏ュ簱");
- orderMesXGHYParam.setBarcode(String.valueOf(snowflakeIdWorker.nextId()));
- orderMesXGHYParam.setPalletizingNo(1);
+ OrderMesXGHYParam orderMesXGHYParam = new OrderMesXGHYParam(locDetlList,"in","鎴愬搧鍏ュ簱");
+ orderMesXGHYParam.setBarcode(String.valueOf(snowflakeIdWorker.nextId()));
+ orderMesXGHYParam.setPalletizingNo(1);
- String response = "";
- boolean success = false;
- try {
- response = new HttpHandler.Builder()
- .setUri(productInventoryUrl)
- .setPath(productInventory)
- .setJson(JSON.toJSONString(orderMesXGHYParam))
- .build()
- .doPost();
- JSONObject jsonObject = JSON.parseObject(response);
- if (jsonObject.getBoolean("state")) {
- success = true;
- } else {
- return R.error("鍚屾搴撳瓨鑷矼ES");
+ String response = "";
+ boolean success = false;
+ try {
+ response = new HttpHandler.Builder()
+ .setUri(productInventoryUrl)
+ .setPath(productInventory)
+ .setJson(JSON.toJSONString(orderMesXGHYParam))
+ .build()
+ .doPost();
+ JSONObject jsonObject = JSON.parseObject(response);
+ if (jsonObject.getBoolean("state")) {
+ success = true;
+ } else {
+ return R.error("鍚屾搴撳瓨鑷矼ES");
+ }
+ } catch (Exception e) {
+ return R.error("鍚屾搴撳瓨鑷矼ES"+e.getMessage());
+ } finally {
+ try {
+ // 淇濆瓨鎺ュ彛鏃ュ織
+ apiLogService.save(
+ "鍚屾搴撳瓨鑷矼ES",
+ productInventoryUrl+"/"+productInventory,
+ null,
+ "127.0.0.1",
+ JSON.toJSONString(orderMesXGHYParam),
+ response,
+ success
+ );
+ } catch (Exception e) { }
}
} catch (Exception e) {
- return R.error("鍚屾搴撳瓨鑷矼ES"+e.getMessage());
- } finally {
- try {
- // 淇濆瓨鎺ュ彛鏃ュ織
- apiLogService.save(
- "鍚屾搴撳瓨鑷矼ES",
- productInventoryUrl+"/"+productInventory,
- null,
- "127.0.0.1",
- JSON.toJSONString(orderMesXGHYParam),
- response,
- success
- );
- } catch (Exception e) { }
+ return R.error("涓婃姤澶辫触"+e.getMessage()).add("涓婃姤澶辫触"+e.getMessage());
}
return R.error("涓婃姤澶辫触").add("涓婃姤澶辫触");
}
--
Gitblit v1.9.1