|
|
@ -21,14 +21,11 @@ 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.GetNodeQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinotherpolicyrecordapply.flow.GetNodeVo; |
|
|
|
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.api.loanfinpolicyrecordapply.LoanFinPolicyRecordApply; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinotherPolicy.LoanFinOtherPolicyService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfinpolicy.LoanFinPolicyService; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
@ -184,13 +181,12 @@ public class LoanFinOtherPolicyRecordApplyService extends MybatisBaseService<Loa |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public LoanFinOtherPolicyApplyInitVo policyRecordInit(LoanFinOtherPolicyApplyDto dto) { |
|
|
|
public LoanFinOtherPolicyApplyInitVo policyRecordInit(String[] sids) { |
|
|
|
LoanFinOtherPolicyApplyInitVo vo = new LoanFinOtherPolicyApplyInitVo(); |
|
|
|
BeanUtil.copyProperties(dto, vo); |
|
|
|
vo.setPolicySids(new ArrayList<>()); |
|
|
|
vo.setApplyDate(new Date()); |
|
|
|
List<LoanFinOtherPolicyApplyInitListVo> policyList = new ArrayList<>(); |
|
|
|
List<String> policySids = dto.getPolicySids(); |
|
|
|
for (String policySid : policySids) { |
|
|
|
for (String policySid : sids) { |
|
|
|
LoanFinOtherPolicyApplyInitListVo initVo = new LoanFinOtherPolicyApplyInitListVo(); |
|
|
|
LoanFinOtherPolicy loanFinOtherPolicy = loanFinOtherPolicyService.fetchBySid(policySid); |
|
|
|
BeanUtil.copyProperties(loanFinOtherPolicy, initVo); |
|
|
@ -210,12 +206,7 @@ public class LoanFinOtherPolicyRecordApplyService extends MybatisBaseService<Loa |
|
|
|
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(); |
|
|
@ -550,7 +541,7 @@ public class LoanFinOtherPolicyRecordApplyService extends MybatisBaseService<Loa |
|
|
|
if (userVo != null) { |
|
|
|
if (StringUtils.isNotBlank(userVo.getName())) { |
|
|
|
messageFlowableQuery.setMsgContent(userVo.getName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
messageFlowableQuery.setMsgTitle("其他融产品备案"); |
|
|
@ -560,4 +551,86 @@ public class LoanFinOtherPolicyRecordApplyService extends MybatisBaseService<Loa |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean breakProcess(LoanOtherPolicyApplyTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("请填写意见"); |
|
|
|
} |
|
|
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = recordApply.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (query.getUserSid().equals(recordApply.getCreateBySid())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean flowRecord(String procInsId) { |
|
|
|
return flowTaskFeign.businessFlowRecord(procInsId); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|
|
|
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//根据业务sid查询排产信息
|
|
|
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setModelId(recordApply.getProcDefId()); |
|
|
|
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()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|
|
|
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//根据业务sid查询排产信息
|
|
|
|
LoanFinOtherPolicyRecordApply recordApply = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setModelId(recordApply.getProcDefId()); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(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()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public int updateBySidDelete(String sid) { |
|
|
|
return baseMapper.updateBySidDelete(sid); |
|
|
|
} |
|
|
|
} |