Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
car-reptiles
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁辉
car-reptiles
Commits
44454d4e
Commit
44454d4e
authored
Jan 13, 2021
by
landerliang@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动签章上传,先判断当前车牌号下是否不为空,为空则不进行报告下载,节省资源
parent
010404dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
car-reptiles-system/src/main/java/me/zhengjie/modules/system/service/ReportService.java
+3
-3
car-reptiles-system/src/main/java/me/zhengjie/modules/system/util/CarReportUtil.java
+8
-2
car-reptiles-system/src/test/java/me/zhengjie/LoginCacheTest.java
+10
-0
No files found.
car-reptiles-system/src/main/java/me/zhengjie/modules/system/service/ReportService.java
View file @
44454d4e
...
...
@@ -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
)
{
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/util/CarReportUtil.java
View file @
44454d4e
...
...
@@ -766,6 +766,9 @@ public class CarReportUtil {
WebDriver
driver
=
null
;
try
{
//判断是否已拍照有文件再进行下载
if
(!
FileUtil
.
isDirEmpty
(
FileUtil
.
file
(
uploadFilePath
+
detailsReqVo
.
getCarNum
()))){
//把检测报告编号作为该报告文件的文件名
String
fileName
=
detailsReqVo
.
getReportNum
();
//如果已经下载有检测报告则直接return
...
...
@@ -906,6 +909,9 @@ public class CarReportUtil {
}
return
getReportPath
(
fileName
,
".pdf"
);
}
}
catch
(
InterruptedException
|
UnsupportedEncodingException
|
UnhandledAlertException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -1115,7 +1121,7 @@ public class CarReportUtil {
/**
* 获取最新
五
条没上传文件的检测报告
* 获取最新
十
条没上传文件的检测报告
* @param stationCode
* @param cookies
* @return
...
...
@@ -1140,7 +1146,7 @@ public class CarReportUtil {
MyContext
.
PHOTO_TABLE_NAME
,
MyContext
.
PHOTO_WHERE
,
fldsVo
.
getFld
(),
conditionVoList
,
null
,
5
);
JSONObject
body
=
JSONUtil
.
createObj
();
body
.
put
(
"data"
,
queryDataVo
);
body
.
put
(
"rows"
,
5
);
body
.
put
(
"rows"
,
10
);
body
.
put
(
"page"
,
1
);
body
.
put
(
"sort"
,
"DetectEndTime"
);
body
.
put
(
"order"
,
"DESC"
);
...
...
car-reptiles-system/src/test/java/me/zhengjie/LoginCacheTest.java
View file @
44454d4e
...
...
@@ -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
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment