From df5baf68ffa7c1f735018c4ca770adac9fcaa467 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 7 Apr 2023 11:09:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A1=A8=E5=A4=B4--?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=A1=B9=E6=94=B6=E9=9B=86=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=92=8C=E4=B8=8A=E6=8A=A5=E5=BA=93=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=A4=84=E7=90=86=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HeadCustomEOController.java | 4 +- .../head/service/IHeadCustomEOService.java | 2 +- .../service/impl/HeadCustomEOServiceImpl.java | 44 ++++++++++++++++++- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/controller/HeadCustomEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/controller/HeadCustomEOController.java index 6fcd7e3f9..8a9a01c15 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/controller/HeadCustomEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/controller/HeadCustomEOController.java @@ -72,8 +72,8 @@ public class HeadCustomEOController extends JeroController> queryList(String cut,String moduleFlag) { - List list = headCustomEOService.queryList(cut,moduleFlag); + public Result> queryList(String cut,String moduleFlag,String paramsManifestId) { + List list = headCustomEOService.queryList(cut,moduleFlag,paramsManifestId); return Result.OK(list); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/IHeadCustomEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/IHeadCustomEOService.java index 6c734819b..c7e271501 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/IHeadCustomEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/IHeadCustomEOService.java @@ -59,5 +59,5 @@ public interface IHeadCustomEOService extends IService { * * @return */ - List queryList(String cut, String moduleFlag); + List queryList(String cut, String moduleFlag,String paramsManifestId); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/impl/HeadCustomEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/impl/HeadCustomEOServiceImpl.java index ee69230f6..8dd630c96 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/impl/HeadCustomEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/head/service/impl/HeadCustomEOServiceImpl.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.constant.enums.CutEnum; import com.jero.common.system.vo.LoginUser; +import com.jero.modules.cert.collect.entity.ParamsConfigEO; +import com.jero.modules.cert.collect.service.IParamsConfigEOService; import com.jero.modules.head.entity.HeadCustomEO; import com.jero.modules.head.enums.AffirmFlagEnum; import com.jero.modules.head.enums.headCustomEnum; @@ -14,6 +16,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -24,6 +27,7 @@ import java.util.LinkedList; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; +import java.util.stream.IntStream; /** * @Description: 自定义表头 @@ -33,6 +37,8 @@ import java.util.stream.Collectors; */ @Service public class HeadCustomEOServiceImpl extends ServiceImpl implements IHeadCustomEOService { + @Autowired + private IParamsConfigEOService paramsConfigEOService; /** * 保存 @@ -232,7 +238,7 @@ public class HeadCustomEOServiceImpl extends ServiceImpl queryList(String cut, String moduleFlag) { + public List queryList(String cut, String moduleFlag,String paramsManifestId) { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.in(HeadCustomEO::getCreateBy, loginUser.getUsername()).in(HeadCustomEO::getModuleFlag, moduleFlag); @@ -273,6 +279,10 @@ public class HeadCustomEOServiceImpl extends ServiceImpl headCustomVOOneList) { + if((headCustomEnum.PARAMETER_COLLECTION_LIST.getName().equals(moduleFlag) + || headCustomEnum.REPORT_DATABASE_DETAILS.getName().equals(moduleFlag)) + && !headCustomVOOneList.isEmpty()){ + List paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); + if(!paramsConfigEOList.isEmpty()){ + int index = IntStream.range(0, headCustomVOOneList.size()) + .filter(x -> headCustomVOOneList.get(x).getTitle().equals("查看") + || headCustomVOOneList.get(x).getTitle().equals("View")).findFirst().orElse(-1); + headCustomVOOneList.removeIf(e-> StringUtils.isNotBlank(e.getTitle()) + && (e.getTitle().contains("查看") || e.getTitle().contains("View"))); + int count=1; + List headCustomVOList = new LinkedList<>(); + for (ParamsConfigEO paramsConfigEO : paramsConfigEOList) { + HeadCustomVO headCustomVO = new HeadCustomVO(); + headCustomVO.setDb_field_name(paramsConfigEO.getId()); + headCustomVO.setDb_field_txt(String.valueOf(count++)); + headCustomVO.setIsLock(paramsConfigEO.getIsLock()); + headCustomVO.setType("true"); + headCustomVOList.add(headCustomVO); + } + headCustomVOOneList.addAll(index , headCustomVOList); + } + } + } + /** * 检查默认表头,如果不存在则添加进列表 */