|
@@ -547,37 +547,35 @@ public class AuthApplyBusiness implements IAuthApplyBusiness
|
|
ResourceInfoDTO resourceInfoDTO = new ResourceInfoDTO();
|
|
ResourceInfoDTO resourceInfoDTO = new ResourceInfoDTO();
|
|
resourceInfoDTO.setVisitorName(applicantName);
|
|
resourceInfoDTO.setVisitorName(applicantName);
|
|
resourceInfoDTO.setVisitorCode(applicantIdcard);
|
|
resourceInfoDTO.setVisitorCode(applicantIdcard);
|
|
- //funCodes拼接appCode
|
|
|
|
- List<String> nameList = new ArrayList<>();
|
|
|
|
- List<String> codeList = new ArrayList<>();
|
|
|
|
|
|
+ //拼接funCodes和appCode成json数组
|
|
Map<String, List<AppFunApplyContent>> collect = contentList
|
|
Map<String, List<AppFunApplyContent>> collect = contentList
|
|
.stream()
|
|
.stream()
|
|
.collect(Collectors.groupingBy(AppFunApplyContent::getAppId));
|
|
.collect(Collectors.groupingBy(AppFunApplyContent::getAppId));
|
|
|
|
+ JSONArray codeArray = new JSONArray();
|
|
|
|
+ JSONArray nameArray = new JSONArray();
|
|
for (Map.Entry<String, List<AppFunApplyContent>> entry : collect.entrySet()) {
|
|
for (Map.Entry<String, List<AppFunApplyContent>> entry : collect.entrySet()) {
|
|
- String appCode = entry.getKey();
|
|
|
|
- List<AppFunApplyContent> list = entry.getValue();
|
|
|
|
- String funCodes = list
|
|
|
|
|
|
+ List<AppFunApplyContent> value = entry.getValue();
|
|
|
|
+ AppFunApplyContent applyContent = value.get(0);
|
|
|
|
+ JSONObject codeJson = new JSONObject();
|
|
|
|
+ codeJson.put("appCode", applyContent.getAppCode());
|
|
|
|
+ List<String> functionCodesList = value
|
|
.stream()
|
|
.stream()
|
|
.map(AppFunApplyContent::getFunCode)
|
|
.map(AppFunApplyContent::getFunCode)
|
|
- .collect(Collectors.joining(StrUtil.SLASH));
|
|
|
|
- String codeJoin = Joiner
|
|
|
|
- .on(StrUtil.COLON)
|
|
|
|
- .join(appCode, funCodes);
|
|
|
|
- codeList.add(codeJoin);
|
|
|
|
-
|
|
|
|
- String funNames = list
|
|
|
|
- .stream()
|
|
|
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
|
+ codeJson.put("functionCode", functionCodesList);
|
|
|
|
+ codeArray.add(codeJson);
|
|
|
|
+
|
|
|
|
+ String appName = applyContent.getAppName();
|
|
|
|
+ JSONObject nameJson = new JSONObject();
|
|
|
|
+ nameJson.put("appName", appName);
|
|
|
|
+ List<String> functionNameList = value.stream()
|
|
.map(AppFunApplyContent::getFunName)
|
|
.map(AppFunApplyContent::getFunName)
|
|
- .collect(Collectors.joining(StrUtil.SLASH));
|
|
|
|
- AppFunApplyContent appFunApplyContent = list.get(0);
|
|
|
|
- String appName = appFunApplyContent.getAppName();
|
|
|
|
- String nameJoin = Joiner
|
|
|
|
- .on(StrUtil.COLON)
|
|
|
|
- .join(appName, funNames);
|
|
|
|
- nameList.add(nameJoin);
|
|
|
|
- }
|
|
|
|
- resourceInfoDTO.setVisitResourceCode(String.join(StrUtil.COMMA, codeList));
|
|
|
|
- resourceInfoDTO.setVisitResourceName(String.join(StrUtil.COMMA, nameList));
|
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ nameJson.put("functionName", functionNameList);
|
|
|
|
+ nameArray.add(nameJson);
|
|
|
|
+ }
|
|
|
|
+ resourceInfoDTO.setVisitResourceCode(codeArray.toJSONString());
|
|
|
|
+ resourceInfoDTO.setVisitResourceName(nameArray.toJSONString());
|
|
approvalWorkFlowDTO.setResourceInfo(resourceInfoDTO);
|
|
approvalWorkFlowDTO.setResourceInfo(resourceInfoDTO);
|
|
}
|
|
}
|
|
|
|
|