|
@ -2,16 +2,16 @@ package com.yxt.anrui.riskcenter.biz.loanoutboundapply; |
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
import cn.hutool.core.date.DateTime; |
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemFeign; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderborrower.BusSalesOrderBorrowerFeign; |
|
|
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; |
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVinStateSetQuery; |
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVinStateSetQuery; |
|
|
|
|
|
import com.yxt.anrui.fin.api.finpaymentrecord.FinPaymentrecordSourceLCVo; |
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
|
|
|
import com.yxt.anrui.fin.api.kingdee.stkmisdelivery.StkMisDelivery; |
|
|
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 +21,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.SysStaffOrg; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
@ -35,27 +36,22 @@ import com.yxt.anrui.riskcenter.api.loanoutboundapply.app.AppOutboundDetailsVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundapply.app.AppOutboundVinListVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundapply.app.AppOutboundVinListVo; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundapply.flow.*; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundapply.flow.*; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundveh.LoanOutboundVeh; |
|
|
import com.yxt.anrui.riskcenter.api.loanoutboundveh.LoanOutboundVeh; |
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.*; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.app.AppSubletDetailsVo; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.app.AppSubletVinListVo; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.flow.*; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletveh.LoanSubletVeh; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loanbuckleapplyrecord.LoanBuckleApplyRecordService; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
import com.yxt.anrui.riskcenter.biz.loanoutboundveh.LoanOutboundVehService; |
|
|
import com.yxt.anrui.riskcenter.biz.loanoutboundveh.LoanOutboundVehService; |
|
|
import com.yxt.anrui.riskcenter.biz.loanredemptionapply.LoanRedemptionApplyService; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymenthistory.LoanRepaymentHistoryService; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrepaymentplandetails.LoanRepaymentPlanDetailsService; |
|
|
|
|
|
import com.yxt.anrui.riskcenter.biz.loansubletveh.LoanSubletVehService; |
|
|
|
|
|
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.WordUtils; |
|
|
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.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -66,6 +62,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: fzz |
|
|
* @author: fzz |
|
@ -79,14 +77,10 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysUserFeign sysUserFeign; |
|
|
private SysUserFeign sysUserFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanRepaymentHistoryService loanRepaymentHistoryService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanBuckleApplyRecordService loanBuckleApplyRecordService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private LoanFileService loanFileService; |
|
|
private LoanFileService loanFileService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FileUploadComponent fileUploadComponent; |
|
|
private FileUploadComponent fileUploadComponent; |
|
@ -97,23 +91,15 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FlowableFeign flowableFeign; |
|
|
private FlowableFeign flowableFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanRepaymentPlanDetailsService loanRepaymentPlanDetailsService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; |
|
|
private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private FinKingDeeFeign finKingDeeFeign; |
|
|
private LoanOutboundVehService loanOutboundVehService; |
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderBorrowerFeign busSalesOrderBorrowerFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BusSalesOrderFeign busSalesOrderFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private BasePurchaseSystemFeign basePurchaseSystemFeign; |
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanRedemptionApplyService loanRedemptionApplyService; |
|
|
private MessageListFeign messageListFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanSubletVehService loanSubletVehService; |
|
|
private com.yxt.anrui.portal.api.flow.FlowableFeign flowableFeignSp; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LoanOutboundVehService loanOutboundVehService; |
|
|
private FinKingDeeFeign finKingDeeFeign; |
|
|
|
|
|
|
|
|
public PagerVo<LoanOutboundApplyVo> listPage(PagerQuery<LoanOutboundApplyQuery> pq) { |
|
|
public PagerVo<LoanOutboundApplyVo> listPage(PagerQuery<LoanOutboundApplyQuery> pq) { |
|
|
IPage<LoanOutboundApply> page = PagerUtil.queryToPage(pq); |
|
|
IPage<LoanOutboundApply> page = PagerUtil.queryToPage(pq); |
|
@ -589,7 +575,7 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
//修改销售订单车辆表风控状态和资金占用费状态
|
|
|
//修改销售订单车辆表风控状态和资金占用费状态
|
|
|
BusVinStateSetQuery busVinStateSetQuery = new BusVinStateSetQuery(); |
|
|
BusVinStateSetQuery busVinStateSetQuery = new BusVinStateSetQuery(); |
|
|
List<String> busVinSidList = loanOutboundVehService.selectByMainSid(businessSid); |
|
|
List<String> busVinSidList = loanOutboundVehService.selectByMainSid(businessSid); |
|
|
if(busVinSidList.isEmpty()){ |
|
|
if(!busVinSidList.isEmpty()){ |
|
|
busVinStateSetQuery.setBusVinSidList(busVinSidList); |
|
|
busVinStateSetQuery.setBusVinSidList(busVinSidList); |
|
|
if("客户赎回".equals(loanOutboundApply.getDisposal())){ |
|
|
if("客户赎回".equals(loanOutboundApply.getDisposal())){ |
|
|
busVinStateSetQuery.setState(2); |
|
|
busVinStateSetQuery.setState(2); |
|
@ -603,6 +589,24 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
}*/else if("二次销售".equals(loanOutboundApply.getDisposal())){ |
|
|
}*/else if("二次销售".equals(loanOutboundApply.getDisposal())){ |
|
|
//ToDo:
|
|
|
//ToDo:
|
|
|
} |
|
|
} |
|
|
|
|
|
//推送金蝶财务其他出库单
|
|
|
|
|
|
try { |
|
|
|
|
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
|
|
|
|
|
.setNameFormat("demo-pool-%d").build(); |
|
|
|
|
|
ExecutorService pool = new org.apache.tomcat.util.threads.ThreadPoolExecutor(2, 100, |
|
|
|
|
|
0L, TimeUnit.MILLISECONDS, |
|
|
|
|
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new org.apache.tomcat.util.threads.ThreadPoolExecutor.AbortPolicy()); |
|
|
|
|
|
LoanOutboundApply finalLoanOutboundApply = loanOutboundApply; |
|
|
|
|
|
Future future1 = pool.submit(() -> { |
|
|
|
|
|
//推送其他出库单
|
|
|
|
|
|
//TOdO:
|
|
|
|
|
|
pushStkOut(finalLoanOutboundApply,busVinSidList); |
|
|
|
|
|
}); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -640,6 +644,32 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void pushStkOut(LoanOutboundApply loanOutboundApply,List<String> busVinSidList) { |
|
|
|
|
|
SysOrganizationVo sysOrg = sysOrganizationFeign.fetchBySid(loanOutboundApply.getUseOrgSid()).getData(); |
|
|
|
|
|
StkMisDelivery stkMisDelivery = new StkMisDelivery(); |
|
|
|
|
|
List<StkMisDelivery.StkMisDeliveryEntry> stkMiscellaneousEntryList = new ArrayList<>(); |
|
|
|
|
|
SysOrganizationVo sysOrgDept = sysOrganizationFeign.fetchBySid(loanOutboundApply.getDeptSid()).getData(); |
|
|
|
|
|
stkMisDelivery.setFStockOrgId(sysOrg.getOrgCode()); |
|
|
|
|
|
stkMisDelivery.setFDEPTID(sysOrgDept.getOrgCode()); |
|
|
|
|
|
stkMisDelivery.setFNOTE(""); |
|
|
|
|
|
stkMisDelivery.setFDate(DateUtil.today()); |
|
|
|
|
|
stkMisDelivery.setFOwnerIdHead(sysOrg.getOrgCode()); |
|
|
|
|
|
for (int i = 0; i < busVinSidList.size(); i++) { |
|
|
|
|
|
StkMisDelivery.StkMisDeliveryEntry stkMisDeliveryEntry = new StkMisDelivery.StkMisDeliveryEntry(); |
|
|
|
|
|
LoanOutboundVeh loanOutboundVeh = loanOutboundVehService.selectByMainSidAndBusVinSid(loanOutboundApply.getSid(),busVinSidList.get(i)); |
|
|
|
|
|
stkMisDeliveryEntry.setFMATERIALID(loanOutboundVeh.getVinNo()); |
|
|
|
|
|
stkMisDeliveryEntry.setFUnitID("liang"); |
|
|
|
|
|
stkMisDeliveryEntry.setFSTOCKID("ARZSCK"); |
|
|
|
|
|
stkMisDeliveryEntry.setFOWNERID(sysOrg.getOrgCode()); |
|
|
|
|
|
stkMiscellaneousEntryList.add(stkMisDeliveryEntry); |
|
|
|
|
|
stkMisDelivery.setStkMisDeliveryEntry(stkMiscellaneousEntryList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ResultBean resultBean = finKingDeeFeign.draftStkMisDelivery(stkMisDelivery); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 撤回 |
|
|
* 撤回 |
|
|
* |
|
|
* |
|
@ -976,4 +1006,107 @@ public class LoanOutboundApplyService extends MybatisBaseService<LoanOutboundApp |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String createPdf(String sid, String userName) { |
|
|
|
|
|
LoanOutboundApplyInit data = outboundDetails(sid).getData(); |
|
|
|
|
|
Map<String, Object> dataMap = new HashMap<String, Object>(); |
|
|
|
|
|
LoanOutboundApply loanOutboundApply = fetchBySid(sid); |
|
|
|
|
|
//分公司
|
|
|
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(data.getOrgPath()).getData(); |
|
|
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData(); |
|
|
|
|
|
dataMap.put("orgName", sysOrganizationVo.getName()); |
|
|
|
|
|
//创建部门
|
|
|
|
|
|
dataMap.put("deptName", data.getDept()); |
|
|
|
|
|
//创建人
|
|
|
|
|
|
dataMap.put("createName", data.getApplyName()); |
|
|
|
|
|
//创建日期
|
|
|
|
|
|
dataMap.put("createTime", data.getApplyDate()); |
|
|
|
|
|
//办结日期
|
|
|
|
|
|
dataMap.put("finishTime", DateUtil.formatDate(loanOutboundApply.getClosingDate())); |
|
|
|
|
|
//审批编号
|
|
|
|
|
|
dataMap.put("billNo", loanOutboundApply.getBillNo()); |
|
|
|
|
|
List<LoanOutboundApplyPdfVo> loanOutboundApplyPdfVos = new ArrayList<>(); |
|
|
|
|
|
//循环获取车辆信息
|
|
|
|
|
|
Integer i = 1; |
|
|
|
|
|
for (OutboundVinList outboundVinList : data.getVinList()) { |
|
|
|
|
|
LoanOutboundApplyPdfVo loanOutboundApplyPdfVo = new LoanOutboundApplyPdfVo(); |
|
|
|
|
|
loanOutboundApplyPdfVo.setId(i); |
|
|
|
|
|
i = i + 1; |
|
|
|
|
|
loanOutboundApplyPdfVo.setVinNo(outboundVinList.getVinNo()); |
|
|
|
|
|
loanOutboundApplyPdfVo.setCph(outboundVinList.getVehMark()); |
|
|
|
|
|
loanOutboundApplyPdfVo.setLx(outboundVinList.getVehType()); |
|
|
|
|
|
loanOutboundApplyPdfVo.setCx(outboundVinList.getVehModel()); |
|
|
|
|
|
loanOutboundApplyPdfVo.setDd(outboundVinList.getLocation()); |
|
|
|
|
|
loanOutboundApplyPdfVos.add(loanOutboundApplyPdfVo); |
|
|
|
|
|
} |
|
|
|
|
|
dataMap.put("wlList", loanOutboundApplyPdfVos); |
|
|
|
|
|
dataMap.put("cz", data.getDisposal()); |
|
|
|
|
|
dataMap.put("czh", data.getDisposalContractNo()); |
|
|
|
|
|
dataMap.put("name", data.getNewCustomer()); |
|
|
|
|
|
dataMap.put("sjh", data.getPhoneNum()); |
|
|
|
|
|
dataMap.put("ckj", data.getAmount()); |
|
|
|
|
|
dataMap.put("remarks", data.getRemarks()); |
|
|
|
|
|
//获取审批记录
|
|
|
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeignSp.flowRecordAndComment(loanOutboundApply.getProcInstId(), "1").getData(); |
|
|
|
|
|
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>(); |
|
|
|
|
|
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) { |
|
|
|
|
|
if (flowTask.getFlowableRecordVo() != null) { |
|
|
|
|
|
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo(); |
|
|
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
|
|
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"); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setName(assigneeName); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setComment(comment1); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setSpsj(flowableRecordVo.get("finishTime").toString()); |
|
|
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
|
|
} else { |
|
|
|
|
|
Map<String, Object> processCommentVo = flowTask.getProcessCommentVo(); |
|
|
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setName(processCommentVo.get("title").toString()); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setComment(processCommentVo.get("content").toString()); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString()); |
|
|
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<Message> messages = messageFeign.selectByBusinessSid(data.getSid()).getData(); |
|
|
|
|
|
if (messages.size() > 0) { |
|
|
|
|
|
for (Message message : messages) { |
|
|
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
|
|
String receiverNames = ""; |
|
|
|
|
|
List<MessageList> messageLists = messageListFeign.fetchByMainSid(message.getSid()).getData(); |
|
|
|
|
|
if (messageLists.size() > 0) { |
|
|
|
|
|
for (MessageList messageList : messageLists) { |
|
|
|
|
|
receiverNames = receiverNames + messageList.getReceiverName() + ","; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
finPaymentrecordSourceLCVo.setName("系统"); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setComment("抄送 " + receiverNames.substring(0, receiverNames.lastIndexOf(","))); |
|
|
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(message.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
finPaymentrecordSourceLCVos.sort(comparing(FinPaymentrecordSourceLCVo::getSpsj)); |
|
|
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
|
|
//下载人
|
|
|
|
|
|
dataMap.put("downName", userName); |
|
|
|
|
|
//下载时间
|
|
|
|
|
|
dataMap.put("downTime", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
|
//获取模板
|
|
|
|
|
|
//模板路径
|
|
|
|
|
|
String sourcePath = "D:\\anrui\\upload\\template\\"; |
|
|
|
|
|
//生成word文件名
|
|
|
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
|
|
// 生成文件路径
|
|
|
|
|
|
String targetPath = sourcePath + dateStr; |
|
|
|
|
|
WordUtils.creatWord(dataMap, "jhclck", sourcePath, targetPath, typeName); |
|
|
|
|
|
//新生成的word路径
|
|
|
|
|
|
String wordPath = targetPath + "\\" + typeName; |
|
|
|
|
|
//生成出门证文件名
|
|
|
|
|
|
String pdfName = "交回车辆出库审批_" + dateStr + seconds + ".pdf"; |
|
|
|
|
|
WordUtils.doc2pdf(wordPath, targetPath, pdfName, userName); |
|
|
|
|
|
return "/template/" + dateStr + "/" + pdfName; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|