From e6c4c174bde7339afb87986174e54a65916e4672 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Sun, 26 Sep 2021 15:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PodTemplateServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index 42496570..ba3ba163 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -500,24 +500,25 @@ public class PodTemplateServiceImpl implements PodTemplateService { //调用WS try { ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder); - if (outHolder.value.length == 1) { - throw new BaseException("ERP接口返回错误"); - } String status = outHolder.value[1].getRet(); String message = outHolder.value[1].getMsg(); if (!status.equals("S")) { - throw new BaseException("ERP接口返回错误消息:" + message); + throw new BaseException(message); } log.setStatus(status); log.setResultMessage(message); } catch (Exception e) { log.setStatus("E"); log.setResultMessage("ERP接口错误: " + e.getMessage()); - String faultString = ((AxisFault) e).getFaultString(); - if (StringUtil.isBlank(faultString)||!faultString.equals("(401)Unauthorized")){ + if (outHolder.value.length == 1){ + String faultString = ((AxisFault) e).getFaultString(); + if (StringUtil.isBlank(faultString)||!faultString.equals("(401)Unauthorized")){ + throw new BaseException("ERP接口错误: " + e.getMessage()); + } + log.setStatus("R"); + }else { throw new BaseException("ERP接口错误: " + e.getMessage()); } - log.setStatus("R"); } finally { //记录接口日志 log.setHandle(UUID.randomUUID().toString());