|
|
@ -36,6 +36,10 @@ import com.yxt.anrui.base.api.baseoutsourcingapplication.BaseOutsourcingApplicat |
|
|
|
import com.yxt.anrui.base.api.baseoutsourcingapplication.BaseOutsourcingApplicationFeign; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchaseSystemFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicleactualpay.BaseVehicleActualPay; |
|
|
|
import com.yxt.anrui.base.api.basevehicleactualpay.BaseVehicleActualPayFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicleactualsales.BaseVehicleActualSalesDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.basevehicleactualsales.BaseVehicleActualSalesFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehicleoutapply.BaseVehicleOutApplyFeign; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.BusVehicleApplyDetailsVo; |
|
|
|
import com.yxt.anrui.base.api.busvehicleapply.BusVehicleApplyFeign; |
|
|
@ -49,6 +53,8 @@ import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowRecordVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTask; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
|
|
import com.yxt.anrui.portal.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
@ -59,6 +65,7 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
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.WordUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -121,11 +128,15 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
private FlowableFeign flowableFeign; |
|
|
|
@Autowired |
|
|
|
private BasePurchaseSystemFeign basePurchaseSystemFeign; |
|
|
|
@Autowired |
|
|
|
private MessageFeign messageFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleActualSalesFeign baseVehicleActualSalesFeign; |
|
|
|
@Autowired |
|
|
|
private BaseVehicleActualPayFeign baseVehicleActualPayFeign; |
|
|
|
|
|
|
|
public PagerVo<FinPaymentrecordVo> listPageVo(PagerQuery<FinPaymentrecordQuery> pq) { |
|
|
|
FinPaymentrecordQuery query = pq.getParams(); |
|
|
@ -148,10 +159,10 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
qw.apply(StringUtils.isNotBlank(pageQuery.getCreateStartDate()), "date_format (fp.createTime,'%Y-%m-%d') >= date_format('" + pageQuery.getCreateStartDate() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(pageQuery.getCreateEndDate()), "date_format (fp.createTime,'%Y-%m-%d') <= date_format('" + pageQuery.getCreateEndDate() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
if(StringUtils.isNotBlank(pageQuery.getOrgPath())){ |
|
|
|
if (StringUtils.isNotBlank(pageQuery.getOrgPath())) { |
|
|
|
String orgSid = sysStaffOrgFeign.getOrgSidByPath(pageQuery.getOrgPath()).getData(); |
|
|
|
qw.eq("fp.useOrgSid", orgSid); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//分公司sid
|
|
|
|
if (StringUtils.isNotBlank(pageQuery.getUserSid())) { |
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getPathSidByUserSid(pageQuery.getUserSid()); |
|
|
@ -302,7 +313,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
AppScmMessageFlowableQuery query = new AppScmMessageFlowableQuery(); |
|
|
|
ArrayList<String> recipientSidList = new ArrayList<>(); |
|
|
|
String costTypeKey = finPaymentrecord.getCostTypeKey(); |
|
|
|
if ("002".equals(costTypeKey)){ |
|
|
|
if ("002".equals(costTypeKey)) { |
|
|
|
BaseOutsourcingApplicationDetailsVo baseOutsourcingApplicationDetailsVo = baseOutsourcingApplicationFeign.fetchBySid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
String createBySid = baseOutsourcingApplicationDetailsVo.getCreateBySid(); |
|
|
|
recipientSidList.add(createBySid); |
|
|
@ -318,7 +329,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
query.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd"); |
|
|
|
query.setName("财务管理"); |
|
|
|
messageFeign.sendMessage(query); |
|
|
|
}else if ("005".equals(costTypeKey)){ |
|
|
|
} else if ("005".equals(costTypeKey)) { |
|
|
|
BusVehicleApplyDetailsVo busVehicleApplyDetailsVo = busVehicleApplyFeign.fetchSid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
String createBySid = busVehicleApplyDetailsVo.getCreateBySid(); |
|
|
|
recipientSidList.add(createBySid); |
|
|
@ -499,20 +510,35 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
//获取审批编号
|
|
|
|
BaseOutsourcingApplicationDetailsVo baseOutsourcingApplicationDetailsVo = baseOutsourcingApplicationFeign.fetchBySid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
BusVehicleApplyDetailsVo busVehicleApplyDetailsVo = busVehicleApplyFeign.fetchSid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
BaseVehicleActualPay baseVehicleActualPay = baseVehicleActualPayFeign.fetchBySid(finPaymentrecord.getApplySid()).getData(); |
|
|
|
BaseVehicleActualSalesDetailsVo baseVehicleActualSalesDetailsVo = baseVehicleActualSalesFeign.details(baseVehicleActualPay.getVehicleActualSid()).getData(); |
|
|
|
if (baseOutsourcingApplicationDetailsVo != null) { |
|
|
|
if (StringUtils.isNotBlank(baseOutsourcingApplicationDetailsVo.getApplicationCode())) { |
|
|
|
dataMap.put("applyCode", baseOutsourcingApplicationDetailsVo.getApplicationCode()); |
|
|
|
//获取审批记录
|
|
|
|
FlowRecordVo flowRecordVo = flowTaskFeign.businessFlowRecord(baseOutsourcingApplicationDetailsVo.getProcInstSid()).getData(); |
|
|
|
List<FlowTask> flowList = flowRecordVo.getFlowList(); |
|
|
|
flowList.sort(comparing(FlowTask::getFinishTime)); |
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeign.flowRecordAndComment(baseOutsourcingApplicationDetailsVo.getProcInstSid(), "1").getData(); |
|
|
|
flowRecordVo.sort(comparing(PCHistTaskListAndCommentList::getTime)); |
|
|
|
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>(); |
|
|
|
for (FlowTask flowTask : flowList) { |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
finPaymentrecordSourceLCVo.setName(flowTask.getTaskUserInfos().get(0).getAssigneeName()); |
|
|
|
finPaymentrecordSourceLCVo.setComment(flowTask.getComment().getComment()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
//获取附件名称(文档类型)
|
|
|
@ -530,18 +556,61 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
if (StringUtils.isNotBlank(busVehicleApplyDetailsVo.getSid())) { |
|
|
|
dataMap.put("applyCode", busVehicleApplyDetailsVo.getApplicationCode()); |
|
|
|
//获取审批记录
|
|
|
|
FlowRecordVo flowRecordVo = flowTaskFeign.businessFlowRecord(busVehicleApplyDetailsVo.getProcInstId()).getData(); |
|
|
|
List<FlowTask> flowList = flowRecordVo.getFlowList(); |
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeign.flowRecordAndComment(busVehicleApplyDetailsVo.getProcInstId(), "1").getData(); |
|
|
|
flowRecordVo.sort(comparing(PCHistTaskListAndCommentList::getTime)); |
|
|
|
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>(); |
|
|
|
for (FlowTask flowTask : flowList) { |
|
|
|
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("concent").toString()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString()); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
} |
|
|
|
if (baseVehicleActualSalesDetailsVo != null) { |
|
|
|
dataMap.put("applyCode", ""); |
|
|
|
//获取审批记录
|
|
|
|
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeign.flowRecordAndComment(baseVehicleActualSalesDetailsVo.getProcInstId(), "1").getData(); |
|
|
|
flowRecordVo.sort(comparing(PCHistTaskListAndCommentList::getTime)); |
|
|
|
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>(); |
|
|
|
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) { |
|
|
|
if (flowTask.getFlowableRecordVo() != null){ |
|
|
|
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo(); |
|
|
|
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo(); |
|
|
|
finPaymentrecordSourceLCVo.setName(flowTask.getTaskUserInfos().get(0).getAssigneeName()); |
|
|
|
finPaymentrecordSourceLCVo.setComment(flowTask.getComment().getComment()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(flowTask.getFinishTime(), "yyyy-MM-dd")); |
|
|
|
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("concent").toString()); |
|
|
|
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString()); |
|
|
|
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo); |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
dataMap.put("lcList", finPaymentrecordSourceLCVos); |
|
|
|
} |
|
|
|
dataMap.put("createTime", DateUtil.format(finPaymentrecord.getCreateTime(), "yyyy-MM-dd")); |
|
|
|
dataMap.put("createByName", createByName); |
|
|
@ -559,19 +628,14 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
List<String> photoList = new ArrayList<>(); |
|
|
|
dataMap.put("photoPath64", photoList); |
|
|
|
//获取模板
|
|
|
|
// 模板路径
|
|
|
|
//模板路径
|
|
|
|
String sourcePath = "D:\\anrui\\upload\\template\\"; |
|
|
|
File file = new File(getClass().getClassLoader().getResource("ftl/prePaymentApply.ftl").getFile()); |
|
|
|
String dir = getClassLoader().getResource("ftl").getPath(); |
|
|
|
log.info("dir:{}", dir); |
|
|
|
//生成word文件名
|
|
|
|
// String targetPath = docPdfComponent.getUploadTemplateUrl();
|
|
|
|
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
|
|
|
long seconds = System.currentTimeMillis(); |
|
|
|
String typeName = dateStr + seconds + ".doc"; |
|
|
|
// 生成文件路径
|
|
|
|
String targetPath = sourcePath + dateStr; |
|
|
|
log.info("dataMap:{}", JSONObject.toJSONString(dataMap)); |
|
|
|
// WordConvertUtils.creatWord(dataMap, file, targetPath, typeName, dir);
|
|
|
|
WordUtils.creatWord(dataMap, "prePaymentApply", sourcePath, targetPath, typeName); |
|
|
|
//新生成的word路径
|
|
|
|