|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.foreverwin.mesnac.production.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
@ -43,6 +44,7 @@ import com.sap.me.production.AssembleComponentsRequest;
|
|
|
|
|
import com.sap.me.production.AssemblyComponent;
|
|
|
|
|
import com.sap.me.production.AssemblyDataField;
|
|
|
|
|
import com.sap.me.production.AssemblyServiceInterface;
|
|
|
|
|
import org.apache.axis.AxisFault;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.i18n.LocaleContextHolder;
|
|
|
|
@ -51,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.rmi.RemoteException;
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.*;
|
|
|
|
@ -486,6 +487,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
struOut.setMsg("");
|
|
|
|
|
outs[0] = struOut;
|
|
|
|
|
TableOfZprodordconfStruOutHolder outHolder = new TableOfZprodordconfStruOutHolder(outs);
|
|
|
|
|
IntegrationLog log = new IntegrationLog();
|
|
|
|
|
|
|
|
|
|
//调用WS
|
|
|
|
|
try {
|
|
|
|
@ -498,20 +500,25 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
|
if (!status.equals("S")) {
|
|
|
|
|
throw new BaseException("ERP接口返回错误消息:" + message);
|
|
|
|
|
}
|
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
|
throw new BaseException("ERP接口错误: " + e.getMessage());
|
|
|
|
|
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")){
|
|
|
|
|
throw new BaseException("ERP接口错误: " + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
log.setStatus("R");
|
|
|
|
|
} finally {
|
|
|
|
|
//记录接口日志
|
|
|
|
|
IntegrationLog log = new IntegrationLog();
|
|
|
|
|
log.setHandle(UUID.randomUUID().toString());
|
|
|
|
|
log.setSite(CommonMethods.getSite());
|
|
|
|
|
log.setIntegrationType(IntegrationTypeConstant.REPORT_ORDER);
|
|
|
|
|
log.setCategory("REQUEST");
|
|
|
|
|
log.setIntegrationWay("ERP");
|
|
|
|
|
log.setIntegrationMethod("erpWebService.zmesProdordconf");
|
|
|
|
|
log.setParam(Arrays.toString(ins));
|
|
|
|
|
log.setStatus("");
|
|
|
|
|
log.setResultMessage(Arrays.toString(outHolder.value));
|
|
|
|
|
log.setParam(JSONObject.toJSONString(struIn));
|
|
|
|
|
log.setTransactionId("");
|
|
|
|
|
log.setRequestDateTime(LocalDateTime.now());
|
|
|
|
|
log.setCreatedDateTime(LocalDateTime.now());
|
|
|
|
|