Commit 67741dc8 by “zcwang”

modify: 导出发起人改为和详情一致

parent e0ba949c
Pipeline #44728 passed with stages
in 2 minutes 11 seconds
...@@ -126,13 +126,21 @@ public class ChangeFlowExportCallback implements DesCallbackService { ...@@ -126,13 +126,21 @@ public class ChangeFlowExportCallback implements DesCallbackService {
if (CollectionUtils.isEmpty(changeRecords)) { if (CollectionUtils.isEmpty(changeRecords)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
// 过滤不为供应商的创建人 // 过滤不为供应商的创建人
List<String> creatorList = changeRecords.stream() List<String> creatorList = changeRecords.stream()
.filter(c -> !CreateSourceEnum.TONG_ZHOU.getType().equals(c.getCreateSource())) .filter(c -> !CreateSourceEnum.TONG_ZHOU.getType().equals(c.getCreateSource()))
.map(ChangeRecord::getCreator).collect(Collectors.toList()); .map(ChangeRecord::getCreator).collect(Collectors.toList());
HashMap<String, List<SecondaryDepartments>> orgMap = null; List<String> allQueryDepartmentList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(creatorList)) { if (CollectionUtils.isNotEmpty(creatorList)) {
allQueryDepartmentList.addAll(creatorList);
}
List<String> changeCommanderList = changeRecords.stream().map(ChangeRecord::getChangeCommander).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(changeCommanderList)) {
allQueryDepartmentList.addAll(changeCommanderList);
}
HashMap<String, List<SecondaryDepartments>> orgMap = null;
if (CollectionUtils.isNotEmpty(allQueryDepartmentList)) {
// 查询创建人部门名 // 查询创建人部门名
IusDepartmentReq iusDepartmentReq = new IusDepartmentReq(); IusDepartmentReq iusDepartmentReq = new IusDepartmentReq();
iusDepartmentReq.setUids(new ArrayList<>(creatorList)); iusDepartmentReq.setUids(new ArrayList<>(creatorList));
...@@ -362,7 +370,6 @@ public class ChangeFlowExportCallback implements DesCallbackService { ...@@ -362,7 +370,6 @@ public class ChangeFlowExportCallback implements DesCallbackService {
changeFlowExcelDTO.setChangeCreator(record.getCreateSupplier()); changeFlowExcelDTO.setChangeCreator(record.getCreateSupplier());
} else { } else {
List<SecondaryDepartments> creator = orgMap.get(record.getCreator()); List<SecondaryDepartments> creator = orgMap.get(record.getCreator());
// 供应商查询不到数据,不会覆盖,展示供应商id
if (!CollectionUtils.isEmpty(creator)) { if (!CollectionUtils.isEmpty(creator)) {
Optional<SecondaryDepartments> anyOrg = creator.stream().filter(o -> o.getOrgPosLevel() == 97).findAny(); Optional<SecondaryDepartments> anyOrg = creator.stream().filter(o -> o.getOrgPosLevel() == 97).findAny();
String orgName = "无三级部门"; String orgName = "无三级部门";
...@@ -378,7 +385,15 @@ public class ChangeFlowExportCallback implements DesCallbackService { ...@@ -378,7 +385,15 @@ public class ChangeFlowExportCallback implements DesCallbackService {
changeFlowExcelDTO.setChangeType(parentChangeType.getTypeName() + ">" + sonChangeType.getTypeName()); changeFlowExcelDTO.setChangeType(parentChangeType.getTypeName() + ">" + sonChangeType.getTypeName());
changeFlowExcelDTO.setChangeLevel(ChangeLevelEnum.getByType(record.getChangeLevel())); changeFlowExcelDTO.setChangeLevel(ChangeLevelEnum.getByType(record.getChangeLevel()));
changeFlowExcelDTO.setChangeDepartment(record.getChangeDepartment()); changeFlowExcelDTO.setChangeDepartment(record.getChangeDepartment());
changeFlowExcelDTO.setChangeCommander(record.getChangeCommander()); List<SecondaryDepartments> commander = orgMap.get(record.getChangeCommander());
if (!CollectionUtils.isEmpty(commander)) {
Optional<SecondaryDepartments> anyOrg = commander.stream().filter(o -> o.getOrgPosLevel() == 97).findAny();
String orgName = "无三级部门";
if (anyOrg.isPresent()) {
orgName = anyOrg.get().getOrgPosName();
}
changeFlowExcelDTO.setChangeCommander(commander.get(0).getUserName() + "(" + orgName + ")");
}
changeFlowExcelDTO.setChangeReason(record.getChangeReason()); changeFlowExcelDTO.setChangeReason(record.getChangeReason());
changeFlowExcelDTO.setChangeContent(record.getChangeContent()); changeFlowExcelDTO.setChangeContent(record.getChangeContent());
changeFlowExcelDTO.setChangeRiskDesc(record.getChangeRiskDesc()); changeFlowExcelDTO.setChangeRiskDesc(record.getChangeRiskDesc());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment