
11 changed files with 443 additions and 8 deletions
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SecondarySalesAppVo { |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDelegateQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@FeignClient( |
||||
|
contextId = "terminal-SecondarySales", |
||||
|
name = "anrui-terminal", |
||||
|
path = "/risk/v1/SecondarySales", |
||||
|
fallback = SecondarySalesFeignFallback.class) |
||||
|
public interface SecondarySalesFeign { |
||||
|
|
||||
|
@ApiOperation("办理") |
||||
|
@PutMapping("/agreeSecondarySales") |
||||
|
@ResponseBody |
||||
|
ResultBean agreeSecondarySales(@RequestBody SecondarySalesDto dto); |
||||
|
|
||||
|
@ApiOperation("驳回") |
||||
|
@PutMapping("/rejectSecondarySales") |
||||
|
@ResponseBody |
||||
|
ResultBean rejectSecondarySales(@RequestBody SecondarySalesTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("撤回") |
||||
|
@PutMapping("/recallSecondarySales") |
||||
|
@ResponseBody |
||||
|
ResultBean recallSecondarySales(@RequestBody SecondarySalesTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("终止") |
||||
|
@PutMapping("/stopSecondarySales") |
||||
|
@ResponseBody |
||||
|
ResultBean stopSecondarySales(@RequestBody SecondarySalesTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@SpringQueryMap SecondarySalesQuery query); |
||||
|
|
||||
|
@ApiOperation("详情") |
||||
|
@GetMapping("/getSecondarySales/{sid}") |
||||
|
@ResponseBody |
||||
|
ResultBean<SecondarySalesAppVo> getSecondarySales(@PathVariable("sid") String sid); |
||||
|
|
||||
|
@ApiOperation(value = "加签") |
||||
|
@PutMapping(value = "/delegate") |
||||
|
@ResponseBody |
||||
|
public ResultBean delegate(@RequestBody SecondarySalesDelegateQuery delegateQuery); |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Component |
||||
|
public class SecondarySalesFeignFallback { |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales.flowable; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SecondarySalesDelegateQuery { |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales.flowable; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SecondarySalesDto { |
||||
|
|
||||
|
@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,23 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SecondarySalesQuery { |
||||
|
|
||||
|
@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,45 @@ |
|||||
|
package com.yxt.anrui.terminal.api.risk.secondarysales.flowable; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SecondarySalesTaskQuery { |
||||
|
|
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@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,62 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.risk.secondarysales; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.SecondarySalesAppVo; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.SecondarySalesFeign; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDelegateQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesTaskQuery; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Controller |
||||
|
@RequestMapping("/risk/v1/SecondarySales") |
||||
|
@Api(tags = "交回车辆二次销售审批") |
||||
|
public class SecondarySalesRest implements SecondarySalesFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private SecondarySalesService secondarySalesService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean agreeSecondarySales(SecondarySalesDto dto) { |
||||
|
return secondarySalesService.agreeSecondarySales(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean rejectSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
return secondarySalesService.rejectSecondarySales(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean recallSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
return secondarySalesService.recallSecondarySales(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean stopSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
return secondarySalesService.stopSecondarySales(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<String> getFlowOperateTitle(SecondarySalesQuery query) { |
||||
|
return secondarySalesService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<SecondarySalesAppVo> getSecondarySales(String sid) { |
||||
|
return secondarySalesService.getSecondarySales(sid); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean delegate(SecondarySalesDelegateQuery delegateQuery) { |
||||
|
return secondarySalesService.delegate(delegateQuery); |
||||
|
} |
||||
|
} |
@ -0,0 +1,114 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.risk.secondarysales; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.riskcenter.api.loansecondarysalesapply.LoanSecondarySalesApplyFeign; |
||||
|
import com.yxt.anrui.riskcenter.api.loansecondarysalesapply.flowable.*; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.SecondarySalesAppVo; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDelegateQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesDto; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesQuery; |
||||
|
import com.yxt.anrui.terminal.api.risk.secondarysales.flowable.SecondarySalesTaskQuery; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/1/29 |
||||
|
**/ |
||||
|
@Service |
||||
|
public class SecondarySalesService { |
||||
|
|
||||
|
@Autowired |
||||
|
private LoanSecondarySalesApplyFeign loanSecondarySalesApplyFeign; |
||||
|
|
||||
|
public ResultBean agreeSecondarySales(SecondarySalesDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
CompleteLoanSecondarySalesApplyDto completeDto = new CompleteLoanSecondarySalesApplyDto(); |
||||
|
BeanUtil.copyProperties(dto, completeDto); |
||||
|
ResultBean resultBean = loanSecondarySalesApplyFeign.complete(completeDto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean rejectSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanSecondarySalesApplyTaskQuery loanSecondarySalesApplyTaskQuery = new LoanSecondarySalesApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, loanSecondarySalesApplyTaskQuery); |
||||
|
ResultBean resultBean = loanSecondarySalesApplyFeign.taskReject(loanSecondarySalesApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean recallSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanSecondarySalesApplyTaskQuery loanSecondarySalesApplyTaskQuery = new LoanSecondarySalesApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, loanSecondarySalesApplyTaskQuery); |
||||
|
ResultBean resultBean = loanSecondarySalesApplyFeign.revokeProcess(loanSecondarySalesApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean stopSecondarySales(SecondarySalesTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanSecondarySalesApplyTaskQuery loanSecondarySalesApplyTaskQuery = new LoanSecondarySalesApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, loanSecondarySalesApplyTaskQuery); |
||||
|
ResultBean resultBean = loanSecondarySalesApplyFeign.breakProcess(loanSecondarySalesApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> getFlowOperateTitle(SecondarySalesQuery query) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
//0 上一环节 1下一环节
|
||||
|
int next = query.getNext(); |
||||
|
LoanSecondarySalesApplyNodeQuery getNodeQuery = new LoanSecondarySalesApplyNodeQuery(); |
||||
|
BeanUtil.copyProperties(query, getNodeQuery); |
||||
|
String data = ""; |
||||
|
if (next == 0) { |
||||
|
ResultBean<List<LoanSecondarySalesApplyNodeVo>> getPreviousNodesForReject = loanSecondarySalesApplyFeign.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<LoanSecondarySalesApplyNodeVo>> getNextNodesForSubmit = loanSecondarySalesApplyFeign.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<SecondarySalesAppVo> getSecondarySales(String sid) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public ResultBean delegate(SecondarySalesDelegateQuery delegateQuery) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
LoanSecondarySalesApplyDelegateQuery delegateQuery1 = new |
||||
|
LoanSecondarySalesApplyDelegateQuery(); |
||||
|
BeanUtil.copyProperties(delegateQuery, delegateQuery1); |
||||
|
ResultBean delegate = loanSecondarySalesApplyFeign.delegate(delegateQuery1); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue