feat: 企标标准导出支持授权部门导出

This commit is contained in:
2024-07-22 15:11:38 +08:00
parent 216d2ca75c
commit 1a551a3ccc
@@ -186,6 +186,9 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
@Resource
private DockingService dockingService;
@Resource
private EnterpriseStandardAuthDeptService authDeptService;
public static boolean ENCRYPT_ENABLE;
public static String DECRYPT_URL;
public static String DECRYPT_APP_CODE;
@@ -377,7 +380,27 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 获取分页查询结果
IPage<Map<String, Object>> infoPage = lawsCommonMapper.getCommonPage(page, tableName, selectField, selectCondition);
// 对返回的数据做处理
// 对返回的数据做处理 增加授权部门字段的数据
if (selectField.contains(FieldCommon.AUTH_DEPT)) {
List<Map<String, Object>> records = infoPage.getRecords();
List<String> standardIds = records.stream().map(map -> (String) map.get("id")).collect(Collectors.toList());
LambdaQueryWrapper<EnterpriseStandardAuthDept> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(EnterpriseStandardAuthDept::getStandardId, standardIds);
queryWrapper.isNull(EnterpriseStandardAuthDept::getAuthExpireDate);
List<EnterpriseStandardAuthDept> enterpriseStandardAuthDeptList = authDeptService.list(queryWrapper);
Map<String, List<EnterpriseStandardAuthDept>> authDeptMap = enterpriseStandardAuthDeptList.stream()
.collect(Collectors.groupingBy(EnterpriseStandardAuthDept::getStandardId));
// 处理数据
records.forEach(map -> {
String standardId = (String) map.get("id");
if (authDeptMap.containsKey(standardId)) {
List<EnterpriseStandardAuthDept> authDeptList = authDeptMap.get(standardId);
List<String> authDeptIdList = authDeptList.stream().map(EnterpriseStandardAuthDept::getAuthDept)
.collect(Collectors.toList());
map.put(FieldCommon.AUTH_DEPT, String.join(",", authDeptIdList));
}
});
}
// 做字段翻译和拼接
infoPage.setRecords(processResultMapPageList(infoPage.getRecords(), fieldList));
// 待处理