|
@@ -1,14 +1,10 @@
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
|
|
|
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.ApplyInfo;
|
|
|
|
-import com.dragoninfo.dcuc.app.entity.ServiceResource;
|
|
|
|
-import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
|
|
|
|
-import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
|
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
|
|
import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
|
|
import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
|
|
import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
|
|
-import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
|
|
|
|
|
|
+import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFlowFacade;
|
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.AuthFlowRepeatCheckVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ResourceAuthInfoVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ResourceAuthInfoVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ServiceAuthFlowAcceptVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ServiceAuthFlowAcceptVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.WorkFlowResutlAcceptVo;
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.WorkFlowResutlAcceptVo;
|
|
@@ -32,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author mazq
|
|
* @author mazq
|
|
@@ -43,7 +40,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
public class WorkFlowApiController {
|
|
public class WorkFlowApiController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private IServiceAuthFacade serviceAuthFacade;
|
|
|
|
|
|
+ private IServiceAuthFlowFacade serviceAuthFlowFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 服务授权工作单保存
|
|
* 服务授权工作单保存
|
|
@@ -56,20 +53,44 @@ public class WorkFlowApiController {
|
|
String idcard = request.getHeader(Constants.IDCARD);
|
|
String idcard = request.getHeader(Constants.IDCARD);
|
|
String tonken = request.getHeader(Constants.DCUC_USER_TOKEN);
|
|
String tonken = request.getHeader(Constants.DCUC_USER_TOKEN);
|
|
String user = StringUtils.isNotBlank(idcard) ? idcard : tonken;
|
|
String user = StringUtils.isNotBlank(idcard) ? idcard : tonken;
|
|
-
|
|
|
|
ServiceAuthFlowDTO dto = new ServiceAuthFlowDTO();
|
|
ServiceAuthFlowDTO dto = new ServiceAuthFlowDTO();
|
|
setAppServiceInfo(dto, serviceAuthFlowVo);
|
|
setAppServiceInfo(dto, serviceAuthFlowVo);
|
|
BeanUtils.copyProperties(serviceAuthFlowVo, dto, "serviceCodes", "serviceNames");
|
|
BeanUtils.copyProperties(serviceAuthFlowVo, dto, "serviceCodes", "serviceNames");
|
|
dto.setUser(user);
|
|
dto.setUser(user);
|
|
- ResponseDTO responseDTO = serviceAuthFacade.serviceAuthFlowSave(dto);
|
|
|
|
|
|
+ ResponseDTO responseDTO = serviceAuthFlowFacade.serviceAuthFlowSave(dto);
|
|
String statusCode = responseDTO.getStatusCode();
|
|
String statusCode = responseDTO.getStatusCode();
|
|
if (ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
|
|
if (ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
|
|
return ApiResult.setSuccess();
|
|
return ApiResult.setSuccess();
|
|
} else {
|
|
} else {
|
|
- return ApiResult.setFailMessage(responseDTO.getMessage());
|
|
|
|
|
|
+ ApiResult apiResult = ApiResult.setFailMessage(responseDTO.getMessage());
|
|
|
|
+ apiResult.setResult(responseDTO.getResult());
|
|
|
|
+ return apiResult;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 服务授权申请是否存在重复申请
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "服务授权申请是否存在重复申请")
|
|
|
|
+ @ApiImplicitParams({@ApiImplicitParam(name = "authFlowRepeatCheckVo", value = "服务授权重复校验Vo")})
|
|
|
|
+ @PostMapping("auth-repeat-check")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public ApiResult authFlowRepeatCheck(@RequestBody AuthFlowRepeatCheckVo authFlowRepeatCheckVo){
|
|
|
|
+ String appCode = authFlowRepeatCheckVo.getAppCode();
|
|
|
|
+ List<String> serviceCodes = authFlowRepeatCheckVo.getServiceCodes();
|
|
|
|
+ ResponseDTO responseDTO = serviceAuthFlowFacade.authFlowRepeatCheck(appCode,serviceCodes);
|
|
|
|
+ String statusCode = responseDTO.getStatusCode();
|
|
|
|
+ if (ResponseStatus.SUCCESS_CODE.equals(statusCode)) {
|
|
|
|
+ return ApiResult.setSuccess();
|
|
|
|
+ } else {
|
|
|
|
+ ApiResult apiResult = ApiResult.setFailMessage(responseDTO.getMessage());
|
|
|
|
+ apiResult.setResult(responseDTO.getResult());
|
|
|
|
+ return apiResult;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 服务授权工作单审批结果处理
|
|
* 服务授权工作单审批结果处理
|
|
* 提供接口
|
|
* 提供接口
|
|
@@ -86,7 +107,7 @@ public class WorkFlowApiController {
|
|
dto.setProcessInstanceId(flowResutlVo.getProcessInstanceId());
|
|
dto.setProcessInstanceId(flowResutlVo.getProcessInstanceId());
|
|
dto.setRemark(flowResutlVo.getDesc());
|
|
dto.setRemark(flowResutlVo.getDesc());
|
|
dto.setMessageId(flowResutlVo.getMessageId());
|
|
dto.setMessageId(flowResutlVo.getMessageId());
|
|
- serviceAuthFacade.dealAuthFlowResult(dto);
|
|
|
|
|
|
+ serviceAuthFlowFacade.dealAuthFlowResult(dto);
|
|
return ApiResult.setSuccess();
|
|
return ApiResult.setSuccess();
|
|
}
|
|
}
|
|
|
|
|