Commit 9dcf0504 authored by 李秀明's avatar 李秀明

fix(巡检): 任务下发增加superviseOrgCode、superviseOrgName字段

parent f9939d7d
...@@ -168,7 +168,7 @@ public class PlanController extends AbstractBaseController { ...@@ -168,7 +168,7 @@ public class PlanController extends AbstractBaseController {
List<UserDetailsDto> resultList = response.getResult(); List<UserDetailsDto> resultList = response.getResult();
for (UserDetailsDto udd : resultList) { for (UserDetailsDto udd : resultList) {
userIdSB.append(",").append(udd.getUserId()); userIdSB.append(",").append(udd.getUserId());
userDeptSB.append(",").append(udd.getUserId()).append("@").append(udd.getUnitCode()); userDeptSB.append(",").append(udd.getUserId()).append("@").append(udd.getSuperviseOrgCode()).append("@").append(udd.getSuperviseOrgName());
userNameSB.append(",").append(udd.getUserName()); userNameSB.append(",").append(udd.getUserName());
} }
} }
......
...@@ -25,10 +25,18 @@ public class UserDetailsDto { ...@@ -25,10 +25,18 @@ public class UserDetailsDto {
*/ */
private String unitName; private String unitName;
/** /**
* 企业名称 * 企业Code
*/ */
private String unitCode; private String unitCode;
/** /**
* 组织名称
*/
private String superviseOrgName;
/**
* 组织Code
*/
private String superviseOrgCode;
/**
* 用户id * 用户id
*/ */
private String userId; private String userId;
......
...@@ -520,7 +520,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String, ...@@ -520,7 +520,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
if (!CollectionUtils.isEmpty(userDetailsDtoList)) { if (!CollectionUtils.isEmpty(userDetailsDtoList)) {
Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream(). Map<String, List<UserDetailsDto>> userDetailsDtoMap = userDetailsDtoList.stream().
filter(obj -> obj.getEquipCategoryCode().contains(deviceType) && obj.getUnitTypeCode().contains(unitType)) filter(obj -> obj.getEquipCategoryCode().contains(deviceType) && obj.getUnitTypeCode().contains(unitType))
.collect(Collectors.groupingBy(UserDetailsDto::getUnitCode)); .collect(Collectors.groupingBy(UserDetailsDto::getSuperviseOrgCode));
for (HashMap<String, Object> stringObjectHashMap : timeList) { for (HashMap<String, Object> stringObjectHashMap : timeList) {
HashMap<String, Object> tempMap = new HashMap<>(); HashMap<String, Object> tempMap = new HashMap<>();
Object strBeginTime = stringObjectHashMap.get("BEGIN_TIME"); Object strBeginTime = stringObjectHashMap.get("BEGIN_TIME");
...@@ -531,19 +531,18 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String, ...@@ -531,19 +531,18 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
tempMap.put("NEXT_GEN_DATE", nextGenDate); tempMap.put("NEXT_GEN_DATE", nextGenDate);
List<HashMap<String, Object>> finalWholeList = wholeList; List<HashMap<String, Object>> finalWholeList = wholeList;
userDetailsDtoMap.forEach((unitCode, userDetailsDto) -> { userDetailsDtoMap.forEach((superviseOrgCode, userDetailsDto) -> {
if (!plan.getIsSingleExecution()) { if (!plan.getIsSingleExecution()) {
HashMap<String, Object> temp; HashMap<String, Object> temp;
temp = (HashMap<String, Object>) tempMap.clone(); temp = (HashMap<String, Object>) tempMap.clone();
String userIds = userDetailsDto.stream().map(UserDetailsDto::getUserId).filter(Objects::nonNull).collect(Collectors.joining(",")); String userIds = userDetailsDto.stream().map(UserDetailsDto::getUserId).filter(Objects::nonNull).collect(Collectors.joining(","));
String userNames = userDetailsDto.stream().map(UserDetailsDto::getUserName).filter(Objects::nonNull).collect(Collectors.joining(",")); String userNames = userDetailsDto.stream().map(UserDetailsDto::getUserName).filter(Objects::nonNull).collect(Collectors.joining(","));
String userDept = userDetailsDto.stream().map(a->{ String userDept = userDetailsDto.stream().map(dto-> dto.getUserId() + "@" + superviseOrgCode + "@" + dto.getSuperviseOrgName()).collect(Collectors.joining(","));
return a.getUserId() + "@" + unitCode; String orgCodes = userDetailsDto.stream().map(UserDetailsDto::getSuperviseOrgCode).filter(Objects::nonNull).collect(Collectors.joining(","));
}).collect(Collectors.joining(","));
temp.put("USER_ID", userIds); temp.put("USER_ID", userIds);
temp.put("USER_NAME", userNames); temp.put("USER_NAME", userNames);
temp.put("ORG_CODE", unitCode); temp.put("ORG_CODE", orgCodes);
temp.put("USER_DEPT", userDept); temp.put("USER_DEPT", userDept);
finalWholeList.add(temp); finalWholeList.add(temp);
} else { } else {
...@@ -552,7 +551,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String, ...@@ -552,7 +551,7 @@ public static List<HashMap<String, Object>> genWholeExeData(List<HashMap<String,
temp = (HashMap<String, Object>) tempMap.clone(); temp = (HashMap<String, Object>) tempMap.clone();
temp.put("USER_ID", dto.getUserId()); temp.put("USER_ID", dto.getUserId());
temp.put("USER_NAME", dto.getUserName()); temp.put("USER_NAME", dto.getUserName());
temp.put("ORG_CODE", dto.getUserId() + "@" + unitCode); temp.put("ORG_CODE", dto.getUserId() + "@" + superviseOrgCode + "@" + dto.getSuperviseOrgName());
finalWholeList.add(temp); finalWholeList.add(temp);
}); });
} }
......
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