From 99faf1988ce7ad30e11c406bfb62704103041290 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Fri, 22 Jul 2022 17:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mipsdl/admin/client/http/PhxyyClient.java | 5 ++ .../mipsdl/admin/client/http/ZaxyyClient.java | 70 +++++++++---------- .../admin/controller/UdiWmsController.java | 2 - 3 files changed, 40 insertions(+), 37 deletions(-) diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java index 97b6207..ce51eb3 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/PhxyyClient.java @@ -131,6 +131,11 @@ public class PhxyyClient { } BasicThirdSysDetailEntity basicThirdSysDetailEntity = basicThirdSysDetailDao.selectByKey("orderSubmitUrl", thirdSysConfig.getThirdSysConfig().getThirdId()); String response = httpClient.postJson(thirdSysConfig.getThirdSysConfig().getThirdSysUrl() + basicThirdSysDetailEntity.getValue(), udiwmsOrderRequest, getHeaderArray()); + + + + + BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference() { }); diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/ZaxyyClient.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/ZaxyyClient.java index a228334..beb1a2b 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/ZaxyyClient.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/client/http/ZaxyyClient.java @@ -232,7 +232,7 @@ public class ZaxyyClient { } public BaseResponse submitOrders(ZaxzyyOrderRequest udiwmsOrderRequest) { - if (StrUtil.isBlank(udiwmsOrderRequest.getId())) { + if (StrUtil.isEmpty(udiwmsOrderRequest.getId())) { return ResultVOUtils.error(500, "单据ID不能为空!"); } //查询单据和详情信息,组装第三方系统接口参数所需数据 @@ -252,9 +252,7 @@ public class ZaxyyClient { if (StrUtil.isBlank(thirdSysBusApiEntity.getUrl())) { return ResultVOUtils.error(500, "接口未配置,无法提交!"); } - String thirdId = getThirdId(thirdSysBusApiEntity); - udiwmsOrderRequest.setThirdSys(thirdId); //第三方系统标识 udiwmsOrderRequest.setBillType(thirdSysBusApiEntity.getThirdBuyCode()); @@ -368,6 +366,8 @@ public class ZaxyyClient { zaZyHeareRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsOrderRequest)); } else if (thirdSysBusApiEntity.getUrl().equals("saveMaterialHight")) { //临床出库 + udiwmsOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode()); + udiwmsOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName()); zaZyHeareRequest.setMsgHeader(getMsgHeader("saveMaterialHight")); key = "preInOrderSubmit"; @@ -395,38 +395,38 @@ public class ZaxyyClient { uploadLog.setFromType(ConstantStatus.THIRD_ORDER_UPLOAD); String response = httpClient.postJson(thirdSysConfig.getThirdSysConfig().getThirdSysUrl() + interStr, zaZyHeareRequest, getHeaderArray()); response = parseErrorMsg(response); - if (StrUtil.isNotBlank(response)){ - try { - BaseResponse baseResponse = - JSONObject.parseObject(response, new TypeReference() { - }); - if (baseResponse.getCode().equals(20000)) { - String thirdBillNo = String.valueOf(baseResponse.getData()); - orderEntity.setExportStatus(1); - orderEntity.setThirdBillNo(thirdBillNo); - uploadLog.setStatus(2); - uploadLog.setThrBillNo(null); - uploadLog.setResult("提交成功"); - stockOrderUploadLogDao.insert(uploadLog); - return ResultVOUtils.success("提交成功"); - } - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage()); - stockOrderUploadLogDao.insert(uploadLog); - return baseResponse; - } catch (Exception e) { - log.error(e.getMessage(), e); - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,错误信息:" + e.getMessage()); - stockOrderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } - }else { - uploadLog.setStatus(3); - uploadLog.setResult("提交失败,调用接口返回为空"); - stockOrderUploadLogDao.insert(uploadLog); - return ResultVOUtils.error(500, "提交失败"); - } + if (StrUtil.isNotBlank(response)) { + try { + BaseResponse baseResponse = + JSONObject.parseObject(response, new TypeReference() { + }); + if (baseResponse.getCode().equals(20000)) { + String thirdBillNo = String.valueOf(baseResponse.getData()); + orderEntity.setExportStatus(1); + orderEntity.setThirdBillNo(thirdBillNo); + uploadLog.setStatus(2); + uploadLog.setThrBillNo(null); + uploadLog.setResult("提交成功"); + stockOrderUploadLogDao.insert(uploadLog); + return ResultVOUtils.success("提交成功"); + } + uploadLog.setStatus(3); + uploadLog.setResult("提交失败,错误信息:" + baseResponse.getMessage()); + stockOrderUploadLogDao.insert(uploadLog); + return baseResponse; + } catch (Exception e) { + log.error(e.getMessage(), e); + uploadLog.setStatus(3); + uploadLog.setResult("提交失败,错误信息:" + e.getMessage()); + stockOrderUploadLogDao.insert(uploadLog); + return ResultVOUtils.error(500, "提交失败"); + } + } else { + uploadLog.setStatus(3); + uploadLog.setResult("提交失败,调用接口返回为空"); + stockOrderUploadLogDao.insert(uploadLog); + return ResultVOUtils.error(500, "提交失败"); + } } diff --git a/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java b/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java index 44afab0..be4eba6 100644 --- a/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java +++ b/api-sync/src/main/java/com/glxp/mipsdl/admin/controller/UdiWmsController.java @@ -156,8 +156,6 @@ public class UdiWmsController { } else if (curFlag.equals("ZAXZYY")) { ZaxzyyOrderRequest zaxzyyOrderRequest = new ZaxzyyOrderRequest(); BeanUtil.copyProperties(udiwmsOrderRequest, zaxzyyOrderRequest); - zaxzyyOrderRequest.setLocInvCode(udiwmsOrderRequest.getLocStorageCode()); - zaxzyyOrderRequest.setLocInvName(udiwmsOrderRequest.getLocStorageName()); return zaxyyClient.submitOrders(zaxzyyOrderRequest); } return ResultVOUtils.error(500, "当前第三方系统不支持提交单据!");