From daa92640797e79b6ddf37fce330e8ccee25e88c6 Mon Sep 17 00:00:00 2001
From: IZCD4L12RTSW0VZ\Administrator <skyouc>
Date: 星期四, 15 一月 2026 15:25:11 +0800
Subject: [PATCH] Merge branch 'jsxswms' of http://47.97.1.152:5880/r/zy-asrs into jsxswms
---
src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java | 109 ++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 93 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java b/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
index 548eaee..f10fdb8 100644
--- a/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
+++ b/src/main/java/com/zy/api/service/impl/KopenApiServiceImpl.java
@@ -1,5 +1,6 @@
package com.zy.api.service.impl;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
@@ -83,6 +84,7 @@
*/
@Override
public XSR receiveOrders(List<PubOrderParams> orderParams, String type) {
+ log.info("鎺ユ敹涓嬪彂璁㈠崟淇℃伅鍙傛暟:{}", JSONObject.toJSONString(orderParams));
orderParams.forEach(params -> {
if (params.getType().equals(OrderWkType.getTypeVal(params.getType()))) {
throw new CoolException("褰撳墠绫诲瀷涓嶆槸涓婃灦娲惧伐鍗曪紒锛�");
@@ -102,6 +104,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public XSR getInDispatchResult(List<ReportOrderParam> params, Order order) {
+ log.info("涓婃灦娲惧伐鍗曞弽棣堣姹傚弬鏁�:{}", JSONObject.toJSONString(params));
if (Objects.isNull(params)) {
return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -119,6 +122,7 @@
}
JSONObject jsonObject = JSONObject.parseObject(response);
Integer code = jsonObject.getInteger("code");
+ log.info("涓婃灦娲惧伐鍗曡繑鍥炵粨鏋�:{}", JSONObject.toJSONString(response));
if (!Objects.isNull(code) && code.equals(200)) {
if (!Objects.isNull(order)) {
order.setReportOnce(5);
@@ -128,7 +132,7 @@
} else {
if (!Objects.isNull(order)) {
int reportOnce = order.getReportOnce();
- reportOnce ++;
+ reportOnce++;
order.setReportOnce(reportOnce);
orderService.updateById(order);
}
@@ -138,7 +142,7 @@
} catch (Exception e) {
if (!Objects.isNull(order)) {
int reportOnce = order.getReportOnce();
- reportOnce ++;
+ reportOnce++;
order.setReportOnce(reportOnce);
orderService.updateById(order);
}
@@ -149,9 +153,10 @@
/**
* 鑾峰彇鑷畾涔夎姹傚ご
+ *
+ * @return java.util.Map<java.lang.String, java.lang.Object>
* @author Ryan
* @date 2025/12/29 9:11
- * @return java.util.Map<java.lang.String,java.lang.Object>
*/
private Map<String, Object> getHeaderParam() {
Map<String, Object> headerParam = new HashMap<>();
@@ -180,6 +185,8 @@
@Override
@Transactional(rollbackFor = Exception.class)
public XSR sendOutDispatch(List<PubOrderParams> pubOrderParams, String type) {
+ log.info("澶囪揣鎸囩ず娲惧伐鍗曚笅鍙戝弬鏁�:{}", JSONObject.toJSONString(pubOrderParams));
+
if (Objects.isNull(pubOrderParams) || pubOrderParams.isEmpty()) {
return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -254,6 +261,8 @@
@Override
@Transactional(rollbackFor = Exception.class)
public synchronized XSR basMatupdate(List<SyncMatParmas> params) {
+ log.info("鍩虹闆朵欢鍙樻洿:{}", JSONArray.toJSONString(params));
+
if (Objects.isNull(params) || params.isEmpty()) {
return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -264,7 +273,12 @@
if (Objects.isNull(mats.getPro_type())) {
throw new CoolException("闆朵欢绫诲瀷涓嶈兘涓虹┖锛侊紒");
}
- Mat matnr = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", mats.getPro_komcode()));
+ if (Objects.isNull(mats.getPro_id())) {
+ throw new CoolException("渚涘簲鍟嗕笉鑳戒负绌猴紒锛�");
+ }
+ Mat matnr = matService.selectOne(new EntityWrapper<Mat>()
+ .eq("supp_code", mats.getPro_id())
+ .eq("matnr", mats.getPro_komcode()));
if (!Objects.isNull(matnr)) {
// 璁㈠崟鏃堕棿
if (Utils.isValidFormat(mats.getUpdate_time(), "yyyy-MM-dd HH:mm:ss")) {
@@ -492,6 +506,8 @@
*/
@Override
public XSR getOutDetails(List<StockUpOrderParams> stockUpParams) {
+ log.info("澶囪揣鍗曚笅鍙戝弬鏁�:{}", JSONArray.toJSONString(stockUpParams));
+
if (Objects.isNull(stockUpParams)) {
return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -550,22 +566,24 @@
wrapper.eq("matnr", params.getPro_komcode());
}
- Page<LocDetl> locDetls = locDetlService.selectPage(new Page<>(params.getCurr(), params.getLimit()), wrapper);
+ Page<LocDetl> locDetls = locDetlService.selectPage(new Page<>(params.getCurr(), params.getLimit()), wrapper);
return XSR.ok(locDetls.getRecords());
}
/**
* 闆朵欢鎹熸孩鍗曚笅鍙�
- *
- * @author Ryan
- * @date 2025/11/24 15:22
+ *
* @param params
* @return com.core.common.R
+ * @author Ryan
+ * @date 2025/11/24 15:22
*/
@Override
@Transactional(rollbackFor = Exception.class)
public XSR sendStockAdjust(List<StockAdjustParams> params, Long userId) {
+ log.info("闆朵欢鎹熸孩鍗曚笅鍙戝弬鏁�:{}", JSONArray.toJSONString(params));
+
if (Objects.isNull(params)) {
return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
}
@@ -578,11 +596,12 @@
/**
* 鎹熸孩鍗曞畬缁撲笂鎶�
- * @author Ryan
- * @date 2025/12/30 16:57
+ *
* @param params
* @param order
* @return com.zy.api.entity.dto.XSR
+ * @author Ryan
+ * @date 2025/12/30 16:57
*/
@Override
public XSR reportCheckOrder(List<StockAdjustParams> params, CheckOrder order) {
@@ -612,7 +631,7 @@
} else {
if (!Objects.isNull(order)) {
int reportOnce = order.getReportOnce();
- reportOnce ++;
+ reportOnce++;
order.setReportOnce(reportOnce);
checkOrderService.updateById(order);
}
@@ -634,6 +653,7 @@
/**
* 澶囪揣鍗曞弽棣�
+ *
* @param params
* @param order
* @return
@@ -666,7 +686,7 @@
} else {
if (!Objects.isNull(order)) {
int reportOnce = order.getReportOnce();
- reportOnce ++;
+ reportOnce++;
order.setReportOnce(reportOnce);
orderService.updateById(order);
}
@@ -676,7 +696,7 @@
} catch (Exception e) {
if (!Objects.isNull(order)) {
int reportOnce = order.getReportOnce();
- reportOnce ++;
+ reportOnce++;
order.setReportOnce(reportOnce);
orderService.updateById(order);
}
@@ -685,9 +705,66 @@
}
}
- /** 鐢熸垚鏂扮殑闆朵欢鎹熸孩鍗�
- * @param userId */
- @Transactional(rollbackFor = Exception.class)
+ /**
+ * 澶囪揣鎸囩ず娲惧伐鍗曞弽棣�
+ * @author Ryan
+ * @date 2026/1/15 15:20
+ * @param orderParams
+ * @param order
+ * @return com.zy.api.entity.dto.XSR
+ */
+ @Override
+ public XSR reportOutDetailsResult(List<ReportOrderParam> orderParams, Order order) {
+ if (Objects.isNull(orderParams)) {
+ return XSR.error("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ String response = null;
+ try {
+ response = new HttpHandler.Builder()
+ .setUri(url + ":" + port)
+ .setPath(prefix + "/getOutDetailsResult")
+ .setJson(JSONObject.toJSONString(orderParams))
+ .build()
+ .doPost();
+ if (Objects.isNull(response) || response.trim().isEmpty()) {
+ return XSR.error("澶栫綉鎺ュ彛鏃犲搷搴旓紒锛�");
+ }
+ JSONObject jsonObject = JSONObject.parseObject(response);
+ Integer code = jsonObject.getInteger("code");
+ if (!Objects.isNull(code) && code.equals(200)) {
+ if (!Objects.isNull(order)) {
+ order.setReportOnce(5);
+ orderService.updateById(order);
+ }
+ return XSR.ok("鍏ュ簱鍗曚笂鎶ュ畬鎴愶紒锛�");
+ } else {
+ if (!Objects.isNull(order)) {
+ int reportOnce = order.getReportOnce();
+ reportOnce++;
+ order.setReportOnce(reportOnce);
+ orderService.updateById(order);
+ }
+ String msg = jsonObject.getString("message");
+ return XSR.error(Objects.isNull(msg) ? "涓婃姤澶辫触锛侊紒" : msg);
+ }
+ } catch (Exception e) {
+ if (!Objects.isNull(order)) {
+ int reportOnce = order.getReportOnce();
+ reportOnce++;
+ order.setReportOnce(reportOnce);
+ orderService.updateById(order);
+ }
+ log.error(e.getMessage(), e);
+ return XSR.error(e.getMessage());
+ }
+ }
+
+ /**
+ * 鐢熸垚鏂扮殑闆朵欢鎹熸孩鍗�
+ *
+ * @param userId
+ */
+ @Transactional(rollbackFor = Exception.class)
public void gentCheckOrders(StockAdjustParams params, Long userId) {
if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) {
throw new CoolException("璁㈠崟鏄庣粏涓嶈兘涓虹┖锛侊紒");
--
Gitblit v1.9.1