自定义表头--参数项收集清单和上报库详情,单独处理配置项
This commit is contained in:
+2
-2
@@ -72,8 +72,8 @@ public class HeadCustomEOController extends JeroController<HeadCustomEO, IHeadCu
|
|||||||
@AutoLog(value = "自定义表头-列表查询")
|
@AutoLog(value = "自定义表头-列表查询")
|
||||||
@ApiOperation(value="自定义表头-列表查询", notes="自定义表头-列表查询")
|
@ApiOperation(value="自定义表头-列表查询", notes="自定义表头-列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public Result<List<HeadCustomVO>> queryList(String cut,String moduleFlag) {
|
public Result<List<HeadCustomVO>> queryList(String cut,String moduleFlag,String paramsManifestId) {
|
||||||
List<HeadCustomVO> list = headCustomEOService.queryList(cut,moduleFlag);
|
List<HeadCustomVO> list = headCustomEOService.queryList(cut,moduleFlag,paramsManifestId);
|
||||||
return Result.OK(list);
|
return Result.OK(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -59,5 +59,5 @@ public interface IHeadCustomEOService extends IService<HeadCustomEO> {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<HeadCustomVO> queryList(String cut, String moduleFlag);
|
List<HeadCustomVO> queryList(String cut, String moduleFlag,String paramsManifestId);
|
||||||
}
|
}
|
||||||
|
|||||||
+43
-1
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.jero.common.constant.enums.CutEnum;
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
import com.jero.common.system.vo.LoginUser;
|
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.entity.HeadCustomEO;
|
||||||
import com.jero.modules.head.enums.AffirmFlagEnum;
|
import com.jero.modules.head.enums.AffirmFlagEnum;
|
||||||
import com.jero.modules.head.enums.headCustomEnum;
|
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.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.SecurityUtils;
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -24,6 +27,7 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 自定义表头
|
* @Description: 自定义表头
|
||||||
@@ -33,6 +37,8 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, HeadCustomEO> implements IHeadCustomEOService {
|
public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, HeadCustomEO> implements IHeadCustomEOService {
|
||||||
|
@Autowired
|
||||||
|
private IParamsConfigEOService paramsConfigEOService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
@@ -232,7 +238,7 @@ public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, Hea
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<HeadCustomVO> queryList(String cut, String moduleFlag) {
|
public List<HeadCustomVO> queryList(String cut, String moduleFlag,String paramsManifestId) {
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
LambdaQueryWrapper<HeadCustomEO> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<HeadCustomEO> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.in(HeadCustomEO::getCreateBy, loginUser.getUsername()).in(HeadCustomEO::getModuleFlag, moduleFlag);
|
wrapper.in(HeadCustomEO::getCreateBy, loginUser.getUsername()).in(HeadCustomEO::getModuleFlag, moduleFlag);
|
||||||
@@ -273,6 +279,10 @@ public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, Hea
|
|||||||
getHeadCustomVO(cut, headCustomEO, headCustomVO);
|
getHeadCustomVO(cut, headCustomEO, headCustomVO);
|
||||||
headCustomVOOneList.add(headCustomVO);
|
headCustomVOOneList.add(headCustomVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//参数项收集清单和上报库详情,单独处理配置项
|
||||||
|
dynamicConfig(moduleFlag, paramsManifestId, headCustomVOOneList);
|
||||||
|
|
||||||
if ("法规清单".equals(moduleFlag) || "虚拟清单详情".equals(moduleFlag) || "维护清单".equals(moduleFlag)) {
|
if ("法规清单".equals(moduleFlag) || "虚拟清单详情".equals(moduleFlag) || "维护清单".equals(moduleFlag)) {
|
||||||
res = checkDefaultHead(headCustomVOOneList, cut, moduleFlag).stream().distinct().collect(Collectors.toList());
|
res = checkDefaultHead(headCustomVOOneList, cut, moduleFlag).stream().distinct().collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
@@ -282,6 +292,38 @@ public class HeadCustomEOServiceImpl extends ServiceImpl<HeadCustomEOMapper, Hea
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数项收集清单和上报库详情,单独处理配置项
|
||||||
|
* @param moduleFlag
|
||||||
|
* @param paramsManifestId
|
||||||
|
* @param headCustomVOOneList
|
||||||
|
*/
|
||||||
|
private void dynamicConfig(String moduleFlag, String paramsManifestId, List<HeadCustomVO> headCustomVOOneList) {
|
||||||
|
if((headCustomEnum.PARAMETER_COLLECTION_LIST.getName().equals(moduleFlag)
|
||||||
|
|| headCustomEnum.REPORT_DATABASE_DETAILS.getName().equals(moduleFlag))
|
||||||
|
&& !headCustomVOOneList.isEmpty()){
|
||||||
|
List<ParamsConfigEO> 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<HeadCustomVO> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查默认表头,如果不存在则添加进列表
|
* 检查默认表头,如果不存在则添加进列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user