|
|
|
@ -3,14 +3,19 @@ package com.spring.ifs.bean; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.spring.ifs.api.IfsServer; |
|
|
|
import com.spring.ifs.api.MasterPartApi; |
|
|
|
import com.spring.ifs.api.TechnicalClassApi; |
|
|
|
import com.spring.modules.base.utils.DateUtils; |
|
|
|
import com.spring.modules.part.entity.APIEntity.PartIfsCatalog; |
|
|
|
import com.spring.modules.part.entity.APIEntity.PartIfsCatalogModel; |
|
|
|
import ifs.fnd.ap.APException; |
|
|
|
import ifs.fnd.ap.Server; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@ -44,7 +49,6 @@ public class MasterServiceBean { |
|
|
|
if (null == resultMap) { |
|
|
|
throw new APException("当前物料件不存在!"); |
|
|
|
} else { |
|
|
|
//设置IFS信息 |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowId(resultMap.get("OBJID")); |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
@ -116,6 +120,8 @@ public class MasterServiceBean { |
|
|
|
inData.setIfsRowId(partMap.get("IFSROWID")); |
|
|
|
inData.setIfsRowVersion(partMap.get("IFSROWVERSION")); |
|
|
|
Map<String, String> resultMap = MasterPartApi.modifyMasterPart(srv, inData); |
|
|
|
//处理基数等级的业务方法 |
|
|
|
this.processPartCatalogTechnicalClass(srv, inData); |
|
|
|
//设置ifs 信息 |
|
|
|
inData.setIfsRowVersion(resultMap.get("OBJVERSION")); |
|
|
|
} |
|
|
|
@ -131,6 +137,41 @@ public class MasterServiceBean { |
|
|
|
return returnMap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 处理基数等级的业务方法 |
|
|
|
* @author LR |
|
|
|
* @date 2024/12/12 15:40 |
|
|
|
* @version 1.0 |
|
|
|
*/ |
|
|
|
public void processPartCatalogTechnicalClass(Server srv, PartIfsCatalog inData) throws APException { |
|
|
|
//拼装技术等级的属性数据 |
|
|
|
String partNo = inData.getPartNo(); |
|
|
|
String luName = "PartCatalog"; |
|
|
|
String keyRef = "PART_NO=" + partNo + "^"; |
|
|
|
String technicalClass = inData.getTechnicalClass(); |
|
|
|
PartIfsCatalogModel technical = new PartIfsCatalogModel(); |
|
|
|
technical.setLuName(luName); |
|
|
|
technical.setKeyRef(keyRef); |
|
|
|
//查询当前技术等级的数据 |
|
|
|
Map<String, String> technicalMap = TechnicalClassApi.getTechnicalClass(srv, "PART_CATALOG", "PART_NO=" + partNo + "^"); |
|
|
|
//设置IFS系统的参数 |
|
|
|
technical.setTechnicalClass(technicalClass); |
|
|
|
technical.setDtOk(DateUtils.getStringDate(new Date(), "yyyy-MM-dd")); |
|
|
|
technical.setOkSign(inData.getIfsUsername()); //判断是否已经存在当前数据 |
|
|
|
if (null == technicalMap){ |
|
|
|
//判断技术等级是否需要新增 |
|
|
|
if (StringUtils.isNotBlank(technicalClass)){ |
|
|
|
//设置同步的属性 |
|
|
|
technical.setTechnicalSpecNo(""); |
|
|
|
TechnicalClassApi.insertTechnicalClass(srv, technical); |
|
|
|
} |
|
|
|
}else { |
|
|
|
//直接调用修改的接口 |
|
|
|
technical.setTechnicalSpecNo(technicalMap.get("TECHNICAL_SPEC_NO")); |
|
|
|
TechnicalClassApi.modifyTechnicalClass(srv, technical); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 调用删除的方法 |
|
|
|
* @author LR |
|
|
|
|