fix: 企标相关报错修复

This commit is contained in:
2024-06-29 08:20:09 +08:00
parent e5982e9289
commit b52dde0369
3 changed files with 51 additions and 51 deletions
@@ -1331,44 +1331,44 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
Map<String, Object> stringObjectMap = processResultMap(initMap, fieldList);
if (module.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())) {
// 企标独有的稽查内容列表
LambdaQueryWrapper<EnterpriseStandardInspectContent> esIcWrapper = new LambdaQueryWrapper<>();
esIcWrapper.eq(EnterpriseStandardInspectContent::getStandardId, id);
List<EnterpriseStandardInspectContent> list = esInspectContentService.list(esIcWrapper);
List<String> departIdList = list.stream().map(EnterpriseStandardInspectContent::getRectificationDepartment)
.collect(Collectors.toList());
if (departIdList.size() != 0) {
LambdaQueryWrapper<SysDepart> sysDepartLambdaQueryWrapper = new LambdaQueryWrapper<>();
sysDepartLambdaQueryWrapper.in(SysDepart::getId, departIdList);
List<SysDepart> departList = sysDepartService.list(sysDepartLambdaQueryWrapper);
Map<String, List<SysDepart>> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getId));
for (EnterpriseStandardInspectContent content : list) {
if (content.getRectificationDepartment() != null) {
content.setRectificationDepartment_dictText(departMap.get(content.getRectificationDepartment()).get(0).getDepartName());
}
}
}
stringObjectMap.put("checkList", list);
// 设置企标独有的标准适用范围
// 查询标准拆分表
LambdaQueryWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaQueryWrapper<>();
// 标准id
queryWrapper.eq(SarFileSplitInfoEO::getStandardId, id);
// 拆分表发布标识
queryWrapper.isNotNull(SarFileSplitInfoEO::getPublishBeforeId);
// 文件字段标识
queryWrapper.eq(SarFileSplitInfoEO::getFileType, FieldCommon.FILE_PUBLISH_OF_ORIGINAL);
List<SarFileSplitInfoEO> sarFileSplitInfoEOList = sarFileSplitInfoService.list(queryWrapper);
if (!sarFileSplitInfoEOList.isEmpty()) {
// 按照创建时间倒序排序
sarFileSplitInfoEOList.sort(Comparator.comparing(SarFileSplitInfoEO::getCreateTime).reversed());
List<Map<String, Object>> maps =
documentSplitMapper.queryLawsDocumentSplitByInfoId(sarFileSplitInfoEOList.get(0).getId());
// 获取item_num等于1的Map
maps.stream().filter(m -> m.get("item_num").equals("1"))
.findFirst()
.ifPresent(map -> stringObjectMap.put("standard_scope", map.get("item_content")));
}
// // 企标独有的稽查内容列表
// LambdaQueryWrapper<EnterpriseStandardInspectContent> esIcWrapper = new LambdaQueryWrapper<>();
// esIcWrapper.eq(EnterpriseStandardInspectContent::getStandardId, id);
// List<EnterpriseStandardInspectContent> list = esInspectContentService.list(esIcWrapper);
// List<String> departIdList = list.stream().map(EnterpriseStandardInspectContent::getRectificationDepartment)
// .collect(Collectors.toList());
// if (departIdList.size() != 0) {
// LambdaQueryWrapper<SysDepart> sysDepartLambdaQueryWrapper = new LambdaQueryWrapper<>();
// sysDepartLambdaQueryWrapper.in(SysDepart::getId, departIdList);
// List<SysDepart> departList = sysDepartService.list(sysDepartLambdaQueryWrapper);
// Map<String, List<SysDepart>> departMap = departList.stream().collect(Collectors.groupingBy(SysDepart::getId));
// for (EnterpriseStandardInspectContent content : list) {
// if (content.getRectificationDepartment() != null) {
// content.setRectificationDepartment_dictText(departMap.get(content.getRectificationDepartment()).get(0).getDepartName());
// }
// }
// }
// stringObjectMap.put("checkList", list);
// // 设置企标独有的标准适用范围
// // 查询标准拆分表
// LambdaQueryWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaQueryWrapper<>();
// // 标准id
// queryWrapper.eq(SarFileSplitInfoEO::getStandardId, id);
// // 拆分表发布标识
// queryWrapper.isNotNull(SarFileSplitInfoEO::getPublishBeforeId);
// // 文件字段标识
// queryWrapper.eq(SarFileSplitInfoEO::getFileType, FieldCommon.FILE_PUBLISH_OF_ORIGINAL);
// List<SarFileSplitInfoEO> sarFileSplitInfoEOList = sarFileSplitInfoService.list(queryWrapper);
// if (!sarFileSplitInfoEOList.isEmpty()) {
// // 按照创建时间倒序排序
// sarFileSplitInfoEOList.sort(Comparator.comparing(SarFileSplitInfoEO::getCreateTime).reversed());
// List<Map<String, Object>> maps =
// documentSplitMapper.queryLawsDocumentSplitByInfoId(sarFileSplitInfoEOList.get(0).getId());
// // 获取item_num等于1的Map
// maps.stream().filter(m -> m.get("item_num").equals("1"))
// .findFirst()
// .ifPresent(map -> stringObjectMap.put("standard_scope", map.get("item_content")));
// }
}
// 标准拆分标识
splitFlag(stringObjectMap);
@@ -149,7 +149,11 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
@Override
public void detailFlagSet(List<Map<String, Object>> records) {
records.forEach(kv -> kv.put(FieldCommon.DETAIL_FLAG, false));
if (true) {
records.forEach(kv -> kv.put(FieldCommon.DETAIL_FLAG, true));
return;
}
SysUser currentUser = sysUserService.getById(UserUtils.getUserId());
String userId = currentUser.getId();
String userName = currentUser.getUsername();
@@ -330,6 +334,10 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
@Override
public void editFlagSet(List<Map<String, Object>> records) {
if (true) {
records.forEach(kv -> kv.put(FieldCommon.EDIT_FLAG, true));
return;
}
// 只有创建人和管理员才有维护的权限
String userId = UserUtils.getUserId();
SysUser currentUser = sysUserService.getById(userId);
@@ -425,6 +433,10 @@ public class EnterpriseStandardAuthUserServiceImpl extends ServiceImpl<Enterpris
@Override
public void delFlagSet(List<Map<String, Object>> records) {
if (true) {
records.forEach(kv -> kv.put(FieldCommon.DEL_FLAG, true));
return;
}
String userId = UserUtils.getUserId();
SysUser currentUser = sysUserService.getById(userId);
List<String> standardIds = new ArrayList<>();
@@ -102,12 +102,6 @@ public class LawsEnterpriseStandard implements Serializable {
@ApiModelProperty(value = "年代号")
private String yearNumber;
/**
* 企标类型
*/
@ApiModelProperty(value = "企标类型")
private String standardCategory;
/**
* 企标英文名称
*/
@@ -203,12 +197,6 @@ public class LawsEnterpriseStandard implements Serializable {
@ApiModelProperty(value = "被引用标准")
private String referencedStandard;
/**
* 配合单位
*/
@ApiModelProperty(value = "配合单位")
private String cooperationUnit;
/**
* 标准推进人
*/