Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
dimengzhe 2 years ago
parent
commit
451091e180
  1. 85
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java

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

@ -1050,6 +1050,7 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
} }
} }
baseMapper.insert(busHandover); baseMapper.insert(busHandover);
//-------------------------PC端注释交车PDF
// ResultBean<List<String>> pdf = createPdf(busHandover.getSid()); // ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
// String path = ""; // String path = "";
// if (pdf.getSuccess()) { // if (pdf.getSuccess()) {
@ -1075,12 +1076,13 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
// path = dateStr + seconds + "交车确认.pdf"; // path = dateStr + seconds + "交车确认.pdf";
// } // }
// } // }
// BusHandover entity = fetchBySid(busHandover.getSid()); String path = "temp";
// entity.setFilePath(path); BusHandover entity = fetchBySid(busHandover.getSid());
// baseMapper.updateById(entity); entity.setFilePath(path);
// String temp = "/template/"; baseMapper.updateById(entity);
// return rb.success().setData(temp + path); String temp = "/template/";
return rb.success().setData(""); return rb.success().setData(temp + path);
} }
/** /**
@ -1773,31 +1775,33 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
} }
} }
baseMapper.insert(busHandover); baseMapper.insert(busHandover);
ResultBean<List<String>> pdf = createPdf(busHandover.getSid()); //-------------------------注释移动端生成PDF--------------------------------------
String path = ""; // ResultBean<List<String>> pdf = createPdf(busHandover.getSid());
if (pdf.getSuccess()) { // String path = "";
//打印pdf // if (pdf.getSuccess()) {
List<String> filePaths = pdf.getData(); // //打印pdf
List<File> fileList = new ArrayList<>(); // List<String> filePaths = pdf.getData();
if (!filePaths.isEmpty()) { // List<File> fileList = new ArrayList<>();
for (String filePath : filePaths) { // if (!filePaths.isEmpty()) {
File file = new File(filePath); // for (String filePath : filePaths) {
fileList.add(file); // File file = new File(filePath);
} // fileList.add(file);
} // }
String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); // }
long seconds = System.currentTimeMillis(); // String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
String targetPath = docPdfComponent.getUploadTemplateUrl(); // long seconds = System.currentTimeMillis();
File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf"); // String targetPath = docPdfComponent.getUploadTemplateUrl();
if (fileList.size() <= 0) { // File file = WordConvertUtils.mulFile2One(fileList, targetPath + dateStr + seconds + "交车确认.pdf");
path = null; // if (fileList.size() <= 0) {
} else { // path = null;
for (File fileDelete : fileList) { // } else {
fileDelete.delete(); // for (File fileDelete : fileList) {
} // fileDelete.delete();
path = dateStr + seconds + "交车确认.pdf"; // }
} // path = dateStr + seconds + "交车确认.pdf";
} // }
// }
String path = "temp";
BusHandover entity = fetchBySid(busHandover.getSid()); BusHandover entity = fetchBySid(busHandover.getSid());
entity.setFilePath(path); entity.setFilePath(path);
baseMapper.updateById(entity); baseMapper.updateById(entity);
@ -2600,9 +2604,11 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
pdfVo.setColor("-"); pdfVo.setColor("-");
pdfVo.setListPdfVos(listPdfVos); pdfVo.setListPdfVos(listPdfVos);
String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl(); String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl();
String s = receiveVehicleConfirmationCreatePdf(pdfVo); //---------------挂车注释PDF
//String s = receiveVehicleConfirmationCreatePdf(pdfVo);
//String savePath = s.substring(uploadTemplateUrl.length());
BusHandover entity = fetchBySid(sid); BusHandover entity = fetchBySid(sid);
String savePath = s.substring(uploadTemplateUrl.length()); String savePath = "temp";
entity.setTrailerFilePath(savePath); entity.setTrailerFilePath(savePath);
baseMapper.updateById(entity); baseMapper.updateById(entity);
String templateUrl = docPdfComponent.getPrefixTemplateUrl(); String templateUrl = docPdfComponent.getPrefixTemplateUrl();
@ -2801,14 +2807,15 @@ public class BusHandoverService extends MybatisBaseService<BusHandoverMapper, Bu
pdfVo.setColor("-"); pdfVo.setColor("-");
pdfVo.setListPdfVos(listPdfVos); pdfVo.setListPdfVos(listPdfVos);
String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl(); String uploadTemplateUrl = docPdfComponent.getUploadTemplateUrl();
//-------挂车注释PDF
// String s = receiveVehicleConfirmationCreatePdf(pdfVo); // String s = receiveVehicleConfirmationCreatePdf(pdfVo);
// BusHandover entity = fetchBySid(sid);
// String savePath = s.substring(uploadTemplateUrl.length()); // String savePath = s.substring(uploadTemplateUrl.length());
// entity.setTrailerFilePath(savePath); String savePath = "temp";
// baseMapper.updateById(entity); BusHandover entity = fetchBySid(sid);
// String temp = "/template/"; entity.setTrailerFilePath(savePath);
// return rb.success().setData(temp + savePath); baseMapper.updateById(entity);
return rb.success().setData(""); String temp = "/template/";
return rb.success().setData(temp + savePath);
} }

Loading…
Cancel
Save