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