Commit ac092941 authored by wei's avatar wei 🎱

word模板生成

parent 5c564cdd
......@@ -2,13 +2,14 @@ package com.yonde.dcs.plan.core.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.google.common.collect.Lists;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.constants.SignConstants;
import com.yonde.dcs.plan.common.utils.FileUtils;
import com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO;
import com.yonde.dcs.plan.common.vo.ExtInComeContractVO;
import com.yonde.dcs.plan.core.factory.ExpenditureContractUtils;
import com.yonde.dcs.plan.core.factory.InComeContractUtils;
import com.yonde.dcs.plan.core.repository.ExtExpenditureContractRepository;
import com.yonde.dcs.plan.core.service.ExtExpenditureContractService;
import com.yonde.dcs.plan.core.util.CommonUtils;
......@@ -45,7 +46,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -83,6 +83,12 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
@Autowired
private DxUserInfoFeign userService;
@Autowired
private ExpenditureContractUtils expenditureContractUtils;
@Autowired
private InComeContractUtils inComeContractUtils;
@Override
public ExtExpenditureContractVO startWorkflow(Long id) {
ExtExpenditureContractVO extExpenditureContractVO = this.get(id);
......@@ -103,16 +109,18 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
try {
if (obj instanceof ExtExpenditureContractVO) {
ExtExpenditureContractVO expenditureContractVO = (ExtExpenditureContractVO) obj;
Class<?> clazz = Class.forName("com.yonde.dcs.plan.core.factory.ExpenditureContractUtils");
/*Class<?> clazz = Class.forName("com.yonde.dcs.plan.core.factory.ExpenditureContractUtils");
Method settingDataMethod = clazz.getMethod("settingData", ExtExpenditureContractVO.class, DxWfProcessInfoVO.class);
settingDataMethod.invoke(SpringUtil.getBean(classType), expenditureContractVO, wfProcessInfoVO);
settingDataMethod.invoke(SpringUtil.getBean(classType), expenditureContractVO, wfProcessInfoVO);*/
expenditureContractUtils.settingDocData(expenditureContractVO, wfProcessInfoVO);
outFilePath = outFilePath + expenditureContractVO.getSubTypeName() + "\\" + expenditureContractVO.getNumber() + "\\";
sPath = sPath + expenditureContractVO.getSubTypeName() + "\\" + expenditureContractVO.getNumber();
} else if (obj instanceof ExtInComeContractVO) {
ExtInComeContractVO extInComeContractVO = (ExtInComeContractVO) obj;
Class<?> clazz = Class.forName("com.yonde.dcs.plan.core.factory.InComeContractUtils");
/*Class<?> clazz = Class.forName("com.yonde.dcs.plan.core.factory.InComeContractUtils");
Method settingDataMethod = clazz.getMethod("settingData", ExtInComeContractVO.class, DxWfProcessInfoVO.class);
settingDataMethod.invoke(SpringUtil.getBean(classType), extInComeContractVO, wfProcessInfoVO);
settingDataMethod.invoke(SpringUtil.getBean(classType), extInComeContractVO, wfProcessInfoVO);*/
inComeContractUtils.settingDocData(extInComeContractVO, wfProcessInfoVO);
outFilePath = outFilePath + extInComeContractVO.getSubTypeName() + "\\" + extInComeContractVO.getNumber() + "\\";
sPath = sPath + extInComeContractVO.getSubTypeName() + "\\" + extInComeContractVO.getNumber();
} else {
......@@ -124,9 +132,7 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
//获取文件夹的所有文件--绝对路径
List<String> fileList = new ArrayList<>();
File[] files = FileUtil.ls(outFilePath);
Arrays.stream(files).forEach(item -> {
fileList.add(item.getAbsolutePath());
});
Arrays.stream(files).forEach(item -> fileList.add(item.getAbsolutePath()));
if (CollectionUtils.isEmpty(fileList)) {
log.error("签名----生成的word文件目录内容为空====");
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment