|
@@ -7,7 +7,6 @@ import com.nokia.financeapi.pojo.po.house.HouseReportsPo;
|
|
import com.nokia.financeapi.pojo.vo.GetHouseReportVo;
|
|
import com.nokia.financeapi.pojo.vo.GetHouseReportVo;
|
|
import com.nokia.financeapi.service.common.file.FileService;
|
|
import com.nokia.financeapi.service.common.file.FileService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class HouseReportService {
|
|
public class HouseReportService {
|
|
@@ -32,7 +31,8 @@ public class HouseReportService {
|
|
private R<GetHouseReportVo> getReport(GetHouseReportDto dto) {
|
|
private R<GetHouseReportVo> getReport(GetHouseReportDto dto) {
|
|
GetHouseReportVo vo = new GetHouseReportVo();
|
|
GetHouseReportVo vo = new GetHouseReportVo();
|
|
vo.setUrl("");
|
|
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) {
|
|
if (dto.getEndDate() == null) {
|
|
HouseReportsPo po = houseReportDao.getLatest(dto);
|
|
HouseReportsPo po = houseReportDao.getLatest(dto);
|
|
if (po != null) {
|
|
if (po != null) {
|
|
@@ -44,10 +44,8 @@ public class HouseReportService {
|
|
object = po.getUrl();
|
|
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);
|
|
return R.ok(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|