|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.foreverwin.mesnac.common.constant.Constants;
|
|
|
|
import com.foreverwin.mesnac.common.constant.Constants;
|
|
|
|
|
|
|
|
import com.foreverwin.mesnac.common.constant.IntegrationTypeConstant;
|
|
|
|
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
|
|
|
|
import com.foreverwin.mesnac.common.enums.DispatchStatusEnum;
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
import com.foreverwin.mesnac.common.erp.ZprodordconfStruIn;
|
|
|
|
import com.foreverwin.mesnac.common.erp.ZprodordconfStruIn;
|
|
|
@ -19,6 +20,8 @@ import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
|
|
|
|
import com.foreverwin.mesnac.common.util.ERPAPI;
|
|
|
|
import com.foreverwin.mesnac.common.util.ERPAPI;
|
|
|
|
import com.foreverwin.mesnac.common.util.ExceptionUtil;
|
|
|
|
import com.foreverwin.mesnac.common.util.ExceptionUtil;
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
|
|
|
import com.foreverwin.mesnac.integration.model.IntegrationLog;
|
|
|
|
|
|
|
|
import com.foreverwin.mesnac.integration.service.IntegrationLogService;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.BomComponentDto;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.SfcDto;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
|
|
|
|
import com.foreverwin.mesnac.meapi.dto.WorkCenterDto;
|
|
|
@ -44,10 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.rmi.RemoteException;
|
|
|
|
import java.rmi.RemoteException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
@ -58,7 +59,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SfcService sfcService;
|
|
|
|
private SfcService sfcService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private BomService bomService;
|
|
|
|
private IntegrationLogService integrationLogService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private RouterService routerService;
|
|
|
|
private RouterService routerService;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
@ -399,7 +400,7 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sendErp(String sfc, String stepId, BigDecimal qty) throws RemoteException {
|
|
|
|
void sendErp(String sfc, String stepId, BigDecimal qty) {
|
|
|
|
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(),sfc));
|
|
|
|
Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(CommonMethods.getSite(),sfc));
|
|
|
|
String shopOrderBo = sfcServiceById.getShopOrderBo();
|
|
|
|
String shopOrderBo = sfcServiceById.getShopOrderBo();
|
|
|
|
String shopOrder = StringUtil.trimHandle(shopOrderBo);
|
|
|
|
String shopOrder = StringUtil.trimHandle(shopOrderBo);
|
|
|
@ -441,14 +442,31 @@ public class PodTemplateServiceImpl implements PodTemplateService {
|
|
|
|
TableOfZprodordconfStruOutHolder outHolder = new TableOfZprodordconfStruOutHolder(outs);
|
|
|
|
TableOfZprodordconfStruOutHolder outHolder = new TableOfZprodordconfStruOutHolder(outs);
|
|
|
|
|
|
|
|
|
|
|
|
//调用WS
|
|
|
|
//调用WS
|
|
|
|
|
|
|
|
try {
|
|
|
|
ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder);
|
|
|
|
ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder);
|
|
|
|
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
String status = outHolder.value[1].getRet();
|
|
|
|
String status = outHolder.value[1].getRet();
|
|
|
|
String message = outHolder.value[1].getMsg();
|
|
|
|
String message = outHolder.value[1].getMsg();
|
|
|
|
System.out.println("ERP接口返回:状态:" + status + ",消息:" + message);
|
|
|
|
|
|
|
|
if (status.equals("E")) {
|
|
|
|
if (status.equals("E")) {
|
|
|
|
throw new BaseException("ERP接口返回:状态:" + status + ",消息:" + message);
|
|
|
|
throw new BaseException("ERP接口返回:状态:" + status + ",消息:" + message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
//记录接口日志
|
|
|
|
|
|
|
|
IntegrationLog log = new IntegrationLog();
|
|
|
|
|
|
|
|
log.setHandle(UUID.randomUUID().toString());
|
|
|
|
|
|
|
|
log.setSite(CommonMethods.getSite());
|
|
|
|
|
|
|
|
log.setIntegrationType(IntegrationTypeConstant.ROUTER);
|
|
|
|
|
|
|
|
log.setCategory("SEND");
|
|
|
|
|
|
|
|
log.setIntegrationWay("ERP");
|
|
|
|
|
|
|
|
log.setIntegrationMethod("erpWebService.zmesProdordconf");
|
|
|
|
|
|
|
|
log.setParam(struIn.toString());
|
|
|
|
|
|
|
|
log.setStatus(outHolder.value[1].getRet());
|
|
|
|
|
|
|
|
log.setResultMessage(outHolder.value[1].getMsg());
|
|
|
|
|
|
|
|
log.setTransactionId("");
|
|
|
|
|
|
|
|
log.setRequestDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
log.setCreatedDateTime(LocalDateTime.now());
|
|
|
|
|
|
|
|
integrationLogService.saveIntegrationLog(log);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|