From 759f62097d262e02a09e35fd0acc8cf42469e052 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 7 Feb 2025 13:27:07 +0800 Subject: [PATCH] =?UTF-8?q?2025-02-07=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/Impl/PropertiesServiceImpl.java | 32 +++++++++---------- .../MasterPartInformationServiceImpl.java | 4 +-- .../impl/PartInformationServiceImpl.java | 31 +++++++++++++----- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java b/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java index 0ddcfd04..8e98fa2c 100644 --- a/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java +++ b/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java @@ -58,10 +58,10 @@ public class PropertiesServiceImpl implements PropertiesService { @Override public PageUtils propertiesItemSearch(PlmPropertiesItemData inData){ - // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy - if ("MP".equals(inData.getItemType()) || "TL".equals(inData.getItemType()) || "TLI".equals(inData.getItemType())) { - inData.setSite("*"); - } +// // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy +// if ("MP".equals(inData.getItemType()) || "TL".equals(inData.getItemType()) || "TLI".equals(inData.getItemType())) { +// inData.setSite("*"); +// } IPage resultList = this.propertiesMapper.plmPropertiesItemSearch(new Page(inData.getPage(), inData.getLimit()), inData); return new PageUtils(resultList); } @@ -69,10 +69,10 @@ public class PropertiesServiceImpl implements PropertiesService { @Override public ResponseData propertiesItemSave(PlmPropertiesItemData inData){ - // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy - if ("MP".equals(inData.getItemType()) || "TL".equals(inData.getItemType()) || "TLI".equals(inData.getItemType())) { - inData.setSite("*"); - } +// // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy +// if ("MP".equals(inData.getItemType()) || "TL".equals(inData.getItemType()) || "TLI".equals(inData.getItemType())) { +// inData.setSite("*"); +// } ResponseData responseData = new ResponseData(); if("T".equals(inData.getValueTypeDb())){ inData.setValueType("文本"); @@ -167,10 +167,10 @@ public class PropertiesServiceImpl implements PropertiesService { @Override public PageUtils propertiesModelSearch(PlmPropertiesModelHeaderData inData){ - // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy - if ("MP".equals(inData.getFunctionType()) || "TL".equals(inData.getFunctionType()) || "TLI".equals(inData.getFunctionType())) { - inData.setSite("*"); - } +// // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy +// if ("MP".equals(inData.getFunctionType()) || "TL".equals(inData.getFunctionType()) || "TLI".equals(inData.getFunctionType())) { +// inData.setSite("*"); +// } IPage resultList = this.propertiesMapper.plmPropertiesModelSearch( new Page(inData.getPage(), inData.getLimit()), inData); return new PageUtils(resultList); @@ -179,10 +179,10 @@ public class PropertiesServiceImpl implements PropertiesService { @Override @Transactional public void propertiesModelSave(PlmPropertiesModelHeaderData inData){ - // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy - if ("MP".equals(inData.getFunctionType()) || "TL".equals(inData.getFunctionType()) || "TLI".equals(inData.getFunctionType())) { - inData.setSite("*"); - } +// // 如果是masterPart 则将site设置为"*" -- 2025-01-22 yfy +// if ("MP".equals(inData.getFunctionType()) || "TL".equals(inData.getFunctionType()) || "TLI".equals(inData.getFunctionType())) { +// inData.setSite("*"); +// } List checkPropertiesModel = propertiesMapper.checkPropertiesModel(inData); if(!checkPropertiesModel.isEmpty()) { throw new RuntimeException("该模板编码已存在!"); diff --git a/src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java index 6538aa23..1a43a168 100644 --- a/src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java @@ -366,7 +366,7 @@ public class MasterPartInformationServiceImpl extends ServiceImpl().eq("part_no", data.getItemList().get(0).getPartNo())); // 修改明细记录信息 for (PartSubPropertiesValueData valueData : data.getItemList()) { - valueData.setSite("*"); + valueData.setSite(data.getSite()); partInformationMapper.commitItemValue(valueData); if (dataUrl && "Y".equals(partData.getOfficialFlag())) { PartIfsCatalogProperty property = new PartIfsCatalogProperty(); diff --git a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java index 016c4439..a98fe781 100644 --- a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java @@ -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 checkValueHeaderData = partInformationMapper.getMasterPartModal("*", fromPart.getPartNo(), "MP"); + List checkValueHeaderData = partInformationMapper.getMasterPartModal(inData.getSite(), fromPart.getPartNo(), "MP"); if (!checkValueHeaderData.isEmpty()) { List valueHeaders = checkValueHeaderData.stream().map(a -> { a.setPartNo(inData.getPartNo()); @@ -2136,14 +2137,14 @@ public class PartInformationServiceImpl extends ServiceImpl fromPartItems1 = partInformationMapper.getItemModal(valueData); if (!fromPartItems1.isEmpty()) { List 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 queryPartUnitCostList(InventoryPartUnitCostSumEntity inData) { + PartInformationEntity partData = partInformationMapper.selectOne(new QueryWrapper().eq("site", inData.getSite()).eq("part_no", inData.getPartNo())); + if ("Y".equals(partData.getStatus())) { + Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); + Map getInventoryValueResponse = baseSearchBean.getInventoryValueByPartNo(srv, partData); + if ("200".equals(getInventoryValueResponse.get("resultCode"))) { + // 修改物料成本 + ArrayList 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 list = partInformationMapper.queryPartUnitCostList(inData); return list; } @@ -4188,7 +4203,7 @@ public class PartInformationServiceImpl extends ServiceImpl().eq("part_no", inData.getPartNo())); if (masterPart == null) { @@ -4204,8 +4219,8 @@ public class PartInformationServiceImpl extends ServiceImpl modelHeaders = partInformationMapper.getModelHeader("*", plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); - List modelDetails = partInformationMapper.getModelDetail("*", plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); + List modelHeaders = partInformationMapper.getModelHeader(site, plmMasterPart.getPartNo(), plmMasterPart.getCodeNo(), "MP", ifsPart.getPartNo()); + List 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 propertyList = partInformationMapper.getMasterPartPropertyList("*", ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 + List propertyList = partInformationMapper.getMasterPartPropertyList(site, ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象 if (!propertyList.isEmpty()) { Map addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList); if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) {