瀏覽代碼

feat: 不动产资源报告添加默认报告

weijianghai 1 年之前
父節點
當前提交
d0dc92ecd7
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/main/java/com/nokia/financeapi/service/house/HouseReportService.java

+ 4 - 6
src/main/java/com/nokia/financeapi/service/house/HouseReportService.java

@@ -7,7 +7,6 @@ import com.nokia.financeapi.pojo.po.house.HouseReportsPo;
 import com.nokia.financeapi.pojo.vo.GetHouseReportVo;
 import com.nokia.financeapi.service.common.file.FileService;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
 
 @Service
 public class HouseReportService {
@@ -32,7 +31,8 @@ public class HouseReportService {
     private R<GetHouseReportVo> getReport(GetHouseReportDto dto) {
         GetHouseReportVo vo = new GetHouseReportVo();
         vo.setUrl("");
-        String object = null;
+        String object ="word".equals(dto.getFileType()) ? "oss/reports/house/default.doc"
+                : "oss/reports/house/default.pdf";
         if (dto.getEndDate() == null) {
             HouseReportsPo po = houseReportDao.getLatest(dto);
             if (po != null) {
@@ -44,10 +44,8 @@ public class HouseReportService {
                 object = po.getUrl();
             }
         }
-        if (StringUtils.hasText(object)) {
-            String url = fileService.getDownloadUrl(object);
-            vo.setUrl(url);
-        }
+        String url = fileService.getDownloadUrl(object);
+        vo.setUrl(url);
         return R.ok(vo);
     }
 }