From 87de4fa8214f7fe555fca651dc2d8b01b643b42a Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Fri, 5 May 2023 17:53:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=81=94=E9=80=9A?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/sync/SyncController.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SyncController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SyncController.java index 4aba568..9576f46 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SyncController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SyncController.java @@ -1,10 +1,12 @@ package com.glxp.sale.admin.controller.sync; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.glxp.sale.admin.constant.BasicProcessStatus; import com.glxp.sale.admin.constant.ConstantStatus; +import com.glxp.sale.admin.entity.param.SystemParamConfigEntity; import com.glxp.sale.admin.entity.sync.BasicExportStatusEntity; import com.glxp.sale.admin.entity.sync.BasicUploadStatusEntity; import com.glxp.sale.admin.idc.utils.UriUtils; @@ -12,9 +14,11 @@ import com.glxp.sale.admin.service.param.SystemParamConfigService; import com.glxp.sale.admin.service.sync.BasicExportService; import com.glxp.sale.admin.service.sync.BasicUploadService; import com.glxp.sale.admin.util.*; +import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; @@ -61,8 +65,28 @@ public class SyncController { * @return */ @PostMapping("/udispsync/sync/testConnection") - public BaseResponse testConnection() { - return ResultVOUtils.success("连接成功"); + public BaseResponse testConnection(HttpServletRequest request) { + String uri = uriUtils.parseUri(request.getRequestURL().toString()); + String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip"); + if (StrUtil.isNotEmpty(upperServerHost)) { + uri = upperServerHost + "/" + uri; + } else { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getRemoteHost() + "服务缺少上级服务IP"); + } + uri = changeUri(uri); + JSONObject jsonObject = null; + try { + jsonObject = redirect(request, uri); + } catch (Exception e) { + e.printStackTrace(); + return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), request.getRemoteHost() + "服务访问上级服务" + upperServerHost + "异常"); + } + BaseResponse response = JSONUtil.toBean(jsonObject.toJSONString(), BaseResponse.class); + if ("20000".equals(response.getCode())) { + return ResultVOUtils.success("连接成功"); + } else { + return ResultVOUtils.error(ResultEnum.NOT_NETWORK.getCode(), response.getMessage()); + } } //单据接口直连--扫码单据 From 68b77abe1a4d69b0fb487a2386d528bfc76bcc7e Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Fri, 5 May 2023 18:02:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8B=89=E5=8F=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/sale/admin/thread/DlAllDataService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java index cc3ec68..8b3a4b1 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java @@ -260,6 +260,11 @@ public class DlAllDataService { */ @Transactional(rollbackFor = Exception.class) public void pullData(BasicExportTypeEnum exportType) { + switch (exportType){ + case IO_ORDER: + case COUNTRY_DI_DATA: + return; + } String data = spGetHttp.pullData(exportType); cn.hutool.json.JSONObject obj = JSONUtil.parseObj(data);