From 578aab2fe64f8478afbb15219ccde6fc73c8c6bb Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 6 Jun 2025 16:48:54 +0800 Subject: [PATCH] =?UTF-8?q?2025-06-06=20=E6=9D=90=E6=96=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=AD=E7=9A=84=E6=B2=B9=E5=A2=A8=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=BE=85=E5=85=A5=E5=88=B0=E5=8D=B0=E5=88=B7=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=A2=9C=E8=89=B2=E4=B8=AD=20=20=20=20=20=20?= =?UTF-8?q?=201=E3=80=81=E6=9D=90=E6=96=99=E4=BF=A1=E6=81=AF=E4=B8=AD?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=98=AFkg=E7=9A=84=20=20=20=20=20=20=202?= =?UTF-8?q?=E3=80=81=E5=B0=86=E7=89=A9=E6=96=99=E7=BC=96=E7=A0=81=E6=94=BE?= =?UTF-8?q?=E5=88=B0=E9=A2=9C=E8=89=B2=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../part/mapper/BomManagementMapper.java | 2 + .../TechnicalSpecificationController.java | 30 ++++ .../dao/TechnicalSpecificationMapper.java | 12 ++ .../TechnicalSpecificationServiceImpl.java | 165 +++++++++++++++--- .../TechnicalSpecificationService.java | 6 + .../mapper/part/BomManagementMapper.xml | 18 ++ .../TechnicalSpecificationMapper.xml | 96 +++++++--- 7 files changed, 281 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java b/src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java index 0e245a57..e97566b5 100644 --- a/src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java +++ b/src/main/java/com/spring/modules/part/mapper/BomManagementMapper.java @@ -137,4 +137,6 @@ public interface BomManagementMapper extends BaseMapper { List selectBomHeaderByPartNo(@Param("site") String site, @Param("partNo") String partNo); List selectBomManufStructCostDistribByPartNo(@Param("site") String site, @Param("partNo") String partNo); + + List queryBomComponentByKg(BomDetailEntity bomDetailEntity); } diff --git a/src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java b/src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java index 142f0f30..77b71824 100644 --- a/src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java +++ b/src/main/java/com/spring/modules/sampleManagement/controller/TechnicalSpecificationController.java @@ -1062,6 +1062,16 @@ public class TechnicalSpecificationController { return R.ok(); } + /** + * 一键导入 + */ + @PostMapping(value="/saveBMPrintingColorBatch") + @ResponseBody + public R saveBMPrintingColorBatch(@RequestBody PlmBmPrintingColorData data){ + technicalSpecificationService.saveBMPrintingColorBatch(data); + return R.ok(); + } + @PostMapping(value="/deleteBMPrintingColor") @ResponseBody public R deleteBMPrintingColor(@RequestBody PlmBmPrintingColorData data){ @@ -1140,6 +1150,16 @@ public class TechnicalSpecificationController { return R.ok(); } + /** + * 一键导入 + */ + @PostMapping(value="/saveBMPrintFlexoColorBatch") + @ResponseBody + public R saveBMPrintFlexoColorBatch(@RequestBody PlmBmPrintFlexoColorData data){ + technicalSpecificationService.saveBMPrintFlexoColorBatch(data); + return R.ok(); + } + @PostMapping(value="/deleteBMprintFlexoColor") @ResponseBody public R deleteBMprintFlexoColor(@RequestBody PlmBmPrintFlexoColorData data){ @@ -1161,6 +1181,16 @@ public class TechnicalSpecificationController { return R.ok(); } + /** + * 一键导入 + */ + @PostMapping(value="/saveBMPrintIndigoColorBatch") + @ResponseBody + public R saveBMPrintIndigoColorBatch(@RequestBody PlmBmPrintIndigoColorData data){ + technicalSpecificationService.saveBMPrintIndigoColorBatch(data); + return R.ok(); + } + @PostMapping(value="/deleteBMprintIndigoColor") @ResponseBody public R deleteBMprintIndigoColor(@RequestBody PlmBmPrintIndigoColorData data){ diff --git a/src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java b/src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java index 5893c2d6..d0323ea3 100644 --- a/src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java +++ b/src/main/java/com/spring/modules/sampleManagement/dao/TechnicalSpecificationMapper.java @@ -1185,4 +1185,16 @@ public interface TechnicalSpecificationMapper { void updateBMIsRemark(PlmTechnicalSpecificationSheetData data); List nodeList(PlmTechnicalSpecificationSheetData data); + + void deleteBMPrintIndigoColorByCodeNo(PlmBmPrintIndigoColorData data); + + void saveBMPrintIndigoColors(List colorList); + + void deleteBMPrintFlexoColorByCodeNo(PlmBmPrintFlexoColorData data); + + void saveBMPrintFlexoColors(List colorList); + + void deleteBMPrintingColorByCodeNo(PlmBmPrintingColorData data); + + void saveBMPrintingColors(List colorList); } diff --git a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java index cab6f413..f539837e 100644 --- a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java +++ b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java @@ -492,18 +492,18 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification // return technicalSpecificationMapper.searchBMBom(inData); // } @Override - public Map searchBMBom(PlmBmBomData inData){ + public Map searchBMBom(PlmBmBomData inData) { HashMap map = new HashMap<>(); - List bomDetailEntity=technicalSpecificationMapper.getBMBomDetail(inData); - if(bomDetailEntity.size()>1){ + List bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData); + if (bomDetailEntity.size() > 1) { throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员"); } - if(bomDetailEntity.size()==0){ + if (bomDetailEntity.isEmpty()) { throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员"); } - List list= bomManagementMapper.queryBomComponent(bomDetailEntity.get(0)); - map.put("rows",list); - map.put("row",bomDetailEntity.get(0)); + List list = bomManagementMapper.queryBomComponent(bomDetailEntity.get(0)); + map.put("rows", list); + map.put("row", bomDetailEntity.get(0)); return map; } @Override @@ -1063,9 +1063,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification @Override public void deleteBMCutCut(PlmBmCutCutData data){ - technicalSpecificationMapper.deleteBMCutCut(data); - } @@ -1107,18 +1105,55 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } } + /** + * 一键导入 + */ @Override - public void deleteBMPrintingColor(PlmBmPrintingColorData data){ + @Transactional + public void saveBMPrintingColorBatch(PlmBmPrintingColorData data) { + // 获取人员 + SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + data.setUpdateBy(sysUserEntity.getUsername()); + // 查询对象 + PlmBmBomData inData = new PlmBmBomData(); + inData.setSite(data.getSite()); + inData.setCodeNo(data.getCodeNo()); + // 数据集 + List colorList = new ArrayList<>(); + + // 删除原数据 + technicalSpecificationMapper.deleteBMPrintingColorByCodeNo(data); + List bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData); + if (bomDetailEntity.size() > 1) { + throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员"); + } + if (bomDetailEntity.isEmpty()) { + throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员"); + } + // 查出单位是kg的物料 + List list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0)); + for (BomComponentVo component : list) { + PlmBmPrintingColorData colorData = new PlmBmPrintingColorData(); + colorData.setSite(data.getSite()); + colorData.setCodeNo(data.getCodeNo()); + colorData.setOrder(component.getLineSequence()); + colorData.setColorReference(component.getComponentPart()); + colorData.setUpdateBy(data.getUpdateBy()); + colorList.add(colorData); + } + // 批量新增 + technicalSpecificationMapper.saveBMPrintingColors(colorList); + } + @Override + public void deleteBMPrintingColor(PlmBmPrintingColorData data){ technicalSpecificationMapper.deleteBMPrintingColor(data); - } @Override @Transactional public void upBMRevNo(UpBMRevNoData data){ SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); - List params = new ArrayList<>(); params.add(data.getSite()); params.add(data.getOldCodeNo()); @@ -1135,7 +1170,6 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification String msg = String.valueOf(resultList.get(0).get("resultMsg")); throw new RuntimeException(msg); } - } @Override @@ -1147,7 +1181,6 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification @Override @Transactional public void updateBMRouteRev(PlmTechnicalSpecificationSheetData data){ - List params = new ArrayList<>(); params.add(data.getSite()); params.add(data.getCodeNo()); @@ -1233,25 +1266,64 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } @Override - public void saveBMprintFlexoColor(PlmBmPrintFlexoColorData data){ + public void saveBMprintFlexoColor(PlmBmPrintFlexoColorData data) { SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); data.setUpdateBy(sysUserEntity.getUsername()); - if(data.getId()==0){ - List checkOrder=technicalSpecificationMapper.checkBMprintFlexoColorOrder(data); - if(checkOrder.size()>0){ + if (data.getId() == 0) { + List checkOrder = technicalSpecificationMapper.checkBMprintFlexoColorOrder(data); + if (!checkOrder.isEmpty()) { throw new RuntimeException("该面色序号已经重复!"); } technicalSpecificationMapper.saveBMprintFlexoColor(data); - }else{ + } else { technicalSpecificationMapper.updateBMprintFlexoColor(data); } } + /** + * 一键导入 + */ @Override - public void deleteBMprintFlexoColor(PlmBmPrintFlexoColorData data){ + @Transactional + public void saveBMPrintFlexoColorBatch(PlmBmPrintFlexoColorData data) { + // 获取人员 + SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + data.setUpdateBy(sysUserEntity.getUsername()); + // 查询对象 + PlmBmBomData inData = new PlmBmBomData(); + inData.setSite(data.getSite()); + inData.setCodeNo(data.getCodeNo()); + // 数据集 + List colorList = new ArrayList<>(); + + // 删除原数据 + technicalSpecificationMapper.deleteBMPrintFlexoColorByCodeNo(data); + List bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData); + if (bomDetailEntity.size() > 1) { + throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员"); + } + if (bomDetailEntity.isEmpty()) { + throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员"); + } + // 查出单位是kg的物料 + List list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0)); + for (BomComponentVo component : list) { + PlmBmPrintFlexoColorData colorData = new PlmBmPrintFlexoColorData(); + colorData.setSite(data.getSite()); + colorData.setCodeNo(data.getCodeNo()); + colorData.setOrder(component.getLineSequence()); + colorData.setPrintSide(data.getPrintSide()); + colorData.setInkCode(component.getComponentPart()); + colorData.setUpdateBy(data.getUpdateBy()); + colorList.add(colorData); + } + // 批量新增 + technicalSpecificationMapper.saveBMPrintFlexoColors(colorList); + } + @Override + public void deleteBMprintFlexoColor(PlmBmPrintFlexoColorData data){ technicalSpecificationMapper.deleteBMprintFlexoColor(data); - } @Override @@ -1260,20 +1332,61 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } @Override - public void saveBMprintIndigoColor(PlmBmPrintIndigoColorData data){ + public void saveBMprintIndigoColor(PlmBmPrintIndigoColorData data) { SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); data.setUpdateBy(sysUserEntity.getUsername()); - if(data.getId()==0){ - List checkOrder=technicalSpecificationMapper.checkBMprintIndigoColorOrder(data); - if(checkOrder.size()>0){ + if (data.getId() == 0) { + List checkOrder = technicalSpecificationMapper.checkBMprintIndigoColorOrder(data); + if (!checkOrder.isEmpty()) { throw new RuntimeException("该面色序号已经重复!"); } technicalSpecificationMapper.saveBMprintIndigoColor(data); - }else{ + } else { technicalSpecificationMapper.updateBMprintIndigoColor(data); } } + /** + * 一键导入 + */ + @Override + @Transactional + public void saveBMPrintIndigoColorBatch (PlmBmPrintIndigoColorData data) { + // 获取人员 + SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + data.setUpdateBy(sysUserEntity.getUsername()); + // 查询对象 + PlmBmBomData inData = new PlmBmBomData(); + inData.setSite(data.getSite()); + inData.setCodeNo(data.getCodeNo()); + // 数据集 + List colorList = new ArrayList<>(); + + // 删除原数据 + technicalSpecificationMapper.deleteBMPrintIndigoColorByCodeNo(data); + List bomDetailEntity = technicalSpecificationMapper.getBMBomDetail(inData); + if (bomDetailEntity.size() > 1) { + throw new RuntimeException("物料编码在物料视图view_Project_final_Part中有重复!请联系管理员"); + } + if (bomDetailEntity.isEmpty()) { + throw new RuntimeException("物料BOM状态不为Buildable!请联系管理员"); + } + // 查出单位是kg的物料 + List list = bomManagementMapper.queryBomComponentByKg(bomDetailEntity.get(0)); + for (BomComponentVo component : list) { + PlmBmPrintIndigoColorData colorData = new PlmBmPrintIndigoColorData(); + colorData.setSite(data.getSite()); + colorData.setCodeNo(data.getCodeNo()); + colorData.setOrder(component.getLineSequence()); + colorData.setPrintSide(data.getPrintSide()); + colorData.setInkCode(component.getComponentPart()); + colorData.setUpdateBy(data.getUpdateBy()); + colorList.add(colorData); + } + // 批量新增 + technicalSpecificationMapper.saveBMPrintIndigoColors(colorList); + } + @Override public void deleteBMprintIndigoColor(PlmBmPrintIndigoColorData data){ technicalSpecificationMapper.deleteBMprintIndigoColor(data); diff --git a/src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java b/src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java index c81b3382..0df63917 100644 --- a/src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java +++ b/src/main/java/com/spring/modules/sampleManagement/service/TechnicalSpecificationService.java @@ -990,4 +990,10 @@ public interface TechnicalSpecificationService { void bmStatusToFinish(PlmTechnicalSpecificationSheetData data); List nodeList(PlmTechnicalSpecificationSheetData data); + + void saveBMPrintIndigoColorBatch(PlmBmPrintIndigoColorData data); + + void saveBMPrintFlexoColorBatch(PlmBmPrintFlexoColorData data); + + void saveBMPrintingColorBatch(PlmBmPrintingColorData data); } diff --git a/src/main/resources/mapper/part/BomManagementMapper.xml b/src/main/resources/mapper/part/BomManagementMapper.xml index 0d44734c..226c5dc5 100644 --- a/src/main/resources/mapper/part/BomManagementMapper.xml +++ b/src/main/resources/mapper/part/BomManagementMapper.xml @@ -270,6 +270,24 @@ order by a.line_sequence + + + select site from plm_bm_PrintingColor @@ -1848,12 +1862,15 @@ and routing_revision = #{routingRevision} - insert into plm_bm_printFlexoColor(site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi, - bcm, openFlag, gallus, markAndy, hexiang, temperature, - pressure, updateDate, updateBy, remark) - values (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi}, - #{bcm}, #{openFlag}, #{gallus}, - #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}) + insert into plm_bm_printFlexoColor + (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi, + bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark) + values + (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi}, + #{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}) + + + + insert into plm_bm_printFlexoColor + (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi, + bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark) + values + + (#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi}, + #{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(), #{item.updateBy}, #{item.remark}) + @@ -2035,11 +2063,15 @@ - delete - from plm_bm_printFlexoColor + delete from plm_bm_printFlexoColor where id = #{id} + + delete from plm_bm_printFlexoColor + where site = #{site} and code_no = #{codeNo} + + - insert into plm_bm_printIndigoColor(site, code_no, [order], printSide, colorReference, inkCode, colorMatch, - printMotion, opticalDensity, lut, lpi, screenAngle, printHits, - blanketTemperture, remark, updateBy, updateDate) - values (#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch}, - #{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, - #{screenAngle}, #{printHits}, #{blanketTemperture}, #{remark}, #{updateBy}, GetDate()) + insert into plm_bm_printIndigoColor + (site, code_no, [order], printSide, colorReference, inkCode, colorMatch, + printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture, + remark, updateBy, updateDate) + values + (#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch}, + #{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, #{screenAngle}, #{printHits}, #{blanketTemperture}, + #{remark}, #{updateBy}, GetDate()) + + + + insert into plm_bm_printIndigoColor + (site, code_no, [order], printSide, colorReference, inkCode, colorMatch, + printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture, + remark, updateBy, updateDate) + values + + (#{item.site}, #{item.codeNo}, #{item.order}, #{item.printSide}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, + #{item.printMotion}, #{item.opticalDensity}, #{item.lut}, #{item.lpi}, #{item.screenAngle}, #{item.printHits}, #{item.blanketTemperture}, + #{item.remark}, #{item.updateBy}, GetDate()) + @@ -2109,6 +2156,11 @@ where id = #{id} + + delete from plm_bm_printIndigoColor + where site = #{site} and code_no = #{codeNo} + +