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
5037ce52
Commit
5037ce52
authored
Dec 24, 2020
by
landerliang@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复自动签章问题
parent
953f9721
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
car-reptiles-system/src/main/java/me/zhengjie/AppRun.java
+2
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/quartz/task/ReportTask.java
+1
-0
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
+5
-4
No files found.
car-reptiles-system/src/main/java/me/zhengjie/AppRun.java
View file @
5037ce52
...
...
@@ -27,6 +27,7 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.data.jpa.repository.config.EnableJpaAuditing
;
import
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -41,6 +42,7 @@ import org.springframework.web.client.RestTemplate;
//@EnableAsync
@RestController
@Api
(
hidden
=
true
)
@EnableScheduling
@SpringBootApplication
@EnableTransactionManagement
@EnableJpaAuditing
(
auditorAwareRef
=
"auditorAware"
)
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/quartz/task/ReportTask.java
View file @
5037ce52
...
...
@@ -42,4 +42,5 @@ public class ReportTask {
jsonObject
.
getString
(
"snName1"
),
jsonObject
.
getString
(
"snName2"
),
jsonObject
.
getString
(
"snName3"
));
log
.
info
(
">> 本次自动签章任务执行完毕!"
);
}
}
car-reptiles-system/src/main/java/me/zhengjie/modules/system/service/ReportService.java
View file @
5037ce52
...
...
@@ -123,11 +123,11 @@ public class ReportService {
* 自动下载检测报告并签章上传
*
*/
public
void
autoDownloadAndSignAndUploadReport
(
String
account
,
String
password
,
String
snKey1
,
String
snKey2
,
String
snKey3
,
public
synchronized
void
autoDownloadAndSignAndUploadReport
(
String
account
,
String
password
,
String
snKey1
,
String
snKey2
,
String
snKey3
,
String
snName1
,
String
snName2
,
String
snName3
){
try
{
try
{
List
<
TestReportVo
>
testReportVos
=
carReportUtil
.
taskReportList
(
account
,
password
);
log
.
info
(
">> 定时扫描未签章上传的检测报告,扫描结果:{} 条数据"
,
testReportVos
.
size
());
for
(
TestReportVo
testReportVo:
testReportVos
){
...
...
@@ -148,7 +148,7 @@ public class ReportService {
reportPdfVo
.
setUniqueString
(
testReportVo
.
getUniqueString
());
reportPdfVo
.
setReportName
(
testReportVo
.
getInspectionReportNo
()
+
".pdf"
);
reportPdfVo
.
setReportNum
(
testReportVo
.
getInspectionReportNo
());
reportPdfVo
.
setBusinessKey
(
testReportVo
.
getBusinessKey
());
reportPdfVo
.
setBusinessKey
(
StrUtil
.
isNotBlank
(
testReportVo
.
getBusinessKey
())?
testReportVo
.
getBusinessKey
():
testReportVo
.
getInspectionNum
());
reportPdfVo
.
setCreateTime
(
DateUtil
.
date
());
reportPdfVo
.
setCarNum
(
testReportVo
.
getVLPN
());
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/util/CarReportUtil.java
View file @
5037ce52
...
...
@@ -94,7 +94,8 @@ public class CarReportUtil {
String
body
=
webDriver
.
getPageSource
();
body
=
body
.
replace
(
"../../Scripts"
,
host
+
"/Scripts"
)
.
replace
(
"../../Entities/"
,
host
+
"/Entities/"
);
.
replace
(
"../../Entities/"
,
host
+
"/Entities/"
)
.
replace
(
"../../Content"
,
host
+
"/Content"
);
Document
parse
=
Jsoup
.
parse
(
body
);
Elements
elementsByClass
=
parse
.
getElementsByClass
(
"unit"
);
...
...
@@ -154,7 +155,7 @@ public class CarReportUtil {
WebDriver
driver
=
null
;
int
success
=
0
;
try
{
log
.
info
(
">> 当前自动上传的检测报告信息:{}"
,
reportPdfVo
.
toString
());
//检测报告文件和其他至少四个文件(检测申请表、身份证、行驶证1、行驶证2)都有了才上传
if
(
FileUtil
.
exist
(
reportPdfVo
.
getPath
())&&
FileUtil
.
exist
(
uploadFilePath
+
reportPdfVo
.
getCarNum
()
+
MyConstants
.
APPLY_SUFFIX
)&&
...
...
@@ -171,7 +172,7 @@ public class CarReportUtil {
Map
<
String
,
Object
>
formData
=
new
HashMap
<>();
formData
.
put
(
"umclData"
,
"{\"UploadFileDataID\":0,\"MAI_ID\":0}"
);
formData
.
put
(
"folder"
,
"/Addins/Template/"
);
formData
.
put
(
"businessKey"
,
StrUtil
.
isNotBlank
(
reportPdfVo
.
getBusinessKey
())?
reportPdfVo
.
getBusinessKey
():
reportPdfVo
.
getReportNum
());
formData
.
put
(
"businessKey"
,
reportPdfVo
.
getBusinessKey
());
formData
.
put
(
"BusinessType"
,
"11"
);
formData
.
put
(
"fileext"
,
"*.pdf;*.jpg;*.png"
);
formData
.
put
(
"UniqueString"
,
reportPdfVo
.
getUniqueString
());
...
...
@@ -374,7 +375,7 @@ public class CarReportUtil {
Map
<
String
,
Object
>
formData
=
new
HashMap
<>();
formData
.
put
(
"umclData"
,
"{\"UploadFileDataID\":0,\"MAI_ID\":0}"
);
formData
.
put
(
"folder"
,
"/Addins/Template/"
);
formData
.
put
(
"businessKey"
,
StrUtil
.
isNotBlank
(
reportPdfVo
.
getBusinessKey
())?
reportPdfVo
.
getBusinessKey
():
reportPdfVo
.
get
ReportNum
());
formData
.
put
(
"businessKey"
,
StrUtil
.
isNotBlank
(
reportPdfVo
.
getBusinessKey
())?
reportPdfVo
.
getBusinessKey
():
reportPdfVo
.
get
BusinessKey
());
formData
.
put
(
"BusinessType"
,
"11"
);
formData
.
put
(
"fileext"
,
"*.pdf;*.jpg;*.png"
);
formData
.
put
(
"UniqueString"
,
reportPdfVo
.
getUniqueString
());
...
...
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