|
@ -12,6 +12,7 @@ import com.yxt.anrui.base.common.enums.BillTypeEnum; |
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
import com.yxt.anrui.base.common.utils.Rule; |
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; |
|
|
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; |
|
@ -21,6 +22,7 @@ import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
|
|
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
@ -28,6 +30,11 @@ import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.ReturnExcelInfo; |
|
|
import com.yxt.anrui.riskcenter.api.loanbepadsincereapply.ReturnExcelInfo; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loanbuckleapply.LoanBuckleApply; |
|
|
|
|
|
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.loanmonthlyaccrualapply.MonthlyAccrualSourceLCVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.*; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.*; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverFinApplyDelegateQuery; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverFinApplyDelegateQuery; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverdueApplyNodeQuery; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverdueApplyNodeQuery; |
|
@ -35,17 +42,25 @@ import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverdueApplyNodeVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverdueApplyTaskQuery; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.flowable.OverdueApplyTaskQuery; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefindetails.LoanOverdueFinAppDetailsVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefindetails.LoanOverdueFinAppDetailsVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefindetails.LoanOverdueFinDetailsDto; |
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefindetails.LoanOverdueFinDetailsDto; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails; |
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentschedule.LoanRepaymentScheduleDetailsVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentschedule.LoanRepaymentScheduleDetailsVo; |
|
|
import com.yxt.anrui.riskcenter.biz.loanoverduefindetails.LoanOverdueFinDetailsService; |
|
|
import com.yxt.anrui.riskcenter.biz.loanoverduefindetails.LoanOverdueFinDetailsService; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; |
|
|
|
|
|
import com.yxt.common.base.config.component.DocPdfComponent; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
|
|
import com.yxt.common.base.utils.ConstantUtils; |
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
|
|
import com.yxt.common.base.utils.WordConvertUtils; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
import com.yxt.messagecenter.api.message.Message; |
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
|
|
|
import com.yxt.messagecenter.api.messagelist.MessageList; |
|
|
|
|
|
import com.yxt.messagecenter.api.messagelist.MessageListFeign; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
@ -66,6 +81,8 @@ import java.util.*; |
|
|
import java.util.concurrent.*; |
|
|
import java.util.concurrent.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import static java.util.Comparator.comparing; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @description: |
|
|
* @description: |
|
|
* @author: dimengzhe |
|
|
* @author: dimengzhe |
|
@ -74,6 +91,10 @@ import java.util.stream.Collectors; |
|
|
@Service |
|
|
@Service |
|
|
public class LoanOverdueFinService extends MybatisBaseService<LoanOverdueFinMapper, LoanOverdueFin> { |
|
|
public class LoanOverdueFinService extends MybatisBaseService<LoanOverdueFinMapper, LoanOverdueFin> { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MessageListFeign messageListFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private com.yxt.anrui.portal.api.flow.FlowableFeign flowableFeignPro; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysUserFeign sysUserFeign; |
|
|
private SysUserFeign sysUserFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -92,6 +113,10 @@ public class LoanOverdueFinService extends MybatisBaseService<LoanOverdueFinMapp |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FlowableFeign flowableFeign; |
|
|
private FlowableFeign flowableFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private DocPdfComponent docPdfComponent; |
|
|
|
|
|
|
|
|
public PagerVo<LoanOverdueFinVo> listPageVo(PagerQuery<LoanOverdueFinQuery> pq) { |
|
|
public PagerVo<LoanOverdueFinVo> listPageVo(PagerQuery<LoanOverdueFinQuery> pq) { |
|
|
LoanOverdueFinQuery query = pq.getParams(); |
|
|
LoanOverdueFinQuery query = pq.getParams(); |
|
@ -894,4 +919,142 @@ public class LoanOverdueFinService extends MybatisBaseService<LoanOverdueFinMapp |
|
|
} |
|
|
} |
|
|
return rb.success().setData(loanOverdueFinAppVo); |
|
|
return rb.success().setData(loanOverdueFinAppVo); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<String> overdueCreatePdf(String sid) { |
|
|
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
String finalPath = ""; |
|
|
|
|
|
Map<String, Object> dataMap = new HashMap(); |
|
|
|
|
|
List<Map<String, Object>> newList = new ArrayList<>(); |
|
|
|
|
|
LoanOverdueFin data = fetchBySid(sid); |
|
|
|
|
|
if (null != data) { |
|
|
|
|
|
if (!data.getNodeState().equals("已办结")) { |
|
|
|
|
|
return rb.setMsg("无法下载没有办结的审批记录。"); |
|
|
|
|
|
} |
|
|
|
|
|
dataMap.put("createTime", DateUtil.formatDate(data.getCreateTime())); |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getUseOrgName())) { |
|
|
|
|
|
dataMap.put("company", data.getUseOrgName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getCreateByName())) { |
|
|
|
|
|
dataMap.put("applyName", data.getCreateByName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getCreateDept())) { |
|
|
|
|
|
dataMap.put("dept", data.getCreateDept()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getRemarks())) { |
|
|
|
|
|
dataMap.put("remarks", data.getRemarks()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getFiles())) { |
|
|
|
|
|
dataMap.put("filePath", data.getFiles()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getStopDate())) { |
|
|
|
|
|
dataMap.put("endTime", data.getStopDate()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(data.getBillNo())) { |
|
|
|
|
|
dataMap.put("billNo", data.getBillNo()); |
|
|
|
|
|
} |
|
|
|
|
|
//获取审批记录
|
|
|
|
|
|
if (StringUtils.isNotBlank(data.getProcInstId())) { |
|
|
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeignPro.flowRecordAndComment(data.getProcInstId(), "1").getData(); |
|
|
|
|
|
List<MonthlyAccrualSourceLCVo> sourceLCVos = new ArrayList<>(); |
|
|
|
|
|
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) { |
|
|
|
|
|
if (flowTask.getFlowableRecordVo() != null) { |
|
|
|
|
|
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo(); |
|
|
|
|
|
MonthlyAccrualSourceLCVo sourceLCVo = new MonthlyAccrualSourceLCVo(); |
|
|
|
|
|
List<Map<String, Object>> taskUserInfos = ConstantUtils.getListData(flowableRecordVo, "taskUserInfos"); |
|
|
|
|
|
Map<String, Object> comment = ConstantUtils.getMap(flowableRecordVo, "comment"); |
|
|
|
|
|
String assigneeName = (String) taskUserInfos.get(0).get("assigneeName"); |
|
|
|
|
|
String comment1 = (String) comment.get("comment"); |
|
|
|
|
|
sourceLCVo.setName(assigneeName); |
|
|
|
|
|
sourceLCVo.setComment(comment1); |
|
|
|
|
|
sourceLCVo.setSpsj(flowableRecordVo.get("finishTime").toString()); |
|
|
|
|
|
sourceLCVos.add(sourceLCVo); |
|
|
|
|
|
} else { |
|
|
|
|
|
Map<String, Object> processCommentVo = flowTask.getProcessCommentVo(); |
|
|
|
|
|
MonthlyAccrualSourceLCVo sourceLCVo = new MonthlyAccrualSourceLCVo(); |
|
|
|
|
|
sourceLCVo.setName(processCommentVo.get("title").toString()); |
|
|
|
|
|
sourceLCVo.setComment(processCommentVo.get("content").toString()); |
|
|
|
|
|
sourceLCVo.setSpsj(processCommentVo.get("time").toString()); |
|
|
|
|
|
sourceLCVos.add(sourceLCVo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<Message> messages = messageFeign.selectByBusinessSid(data.getSid()).getData(); |
|
|
|
|
|
if (messages.size() > 0) { |
|
|
|
|
|
for (Message message : messages) { |
|
|
|
|
|
MonthlyAccrualSourceLCVo sourceLCVo = new MonthlyAccrualSourceLCVo(); |
|
|
|
|
|
String receiverNames = ""; |
|
|
|
|
|
List<MessageList> messageLists = messageListFeign.fetchByMainSid(message.getSid()).getData(); |
|
|
|
|
|
if (messageLists.size() > 0) { |
|
|
|
|
|
for (MessageList messageList : messageLists) { |
|
|
|
|
|
receiverNames = receiverNames + messageList.getReceiverName() + ","; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
sourceLCVo.setName("系统"); |
|
|
|
|
|
sourceLCVo.setComment("抄送 " + receiverNames.substring(0, receiverNames.lastIndexOf(","))); |
|
|
|
|
|
sourceLCVo.setSpsj(DateUtil.format(message.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
|
sourceLCVos.add(sourceLCVo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
sourceLCVos.sort(comparing(MonthlyAccrualSourceLCVo::getSpsj)); |
|
|
|
|
|
dataMap.put("lcList", sourceLCVos); |
|
|
|
|
|
} |
|
|
|
|
|
List<LoanOverdueFinDetailsDto> records = loanOverdueFinDetailsService.selectByMainSid(sid); |
|
|
|
|
|
if (!records.isEmpty()) { |
|
|
|
|
|
int sortNo = 1; |
|
|
|
|
|
for (LoanOverdueFinDetailsDto applyRecord : records) { |
|
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
|
|
LoanRepaymentPlanDetails details = loanRepaymentPlanDetailsService.fetchMainBankByBusVinSid(applyRecord.getBusVinSid()); |
|
|
|
|
|
if (null != details) { |
|
|
|
|
|
map.put("sortNo", String.valueOf(sortNo++)); |
|
|
|
|
|
if (StringUtils.isNotBlank(details.getLoanContractNo())) { |
|
|
|
|
|
map.put("loanNo", details.getLoanContractNo()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(details.getVinNo())) { |
|
|
|
|
|
map.put("vinNo", details.getVinNo()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(details.getBorrowerName())) { |
|
|
|
|
|
map.put("borrowerName", details.getBorrowerName()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(details.getDept())) { |
|
|
|
|
|
map.put("saleDept", details.getDept()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(applyRecord.getOverdueMoney())) { |
|
|
|
|
|
map.put("overDueMoney", applyRecord.getOverdueMoney()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(applyRecord.getTiredDeficiency())) { |
|
|
|
|
|
map.put("tiredMoney", applyRecord.getTiredDeficiency()); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(applyRecord.getDiffMoney())) { |
|
|
|
|
|
map.put("diffMoney", applyRecord.getDiffMoney()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
newList.add(map); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
dataMap.put("newList", newList); |
|
|
|
|
|
String temp = "/template/"; |
|
|
|
|
|
String targetPath = docPdfComponent.getUploadTemplateUrl(); |
|
|
|
|
|
try { |
|
|
|
|
|
//获取模板
|
|
|
|
|
|
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/vouchers/overDue.ftl"); |
|
|
|
|
|
//生成word文件名
|
|
|
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
|
|
File file = new File(targetPath + "templateVouchers" + seconds + ".ftl"); |
|
|
|
|
|
File dir = new File(targetPath); |
|
|
|
|
|
WordConvertUtils.inputStreamToFile(inputStream, file); |
|
|
|
|
|
WordConvertUtils.creatWord1(dataMap, file, targetPath, typeName, dir); |
|
|
|
|
|
//新生成的word路径
|
|
|
|
|
|
String wordPath = targetPath + typeName; |
|
|
|
|
|
String pdfName = "逾期对账审批" + dateStr + seconds + ".pdf"; |
|
|
|
|
|
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); |
|
|
|
|
|
finalPath = temp + pdfName; |
|
|
|
|
|
} catch (NoClassDefFoundError e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
finalPath = targetPath; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return rb.success().setData(finalPath); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|