|
@@ -12,6 +12,7 @@ import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthFlow;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.entity.ServiceAuthResult;
|
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.WokrFlowPermissionTypeEnum;
|
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
|
|
|
import com.dragoninfo.dcuc.auth.auth.service.IAuthFlowService;
|
|
@@ -110,9 +111,9 @@ public class ServiceAuthBusinessImpl implements IServiceAuthBusiness {
|
|
|
}
|
|
|
}
|
|
|
//校验服务授权是否存在重复申请
|
|
|
- List<String> exitstServiceCodes = authFlowService.authFlowRepeatCheck(dto.getAppCode(), Arrays.asList(serviceCodArray));
|
|
|
- if(!CollectionUtils.isEmpty(exitstServiceCodes)) {
|
|
|
- return ResponseDTO.fail(ResponseStatus.FAIL_CODE, String.format("服务授权申请中,服务code: %s ", exitstServiceCodes), exitstServiceCodes);
|
|
|
+ ResponseDTO checkRepeat = authFlowRepeatCheck(dto.getAppCode(), Arrays.asList(serviceCodArray));
|
|
|
+ if(!ResponseStatus.SUCCESS_CODE.equals(checkRepeat.getStatusCode())){
|
|
|
+ return checkRepeat;
|
|
|
}
|
|
|
String flowStatus = WorkFlowStatusEnum.APPLYING.getValue();
|
|
|
//生成消息id
|
|
@@ -155,6 +156,23 @@ public class ServiceAuthBusinessImpl implements IServiceAuthBusiness {
|
|
|
return responseDTO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ResponseDTO authFlowRepeatCheck(String appCode, List<String> serviceCodes) {
|
|
|
+ List<String> list = authFlowService.authFlowApplyRepeatCheck(appCode, serviceCodes);
|
|
|
+ if(!CollectionUtils.isEmpty(list)) {
|
|
|
+ return ResponseDTO.fail(ResponseStatus.FAIL_CODE, String.format("服务授权申请中,申请中的服务代码:%s ", list), list);
|
|
|
+ }
|
|
|
+ List<ServiceAuthResult> authResults = authResultService.getByAppCode(appCode);
|
|
|
+ List<String> exist = authResults.stream()
|
|
|
+ .map(item -> item.getServiceCode())
|
|
|
+ .filter(item -> serviceCodes.contains(item))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if(!CollectionUtils.isEmpty(list)) {
|
|
|
+ return ResponseDTO.fail(ResponseStatus.FAIL_CODE, String.format("服务授权已存在,存在的服务代码:%s ", exist), exist);
|
|
|
+ }
|
|
|
+ return ResponseDTO.success(ResponseStatus.SUCCESS_CODE,null);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 将服务授权工作单推送给审批服务
|
|
|
*
|