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); + } + } + } + /** * 检查默认表头,如果不存在则添加进列表 */