Переглянути джерело

Merge branch 'test-merge' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

lvy 1 місяць тому
батько
коміт
ab514dc313

+ 6 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java

@@ -40,6 +40,7 @@ import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.ContractLogVO;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -255,7 +256,7 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
                 .isNotNull(ContractLog::getPdfUrl)
                 .orderByAsc(ContractLog::getRecordTime)
         );
-        if(CollectionUtil.isNotEmpty(contractLogs)){
+        if(CollectionUtil.isEmpty(contractLogs)){
             return false;
         }
 
@@ -302,7 +303,7 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
                     try {
                         String filePath = FileUtils.getSysLocalFileUrl();
                         Long id = SnowFlakeUtil.getId();
-                        String trialPdf = filePath + "/pdf/" + id + ".pdf";
+                        String trialPdf = filePath + "pdf/" + id + ".pdf";
                         File trialPdf2 = ResourceUtil.getFile(trialPdf);
                         if (trialPdf2.exists()) {
                             trialPdf2.delete();
@@ -314,8 +315,9 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
                         if (bladeFile != null && ObjectUtils.isNotEmpty(bladeFile.getLink())) {
                             contractLogMonthPack.setPdfUrl(bladeFile.getLink());
                         }
-                    } catch (FileNotFoundException e) {
-                        throw new RuntimeException(e);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        throw new ServiceException("文件加载错误,请检查文件是否正常");
                     }
                     contractLogMonthPacks.add(contractLogMonthPack);
                 }