From 0e57dcc39617826f7101e088e8b57fe00e0f31cb Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 14 Apr 2023 18:39:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/constant/BasicProcessStatus.java | 1 + .../sale/admin/constant/ConstantStatus.java | 1 + .../sync/SpsSyncDataController.java | 45 ------------------- .../admin/controller/sync/SyncController.java | 28 +++++++++++- .../sale/admin/thread/DlAllDataService.java | 1 - 5 files changed, 29 insertions(+), 47 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java index 3e3a31b..1301795 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicProcessStatus.java @@ -34,6 +34,7 @@ public class BasicProcessStatus { public static final String NEW_ALL_BUS = "8"; public static final String NEW_ALL_ORDER = "9"; public static final String NEW_ALL_UDIS = "10"; + public static final String ALL_BUS_ORDER = "11"; public static final int IMPORT_LOG_TYPE_ORDER = 1;//单据 diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java index 33a5e87..649de46 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/ConstantStatus.java @@ -5,6 +5,7 @@ public class ConstantStatus { public static final String SYNC_BASIC_DATA = "AutoDownloadAllData"; public static final String SYNC_BUS_TYPE = "AutoDownloadBusType"; public static final String SYNC_SCAN_ORDER = "AutoDownloadOrder"; + public static final String SYNC_BUS_ORDER = "AutoUploadBusOrder"; public static final String SYNC_DI_PRODUCTS = "AutoDownloadDiProducts"; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SpsSyncDataController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SpsSyncDataController.java index acdbb5b..95ad779 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SpsSyncDataController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/sync/SpsSyncDataController.java @@ -182,51 +182,6 @@ public class SpsSyncDataController { } - @PostMapping("/sps/sync/busType/upload") - public BaseResponse postAllBus(@RequestBody SpsSyncBusResponse spsSyncBusResponse, - BindingResult bindingResult) { - - if (bindingResult.hasErrors()) { - return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); - } - SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("sync_upstream_enable"); - String key = gennerOrderUtils.getBusType(); - BasicUploadStatusEntity basicUploadStatusEntity = new BasicUploadStatusEntity(); - basicUploadStatusEntity.setId(key); - basicUploadStatusEntity.setTaskId(spsSyncBusResponse.getTaskId()); - basicUploadStatusEntity.setStartTime(DateUtil.getDateTime()); - basicUploadStatusEntity.setIdDatas(ConstantStatus.SYNC_BUS_TYPE); - basicUploadStatusEntity.setType(BasicProcessStatus.NEW_ALL_BUS); - basicUploadStatusEntity.setRemark(spsSyncBusResponse.toString()); - - if (systemParamConfigEntity.getParamValue().equals("0")) {//上游不通 - String path = getPath(); - String fileName = path + FileConstant.lowerWaitCopy_products + key + ".UpperIn"; - String datas = JSON.toJSONString(spsSyncBusResponse); - FileUtils.SaveFileAs(datas, fileName); - basicUploadStatusEntity.setUpdateTime(new Date()); - basicUploadStatusEntity.setEndTime(DateUtil.getDateTime()); - basicUploadStatusEntity.setTransportType(BasicProcessStatus.FILE_TYPE); - basicUploadStatusEntity.setCacheFilePath(fileName); - basicUploadStatusEntity.setStatus(Constant.SYNC_STATUS_SUCCESS); - basicUploadService.insertDownloadStatus(basicUploadStatusEntity); - - return ResultVOUtils.success("文件上传成功,已保存,等待拷贝!"); - } else { - //上游通 - BaseResponse response = spPostHttp.postAllBus(spsSyncBusResponse); - basicUploadStatusEntity.setUpdateTime(new Date()); - basicUploadStatusEntity.setEndTime(DateUtil.getDateTime()); - basicUploadStatusEntity.setTransportType(BasicProcessStatus.INTERFACE_TYPE); - if (response.getCode() == 20000) { - basicUploadStatusEntity.setStatus(Constant.SYNC_STATUS_SUCCESS); - } else { - basicUploadStatusEntity.setStatus(Constant.SYNC_STATUS_FAIL); - } - basicUploadService.insertDownloadStatus(basicUploadStatusEntity); - return response; - } - } @PostMapping("sps/sync/schedule/upload") 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 7fd0d51..2cc23e9 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 @@ -94,7 +94,33 @@ public class SyncController { if (StrUtil.isNotEmpty(upperServerHost)) { uri = upperServerHost + "/" + uri; } - JSONObject jsonObject = redirect(request, uri, ConstantStatus.SYNC_SCAN_ORDER, BasicProcessStatus.NEW_ALL_ORDER); + JSONObject jsonObject = redirect(request, uri, ConstantStatus.SYNC_BUS_ORDER, BasicProcessStatus.ALL_BUS_ORDER); + return jsonObject; + } + + + //单据类型接口直连 + @RequestMapping("/sps/sync/busType/upload") + public Object busTypeApi(HttpServletRequest request, HttpServletResponse httpServletResponse) { + String uri = uriUtils.parseUri(request.getRequestURL().toString()); + String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip"); + if (StrUtil.isNotEmpty(upperServerHost)) { + uri = upperServerHost + "/" + uri; + } + JSONObject jsonObject = redirect(request, uri, ConstantStatus.SYNC_BUS_TYPE, BasicProcessStatus.NEW_ALL_BUS); + return jsonObject; + } + + + //用户信息接口直连 + @RequestMapping("/sps/sync/allUser/upload") + public Object allUserApi(HttpServletRequest request, HttpServletResponse httpServletResponse) { + String uri = uriUtils.parseUri(request.getRequestURL().toString()); + String upperServerHost = systemParamConfigService.selectValueByParamKey("upper_server_ip"); + if (StrUtil.isNotEmpty(upperServerHost)) { + uri = upperServerHost + "/" + uri; + } + JSONObject jsonObject = redirect(request, uri, ConstantStatus.SYNC_BASIC_DATA, BasicProcessStatus.NEW_ALL_DATA); return jsonObject; } 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 3709e21..3b2b6a5 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 @@ -222,7 +222,6 @@ public class DlAllDataService { } } - log.info("下载所有单据---结束"); }