Commit 44454d4e by landerliang@163.com

自动签章上传,先判断当前车牌号下是否不为空,为空则不进行报告下载,节省资源

parent 010404dc
......@@ -137,13 +137,14 @@ public class ReportService {
reportDetailsReqVo.setCarNum(testReportVo.getVLPN());
reportDetailsReqVo.setReportNum(testReportVo.getInspectionNum());
//下载报告pdf 并写入数据库
reportPdfVo = new ReportPdfVo();
//下载报告pdf
String path = carReportUtil.authDownloadReport(account, password, reportDetailsReqVo);
//如果下载成功
if(StrUtil.isNotBlank(path)){
// 写入数据库
reportPdfVo = new ReportPdfVo();
reportPdfVo.setPath(path);
reportPdfVo.setVehicleId(testReportVo.getVehicleID());
reportPdfVo.setUniqueString(testReportVo.getUniqueString());
......@@ -337,7 +338,6 @@ public class ReportService {
AssertUtil.isNotNull(deptVo,"列表获取失败,未找到当前账号所属部门");
String reportPath = "";
try {
//下载检测报告
reportPath = carReportUtil.downloadReport(deptVo.getEpAccount(), deptVo.getEpPassword(), detailsReqVo);
}catch (Exception e) {
......
......@@ -18,6 +18,16 @@ public class LoginCacheTest {
@Resource(name = "userDetailsService")
private UserDetailsServiceImpl userDetailsService;
@Test
public void testIsDirEmptry(){
String dirPath = "C:\\Users\\Lander.LAPTOP-6VMQUJS1\\Desktop\\pdf";
boolean dirEmpty = FileUtil.isDirEmpty(FileUtil.file(dirPath));
System.out.println("当前文件夹是否为空:" + dirEmpty);
if(!dirEmpty){
System.out.println("不为空");
}
}
@Test
public void testCreateFileDirect(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment