|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.yxt.anrui.riskcenter.biz.loanbuckleapply; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -8,6 +9,9 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
|
import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
|
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFile; |
|
|
|
import com.yxt.anrui.buscenter.api.buscenterfile.BuscenterFileEnum; |
|
|
|
import com.yxt.anrui.buscenter.api.bussolutionschange.BusSolutionsChangeFiles; |
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; |
|
|
@ -30,15 +34,11 @@ import com.yxt.anrui.riskcenter.api.loanbuckleapply.flow.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanbuckleapplyrecord.LoanBuckleApplyRecord; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFile; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfile.LoanFileEnum; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinotherPolicy.LoanFinOtherPolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicy.LoanFinPolicy; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.LoanFinPolicyRecordApply; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.LoanRepaymentHistory; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.LoanRepaymentHistoryRecordVo; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanbuckleapplyrecord.LoanBuckleApplyRecordService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymenthistory.LoanRepaymentHistoryService; |
|
|
|
import com.yxt.common.base.config.component.DocPdfComponent; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -159,6 +159,8 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
public ResultBean<LoanBuckleApplyInit> buckleInit(String[] sids) { |
|
|
|
ResultBean<LoanBuckleApplyInit> rb = ResultBean.fireFail(); |
|
|
|
LoanBuckleApplyInit vo = new LoanBuckleApplyInit(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
vo.setApplyDate(sdf.format(new Date())); |
|
|
|
List<LoanBuckleHistoryRecord> historyRecords = new ArrayList<>(); |
|
|
|
for (String sid : sids) { |
|
|
|
LoanBuckleHistoryRecord record = new LoanBuckleHistoryRecord(); |
|
|
@ -173,7 +175,7 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 生成交车资料确认单单据编号 |
|
|
|
* 生成申请单单据编号 |
|
|
|
* |
|
|
|
* @param orgSid |
|
|
|
* @return |
|
|
@ -204,8 +206,12 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
loanBuckleApplyRecordService.deleteByMainSid(sid); |
|
|
|
//删除附件表中关于该linkSid的文件
|
|
|
|
loanFileService.deleteByLinkSid(sid); |
|
|
|
List<String> files = dto.getFiles(); |
|
|
|
if (!files.isEmpty()) { |
|
|
|
List<LoanBuckleFile> filess = dto.getFiles(); |
|
|
|
if (!filess.isEmpty()) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (LoanBuckleFile file : filess) { |
|
|
|
files.add(file.getUrl()); |
|
|
|
} |
|
|
|
loanFileService.saveAll(sid, files, LoanFileEnum.BUCKLE_APPLY.getAttachType()); |
|
|
|
} |
|
|
|
List<LoanBuckleHistoryRecord> records = dto.getRecords(); |
|
|
@ -255,8 +261,14 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> files = dto.getFiles(); |
|
|
|
if (!files.isEmpty()) { |
|
|
|
//删除附件表中关于该linkSid的文件
|
|
|
|
loanFileService.deleteByLinkSid(sid); |
|
|
|
List<LoanBuckleFile> filess = dto.getFiles(); |
|
|
|
if (!filess.isEmpty()) { |
|
|
|
List<String> files = new ArrayList<>(); |
|
|
|
for (LoanBuckleFile file : filess) { |
|
|
|
files.add(file.getUrl()); |
|
|
|
} |
|
|
|
loanFileService.saveAll(sid, files, LoanFileEnum.BUCKLE_APPLY.getAttachType()); |
|
|
|
} |
|
|
|
} |
|
|
@ -283,7 +295,13 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
if (!fileList.isEmpty()) { |
|
|
|
List<String> files = fileList.stream().map(c -> fileUploadComponent.getUrlPrefix() + c.getFilePath()). |
|
|
|
collect(Collectors.toList()); |
|
|
|
initVo.setFiles(files); |
|
|
|
List<LoanBuckleFile> loanBuckleFiles = new ArrayList<>(); |
|
|
|
for (String file : files) { |
|
|
|
LoanBuckleFile loanBuckleFile = new LoanBuckleFile(); |
|
|
|
loanBuckleFile.setUrl(file); |
|
|
|
loanBuckleFiles.add(loanBuckleFile); |
|
|
|
} |
|
|
|
initVo.setFiles(loanBuckleFiles); |
|
|
|
} |
|
|
|
List<LoanBuckleApplyRecord> records = loanBuckleApplyRecordService.selByMainSid(sid); |
|
|
|
List<LoanBuckleHistoryRecord> recordList = new ArrayList<>(); |
|
|
@ -509,6 +527,9 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
} |
|
|
|
int i = updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
LoanBuckleApply buckleApply = fetchBySid(businessSid); |
|
|
|
buckleApply.setClosingDate(new DateTime()); |
|
|
|
baseMapper.updateById(buckleApply); |
|
|
|
List<LoanBuckleApplyRecord> applyRecords = loanBuckleApplyRecordService.selByMainSid(businessSid); |
|
|
|
if (!applyRecords.isEmpty()) { |
|
|
|
for (LoanBuckleApplyRecord applyRecord : applyRecords) { |
|
|
@ -516,11 +537,11 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
if (null != repaymentHistory) { |
|
|
|
repaymentHistory.setBuckle("审核通过"); |
|
|
|
repaymentHistory.setBuckleKey("003"); |
|
|
|
repaymentHistory.setClosingDate(new DateTime()); |
|
|
|
loanRepaymentHistoryService.updateById(repaymentHistory); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
@ -830,26 +851,26 @@ public class LoanBuckleApplyService extends MybatisBaseService<LoanBuckleApplyMa |
|
|
|
if (StringUtils.isNotBlank(data.getBorrowerName())) { |
|
|
|
appRecordVo.setLoanName(data.getBorrowerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(data.getDueDate())) { |
|
|
|
appRecordVo.setRepaymentDate(data.getDueDate()); |
|
|
|
} |
|
|
|
// if (StringUtils.isNotBlank(data.getDueDate())) {
|
|
|
|
// appRecordVo.setRepaymentDate(data.getDueDate());
|
|
|
|
// }
|
|
|
|
String yinghuan = ""; |
|
|
|
String weihuan = ""; |
|
|
|
String shihuan = ""; |
|
|
|
String shihuandate = ""; |
|
|
|
if (StringUtils.isNotBlank(data.getDueMoney())) { |
|
|
|
yinghuan = data.getDueMoney(); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(data.getOutstandingMoney())) { |
|
|
|
weihuan = data.getOutstandingMoney(); |
|
|
|
} |
|
|
|
// if (StringUtils.isNotBlank(data.getDueMoney())) {
|
|
|
|
// yinghuan = data.getDueMoney();
|
|
|
|
// }
|
|
|
|
// if (StringUtils.isNotBlank(data.getOutstandingMoney())) {
|
|
|
|
// weihuan = data.getOutstandingMoney();
|
|
|
|
// }
|
|
|
|
if (StringUtils.isNotBlank(data.getActualDate())) { |
|
|
|
shihuandate = data.getActualDate(); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(data.getActualMoney())) { |
|
|
|
shihuan = data.getActualMoney(); |
|
|
|
} |
|
|
|
appRecordVo.setInfo1("本期应还:" + yinghuan + ",本期未还:" + weihuan); |
|
|
|
appRecordVo.setInfo1(""); |
|
|
|
appRecordVo.setInfo2("实还日期:" + shihuandate + ",实还金额:" + shihuan); |
|
|
|
records.add(appRecordVo); |
|
|
|
} |
|
|
|