Browse Source

恢复交车办理生成PDF功能

master
fanzongzhe 2 years ago
parent
commit
f5d86893b7
  1. 31
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdiscountpackagehandover/BusDiscountpackageHandoverService.java
  2. 114
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java

31
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdiscountpackagehandover/BusDiscountpackageHandoverService.java

@ -449,12 +449,11 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis
this.uploadPicture(dto);
}
BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(sid);
// String s = commonCreatePdf(detailsVo);
String s = commonCreatePdf(detailsVo);
String targetPath = docPdfComponent.getUploadTemplateUrl();
// String filePath = s.substring(targetPath.length());
String filePath = s.substring(targetPath.length());
BusDiscountpackageHandover entity = fetchBySid(sid);
// entity.setFilePath(filePath);
entity.setFilePath("");
entity.setFilePath(filePath);
baseMapper.updateById(entity);
} else if (role == 1 || (role == 3 && transferStateValue.equals("待移交"))) {
dto.setTransferStateKey("003");
@ -532,13 +531,13 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis
if (null != busFiles && i > 0 && !busFiles.isEmpty()) {
this.uploadPicture(dto);
}
// BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(sid);
// String s = commonCreatePdf(detailsVo);
// String targetPath = docPdfComponent.getUploadTemplateUrl();
// String filePath = s.substring(targetPath.length());
// BusDiscountpackageHandover entity = fetchBySid(sid);
// entity.setFilePath(filePath);
// baseMapper.updateById(entity);
BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(sid);
String s = commonCreatePdf(detailsVo);
String targetPath = docPdfComponent.getUploadTemplateUrl();
String filePath = s.substring(targetPath.length());
BusDiscountpackageHandover entity = fetchBySid(sid);
entity.setFilePath(filePath);
baseMapper.updateById(entity);
return rb.success();
}
@ -1022,11 +1021,11 @@ public class BusDiscountpackageHandoverService extends MybatisBaseService<BusDis
entity.setRecTime(new Date());
entity.setTransferStateValue("已移交");
entity.setTransferStateKey("004");
// BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(dto.getSid());
// String s = commonCreatePdf(detailsVo);
// String targetPath = docPdfComponent.getUploadTemplateUrl();
// String filePath = s.substring(targetPath.length());
// entity.setFilePath(filePath);
BusDiscountpackageHandoverDetailsVo detailsVo = this.handoverDetails(dto.getSid());
String s = commonCreatePdf(detailsVo);
String targetPath = docPdfComponent.getUploadTemplateUrl();
String filePath = s.substring(targetPath.length());
entity.setFilePath(filePath);
baseMapper.updateById(entity);
return rb.success();
}

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

@ -1051,32 +1051,31 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
}
baseMapper.insert(busHandover);
//-------------------------PC端注释交车PDF
// ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
// String path = "";
// if (pdf.getSuccess()) {
// //打印pdf
// List<String> filePaths = pdf.getData();
// List<File> fileList = new ArrayList<>();
// if (!filePaths.isEmpty()) {
// for (String filePath : filePaths) {
// File file = new File(filePath);
// fileList.add(file);
// }
// }
// String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
// long seconds = System.currentTimeMillis();
// String targetPath = docPdfComponent.getUploadTemplateUrl();
// File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf");
// if (fileList.size() <= 0) {
// path = null;
// } else {
// for (File fileDelete : fileList) {
// fileDelete.delete();
// }
// path = dateStr + seconds + "交车确认.pdf";
// }
// }
String path = "temp";
ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
String path = "";
if (pdf.getSuccess()) {
//打印pdf
List<String> filePaths = pdf.getData();
List<File> fileList = new ArrayList<>();
if (!filePaths.isEmpty()) {
for (String filePath : filePaths) {
File file = new File(filePath);
fileList.add(file);
}
}
String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis();
String targetPath = docPdfComponent.getUploadTemplateUrl();
File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf");
if (fileList.size() <= 0) {
path = null;
} else {
for (File fileDelete : fileList) {
fileDelete.delete();
}
path = dateStr + seconds + "交车确认.pdf";
}
}
BusHandover entity = fetchBySid(busHandover.getSid());
entity.setFilePath(path);
baseMapper.updateById(entity);
@ -1776,32 +1775,31 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
}
baseMapper.insert(busHandover);
//-------------------------注释移动端生成PDF--------------------------------------
// ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
// String path = "";
// if (pdf.getSuccess()) {
// //打印pdf
// List<String> filePaths = pdf.getData();
// List<File> fileList = new ArrayList<>();
// if (!filePaths.isEmpty()) {
// for (String filePath : filePaths) {
// File file = new File(filePath);
// fileList.add(file);
// }
// }
// String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
// long seconds = System.currentTimeMillis();
// String targetPath = docPdfComponent.getUploadTemplateUrl();
// File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf");
// if (fileList.size() <= 0) {
// path = null;
// } else {
// for (File fileDelete : fileList) {
// fileDelete.delete();
// }
// path = dateStr + seconds + "交车确认.pdf";
// }
// }
String path = "temp";
ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
String path = "";
if (pdf.getSuccess()) {
//打印pdf
List<String> filePaths = pdf.getData();
List<File> fileList = new ArrayList<>();
if (!filePaths.isEmpty()) {
for (String filePath : filePaths) {
File file = new File(filePath);
fileList.add(file);
}
}
String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis();
String targetPath = docPdfComponent.getUploadTemplateUrl();
File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf");
if (fileList.size() <= 0) {
path = null;
} else {
for (File fileDelete : fileList) {
fileDelete.delete();
}
path = dateStr + seconds + "交车确认.pdf";
}
}
BusHandover entity = fetchBySid(busHandover.getSid());
entity.setFilePath(path);
baseMapper.updateById(entity);
@ -2604,11 +2602,10 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
pdfVo.setColor("-");
pdfVo.setListPdfVos(listPdfVos);
String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl();
//---------------挂车注释PDF
//String s = receiveVehicleConfirmationCreatePdf(pdfVo);
//String savePath = s.substring(uploadTemplateUrl.length());
// ---------------挂车注释PDF
String s = receiveVehicleConfirmationCreatePdf(pdfVo);
String savePath = s.substring(uploadTemplateUrl.length());
BusHandover entity = fetchBySid(sid);
String savePath = "temp";
entity.setTrailerFilePath(savePath);
baseMapper.updateById(entity);
String templateUrl = docPdfComponent.getPrefixTemplateUrl();
@ -2808,9 +2805,8 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
pdfVo.setListPdfVos(listPdfVos);
String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl();
//-------挂车注释PDF
// String s = receiveVehicleConfirmationCreatePdf(pdfVo);
// String savePath = s.substring(uploadTemplateUrl.length());
String savePath = "temp";
String s = receiveVehicleConfirmationCreatePdf(pdfVo);
String savePath = s.substring(uploadTemplateUrl.length());
BusHandover entity = fetchBySid(sid);
entity.setTrailerFilePath(savePath);
baseMapper.updateById(entity);

Loading…
Cancel
Save