|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.spring.modules.part.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
@ -2127,7 +2128,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
masterPartInformationMapper.insert(masterPart); |
|
|
|
} |
|
|
|
// master part 模板和属性 |
|
|
|
List<PartSubPropertiesValueHeaderData> checkValueHeaderData = partInformationMapper.getMasterPartModal("*", fromPart.getPartNo(), "MP"); |
|
|
|
List<PartSubPropertiesValueHeaderData> checkValueHeaderData = partInformationMapper.getMasterPartModal(inData.getSite(), fromPart.getPartNo(), "MP"); |
|
|
|
if (!checkValueHeaderData.isEmpty()) { |
|
|
|
List<PartSubPropertiesValueHeaderData> valueHeaders = checkValueHeaderData.stream().map(a -> { |
|
|
|
a.setPartNo(inData.getPartNo()); |
|
|
|
@ -2136,14 +2137,14 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
partInformationMapper.savePartModelHeaders(valueHeaders); |
|
|
|
} |
|
|
|
PartSubPropertiesValueData valueData = new PartSubPropertiesValueData(); |
|
|
|
valueData.setSite("*"); |
|
|
|
valueData.setSite(inData.getSite()); |
|
|
|
valueData.setPartNo(fromPart.getPartNo()); |
|
|
|
valueData.setRecordType("MP"); |
|
|
|
// 物料属性 |
|
|
|
List<PartSubPropertiesValueData> fromPartItems1 = partInformationMapper.getItemModal(valueData); |
|
|
|
if (!fromPartItems1.isEmpty()) { |
|
|
|
List<PartSubPropertiesValueData> toPartItems1 = fromPartItems1.stream().map(a -> { |
|
|
|
a.setSite("*"); |
|
|
|
a.setSite(inData.getSite()); |
|
|
|
a.setPartNo(inData.getPartNo()); |
|
|
|
return a; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
@ -2869,7 +2870,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
masterPartInformation.setPartNo(ifsPart.getPartNo()); |
|
|
|
masterPartInformation.setPlmPartNo(data.getPartNo()); |
|
|
|
masterPartInformation.setUpdateBy(data.getUpdateBy()); |
|
|
|
toBecomeOfficialMasterPart(masterPartInformation); |
|
|
|
toBecomeOfficialMasterPart(masterPartInformation, data.getSite()); |
|
|
|
|
|
|
|
// 获取ifsServer |
|
|
|
Server srv = getIfsServer(data.getUpdateBy()); |
|
|
|
@ -3584,6 +3585,20 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<InventoryPartUnitCostSumEntity> queryPartUnitCostList(InventoryPartUnitCostSumEntity inData) { |
|
|
|
PartInformationEntity partData = partInformationMapper.selectOne(new QueryWrapper<PartInformationEntity>().eq("site", inData.getSite()).eq("part_no", inData.getPartNo())); |
|
|
|
if ("Y".equals(partData.getStatus())) { |
|
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
|
Map<String, String> getInventoryValueResponse = baseSearchBean.getInventoryValueByPartNo(srv, partData); |
|
|
|
if ("200".equals(getInventoryValueResponse.get("resultCode"))) { |
|
|
|
// 修改物料成本 |
|
|
|
ArrayList<InventoryPartUnitCostSumEntity> subList = new ArrayList<>(); |
|
|
|
InventoryPartUnitCostSumEntity unitCostSum = JSONObject.parseObject(getInventoryValueResponse.get("obj"), InventoryPartUnitCostSumEntity.class); |
|
|
|
subList.add(unitCostSum); |
|
|
|
partInformationMapper.syncUpdateUnitValue(subList); |
|
|
|
} else { |
|
|
|
log.error("获取成本信息异常: " + getInventoryValueResponse.get("resultMsg")); |
|
|
|
} |
|
|
|
} |
|
|
|
List<InventoryPartUnitCostSumEntity> list = partInformationMapper.queryPartUnitCostList(inData); |
|
|
|
return list; |
|
|
|
} |
|
|
|
@ -4188,7 +4203,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
* @param inData |
|
|
|
*/ |
|
|
|
@Transactional |
|
|
|
public void toBecomeOfficialMasterPart(MasterPartInformationEntity inData) { |
|
|
|
public void toBecomeOfficialMasterPart(MasterPartInformationEntity inData, String site) { |
|
|
|
// 校验ifsPartNo是否已存在 |
|
|
|
MasterPartInformationEntity masterPart = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", inData.getPartNo())); |
|
|
|
if (masterPart == null) { |
|
|
|
@ -4204,8 +4219,8 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
masterPartInformationMapper.insert(ifsPart); |
|
|
|
|
|
|
|
// 新增IFS物料属性 |
|
|
|
List<PartSubPropertiesValueHeaderData> modelHeaders = partInformationMapper.getModelHeader("*", plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); |
|
|
|
List<PartSubPropertiesValueData> modelDetails = partInformationMapper.getModelDetail("*", plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); |
|
|
|
List<PartSubPropertiesValueHeaderData> modelHeaders = partInformationMapper.getModelHeader(site, plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); |
|
|
|
List<PartSubPropertiesValueData> modelDetails = partInformationMapper.getModelDetail(site, plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); |
|
|
|
if (!modelHeaders.isEmpty()) { |
|
|
|
partInformationMapper.savePartModelHeaders(modelHeaders); |
|
|
|
} |
|
|
|
@ -4249,7 +4264,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList("*", ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 |
|
|
|
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList(site, ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 |
|
|
|
if (!propertyList.isEmpty()) { |
|
|
|
Map<String, String> addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList); |
|
|
|
if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) { |
|
|
|
|