浏览代码

盖章报错bug fixed

wucl 1 年之前
父节点
当前提交
e599924d2f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      service/src/main/java/com/dayou/service/impl/BusinessProductionServiceImpl.java

+ 2 - 1
service/src/main/java/com/dayou/service/impl/BusinessProductionServiceImpl.java

@@ -56,7 +56,8 @@ public class BusinessProductionServiceImpl implements IBusinessProductionService
     public Boolean addPublicStamp(String filePath) {
     public Boolean addPublicStamp(String filePath) {
         try {
         try {
             if (StrUtil.isNotBlank(filePath)){
             if (StrUtil.isNotBlank(filePath)){
-                InputStream inputStream = new FileInputStream(filePath);
+                //filePath 为相对路径,这里需要加上/opt
+                InputStream inputStream = new FileInputStream("/opt"+filePath);
                 Resource resource = resourceLoader.getResource("classpath:static/image/stamp.png");
                 Resource resource = resourceLoader.getResource("classpath:static/image/stamp.png");
                 PersonalUtils.addPublicStamp(inputStream,resource,filePath);
                 PersonalUtils.addPublicStamp(inputStream,resource,filePath);
                 inputStream.close();
                 inputStream.close();