
43 changed files with 2734 additions and 30 deletions
@ -0,0 +1,53 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-base(安瑞基础信息模块) <br/> |
||||
|
* File: BaseFinBankDto.java <br/> |
||||
|
* Class: com.yxt.anrui.base.api.basefinbank.BaseFinBankDto <br/> |
||||
|
* Description: 资方信息表 数据传输对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-09-10 11:31:46 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "其他融备案 数据传输对象", description = "其他融备案 数据传输对象") |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyApplyDto implements Dto { |
||||
|
private String sid; |
||||
|
private String userSid; |
||||
|
@ApiModelProperty("申请分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人sid") |
||||
|
private String applicantSid; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("申请日期") |
||||
|
private Date applyDate; |
||||
|
@ApiModelProperty("申请金融产品政策sid") |
||||
|
private List<String> policySids = new ArrayList<>(); |
||||
|
@ApiModelProperty("附件路径") |
||||
|
private List<String> annexPaths = new ArrayList<>(); |
||||
|
@ApiModelProperty("创建组织sid") |
||||
|
private String createOrgSid; |
||||
|
@ApiModelProperty("创建组织名") |
||||
|
private String createOrgName; |
||||
|
@ApiModelProperty("使用组织全路径") |
||||
|
private String orgSidPath; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/7/6 15:49 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyApplyInitListVo implements Vo { |
||||
|
|
||||
|
@ApiModelProperty("政策sid") |
||||
|
private String otherPolicySid; |
||||
|
@ApiModelProperty("政策名称") |
||||
|
private String otherPolicyName; |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private String busTypeValue; |
||||
|
@ApiModelProperty("车辆大类") |
||||
|
private String vehCategoryValue; |
||||
|
@ApiModelProperty("车辆功能") |
||||
|
private String vehTypeValue; |
||||
|
@ApiModelProperty("最高融资额") |
||||
|
private String maxLoanAmount; |
||||
|
@ApiModelProperty("期数") |
||||
|
private int period; |
||||
|
@ApiModelProperty("标准年利率(%)") |
||||
|
private String yearRatio; |
||||
|
@ApiModelProperty("有效期至") |
||||
|
private String validDateTo; |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/7/6 15:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyApplyInitVo implements Vo { |
||||
|
private String sid; |
||||
|
private String userSid; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
@ApiModelProperty("申请分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("申请日期") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
private Date applyDate; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("实例id") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty("申请金融产品政策sid") |
||||
|
private List<String> policySids = new ArrayList<>(); |
||||
|
@ApiModelProperty("附件路径") |
||||
|
private List<String> annexPaths = new ArrayList<>(); |
||||
|
@ApiModelProperty("使用组织全路径") |
||||
|
private String orgSidPath; |
||||
|
private List<LoanFinOtherPolicyApplyInitListVo> policyList = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-base(安瑞基础信息模块) <br/> |
||||
|
* File: BaseFinBankQuery.java <br/> |
||||
|
* Class: com.yxt.anrui.base.api.basefinbank.BaseFinBankQuery <br/> |
||||
|
* Description: 资方信息表 查询条件. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-09-10 11:31:46 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "资方信息表 查询条件", description = "资方信息表 查询条件") |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyApplyQuery implements Query { |
||||
|
|
||||
|
@ApiModelProperty("分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("创建组织sid") |
||||
|
private String createOrgSid; |
||||
|
@ApiModelProperty("开始日期") |
||||
|
private String createStartTime; |
||||
|
@ApiModelProperty("结束日期") |
||||
|
private String createEndTime; |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* Project: anrui-base(安瑞基础信息模块) <br/> |
||||
|
* File: BaseFinBankVo.java <br/> |
||||
|
* Class: com.yxt.anrui.base.api.basefinbank.BaseFinBankVo <br/> |
||||
|
* Description: 资方信息表 视图数据对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-09-10 11:31:46 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "金融产品政策报备 视图数据对象", description = "金融产品政策报备 视图数据对象") |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyApplyVo implements Vo { |
||||
|
private String sid; |
||||
|
@ApiModelProperty("申请分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("申请日期") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
private Date applyDate; |
||||
|
@ApiModelProperty("流程状态") |
||||
|
private String nodeState; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* File: BaseFinBank.java <br/> |
||||
|
* Class: com.yxt.anrui.base.api.basefinbank.BaseFinBank <br/> |
||||
|
* Description: 金融产品政策报备. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-09-10 11:31:46 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "金融产品政策报备", description = "金融产品政策报备") |
||||
|
@TableName("loan_fin_other_policy_record_apply") |
||||
|
@Data |
||||
|
public class LoanFinOtherPolicyRecordApply extends BaseEntity { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty("申请分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人sid") |
||||
|
private String applicantSid; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("申请日期") |
||||
|
private Date applyDate; |
||||
|
@ApiModelProperty("其他融产品政策sid") |
||||
|
private String otherPolicySid; |
||||
|
@ApiModelProperty("附件路径") |
||||
|
private String annexPath; |
||||
|
@ApiModelProperty("流程定义的id") |
||||
|
private String procDefId; |
||||
|
@ApiModelProperty("环节定义的sid") |
||||
|
private String nodeSid; |
||||
|
@ApiModelProperty("流程实例的id") |
||||
|
private String procInstId; |
||||
|
@ApiModelProperty("流程状态") |
||||
|
private String nodeState; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("创建组织sid") |
||||
|
private String createOrgSid; |
||||
|
@ApiModelProperty("创建组织名") |
||||
|
private String createOrgName; |
||||
|
@ApiModelProperty("使用组织全路径") |
||||
|
private String orgSidPath; |
||||
|
|
||||
|
} |
@ -0,0 +1,114 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.*; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* File: BaseFinBankFeign.java <br/> |
||||
|
* Class: com.yxt.anrui.base.api.basefinbank.BaseFinBankFeign <br/> |
||||
|
* Description: 金融产品政策报备. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2021-09-10 11:31:46 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@Api(tags = "其他融产品政策报备") |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-riskcenter-LoanFinOtherPolicyRecordApply", |
||||
|
name = "anrui-riskcenter", |
||||
|
path = "v1/loanfinotherpolicyrecordapply", |
||||
|
fallback = LoanFinOtherPolicyRecordApplyFeignFallback.class) |
||||
|
public interface LoanFinOtherPolicyRecordApplyFeign { |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* |
||||
|
* @param dto |
||||
|
*/ |
||||
|
@ApiOperation("新增修改") |
||||
|
@PostMapping("/saveOrUpdate") |
||||
|
public ResultBean save(@Valid @RequestBody LoanFinOtherPolicyApplyDto dto); |
||||
|
|
||||
|
/** |
||||
|
* 根据条件分页查询数据的列表(已测试) |
||||
|
* |
||||
|
* @param pq |
||||
|
*/ |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<LoanFinOtherPolicyApplyVo>> listPage(@RequestBody PagerQuery<LoanFinOtherPolicyApplyQuery> pq); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 金融产品政策报备初始化 |
||||
|
* |
||||
|
* @param dto |
||||
|
*/ |
||||
|
@ApiOperation("金融产品政策报备保存初始化") |
||||
|
@GetMapping("/policyRecordInit") |
||||
|
@ResponseBody |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> policyRecordInit(@RequestBody LoanFinOtherPolicyApplyDto dto); |
||||
|
|
||||
|
/** |
||||
|
* 金融产品政策报备初始化 |
||||
|
* |
||||
|
* @param sid |
||||
|
*/ |
||||
|
@ApiOperation("金融产品政策报备编辑初始化") |
||||
|
@GetMapping("/fetchDetailsBySid/{sid}") |
||||
|
@ResponseBody |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> fetchDetailsBySid(@PathVariable("sid") String sid); |
||||
|
|
||||
|
|
||||
|
/******************流程接口**************************************/ |
||||
|
@ApiOperation("金融政策产品备案提交") |
||||
|
@PostMapping("/submit") |
||||
|
public ResultBean submitRecordApplication(@RequestBody @Valid SubmitLoanOtherPolicyApplyDto dto); |
||||
|
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PostMapping("/complete") |
||||
|
public ResultBean complete(@Valid @RequestBody LoanOtherPolicyApplyCompleteDto dto); |
||||
|
|
||||
|
//分公司到风控中心同意
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PostMapping("/companyToDivisionOperate") |
||||
|
public ResultBean companyToDivisionOperate(@Valid @RequestBody LoanOtherPolicyApplyCompleteDto query); |
||||
|
|
||||
|
|
||||
|
@ApiOperation(value = "撤回流程") |
||||
|
@PostMapping(value = "/revokeProcess") |
||||
|
public ResultBean revokeProcess(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody LoanOtherPolicyApplyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation(value = "驳回任务") |
||||
|
@PostMapping(value = "/reject") |
||||
|
public ResultBean taskReject(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody LoanOtherPolicyApplyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation(value = "终止任务") |
||||
|
@PostMapping(value = "/breakProcess") |
||||
|
public ResultBean breakProcess(@RequestBody LoanOtherPolicyApplyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation(value = "流程历史流转记录") |
||||
|
@GetMapping(value = "/task/flowRecord/{procInsId}/{deployId}") |
||||
|
public ResultBean flowRecord(@ApiParam(value = "流程实例id") @PathVariable(value = "procInsId") String procInsId); |
||||
|
|
||||
|
@ApiOperation(value = "获取下一个环节") |
||||
|
@GetMapping(value = "/getNextNodesForSubmit") |
||||
|
ResultBean<List<GetNodeVo>> getNextNodesForSubmit(@Valid @RequestBody GetNodeQuery query); |
||||
|
|
||||
|
@ApiOperation(value = "获取上一个环节") |
||||
|
@GetMapping(value = "/getPreviousNodesForReject") |
||||
|
ResultBean<List<GetNodeVo>> getPreviousNodesForReject(@Valid @RequestBody GetNodeQuery query); |
||||
|
|
||||
|
} |
@ -0,0 +1,86 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
|
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.GetNodeQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.GetNodeVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.LoanOtherPolicyApplyCompleteDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.LoanOtherPolicyApplyTaskQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.SubmitLoanOtherPolicyApplyDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.*; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@Component |
||||
|
public class LoanFinOtherPolicyRecordApplyFeignFallback implements LoanFinOtherPolicyRecordApplyFeign { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public ResultBean save(LoanFinOtherPolicyApplyDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<PagerVo<LoanFinOtherPolicyApplyVo>> listPage(PagerQuery<LoanFinOtherPolicyApplyQuery> pq) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> policyRecordInit(LoanFinOtherPolicyApplyDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> fetchDetailsBySid(String sid) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean submitRecordApplication(SubmitLoanOtherPolicyApplyDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean complete(LoanOtherPolicyApplyCompleteDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean companyToDivisionOperate(LoanOtherPolicyApplyCompleteDto query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean revokeProcess(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean taskReject(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean breakProcess(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean flowRecord(String procInsId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 10:42 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GetNodeQuery implements Query { |
||||
|
private static final long serialVersionUID = -5674867230708197611L; |
||||
|
|
||||
|
@ApiModelProperty(value = "环节定义id") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
|
||||
|
@ApiModelProperty(value = "分支字段及业务字段") |
||||
|
private Map<String, Object> formVariables; |
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 11:09 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GetNodeVo implements Vo { |
||||
|
private static final long serialVersionUID = 8802774014747063504L; |
||||
|
@ApiModelProperty(value = "节点名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
private String id; |
||||
|
@ApiModelProperty(value = "审批组") |
||||
|
private List<String> candidateGroups; |
||||
|
@ApiModelProperty(value = "是否是最后环节") |
||||
|
private String endTask; |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 9:01 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanOtherPolicyApplyCompleteDto implements Dto { |
||||
|
private static final long serialVersionUID = 3240453987322803352L; |
||||
|
@ApiModelProperty(value = "用户sid") |
||||
|
@NotBlank(message = "参数错误:userSid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty(value = "用户全路径sid") |
||||
|
private String orgSidPath; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
@NotBlank(message = "参数错误:taskDefKey") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "任务id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
@NotBlank(message = "参数错误:instanceId") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
@NotBlank(message = "参数错误:comment") |
||||
|
private String comment; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "分支字段及业务字段") |
||||
|
private Map<String, Object> formVariables; |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 17:29 |
||||
|
* @Description 终止、撤回、驳回查询参数 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanOtherPolicyApplyTaskQuery implements Query { |
||||
|
private static final long serialVersionUID = -4006020771892400451L; |
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务Id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
/** |
||||
|
* 终止、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务意见") |
||||
|
private String comment; |
||||
|
/** |
||||
|
* 终止、撤回、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("用户Sid") |
||||
|
private String userSid; |
||||
|
/** |
||||
|
* 终止 |
||||
|
*/ |
||||
|
@ApiModelProperty("流程实例Id") |
||||
|
private String instanceId; |
||||
|
/*@ApiModelProperty("用户Id") |
||||
|
private String userId; |
||||
|
@ApiModelProperty("节点") |
||||
|
private String targetKey; |
||||
|
@ApiModelProperty("流程变量信息") |
||||
|
private Map<String, Object> values = new HashMap<>(); |
||||
|
@ApiModelProperty("审批人") |
||||
|
private String assignee; |
||||
|
@ApiModelProperty("候选人") |
||||
|
private List<String> candidateUsers = new ArrayList<>(); |
||||
|
@ApiModelProperty("审批组") |
||||
|
private List<String> candidateGroups = new ArrayList<>();*/ |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.LoanFinOtherPolicyApplyDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyApplyDto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/27 13:38 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SubmitLoanOtherPolicyApplyDto extends LoanFinOtherPolicyApplyDto { |
||||
|
private static final long serialVersionUID = 378585162071125756L; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 10:42 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GetNodeQuery implements Query { |
||||
|
private static final long serialVersionUID = -5674867230708197611L; |
||||
|
|
||||
|
@ApiModelProperty(value = "环节定义id") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
|
||||
|
@ApiModelProperty(value = "分支字段及业务字段") |
||||
|
private Map<String, Object> formVariables; |
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 11:09 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GetNodeVo implements Vo { |
||||
|
private static final long serialVersionUID = 8802774014747063504L; |
||||
|
@ApiModelProperty(value = "节点名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
private String id; |
||||
|
@ApiModelProperty(value = "审批组") |
||||
|
private List<String> candidateGroups; |
||||
|
@ApiModelProperty(value = "是否是最后环节") |
||||
|
private String endTask; |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 9:01 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanFinPolicyApplyCompleteDto implements Dto { |
||||
|
private static final long serialVersionUID = 3240453987322803352L; |
||||
|
@ApiModelProperty(value = "用户sid") |
||||
|
@NotBlank(message = "参数错误:userSid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty(value = "用户全路径sid") |
||||
|
private String orgSidPath; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
@NotBlank(message = "参数错误:taskDefKey") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "任务id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
@NotBlank(message = "参数错误:instanceId") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
@NotBlank(message = "参数错误:comment") |
||||
|
private String comment; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "分支字段及业务字段") |
||||
|
private Map<String, Object> formVariables; |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/28 17:29 |
||||
|
* @Description 终止、撤回、驳回查询参数 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class LoanFinPolicyApplyTaskQuery implements Query { |
||||
|
private static final long serialVersionUID = -4006020771892400451L; |
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务Id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
/** |
||||
|
* 终止、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务意见") |
||||
|
private String comment; |
||||
|
/** |
||||
|
* 终止、撤回、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("用户Sid") |
||||
|
private String userSid; |
||||
|
/** |
||||
|
* 终止 |
||||
|
*/ |
||||
|
@ApiModelProperty("流程实例Id") |
||||
|
private String instanceId; |
||||
|
/*@ApiModelProperty("用户Id") |
||||
|
private String userId; |
||||
|
@ApiModelProperty("节点") |
||||
|
private String targetKey; |
||||
|
@ApiModelProperty("流程变量信息") |
||||
|
private Map<String, Object> values = new HashMap<>(); |
||||
|
@ApiModelProperty("审批人") |
||||
|
private String assignee; |
||||
|
@ApiModelProperty("候选人") |
||||
|
private List<String> candidateUsers = new ArrayList<>(); |
||||
|
@ApiModelProperty("审批组") |
||||
|
private List<String> candidateGroups = new ArrayList<>();*/ |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyApplyDto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/6/27 13:38 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SubmitLoanFinPolicyApplyDto extends LoanFinPolicyApplyDto { |
||||
|
private static final long serialVersionUID = 378585162071125756L; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.riskcenter.biz.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.LoanFinOtherPolicyApplyVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.LoanFinOtherPolicyRecordApply; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyRecordApply; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: |
||||
|
* @date: 2023/7/6 |
||||
|
**/ |
||||
|
@Mapper |
||||
|
public interface LoanFinOtherPolicyRecordApplyMapper extends BaseMapper<LoanFinOtherPolicyRecordApply> { |
||||
|
IPage<LoanFinOtherPolicyApplyVo> selectPageVo(IPage<LoanFinOtherPolicyRecordApply> page, @Param(Constants.WRAPPER) QueryWrapper<LoanFinOtherPolicyRecordApply> qw); |
||||
|
|
||||
|
int updateFlowFiled(Map<String, Object> map); |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.anrui.riskcenter.biz.loanfinotherpolicyrecordapply.LoanFinOtherPolicyRecordApplyMapper"> |
||||
|
|
||||
|
<update id="updateFlowFiled"> |
||||
|
UPDATE loan_fin_policy_record_apply |
||||
|
SET nodeState=#{nodeState} |
||||
|
, nodeSid=#{taskDefKey} |
||||
|
<if test="procDefId != null and procDefId != ''"> |
||||
|
, procDefId=#{procDefId} |
||||
|
</if> |
||||
|
<if test="procInsId != null and procInsId != ''"> |
||||
|
, procInstId=#{procInsId} |
||||
|
</if> |
||||
|
<if test="taskId != null and taskId != ''"> |
||||
|
, taskId=#{taskId} |
||||
|
</if> |
||||
|
WHERE sid = #{sid} |
||||
|
</update> |
||||
|
<select id="selectPageVo" |
||||
|
resultType="com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.LoanFinOtherPolicyApplyVo"> |
||||
|
SELECT |
||||
|
sid, |
||||
|
applyCompany, |
||||
|
department, |
||||
|
applicant, |
||||
|
applyDate, |
||||
|
nodeState, |
||||
|
remarks |
||||
|
FROM loan_fin_other_policy_record_apply |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,114 @@ |
|||||
|
package com.yxt.anrui.riskcenter.biz.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
||||
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.*; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.GetNodeQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.GetNodeVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.LoanOtherPolicyApplyCompleteDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.LoanOtherPolicyApplyTaskQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.SubmitLoanOtherPolicyApplyDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.*; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.*; |
||||
|
import com.yxt.anrui.riskcenter.biz.loanfinpolicyrecordapply.LoanFinPolicyRecordApplyService; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2023/7/6 |
||||
|
**/ |
||||
|
@Api(tags = "金融产品政策报备") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/loanfinotherpolicyrecordapply") |
||||
|
public class LoanFinOtherPolicyRecordApplyRest implements LoanFinOtherPolicyRecordApplyFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private LoanFinOtherPolicyRecordApplyService loanFinOtherPolicyRecordApplyService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<String> save(LoanFinOtherPolicyApplyDto dto) { |
||||
|
return loanFinOtherPolicyRecordApplyService.saveOrUpdateRecord(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<PagerVo<LoanFinOtherPolicyApplyVo>> listPage(PagerQuery<LoanFinOtherPolicyApplyQuery> pq) { |
||||
|
ResultBean<PagerVo<LoanFinOtherPolicyApplyVo>> rb = ResultBean.fireFail(); |
||||
|
PagerVo<LoanFinOtherPolicyApplyVo> pv = loanFinOtherPolicyRecordApplyService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> policyRecordInit(LoanFinOtherPolicyApplyDto dto) { |
||||
|
ResultBean<LoanFinOtherPolicyApplyInitVo> rb = ResultBean.fireFail(); |
||||
|
LoanFinOtherPolicyApplyInitVo vo = loanFinOtherPolicyRecordApplyService.policyRecordInit(dto); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<LoanFinOtherPolicyApplyInitVo> fetchDetailsBySid(String sid) { |
||||
|
ResultBean<LoanFinOtherPolicyApplyInitVo> rb = ResultBean.fireFail(); |
||||
|
LoanFinOtherPolicyApplyInitVo vo = loanFinOtherPolicyRecordApplyService.fetchDetailsBySid(sid); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean submitRecordApplication(SubmitLoanOtherPolicyApplyDto dto) { |
||||
|
return loanFinOtherPolicyRecordApplyService.submitRecordApplication(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean complete(LoanOtherPolicyApplyCompleteDto dto) { |
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
BeanUtil.copyProperties(dto, bv); |
||||
|
bv.setModelId(ProcDefEnum.LOANOTHERPOLICYRECORDAPPLY.getProDefId()); |
||||
|
return loanFinOtherPolicyRecordApplyService.complete(bv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean companyToDivisionOperate(LoanOtherPolicyApplyCompleteDto query) { |
||||
|
BusinessVariables bv=new BusinessVariables(); |
||||
|
BeanUtil.copyProperties(query,bv); |
||||
|
bv.setModelId(ProcDefEnum.LOANOTHERPOLICYRECORDAPPLY.getProDefId()); |
||||
|
return loanFinOtherPolicyRecordApplyService.companyToDivisionOperate(bv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean revokeProcess(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return loanFinOtherPolicyRecordApplyService.revokeProcess(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean taskReject(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return loanFinOtherPolicyRecordApplyService.taskReject(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean breakProcess(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean flowRecord(String procInsId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,563 @@ |
|||||
|
package com.yxt.anrui.riskcenter.biz.loanfinotherpolicyrecordapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
||||
|
import com.yxt.anrui.flowable.api.flow.FlowProcessMapQuery; |
||||
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
||||
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
||||
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
||||
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
||||
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
||||
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
||||
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
||||
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
||||
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
||||
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
||||
|
import com.yxt.anrui.portal.api.sysuser.UserRoleQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherPolicy.LoanFinOtherPolicy; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.*; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.LoanOtherPolicyApplyTaskQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.SubmitLoanOtherPolicyApplyDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanFinPolicy; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.*; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.LoanFinPolicyApplyTaskQuery; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.SubmitLoanFinPolicyApplyDto; |
||||
|
import com.yxt.anrui.riskcenter.biz.loanfinotherPolicy.LoanFinOtherPolicyService; |
||||
|
import com.yxt.anrui.riskcenter.biz.loanfinpolicy.LoanFinPolicyService; |
||||
|
import com.yxt.common.base.config.component.FileUploadComponent; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import com.yxt.messagecenter.api.message.MessageFeign; |
||||
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
||||
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.concurrent.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2023/7/6 |
||||
|
**/ |
||||
|
@Service |
||||
|
public class LoanFinOtherPolicyRecordApplyService extends MybatisBaseService<LoanFinOtherPolicyRecordApplyMapper, LoanFinOtherPolicyRecordApply> { |
||||
|
|
||||
|
@Autowired |
||||
|
private SysStaffOrgFeign sysStaffOrgFeign; |
||||
|
@Autowired |
||||
|
private SysOrganizationFeign sysOrganizationFeign; |
||||
|
@Autowired |
||||
|
private FileUploadComponent fileUploadComponent; |
||||
|
@Autowired |
||||
|
private LoanFinPolicyService loanFinPolicyService; |
||||
|
@Autowired |
||||
|
private LoanFinOtherPolicyService loanFinOtherPolicyService; |
||||
|
@Autowired |
||||
|
private FlowableFeign flowableFeign; |
||||
|
@Autowired |
||||
|
private MessageFeign messageFeign; |
||||
|
@Autowired |
||||
|
private SysUserFeign sysUserFeign; |
||||
|
@Autowired |
||||
|
private FlowTaskFeign flowTaskFeign; |
||||
|
|
||||
|
|
||||
|
public ResultBean<String> saveOrUpdateRecord(LoanFinOtherPolicyApplyDto dto) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
if (StringUtils.isNotBlank(dto.getSid())) { |
||||
|
String sid = dto.getSid(); |
||||
|
LoanFinOtherPolicyRecordApply entity = fetchBySid(sid); |
||||
|
StringBuffer sb = new StringBuffer(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
List<String> policySids = dto.getPolicySids(); |
||||
|
String policySid = String.join(",", policySids); |
||||
|
entity.setOtherPolicySid(policySid); |
||||
|
if (!dto.getAnnexPaths().isEmpty()) { |
||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
||||
|
for (String filePath : dto.getAnnexPaths()) { |
||||
|
String path = filePath.substring(urlPrefix.length()); |
||||
|
sb.append(path).append(","); |
||||
|
} |
||||
|
sb.delete(sb.length() - 1, sb.length()); |
||||
|
entity.setAnnexPath(sb.toString()); |
||||
|
} |
||||
|
int i = baseMapper.updateById(entity); |
||||
|
if (i > 0) { |
||||
|
return rb.success().setData(sid).setMsg("修改成功"); |
||||
|
} else { |
||||
|
return rb.success().setData(sid).setMsg("修改失败"); |
||||
|
} |
||||
|
} else { |
||||
|
//新增
|
||||
|
LoanFinOtherPolicyRecordApply entity = new LoanFinOtherPolicyRecordApply(); |
||||
|
String sid = entity.getSid(); |
||||
|
StringBuffer sb = new StringBuffer(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
String userSid = dto.getUserSid(); |
||||
|
ResultBean<String> orgSidByPath = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgSidPath()); |
||||
|
if (orgSidByPath.getSuccess()) { |
||||
|
String userOrgSid = orgSidByPath.getData(); |
||||
|
entity.setCreateOrgSid(userOrgSid); |
||||
|
ResultBean<SysOrganizationVo> organizationVo = sysOrganizationFeign.fetchBySid(userOrgSid); |
||||
|
if (organizationVo.getSuccess()) { |
||||
|
SysOrganizationVo organizationVoData = organizationVo.getData(); |
||||
|
if (null != organizationVoData) { |
||||
|
entity.setCreateOrgName(organizationVoData.getName()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
entity.setCreateBySid(userSid); |
||||
|
entity.setApplicantSid(userSid); |
||||
|
List<String> policySids = dto.getPolicySids(); |
||||
|
String policySid = String.join(",", policySids); |
||||
|
entity.setOtherPolicySid(policySid); |
||||
|
if (!dto.getAnnexPaths().isEmpty()) { |
||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
||||
|
for (String filePath : dto.getAnnexPaths()) { |
||||
|
String path = filePath.substring(urlPrefix.length()); |
||||
|
sb.append(path).append(","); |
||||
|
} |
||||
|
sb.delete(sb.length() - 1, sb.length()); |
||||
|
entity.setAnnexPath(sb.toString()); |
||||
|
} |
||||
|
entity.setNodeState("待提交"); |
||||
|
int i = baseMapper.insert(entity); |
||||
|
if (i > 0) { |
||||
|
return rb.success().setData(sid).setMsg("保存成功"); |
||||
|
} else { |
||||
|
return rb.success().setData(sid).setMsg("保存失败"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<LoanFinOtherPolicyRecordApply> createQueryWrapper(LoanFinOtherPolicyApplyQuery query) { |
||||
|
// todo: 这里根据具体业务调整查询条件
|
||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||
|
QueryWrapper<LoanFinOtherPolicyRecordApply> qw = new QueryWrapper<>(); |
||||
|
if (StringUtils.isNotBlank(query.getApplyCompany())) { |
||||
|
qw.like("applyCompany", query.getApplyCompany()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getDepartment())) { |
||||
|
qw.like("department", query.getDepartment()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getApplicant())) { |
||||
|
qw.like("applicant", query.getApplicant()); |
||||
|
} |
||||
|
String createStartTime = query.getCreateStartTime(); |
||||
|
String createEndTime = query.getCreateEndTime(); |
||||
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createStartTime), "date_format (applyDate,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
||||
|
apply(org.apache.commons.lang3.StringUtils.isNotEmpty(createEndTime), "date_format (applyDate,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
||||
|
); |
||||
|
qw.eq("createOrgSid", query.getCreateOrgSid()); |
||||
|
qw.eq("isDelete", 0); |
||||
|
qw.orderByDesc("createTime"); |
||||
|
return qw; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 分页列表 |
||||
|
* |
||||
|
* @param pq |
||||
|
* @return |
||||
|
*/ |
||||
|
public PagerVo<LoanFinOtherPolicyApplyVo> listPageVo(PagerQuery<LoanFinOtherPolicyApplyQuery> pq) { |
||||
|
LoanFinOtherPolicyApplyQuery query = pq.getParams(); |
||||
|
QueryWrapper<LoanFinOtherPolicyRecordApply> qw = createQueryWrapper(query); |
||||
|
IPage<LoanFinOtherPolicyRecordApply> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<LoanFinOtherPolicyApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<LoanFinOtherPolicyApplyVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public LoanFinOtherPolicyApplyInitVo policyRecordInit(LoanFinOtherPolicyApplyDto dto) { |
||||
|
LoanFinOtherPolicyApplyInitVo vo = new LoanFinOtherPolicyApplyInitVo(); |
||||
|
BeanUtil.copyProperties(dto, vo); |
||||
|
vo.setApplyDate(new Date()); |
||||
|
List<LoanFinOtherPolicyApplyInitListVo> policyList = new ArrayList<>(); |
||||
|
List<String> policySids = dto.getPolicySids(); |
||||
|
for (String policySid : policySids) { |
||||
|
LoanFinOtherPolicyApplyInitListVo initVo = new LoanFinOtherPolicyApplyInitListVo(); |
||||
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(policySid); |
||||
|
BeanUtil.copyProperties(loanFinOtherPolicy, initVo); |
||||
|
initVo.setOtherPolicySid(policySid); |
||||
|
policyList.add(initVo); |
||||
|
} |
||||
|
vo.setPolicyList(policyList); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public LoanFinOtherPolicyApplyInitVo fetchDetailsBySid(String sid) { |
||||
|
LoanFinOtherPolicyApplyInitVo vo = new LoanFinOtherPolicyApplyInitVo(); |
||||
|
LoanFinOtherPolicyRecordApply entity = fetchBySid(sid); |
||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
||||
|
BeanUtil.copyProperties(entity, vo); |
||||
|
if (StringUtils.isNotBlank(entity.getProcInstId())) { |
||||
|
vo.setInstanceId(entity.getProcInstId()); |
||||
|
} |
||||
|
String policySid = entity.getOtherPolicySid(); |
||||
|
List<String> pSids = new ArrayList<>(); |
||||
|
String[] policySids = policySid.split(","); |
||||
|
for (String s : policySids) { |
||||
|
pSids.add(s); |
||||
|
} |
||||
|
vo.setPolicySids(pSids); |
||||
|
List<LoanFinOtherPolicyApplyInitListVo> policyList = new ArrayList<>(); |
||||
|
for (String psid : policySids) { |
||||
|
LoanFinOtherPolicyApplyInitListVo initVo = new LoanFinOtherPolicyApplyInitListVo(); |
||||
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(psid); |
||||
|
BeanUtil.copyProperties(loanFinOtherPolicy, initVo); |
||||
|
initVo.setOtherPolicySid(psid); |
||||
|
policyList.add(initVo); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(entity.getAnnexPath())) { |
||||
|
String annexPath = entity.getAnnexPath(); |
||||
|
String[] splitPath = annexPath.split(","); |
||||
|
List<String> annexPaths = new ArrayList<>(); |
||||
|
for (String path : splitPath) { |
||||
|
annexPaths.add(urlPrefix + path); |
||||
|
} |
||||
|
vo.setAnnexPaths(annexPaths); |
||||
|
} |
||||
|
vo.setPolicyList(policyList); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
/****************************** 流程代码 ********************************************************/ |
||||
|
|
||||
|
/** |
||||
|
* 判断提交的流程是否被允许 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
private synchronized int submitBusinessData(SubmitLoanOtherPolicyApplyDto dto, LoanFinOtherPolicyRecordApply recordApply) { |
||||
|
int r = 0; |
||||
|
if (StringUtils.isBlank(dto.getSid())) { |
||||
|
r = 1; |
||||
|
} else { |
||||
|
if (recordApply != null) { |
||||
|
String businessTaskId = recordApply.getTaskId(); |
||||
|
if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { |
||||
|
//新提交
|
||||
|
r = 1; |
||||
|
} else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { |
||||
|
//二次提交//只有数据一致的时候才能进行下一步
|
||||
|
r = 2; |
||||
|
} |
||||
|
} else { |
||||
|
r = 3; |
||||
|
} |
||||
|
} |
||||
|
return r; |
||||
|
} |
||||
|
|
||||
|
public ResultBean submitRecordApplication(SubmitLoanOtherPolicyApplyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(dto.getSid()); |
||||
|
int r = submitBusinessData(dto, recordApply); |
||||
|
if (r == 3) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
if (r == 0) { |
||||
|
return rb.setMsg("操作失败!提交的数据不一致"); |
||||
|
} |
||||
|
//新增修改保存
|
||||
|
ResultBean<String> resultBean = saveOrUpdateRecord(dto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
String businessSid = resultBean.getData(); |
||||
|
//创建BusinessVariables实体对象
|
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
//流程中的参数赋值
|
||||
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
//若有网关,则赋值网关中判断的字段。
|
||||
|
variables.put("businessSid", businessSid); |
||||
|
appMap.put("sid", businessSid); |
||||
|
variables.put("app", appMap); |
||||
|
LoanFinOtherPolicyRecordApply recordApply1 = fetchBySid(businessSid); |
||||
|
//用户的部门全路径sid
|
||||
|
bv.setOrgSidPath(recordApply1.getOrgSidPath()); |
||||
|
//业务sid
|
||||
|
bv.setBusinessSid(businessSid); |
||||
|
//用户sid
|
||||
|
bv.setUserSid(dto.getUserSid()); |
||||
|
bv.setFormVariables(variables); |
||||
|
//流程定义id
|
||||
|
bv.setModelId(ProcDefEnum.LOANOTHERPOLICYRECORDAPPLY.getProDefId()); |
||||
|
if (r == 1) { |
||||
|
//流程定义id
|
||||
|
bv.setModelId(ProcDefEnum.LOANOTHERPOLICYRECORDAPPLY.getProDefId()); |
||||
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
||||
|
if (!voResultBean.getSuccess()) { |
||||
|
return rb.setMsg(voResultBean.getMsg()); |
||||
|
} |
||||
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
||||
|
int i = updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
||||
|
if (i > 0) { |
||||
|
List<String> policySids = dto.getPolicySids(); |
||||
|
for (String policySid : policySids) { |
||||
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(policySid); |
||||
|
loanFinOtherPolicy.setFilingState(2); |
||||
|
loanFinOtherPolicyService.updateById(loanFinOtherPolicy); |
||||
|
} |
||||
|
} |
||||
|
//==================================添加线程
|
||||
|
try { |
||||
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
||||
|
.setNameFormat("demo-pool-%d").build(); |
||||
|
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
||||
|
0L, TimeUnit.MILLISECONDS, |
||||
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
||||
|
Future future1 = pool.submit(() -> { |
||||
|
//极光推送
|
||||
|
// busVehicleApply.set(fetchBySid(businessSid))
|
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(businessSid); |
||||
|
messageFlowableQuery.setModuleName("其他融产品备案"); |
||||
|
SysUserVo userVo = sysUserFeign.fetchBySid(recordApply1.getCreateBySid()).getData(); |
||||
|
if (userVo != null) { |
||||
|
if (StringUtils.isNotBlank(userVo.getName())) { |
||||
|
messageFlowableQuery.setMsgContent(userVo.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
} |
||||
|
} |
||||
|
messageFlowableQuery.setMsgTitle("其他融产品备案"); |
||||
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
||||
|
}); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
//==================================添加线程
|
||||
|
return voResultBean; |
||||
|
} |
||||
|
if (r == 2) { |
||||
|
// ToDo:驳回到发起人后再次提交
|
||||
|
if (StringUtils.isBlank(dto.getInstanceId())) { |
||||
|
return rb.setMsg("参数错误:instanceId"); |
||||
|
} |
||||
|
bv.setTaskId(recordApply.getTaskId()); |
||||
|
bv.setTaskDefKey(recordApply.getNodeSid()); |
||||
|
bv.setComment("重新提交"); |
||||
|
bv.setInstanceId(dto.getInstanceId()); |
||||
|
return complete(bv); |
||||
|
} |
||||
|
return rb; |
||||
|
} |
||||
|
|
||||
|
private int updateFlowFiled(Map<String, Object> map) { |
||||
|
return baseMapper.updateFlowFiled(map); |
||||
|
} |
||||
|
|
||||
|
public ResultBean complete(BusinessVariables bv) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String businessSid = bv.getBusinessSid(); |
||||
|
LoanFinOtherPolicyRecordApply recordApply = this.fetchBySid(businessSid); |
||||
|
if (bv.getTaskId().equals(recordApply.getTaskId())) { |
||||
|
bv.setOrgSidPath(recordApply.getOrgSidPath()); |
||||
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
int i = updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
||||
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
||||
|
// LoanFinPolicyApplyInitVo entity = fetchDetailsBySid(businessSid);
|
||||
|
// List<String> policySids = entity.getPolicySids();
|
||||
|
// for (String policySid : policySids) {
|
||||
|
// LoanFinPolicy loanFinPolicy = loanFinPolicyService.fetchBySid(policySid);
|
||||
|
// loanFinPolicy.setFilingState(1);
|
||||
|
// loanFinPolicyService.updateById(loanFinPolicy);
|
||||
|
// }
|
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} else { |
||||
|
return rb.setMsg("操作失败!提交的数据不一致"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public ResultBean companyToDivisionOperate(BusinessVariables bv) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanFinOtherPolicyRecordApply otherPolicyRecordApply = fetchBySid(bv.getBusinessSid()); |
||||
|
bv.setOrgSidPath(otherPolicyRecordApply.getOrgSidPath()); |
||||
|
Map<String, Object> variables = bv.getFormVariables(); |
||||
|
otherPolicyRecordApply = fetchBySid(bv.getBusinessSid()); |
||||
|
FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); |
||||
|
flowProcessMapQuery.setProDefKey(otherPolicyRecordApply.getProcDefId()); |
||||
|
flowProcessMapQuery.setVariables(variables); |
||||
|
variables = flowableFeign.getMap(flowProcessMapQuery).getData(); |
||||
|
bv.setFormVariables(variables); |
||||
|
//=======================================
|
||||
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
||||
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
||||
|
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
||||
|
List<String> candidateGroups = voList.get(0).getCandidateGroups(); |
||||
|
UserRoleQuery userRoleQuery = new UserRoleQuery(); |
||||
|
userRoleQuery.setRoleSid(candidateGroups.get(0)); |
||||
|
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData(); |
||||
|
StringBuilder nextNodeUserSids = new StringBuilder(); |
||||
|
if (sysUserVos.size() > 0) { |
||||
|
for (SysUserVo sysUserVo : sysUserVos) { |
||||
|
String sid = sysUserVo.getSid(); |
||||
|
nextNodeUserSids.append(sid).append(","); |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isBlank(nextNodeUserSids)) { |
||||
|
return rb.setMsg("下一环节暂无操作人员"); |
||||
|
} |
||||
|
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(",")); |
||||
|
bv.setNextNodeUserSids(substring); |
||||
|
if (bv.getTaskId().equals(otherPolicyRecordApply.getTaskId())) { |
||||
|
variables = new HashMap<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", bv.getBusinessSid()); |
||||
|
variables.put("app", appMap); |
||||
|
//========================================
|
||||
|
otherPolicyRecordApply = fetchBySid(bv.getBusinessSid()); |
||||
|
flowProcessMapQuery = new FlowProcessMapQuery(); |
||||
|
flowProcessMapQuery.setProDefKey(otherPolicyRecordApply.getProcDefId()); |
||||
|
flowProcessMapQuery.setVariables(variables); |
||||
|
variables = flowableFeign.getMap(flowProcessMapQuery).getData(); |
||||
|
//=======================================
|
||||
|
bv.setFormVariables(variables); |
||||
|
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.handleProsess(bv); |
||||
|
if (!resultBean1.getSuccess()) { |
||||
|
return rb.setMsg(resultBean1.getMsg()); |
||||
|
} |
||||
|
updateFlowFiled(BeanUtil.beanToMap(resultBean1.getData())); |
||||
|
//极光推送
|
||||
|
UpdateFlowFieldVo ufVo = resultBean1.getData(); |
||||
|
otherPolicyRecordApply = fetchBySid(bv.getBusinessSid()); |
||||
|
SysUserVo userVo = sysUserFeign.fetchBySid(otherPolicyRecordApply.getCreateBySid()).getData(); |
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
messageFlowVo.setProcInsId(otherPolicyRecordApply.getProcInstId()); |
||||
|
messageFlowVo.setProcDefId(otherPolicyRecordApply.getProcDefId()); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); |
||||
|
messageFlowableQuery.setModuleName("其他融产品备案"); |
||||
|
messageFlowableQuery.setMsgContent(userVo.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
messageFlowableQuery.setMsgTitle("其他融产品备案"); |
||||
|
messageFeign.pushMessage(messageFlowableQuery); |
||||
|
//修改备案状态
|
||||
|
LoanFinOtherPolicyApplyInitVo finOtherPolicyApplyInitVo = fetchDetailsBySid(bv.getBusinessSid()); |
||||
|
List<String> policySids = finOtherPolicyApplyInitVo.getPolicySids(); |
||||
|
for (String policySid : policySids) { |
||||
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(policySid); |
||||
|
loanFinOtherPolicy.setFilingState(1); |
||||
|
loanFinOtherPolicyService.updateById(loanFinOtherPolicy); |
||||
|
} |
||||
|
return rb.success().setData(resultBean1.getData()); |
||||
|
} else { |
||||
|
return rb.setMsg("操作失败!提交的数据不一致"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public ResultBean revokeProcess(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
if (StringUtils.isBlank(query.getUserSid())) { |
||||
|
return rb.setMsg("参数错误:userSid"); |
||||
|
} |
||||
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(query.getBusinessSid()); |
||||
|
String businessTaskId = recordApply.getTaskId(); |
||||
|
if (StringUtils.isNotBlank(businessTaskId)) { |
||||
|
if (businessTaskId.equals(query.getTaskId())) { |
||||
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
||||
|
BeanUtil.copyProperties(query, flowTaskVo); |
||||
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(flowTaskVo); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
} |
||||
|
return rb.setMsg("操作失败,提交的数据不一致!"); |
||||
|
} |
||||
|
|
||||
|
public ResultBean taskReject(LoanOtherPolicyApplyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String businessSid = query.getBusinessSid(); |
||||
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(businessSid); |
||||
|
if (recordApply == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
String businessTaskId = recordApply.getTaskId(); |
||||
|
if (StringUtils.isNotBlank(businessTaskId)) { |
||||
|
if (businessTaskId.equals(query.getTaskId())) { |
||||
|
if (StringUtils.isBlank(query.getComment())) { |
||||
|
return rb.setMsg("请填写意见"); |
||||
|
} |
||||
|
if (StringUtils.isBlank(query.getUserSid())) { |
||||
|
return rb.setMsg("参数错误:userSid"); |
||||
|
} |
||||
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
||||
|
BeanUtil.copyProperties(query, flowTaskVo); |
||||
|
Map<String, Object> variables = new HashMap<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", businessSid); |
||||
|
variables.put("app", appMap); |
||||
|
flowTaskVo.setValues(variables); |
||||
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
||||
|
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
||||
|
//更新业务中的流程相关的参数
|
||||
|
updateFlowFiled(map); |
||||
|
//极光推送
|
||||
|
recordApply = fetchBySid(businessSid); |
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
String procId = recordApply.getProcInstId(); |
||||
|
messageFlowVo.setProcInsId(procId); |
||||
|
messageFlowVo.setProcDefId(recordApply.getProcDefId()); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(businessSid); |
||||
|
messageFlowableQuery.setModuleName("其他融产品备案"); |
||||
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
||||
|
String nextName = listResultBean.getData().get(0).getName_(); |
||||
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
||||
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
||||
|
// if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(busVehicleApply.getCreateBySid())) {
|
||||
|
if ("发起申请".equals(nextName)) { |
||||
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
||||
|
} else { |
||||
|
SysUserVo userVo = sysUserFeign.fetchBySid(recordApply.getCreateBySid()).getData(); |
||||
|
if (userVo != null) { |
||||
|
if (StringUtils.isNotBlank(userVo.getName())) { |
||||
|
messageFlowableQuery.setMsgContent(userVo.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
messageFlowableQuery.setMsgTitle("其他融产品备案"); |
||||
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
||||
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/7/7 14:06 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppFinPolicyApplyInitVo implements Vo { |
||||
|
|
||||
|
private String sid; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
@ApiModelProperty("申请分公司") |
||||
|
private String applyCompany; |
||||
|
@ApiModelProperty("申请部门") |
||||
|
private String department; |
||||
|
@ApiModelProperty("申请人") |
||||
|
private String applicant; |
||||
|
@ApiModelProperty("申请日期") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
||||
|
private Date applyDate; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("实例id") |
||||
|
@JsonProperty("procInsId") |
||||
|
private String instanceId; |
||||
|
// @ApiModelProperty("申请金融产品政策sid")
|
||||
|
// private List<String> policySids = new ArrayList<>();
|
||||
|
@ApiModelProperty("附件路径") |
||||
|
private List<String> annexPaths = new ArrayList<>(); |
||||
|
@ApiModelProperty("使用组织全路径") |
||||
|
@JsonProperty("orgPath") |
||||
|
private String orgSidPath; |
||||
|
private List<AppPolicyApplyInitListVo> policyList = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/7/7 14:07 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppPolicyApplyInitListVo implements Vo { |
||||
|
@ApiModelProperty("政策sid") |
||||
|
private String policySid; |
||||
|
@ApiModelProperty("政策名称") |
||||
|
private String policyName; |
||||
|
@ApiModelProperty("车辆功能value") |
||||
|
private String vehTypeValue; |
||||
|
@ApiModelProperty("期数") |
||||
|
private int period; |
||||
|
@ApiModelProperty("标准年利率(%)") |
||||
|
private String yearRatio; |
||||
|
@ApiModelProperty("服务费类型value") |
||||
|
private String serviceAmountTypeValue; |
||||
|
@ApiModelProperty("服务费") |
||||
|
private String serviceAmount; |
||||
|
@ApiModelProperty("最低首付比例(%)") |
||||
|
private String downPayRatioLeast; |
||||
|
@ApiModelProperty("单车意外险") |
||||
|
private String vehAccidentAmount; |
||||
|
@ApiModelProperty("保险保证金") |
||||
|
private String depositPremium; |
||||
|
@ApiModelProperty("落户保证金") |
||||
|
private BigDecimal depositSettle; |
||||
|
@ApiModelProperty("名义/留购价款") |
||||
|
private BigDecimal nominalPrice; |
||||
|
@ApiModelProperty("有效期至") |
||||
|
private String validDateTo; |
||||
|
@ApiModelProperty("是否有其他融政策") |
||||
|
private boolean showOtherPolicy; |
||||
|
} |
@ -0,0 +1,72 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply; |
||||
|
|
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.autoservice.deliveryConfirm.flowable.DeliveryConfirmTaskQuery; |
||||
|
import com.yxt.anrui.terminal.api.autoservice.deliveryConfirm.flowable.DeliveryFlowableQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.CompletePolicyDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyFlowableQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
|
||||
|
/** |
||||
|
* @Author |
||||
|
* @Date |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Api(tags = "金融方案") |
||||
|
@FeignClient( |
||||
|
contextId = "terminal-PolicyRecordApply", |
||||
|
name = "anrui-terminal", |
||||
|
path = "/risk/v1/policyrecordapply", |
||||
|
fallback = PolicyRecordApplyFeignFallback.class) |
||||
|
public interface PolicyRecordApplyFeign { |
||||
|
|
||||
|
/** |
||||
|
* 金融产品政策报备初始化 |
||||
|
* @param sid |
||||
|
*/ |
||||
|
@ApiOperation("金融产品政策报备详情") |
||||
|
@GetMapping("/fetchDetailsBySid/{sid}") |
||||
|
@ResponseBody |
||||
|
public ResultBean<AppFinPolicyApplyInitVo> fetchDetailsBySid(@PathVariable("sid") String sid); |
||||
|
|
||||
|
@ApiOperation("办理") |
||||
|
@PutMapping("/agreePolicyApplyInfo") |
||||
|
@ResponseBody |
||||
|
ResultBean agreePolicyApplyInfo(@Valid @RequestBody CompletePolicyDto dto); |
||||
|
|
||||
|
@ApiOperation("从分公司到风控中心办理") |
||||
|
@PutMapping("/agreeCompanyToDivisionOperate") |
||||
|
@ResponseBody |
||||
|
ResultBean agreeCompanyToDivisionOperate(@Valid @RequestBody CompletePolicyDto dto); |
||||
|
|
||||
|
|
||||
|
@ApiOperation("驳回") |
||||
|
@PutMapping("/rejectPolicyApplyInfo") |
||||
|
@ResponseBody |
||||
|
ResultBean rejectPolicyApplyInfo(@Valid @RequestBody PolicyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("撤回") |
||||
|
@PutMapping("/recallPolicyApplyInfo") |
||||
|
@ResponseBody |
||||
|
ResultBean recallPolicyApplyInfo(@Valid @RequestBody PolicyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("终止") |
||||
|
@PutMapping("/stopPolicyApplyInfo") |
||||
|
@ResponseBody |
||||
|
ResultBean stopPolicyApplyInfo(@Valid @RequestBody PolicyTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@Valid @SpringQueryMap PolicyFlowableQuery query); |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.CompletePolicyDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyFlowableQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2023/3/21 15:19 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Component |
||||
|
public class PolicyRecordApplyFeignFallback implements PolicyRecordApplyFeign{ |
||||
|
@Override |
||||
|
public ResultBean<AppFinPolicyApplyInitVo> fetchDetailsBySid(String sid) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean agreePolicyApplyInfo(CompletePolicyDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean agreeCompanyToDivisionOperate(CompletePolicyDto dto) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean rejectPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean recallPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean stopPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<String> getFlowOperateTitle(PolicyFlowableQuery query) { |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply.flow; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @author Administrator |
||||
|
* @description |
||||
|
* @date 2023/7/7 14:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompletePolicyDto implements Dto { |
||||
|
private static final long serialVersionUID = -1634177638238174363L; |
||||
|
|
||||
|
@ApiModelProperty(value = "任务id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
@NotBlank(message = "参数错误:procInsId") |
||||
|
@JsonProperty("procInsId") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
private String comment; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "用户sid") |
||||
|
@NotBlank(message = "参数错误:userSid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
@NotBlank(message = "参数错误:taskDefKey") |
||||
|
private String taskDefKey; |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply.flow; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
@Data |
||||
|
public class PolicyFlowableQuery implements Query { |
||||
|
private static final long serialVersionUID = -5879668616710833830L; |
||||
|
|
||||
|
@ApiModelProperty(value = "节点key") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "0 上一环节 1下一环节") |
||||
|
@NotNull(message = "参数错误:next") |
||||
|
private Integer next; |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.policyrecordapply.flow; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
@Data |
||||
|
public class PolicyTaskQuery implements Query { |
||||
|
private static final long serialVersionUID = -6061453269533691015L; |
||||
|
|
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务Id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@ApiModelProperty("业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
/** |
||||
|
* 终止、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("任务意见") |
||||
|
private String comment; |
||||
|
/** |
||||
|
* 终止、撤回、驳回 |
||||
|
*/ |
||||
|
@ApiModelProperty("用户Sid") |
||||
|
private String userSid; |
||||
|
/** |
||||
|
* 终止 |
||||
|
*/ |
||||
|
@ApiModelProperty("流程实例Id") |
||||
|
@JsonProperty("procInsId") |
||||
|
private String instanceId; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.risk.policyrecordapply; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.AppFinPolicyApplyInitVo; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.PolicyRecordApplyFeign; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.CompletePolicyDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyFlowableQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyTaskQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.solutions.AppSolutionsDetailsVo; |
||||
|
import com.yxt.anrui.terminal.api.risk.solutions.AppSolutionsDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.solutions.SolutionsFeign; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
/** |
||||
|
* @Author |
||||
|
* @Date 2023/3/25 9:39 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Api(tags = "金融方案") |
||||
|
@Controller |
||||
|
@RequestMapping("/risk/v1/policyrecordapply") |
||||
|
public class PolicyRecordApplyRest implements PolicyRecordApplyFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private PolicyRecordApplyService policyRecordApplyService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<AppFinPolicyApplyInitVo> fetchDetailsBySid(String sid) { |
||||
|
return policyRecordApplyService.fetchDetailsBySid(sid); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean agreePolicyApplyInfo(CompletePolicyDto dto) { |
||||
|
return policyRecordApplyService.agreePolicyApplyInfo(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean agreeCompanyToDivisionOperate(CompletePolicyDto dto) { |
||||
|
return policyRecordApplyService.agreeCompanyToDivisionOperate(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean rejectPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return policyRecordApplyService.rejectPolicyApplyInfo(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean recallPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return policyRecordApplyService.recallPolicyApplyInfo(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean stopPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
return policyRecordApplyService.stopPolicyApplyInfo(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<String> getFlowOperateTitle(PolicyFlowableQuery query) { |
||||
|
return policyRecordApplyService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
} |
@ -0,0 +1,160 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.risk.policyrecordapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
||||
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
||||
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
||||
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyApplyInitVo; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyRecordApplyFeign; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.LoanFinPolicyApplyCompleteDto; |
||||
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.LoanFinPolicyApplyTaskQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.AppFinPolicyApplyInitVo; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.CompletePolicyDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyFlowableQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.policyrecordapply.flow.PolicyTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author |
||||
|
* @Date 2023/3/25 9:40 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PolicyRecordApplyService { |
||||
|
|
||||
|
@Autowired |
||||
|
private LoanFinPolicyRecordApplyFeign loanFinPolicyRecordApplyFeign; |
||||
|
|
||||
|
@Autowired |
||||
|
private SysUserFeign sysUserFeign; |
||||
|
|
||||
|
@Autowired |
||||
|
private SysStaffOrgFeign sysStaffOrgFeign; |
||||
|
|
||||
|
public ResultBean<AppFinPolicyApplyInitVo> fetchDetailsBySid(String sid) { |
||||
|
ResultBean<AppFinPolicyApplyInitVo> rb = ResultBean.fireFail(); |
||||
|
AppFinPolicyApplyInitVo vo = new AppFinPolicyApplyInitVo(); |
||||
|
ResultBean<LoanFinPolicyApplyInitVo> resultBean = loanFinPolicyRecordApplyFeign.fetchDetailsBySid(sid); |
||||
|
if (resultBean.getSuccess()) { |
||||
|
LoanFinPolicyApplyInitVo data = resultBean.getData(); |
||||
|
BeanUtil.copyProperties(data, vo); |
||||
|
} |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean agreePolicyApplyInfo(CompletePolicyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
//根据用户sid获取staffSid
|
||||
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
||||
|
if (!userVoResultBean.getSuccess()) { |
||||
|
return rb.setMsg(userVoResultBean.getMsg()); |
||||
|
} |
||||
|
//根据staffSid获取用户的组织全路径
|
||||
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
||||
|
if (!staffOrgResultBean.getSuccess()) { |
||||
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
||||
|
} |
||||
|
//用户的组织全路径
|
||||
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
||||
|
LoanFinPolicyApplyCompleteDto loanFinPolicyApplyCompleteDto = new LoanFinPolicyApplyCompleteDto(); |
||||
|
BeanUtil.copyProperties(dto, loanFinPolicyApplyCompleteDto); |
||||
|
loanFinPolicyApplyCompleteDto.setOrgSidPath(orgSidPath); |
||||
|
ResultBean resultBean = loanFinPolicyRecordApplyFeign.complete(loanFinPolicyApplyCompleteDto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean rejectPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanFinPolicyApplyTaskQuery taskQuery = new LoanFinPolicyApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, taskQuery); |
||||
|
ResultBean resultBean = loanFinPolicyRecordApplyFeign.taskReject(taskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean recallPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanFinPolicyApplyTaskQuery taskQuery = new LoanFinPolicyApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, taskQuery); |
||||
|
ResultBean resultBean = loanFinPolicyRecordApplyFeign.revokeProcess(taskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean stopPolicyApplyInfo(PolicyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanFinPolicyApplyTaskQuery taskQuery = new LoanFinPolicyApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, taskQuery); |
||||
|
ResultBean resultBean = loanFinPolicyRecordApplyFeign.breakProcess(taskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> getFlowOperateTitle(PolicyFlowableQuery query) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
//0 上一环节 1下一环节
|
||||
|
int next = query.getNext(); |
||||
|
com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeQuery getNodeQuery = new com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeQuery(); |
||||
|
BeanUtil.copyProperties(query, getNodeQuery); |
||||
|
String data = ""; |
||||
|
if (next == 0) { |
||||
|
ResultBean<List<com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeVo>> getPreviousNodesForReject = loanFinPolicyRecordApplyFeign.getPreviousNodesForReject(getNodeQuery); |
||||
|
if (getPreviousNodesForReject.getSuccess()) { |
||||
|
getPreviousNodesForReject.getData().removeAll(Collections.singleton(null)); |
||||
|
data = getPreviousNodesForReject.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(getPreviousNodesForReject.getMsg()); |
||||
|
} |
||||
|
} else if (next == 1) { |
||||
|
ResultBean<List<com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeVo>> getNextNodesForSubmit = loanFinPolicyRecordApplyFeign.getNextNodesForSubmit(getNodeQuery); |
||||
|
if (getNextNodesForSubmit.getSuccess()) { |
||||
|
getNextNodesForSubmit.getData().removeAll(Collections.singleton(null)); |
||||
|
data = getNextNodesForSubmit.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(getNextNodesForSubmit.getMsg()); |
||||
|
} |
||||
|
} else { |
||||
|
return rb.setMsg("参数错误:next"); |
||||
|
} |
||||
|
return rb.success().setData(data); |
||||
|
} |
||||
|
|
||||
|
public ResultBean agreeCompanyToDivisionOperate(CompletePolicyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
//根据用户sid获取staffSid
|
||||
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
||||
|
if (!userVoResultBean.getSuccess()) { |
||||
|
return rb.setMsg(userVoResultBean.getMsg()); |
||||
|
} |
||||
|
//根据staffSid获取用户的组织全路径
|
||||
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
||||
|
if (!staffOrgResultBean.getSuccess()) { |
||||
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
||||
|
} |
||||
|
//用户的组织全路径
|
||||
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
||||
|
LoanFinPolicyApplyCompleteDto loanFinPolicyApplyCompleteDto = new LoanFinPolicyApplyCompleteDto(); |
||||
|
BeanUtil.copyProperties(dto, loanFinPolicyApplyCompleteDto); |
||||
|
loanFinPolicyApplyCompleteDto.setOrgSidPath(orgSidPath); |
||||
|
ResultBean resultBean = loanFinPolicyRecordApplyFeign.companyToDivisionOperate(loanFinPolicyApplyCompleteDto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue