Browse Source

修复问题

zhanglei
dimengzhe 3 years ago
parent
commit
d022f57058
  1. 2
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basediscountpackage/BaseDiscountpackageService.java
  2. 40
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java
  3. 2
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bushandover/BusHandoverVo.java
  4. 3
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverMapper.xml
  5. 47
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java
  6. 13
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java

2
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basediscountpackage/BaseDiscountpackageService.java

@ -30,7 +30,6 @@ import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
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.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.query.PagerQuery;
@ -395,6 +394,7 @@ public class BaseDiscountpackageService extends MybatisBaseService<BaseDiscountp
qw.lambda().apply("FIND_IN_SET ('" + orgPath + "',useOrg)"); qw.lambda().apply("FIND_IN_SET ('" + orgPath + "',useOrg)");
} }
qw.eq("salesPolicyKey", "0002"); qw.eq("salesPolicyKey", "0002");
qw.eq("nodeState","已办结");
List<AppBaseDiscountpackageVo> voList = baseMapper.getAppPackage(qw); List<AppBaseDiscountpackageVo> voList = baseMapper.getAppPackage(qw);
if (voList.isEmpty()) { if (voList.isEmpty()) {
voList = new ArrayList<>(); voList = new ArrayList<>();

40
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/commoncontract/CommonContractService.java

@ -74,6 +74,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.File; import java.io.File;
import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -750,24 +751,32 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp
return url; return url;
}*/ }*/
private String genCarSaleContract(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { private String genCarSaleContract(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) {
File file = null; // File file = null;
String ftl = "";
if ("现车".equals(appOrderDetailsVo.getOrderType())) { if ("现车".equals(appOrderDetailsVo.getOrderType())) {
//获取模板 //获取模板
file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles.ftl").getFile()); // file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles.ftl").getFile());
ftl = "existingvehicles.ftl";
} else { } else {
//获取模板 //获取模板
file = new File(getClass().getClassLoader().getResource("ftl/orderacar.ftl").getFile()); ftl = "orderacar.ftl";
// file = new File(getClass().getClassLoader().getResource("ftl/orderacar.ftl").getFile());
} }
String dir = getClassLoader().getResource("ftl").getPath(); InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl);
// String dir = getClassLoader().getResource("ftl").getPath();
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); File file = new File(targetPath + ftl);
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成文件名
String pdfName = dateStr + seconds + ".pdf"; String pdfName = dateStr + seconds + ".pdf";
WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName); WordConvertUtils.doc2pdf(wordPath, targetPath, pdfName);
return pdfName; return pdfName;
@ -805,27 +814,34 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp
}*/ }*/
private String genCarSaleContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) { private String genCarSaleContractBlank(PrintConfirmDto dto, Map<String, Object> map, AppOrderDetailsVo appOrderDetailsVo) {
String url = ""; String url = "";
File file = null; // File file = null;
map.put("totalPrice", ""); map.put("totalPrice", "");
map.put("priceRemarks", ""); map.put("priceRemarks", "");
map.put("depositTotal", ""); map.put("depositTotal", "");
String ftl = "";
// 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用) // 涉及高低开票的,需要打印两套合同,一套按照成交价打印(记账用),一套为价格空白的合同(开票用)
if ("1".equals(dto.getDiscountKey())) { if ("1".equals(dto.getDiscountKey())) {
// 现车 // 现车
if ("现车".equals(appOrderDetailsVo.getOrderType())) { if ("现车".equals(appOrderDetailsVo.getOrderType())) {
//获取模板 //获取模板
file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles_black.ftl").getFile()); ftl = "existingvehicles_black.ftl";
// file = new File(getClass().getClassLoader().getResource("ftl/existingvehicles_black.ftl").getFile());
} else { } else {
// 订车获取模板 // 订车获取模板
file = new File(getClass().getClassLoader().getResource("ftl/orderacar_black.ftl").getFile()); ftl = "orderacar_black.ftl";
// file = new File(getClass().getClassLoader().getResource("ftl/orderacar_black.ftl").getFile());
} }
String dir = getClassLoader().getResource("ftl").getPath(); // String dir = getClassLoader().getResource("ftl").getPath();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/" + ftl);
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); File file = new File(targetPath + ftl);
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成合同文件名 //生成合同文件名
@ -1231,7 +1247,7 @@ public class CommonContractService extends MybatisBaseService<CommonContractMapp
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv);
UpdateFlowFieldVo ufVo = voResultBean.getData(); UpdateFlowFieldVo ufVo = voResultBean.getData();
updateFlowFiled(BeanUtil.beanToMap(ufVo)); updateFlowFiled(BeanUtil.beanToMap(ufVo));
if(!voResultBean.getSuccess()){ if (!voResultBean.getSuccess()) {
return rb.setMsg(voResultBean.getMsg()); return rb.setMsg(voResultBean.getMsg());
} }
baseMapper.updateBySidAndState(businessSid, "2"); baseMapper.updateBySidAndState(businessSid, "2");

2
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bushandover/BusHandoverVo.java

@ -46,4 +46,6 @@ public class BusHandoverVo implements Vo {
//下载路径 //下载路径
private List<DownloadVo> fileResps = new ArrayList<>(); private List<DownloadVo> fileResps = new ArrayList<>();
private String recipient;
} }

3
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverMapper.xml

@ -39,7 +39,8 @@
bhi.modelName, bhi.modelName,
bh.sid, bh.sid,
(select count(*) from bus_handover_items bhi2 where bhi2.handoverSid = bh.sid) as number, (select count(*) from bus_handover_items bhi2 where bhi2.handoverSid = bh.sid) as number,
bh.handoverStateKey bh.handoverStateKey,
bh.recipient
from bus_handover bh from bus_handover bh
left join bus_handover_items bhi on bh.sid = bhi.handoverSid left join bus_handover_items bhi on bh.sid = bhi.handoverSid
<where> <where>

47
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java

@ -48,8 +48,6 @@ import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.hutool.core.util.ClassLoaderUtil.getClassLoader;
/** /**
* Project: anrui-buscenter(业务中心) <br/> * Project: anrui-buscenter(业务中心) <br/>
* File: BusHandoverService.java <br/> * File: BusHandoverService.java <br/>
@ -185,7 +183,7 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1)); buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1));
buscenterFileService.insert(buscenterFile); buscenterFileService.insert(buscenterFile);
} }
/* Future<String> future2 = pool.submit(() -> { Future<String> future2 = pool.submit(() -> {
return entrustConfirmImages(busHandover.getSid()); return entrustConfirmImages(busHandover.getSid());
}); });
if (StringUtils.isNotBlank(future2.get())) { if (StringUtils.isNotBlank(future2.get())) {
@ -206,6 +204,7 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1)); buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1));
buscenterFileService.insert(buscenterFile); buscenterFileService.insert(buscenterFile);
} }
if (!busHandover.getCustomerName().equals(busHandover.getRecipient())) {
Future<String> future3 = pool.submit(() -> { Future<String> future3 = pool.submit(() -> {
return entrustImages(busHandover.getSid()); return entrustImages(busHandover.getSid());
}); });
@ -227,6 +226,7 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1)); buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1));
buscenterFileService.insert(buscenterFile); buscenterFileService.insert(buscenterFile);
} }
}
Future<String> future4 = pool.submit(() -> { Future<String> future4 = pool.submit(() -> {
return outDoor(busHandover.getSid()); return outDoor(busHandover.getSid());
}); });
@ -247,7 +247,7 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
buscenterFile.setFileName(BuscenterFileEnum.EXIT_TICKET_IMAGES.getMark()); buscenterFile.setFileName(BuscenterFileEnum.EXIT_TICKET_IMAGES.getMark());
buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1)); buscenterFile.setFileType(str.substring(str.lastIndexOf(".") + 1));
buscenterFileService.insert(buscenterFile); buscenterFileService.insert(buscenterFile);
}*/ }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return rb.setMsg("生成文件失败"); return rb.setMsg("生成文件失败");
@ -295,15 +295,15 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
// File file = new File(getClass().getClassLoader().getResource("ftl/receiveCar.ftl").getFile()); // File file = new File(getClass().getClassLoader().getResource("ftl/receiveCar.ftl").getFile());
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/receiveCar.ftl"); InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/receiveCar.ftl");
// String dir = getClassLoader().getResource("ftl").getPath(); // String dir = getClassLoader().getResource("ftl").getPath();
String dir = this.getClass().getResource("ftl").getPath();
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
File file = new File(targetPath +"receiveCar.ftl"); File file = new File(targetPath + "receiveCar.ftl");
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file); WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成出门证文件名
@ -336,14 +336,18 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
List<BusItemVo> list = busHandoverItemsService.getList(sid); List<BusItemVo> list = busHandoverItemsService.getList(sid);
List<String> stringList = list.stream().map(v -> v.getVinNo()).collect(Collectors.toList()); List<String> stringList = list.stream().map(v -> v.getVinNo()).collect(Collectors.toList());
map.put("vinNo", String.join(",", stringList)); map.put("vinNo", String.join(",", stringList));
File file = new File(getClass().getClassLoader().getResource("ftl/entrust.ftl").getFile()); // File file = new File(getClass().getClassLoader().getResource("ftl/entrust.ftl").getFile());
String dir = getClassLoader().getResource("ftl").getPath(); InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/entrust.ftl");
// String dir = getClassLoader().getResource("ftl").getPath();
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); File file = new File(targetPath + "entrust.ftl");
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成出门证文件名
@ -366,14 +370,18 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
map.put("customerName", busHandover.getCustomerName()); map.put("customerName", busHandover.getCustomerName());
List<BusItemVo> list = busHandoverItemsService.getList(sid); List<BusItemVo> list = busHandoverItemsService.getList(sid);
map.put("list", list); map.put("list", list);
File file = new File(getClass().getClassLoader().getResource("ftl/entrustConfirm.ftl").getFile()); // File file = new File(getClass().getClassLoader().getResource("ftl/entrustConfirm.ftl").getFile());
String dir = getClassLoader().getResource("ftl").getPath(); // String dir = getClassLoader().getResource("ftl").getPath();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/entrustConfirm.ftl");
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); File file = new File(targetPath + "entrustConfirm.ftl");
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成出门证文件名
@ -407,14 +415,18 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
AppOrderDetailsVo appOrderDetailsVo = orderDetailsVoResultBean.getData(); AppOrderDetailsVo appOrderDetailsVo = orderDetailsVoResultBean.getData();
AppOrderModelInfoVo appOrderModelInfoVo = appOrderDetailsVo.getModelInfo(); AppOrderModelInfoVo appOrderModelInfoVo = appOrderDetailsVo.getModelInfo();
map.put("modelName", appOrderModelInfoVo.getModelName()); map.put("modelName", appOrderModelInfoVo.getModelName());
File file = new File(getClass().getClassLoader().getResource("ftl/outdoor.ftl").getFile()); // File file = new File(getClass().getClassLoader().getResource("ftl/outdoor.ftl").getFile());
String dir = getClassLoader().getResource("ftl").getPath(); // String dir = getClassLoader().getResource("ftl").getPath();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/outdoor.ftl");
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(map, file, targetPath, typeName, dir); File file = new File(targetPath + "outdoor.ftl");
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(map, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成出门证文件名
@ -458,11 +470,14 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
vo.setName(buscenterFile.getFileName()); vo.setName(buscenterFile.getFileName());
vo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + buscenterFile.getFilePath()); vo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + buscenterFile.getFilePath());
stringList.add(vo); stringList.add(vo);
if(!record.getCustomerName().equals(record.getRecipient())){
vo = new DownloadVo(); vo = new DownloadVo();
buscenterFile = buscenterFileService.selectByLinkSidOne(record.getSid(), BuscenterFileEnum.ENTRUST.getAttachType()); buscenterFile = buscenterFileService.selectByLinkSidOne(record.getSid(), BuscenterFileEnum.ENTRUST.getAttachType());
vo.setName(buscenterFile.getFileName()); vo.setName(buscenterFile.getFileName());
vo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + buscenterFile.getFilePath()); vo.setDownloadUrl(docPdfComponent.getPrefixTemplateUrl() + buscenterFile.getFilePath());
stringList.add(vo); stringList.add(vo);
}
vo = new DownloadVo(); vo = new DownloadVo();
buscenterFile = buscenterFileService.selectByLinkSidOne(record.getSid(), BuscenterFileEnum.EXIT_TICKET.getAttachType()); buscenterFile = buscenterFileService.selectByLinkSidOne(record.getSid(), BuscenterFileEnum.EXIT_TICKET.getAttachType());
vo.setName(buscenterFile.getFileName()); vo.setName(buscenterFile.getFileName());

13
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehiclegression/ScmVehicleGressionService.java

@ -93,13 +93,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.io.File; import java.io.File;
import java.io.InputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.hutool.core.util.ClassLoaderUtil.getClassLoader;
/** /**
* Project: scm(scm) <br/> * Project: scm(scm) <br/>
* File: ScmVehicleGressionService.java <br/> * File: ScmVehicleGressionService.java <br/>
@ -1373,14 +1372,18 @@ public class ScmVehicleGressionService extends MybatisBaseService<ScmVehicleGres
//申请人 //申请人
dataMap.put("apply", scmVehicleGression.getApplicantName()); dataMap.put("apply", scmVehicleGression.getApplicantName());
//获取模板 //获取模板
File file = new File(getClass().getClassLoader().getResource("ftl/outdoor.ftl").getFile()); // File file = new File(getClass().getClassLoader().getResource("ftl/outdoor.ftl").getFile());
String dir = getClassLoader().getResource("ftl").getPath(); // String dir = getClassLoader().getResource("ftl").getPath();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("ftl/outdoor.ftl");
//生成word文件名 //生成word文件名
String targetPath = docPdfComponent.getUploadTemplateUrl(); String targetPath = docPdfComponent.getUploadTemplateUrl();
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis(); long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc"; String typeName = dateStr + seconds + ".doc";
WordConvertUtils.creatWord(dataMap, file, targetPath, typeName, dir); File file = new File(targetPath + "outdoor.ftl");
File dir = new File(targetPath);
WordConvertUtils.inputStreamToFile(inputStream, file);
WordConvertUtils.creatWord1(dataMap, file, targetPath, typeName, dir);
//新生成的word路径 //新生成的word路径
String wordPath = targetPath + typeName; String wordPath = targetPath + typeName;
//生成出门证文件名 //生成出门证文件名

Loading…
Cancel
Save