diff --git a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java index 62384765..4b61f140 100644 --- a/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java +++ b/integration/src/main/java/com/foreverwin/mesnac/integration/service/impl/InterfaceServiceImpl.java @@ -88,24 +88,24 @@ public class InterfaceServiceImpl implements InterfaceService { throw BusinessException.build("物料状态可维护的值为:201(可下达)、202(冻结)、203(作废)、204(保留)、205(新建)"); } String statusBo = HandleEnum.STATUS.getHandle(site, status); - //物料类型(FERT(已完成)/ROH(原始)/HALB(半成品)/KMAT(可配置)/INST(安装)/VERP(包装)/FHMI(生产资源/工具)/CSTM(自定义)) - String itemType = itemSyncRequest.getITEM_TYPE(); - if (!"FERT".equals(itemType) && !"ROH".equals(itemType) && !"HALB".equals(itemType)) { - throw BusinessException.build("物料类型可维护的值为:FERT(已完成)、ROH(原始)、HALB(半成品)"); - } - //采购类型(M(制造)/P(采购)/B(制造/采购)) - String procurementType = itemSyncRequest.getPROCUREMENT_TYPE(); - if (!"M".equals(procurementType) && !"P".equals(procurementType) && !"B".equals(procurementType)) { - throw BusinessException.build("采购类型可维护的值为:M(制造)、P(采购)、B(制造/采购)"); + + /** + * Modify by Leon - 20210920 + * 物料类型-根据物料编码来判断,CAPP传过来为空(编码05开头为原始,02/03/06开头的为半成品) + */ + String itemType = null; + String procurementType = null; + if (item.startsWith("02") || item.startsWith("03") || item.startsWith("06")) { + itemType = "HALB"; + procurementType = "B"; + } else { + itemType = "ROH"; + procurementType = "P"; } //批次大小 String lotSize = itemSyncRequest.getLOT_SIZE(); lotSize = StringUtil.notBlank(lotSize) ? lotSize : "999999"; - //装配时要收集的数据 - String assyDataType = itemSyncRequest.getASSY_DATA_TYPE(); - //库存接收数据类型 - String invAssyDataType = itemSyncRequest.getINV_ASSY_DATA_TYPE(); //物料标准API ItemConfigurationServiceInterface itemServiceInterFace = MEServices.create("com.sap.me.productdefinition", "ItemConfigurationService", site);