From d9dc294a5065b2427bc8eeaff46d9f14fe857efa Mon Sep 17 00:00:00 2001 From: x_z Date: Wed, 7 Dec 2022 16:57:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=8A=B6=E6=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java b/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java index ac6e8b1..2a67f97 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java @@ -108,7 +108,7 @@ public class PostSmpHttp { paramMap.put("orderId", postThirdSysUploadInfo.getOrderId()); paramMap.put("wzUploadStatus", postThirdSysUploadInfo.getWzUploadStatus()); paramMap.put("wzUploadResult", postThirdSysUploadInfo.getWzUploadResult()); - String response = UHttpClient.postJson(getSpmsUrl() + "/udiwms/", paramMap, getHeaders()); + String response = UHttpClient.postJson(getSpmsUrl() + "/sps/sync/order/syncOrderUploadInfo", paramMap, getHeaders()); try { BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class); return baseResponse; From 9319ef431cd006e38214c521004ec2b7fd8b2b0b Mon Sep 17 00:00:00 2001 From: x_z Date: Sun, 18 Dec 2022 19:48:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0UDI=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AF=B7=E6=B1=82=E7=AB=8B=E5=8D=B3=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sync/UdiwmsPostDirectController.java | 16 ++++++++++++ .../com/glxp/sale/admin/http/PostSmpHttp.java | 25 +++++++++++++++++-- .../sale/admin/req/sync/PostDownloadInfo.java | 16 ++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 api-admin/src/main/java/com/glxp/sale/admin/req/sync/PostDownloadInfo.java diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/UdiwmsPostDirectController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/UdiwmsPostDirectController.java index 47e8f0e..8e8b8e4 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/UdiwmsPostDirectController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/UdiwmsPostDirectController.java @@ -195,5 +195,21 @@ public class UdiwmsPostDirectController { return baseResponse; } + /** + * UDI管理系统发送下载请求到自助平台 + * + * @param postDownloadInfo + * @param bindingResult + * @return + */ + @PostMapping("/udisp/sync/downloadNow") + public BaseResponse postDownloadInfo(@RequestBody PostDownloadInfo postDownloadInfo, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); + } + BaseResponse response = postSmpHttp.postDownloadInfo(postDownloadInfo); + return response; + } + } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java b/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java index 2a67f97..87b84c2 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/http/PostSmpHttp.java @@ -10,6 +10,7 @@ import com.glxp.sale.admin.res.sync.UdiRelevanceResponse; import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Service; @@ -18,6 +19,7 @@ import javax.annotation.Resource; import java.util.HashMap; import java.util.Map; +@Slf4j @Service public class PostSmpHttp { @@ -92,7 +94,7 @@ public class PostSmpHttp { return udiDlDeviceResponse; } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); return ResultVOUtils.error(500, "下载失败!"); } } @@ -113,7 +115,26 @@ public class PostSmpHttp { BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class); return baseResponse; } catch (Exception e) { - e.printStackTrace(); + log.error(e.getMessage(), e); + return ResultVOUtils.error(500, "同步失败!"); + } + } + + /** + * UDI管理系统发送下载请求到自助平台 + * + * @param postDownloadInfo + * @return + */ + public BaseResponse postDownloadInfo(PostDownloadInfo postDownloadInfo) { + Map paramMap = new HashMap<>(1); + paramMap.put("type", postDownloadInfo.getType()); + String response = UHttpClient.postJson(getSpmsUrl() + "/sps/sync/data/downloadNow", paramMap, getHeaders()); + try { + BaseResponse baseResponse = JSONUtil.toBean(response, BaseResponse.class); + return baseResponse; + } catch (Exception e) { + log.error(e.getMessage(), e); return ResultVOUtils.error(500, "同步失败!"); } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/req/sync/PostDownloadInfo.java b/api-admin/src/main/java/com/glxp/sale/admin/req/sync/PostDownloadInfo.java new file mode 100644 index 0000000..5066840 --- /dev/null +++ b/api-admin/src/main/java/com/glxp/sale/admin/req/sync/PostDownloadInfo.java @@ -0,0 +1,16 @@ +package com.glxp.sale.admin.req.sync; + +import lombok.Data; + +/** + * 下载任务信息 + */ +@Data +public class PostDownloadInfo { + + /** + * 下载类型 + */ + private Integer type; + +}