|
@@ -197,6 +197,18 @@ public class DocServiceImpl extends ServiceImpl<DocDao, Doc> implements DocServi
|
|
docRoleDao.insertBatch(docRoles);
|
|
docRoleDao.insertBatch(docRoles);
|
|
}
|
|
}
|
|
if (flag) {
|
|
if (flag) {
|
|
|
|
+
|
|
|
|
+ //不相等,那么删除当前目录的下的文件
|
|
|
|
+ File imageFile = new File(getImageFilePath(doc.getId()));
|
|
|
|
+ File pdfFile = new File(getImageFilePath(doc.getId())+".pdf");
|
|
|
|
+ if(imageFile.exists()){
|
|
|
|
+ imageFile.delete();
|
|
|
|
+ }
|
|
|
|
+ if(pdfFile.exists()){
|
|
|
|
+ pdfFile.delete();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
DocHistory docHistory = new DocHistory();
|
|
DocHistory docHistory = new DocHistory();
|
|
BeanUtil.copyProperties(doc, docHistory);
|
|
BeanUtil.copyProperties(doc, docHistory);
|
|
docHistory.setCreateTime(new Date());
|
|
docHistory.setCreateTime(new Date());
|
|
@@ -318,6 +330,10 @@ public class DocServiceImpl extends ServiceImpl<DocDao, Doc> implements DocServi
|
|
return doc;
|
|
return doc;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private String getImageFilePath(Long docId){
|
|
|
|
+ return pictureConfig.getServerBasePath() +"/"+ pictureConfig.getUploadPath() + "/produce/" + docId;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public JsonResult pdfDetail(HttpServletRequest request, Long docId, String userNo) {
|
|
public JsonResult pdfDetail(HttpServletRequest request, Long docId, String userNo) {
|
|
|
|
|
|
@@ -336,7 +352,7 @@ public class DocServiceImpl extends ServiceImpl<DocDao, Doc> implements DocServi
|
|
String domain = pictureConfig.getServerPath();
|
|
String domain = pictureConfig.getServerPath();
|
|
String path = domain + request.getContextPath() + "/";
|
|
String path = domain + request.getContextPath() + "/";
|
|
String filePath = pictureConfig.getServerBasePath() +"/"+ pictureConfig.getUploadPath() + "/produce/" + docId + ".pdf";
|
|
String filePath = pictureConfig.getServerBasePath() +"/"+ pictureConfig.getUploadPath() + "/produce/" + docId + ".pdf";
|
|
- String imageFilePath = pictureConfig.getServerBasePath() +"/"+ pictureConfig.getUploadPath() + "/produce/" + docId + File.separator;
|
|
|
|
|
|
+ String imageFilePath = getImageFilePath(docId) + "/";
|
|
String createPath = pictureConfig.getBasePath() + "/" + pictureConfig.getUploadPath() + "/produce/" + docId + ".pdf";
|
|
String createPath = pictureConfig.getBasePath() + "/" + pictureConfig.getUploadPath() + "/produce/" + docId + ".pdf";
|
|
File fromFile = new File(createPath);
|
|
File fromFile = new File(createPath);
|
|
//判断目标文件所在的目录是否存在
|
|
//判断目标文件所在的目录是否存在
|