|
@@ -57,7 +57,7 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
|
|
searchable.addSearchFilter("app_id", SearchOperator.eq, appId);
|
|
searchable.addSearchFilter("app_id", SearchOperator.eq, appId);
|
|
List<AppFunAuthResult> exist = getResultList(searchable);
|
|
List<AppFunAuthResult> exist = getResultList(searchable);
|
|
Map<String, AppFunAuthResult> resultMap = exist.stream()
|
|
Map<String, AppFunAuthResult> resultMap = exist.stream()
|
|
- .collect(Collectors.toMap(AppFunAuthResult::getFunCode, item -> item, (old, last) -> last));
|
|
|
|
|
|
+ .collect(Collectors.toMap(AppFunAuthResult::getFunId, item -> item, (old, last) -> last));
|
|
addAuthApply(flow, applyInfo, resultMap);
|
|
addAuthApply(flow, applyInfo, resultMap);
|
|
delAuthExist(applyInfo,resultMap);
|
|
delAuthExist(applyInfo,resultMap);
|
|
}
|
|
}
|
|
@@ -65,12 +65,12 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
|
|
}
|
|
}
|
|
|
|
|
|
private void delAuthExist(AppFunApplyContent applyInfo, Map<String, AppFunAuthResult> resultMap) {
|
|
private void delAuthExist(AppFunApplyContent applyInfo, Map<String, AppFunAuthResult> resultMap) {
|
|
- String funCodes = applyInfo.getFunCodes();
|
|
|
|
- List<String> applyFunCodes = Arrays.asList(funCodes.split(","));
|
|
|
|
- Set<String> existFunCodes = resultMap.keySet();
|
|
|
|
- for (String existFunCode : existFunCodes) {
|
|
|
|
- if(!applyFunCodes.contains(existFunCode)) {
|
|
|
|
- AppFunAuthResult authResult = resultMap.get(existFunCode);
|
|
|
|
|
|
+ String funCodes = applyInfo.getFunIds();
|
|
|
|
+ List<String> applyFunIds = Arrays.asList(funCodes.split(","));
|
|
|
|
+ Set<String> existFunIds = resultMap.keySet();
|
|
|
|
+ for (String existFunId : existFunIds) {
|
|
|
|
+ if(!applyFunIds.contains(existFunId)) {
|
|
|
|
+ AppFunAuthResult authResult = resultMap.get(existFunId);
|
|
authResultRepository.delete(authResult);
|
|
authResultRepository.delete(authResult);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -78,7 +78,7 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
|
|
}
|
|
}
|
|
|
|
|
|
private void addAuthApply(WorkFlow flow, AppFunApplyContent applyInfo, Map<String, AppFunAuthResult> resultMap) {
|
|
private void addAuthApply(WorkFlow flow, AppFunApplyContent applyInfo, Map<String, AppFunAuthResult> resultMap) {
|
|
- Set<String> existFunCodes = resultMap.keySet();
|
|
|
|
|
|
+ Set<String> existFunIds = resultMap.keySet();
|
|
String userId = applyInfo.getUserId();
|
|
String userId = applyInfo.getUserId();
|
|
String appId = applyInfo.getAppId();
|
|
String appId = applyInfo.getAppId();
|
|
Date startTime = null;
|
|
Date startTime = null;
|
|
@@ -97,23 +97,28 @@ public class AppFunAuthResultServiceImpl implements IAppFunAuthResultService {
|
|
authStatus = AuthStatusEnum.OVER_DUE.getValue();
|
|
authStatus = AuthStatusEnum.OVER_DUE.getValue();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ String funIds = applyInfo.getFunIds();
|
|
String funCodes = applyInfo.getFunCodes();
|
|
String funCodes = applyInfo.getFunCodes();
|
|
- String[] applyFunCodes = funCodes.split(",");
|
|
|
|
- for (String funCode : applyFunCodes) {
|
|
|
|
- if(!existFunCodes.contains(funCode)) {
|
|
|
|
|
|
+ String[] funCodeArr = funCodes.split(",");
|
|
|
|
+ String[] funIdsArr = funIds.split(",");
|
|
|
|
+ for (int i = 0; i < funIdsArr.length; i++) {
|
|
|
|
+ String funId = funIdsArr[i];
|
|
|
|
+ String funCode = funCodeArr[i];
|
|
|
|
+ if(!existFunIds.contains(funId)) {
|
|
AppFunAuthResult authResult = new AppFunAuthResult();
|
|
AppFunAuthResult authResult = new AppFunAuthResult();
|
|
authResult.setAppId(appId);
|
|
authResult.setAppId(appId);
|
|
authResult.setAppCode(applyInfo.getAppCode());
|
|
authResult.setAppCode(applyInfo.getAppCode());
|
|
authResult.setAuthSource(flow.getApplySource());
|
|
authResult.setAuthSource(flow.getApplySource());
|
|
authResult.setSourceId(flow.getMessageId());
|
|
authResult.setSourceId(flow.getMessageId());
|
|
authResult.setUserId(userId);
|
|
authResult.setUserId(userId);
|
|
|
|
+ authResult.setFunId(funId);
|
|
authResult.setFunCode(funCode);
|
|
authResult.setFunCode(funCode);
|
|
authResult.setAuthStatus(authStatus);
|
|
authResult.setAuthStatus(authStatus);
|
|
authResult.setStartTime(startTime);
|
|
authResult.setStartTime(startTime);
|
|
authResult.setEndTime(endTime);
|
|
authResult.setEndTime(endTime);
|
|
save(authResult);
|
|
save(authResult);
|
|
} else {
|
|
} else {
|
|
- AppFunAuthResult authResult = resultMap.get(funCode);
|
|
|
|
|
|
+ AppFunAuthResult authResult = resultMap.get(funId);
|
|
authResult.setAuthSource(flow.getApplySource());
|
|
authResult.setAuthSource(flow.getApplySource());
|
|
authResult.setSourceId(flow.getMessageId());
|
|
authResult.setSourceId(flow.getMessageId());
|
|
authResult.setAuthStatus(authStatus);
|
|
authResult.setAuthStatus(authStatus);
|