From 61c4471930f2af2658fc4876bad11f61baf28872 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Mon, 25 Sep 2023 14:43:41 +0800 Subject: [PATCH] =?UTF-8?q?=20=E5=B9=B3=E5=8F=B0=E4=BB=B6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/mapper/xml/TodoCenterMapper.xml | 3 +- .../LawsInventoryPlatformEOController.java | 2 +- ...ectCertificationInventoryEOController.java | 4 +- .../ProjectCertificationInventoryEO.java | 20 ++--- ...rojectCertificationInventoryEOService.java | 2 +- ...ctCertificationInventoryEOServiceImpl.java | 78 +++++++++++++++++-- .../ProjectLawsInventoryEOServiceImpl.java | 4 + 7 files changed, 94 insertions(+), 19 deletions(-) diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml index ff0405564..1a2deaf32 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/TodoCenterMapper.xml @@ -23,7 +23,8 @@ SELECT pm.id FROM params_manifest pm JOIN ( SELECT id FROM - ( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id + ( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id, + a.platform FROM project_library_base a JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java index c05cd93be..0433e3699 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java @@ -118,7 +118,7 @@ public class LawsInventoryPlatformEOController extends JeroController listPlatform(@RequestBody Map params) { - projectCertificationInventoryEOService.listPlatform(params); - return Result.OK(); + String msg = projectCertificationInventoryEOService.listPlatform(params); + return Result.OK(msg); } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index 7f8c25293..e08add5f6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -1,24 +1,22 @@ package com.jero.modules.project.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; -import java.util.Date; - import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; import com.jero.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; /** @@ -261,4 +259,8 @@ public class ProjectCertificationInventoryEO implements Serializable { /**一级责任领域**/ @TableField(exist = false) private String firstLevelDutyTerritory; + + @ApiModelProperty(value = "关联平台件数据") + @TableField(exist = false) + private List projectCertificationInventoryEOS; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 472446bd3..f205301bb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -344,5 +344,5 @@ public interface IProjectCertificationInventoryEOService extends IService params); + String listPlatform(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 27ab0fb30..267c06211 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -73,6 +73,7 @@ import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.enums.ProjectRoleEnum; import com.jero.modules.system.enums.SysCategoryValueTypeEnum; import com.jero.modules.system.mapper.SysCategoryMapper; +import com.jero.modules.system.mapper.SysDictItemMapper; import com.jero.modules.system.mapper.SysRoleMapper; import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.service.IProjectUserDutyTerritoryService; @@ -109,6 +110,7 @@ import org.aspectj.util.FileUtil; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.enmus.ExcelType; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -230,6 +232,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl collect = lawsInventoryPlatformEOList.stream() + .filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect)){ + List platformLawsInventoryIdList = collect.stream() + .map(LawsInventoryPlatformEO::getPlatformLawsInventoryId).distinct().collect(Collectors.toList()); + + List inventoryEOList = projectCertificationInventoryEOS.stream() + .filter(e -> platformLawsInventoryIdList.contains(e.getId())).collect(Collectors.toList()); + certificationInventoryEO.setProjectCertificationInventoryEOS(inventoryEOList); + } + + List inventoryPlatformEOList = lawsInventoryPlatformEOList.stream() .filter(e -> certificationInventoryEO.getId().equals(e.getLawsInventoryId())).collect(Collectors.toList()); if(!inventoryPlatformEOList.isEmpty()){ @@ -3593,8 +3609,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); - List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + List certificationEngineerList = new ArrayList<>(); + List certificationEngineerIdList = new ArrayList<>(); + if(StringUtils.isNotBlank(projectLibraryBase.getCertificationEngineer())){ + certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + } + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 @@ -3717,6 +3738,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,Arrays.asList(ids.split(","))); + lawsInventoryPlatformEOService.remove(wrapper); return Result.OK("流程重置成功!"); } @@ -7029,7 +7054,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl params) { + public String listPlatform(Map params) { String cut = (String) params.get("cut");// String ids = (String) params.get("ids");//认证清单id String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id @@ -7052,11 +7077,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl sysDictItemList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue()); List lawsInventoryPlatformEOS = new ArrayList<>(); List result = new ArrayList<>(); + List emptyList = new ArrayList<>(); for (ProjectCertificationInventoryEO projectCertificationInventoryEO : certificationInventoryEOList) { //类别 String category = projectCertificationInventoryEO.getCategory(); @@ -7090,10 +7117,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl sysDictItemList, List emptyList) { + List msgList = new ArrayList<>(); + //未匹配上法规清单 + if(ObjectUtils.isNotEmpty(emptyList)){ + for (ProjectCertificationInventoryEO projectCertificationInventoryEO : emptyList) { + List list = new LinkedList<>(); + if(com.jero.modules.system.util.StringUtils.isNotBlank(projectCertificationInventoryEO.getDutyTerritory())){ + for (String s : projectCertificationInventoryEO.getDutyTerritory().split(",")) { + List collect = sysDictItemList.stream().filter(e -> e.getItemValue().equals(s)).collect(Collectors.toList()); + if(CutEnum.CN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getItemText()); + }else if(CutEnum.EN.getValue().equals(cut) && !collect.isEmpty()){ + list.add(collect.get(0).getEnName()); + } + } + } + String serialNumber = projectCertificationInventoryEO.getSerialNumber(); + String dutyTerritoryName = com.jero.modules.system.util.StringUtils.join(list,","); + String msg = serialNumber+" "+dutyTerritoryName+"未匹配到数据"; + msgList.add(msg); + } + } + String html = ""; + for (String s : msgList) { + html += s + "
"; + } + return html; } private void setDataTemp(List lawsInventoryPlatformEOS, diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index b70756479..582ccdfdd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -4965,6 +4965,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,Arrays.asList(ids.split(","))); + lawsInventoryPlatformEOService.remove(wrapper); return Result.OK("变更成功!"); }