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
0e645039
Commit
0e645039
authored
Dec 02, 2020
by
梁辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增签章字段
parent
e89bd907
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
10 deletions
+30
-10
car-reptiles-system/pom.xml
+1
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/DeptVo.java
+2
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/SysUserVo.java
+2
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/report/CarSignatureReqVo.java
+4
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/system/repository/ReportPdfMapper.java
+2
-0
car-reptiles-system/src/main/java/me/zhengjie/modules/system/service/ReportService.java
+4
-3
car-reptiles-system/src/main/java/me/zhengjie/modules/system/util/CarReportUtil.java
+11
-4
car-reptiles-system/src/main/resources/config/application-prod.yml
+2
-2
car-reptiles-system/src/main/resources/config/application.yml
+0
-0
pom.xml
+2
-1
No files found.
car-reptiles-system/pom.xml
View file @
0e645039
...
...
@@ -99,6 +99,7 @@
<!-- 打包 -->
<build>
<finalName>
reptiles
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/DeptVo.java
View file @
0e645039
...
...
@@ -2,6 +2,7 @@ package me.zhengjie.modules.system.domain.vo;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
...
...
@@ -10,6 +11,7 @@ import javax.validation.constraints.NotNull;
/**
* 部门Vo
*/
@TableName
(
"sys_dept"
)
@Data
public
class
DeptVo
{
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/SysUserVo.java
View file @
0e645039
...
...
@@ -72,4 +72,6 @@ public class SysUserVo {
@ApiModelProperty
(
value
=
"站点名称"
,
hidden
=
false
)
private
String
siteName
;
@ApiModelProperty
(
"签名章名称"
)
private
String
snSignature
;
}
car-reptiles-system/src/main/java/me/zhengjie/modules/system/domain/vo/report/CarSignatureReqVo.java
View file @
0e645039
...
...
@@ -2,6 +2,7 @@ package me.zhengjie.modules.system.domain.vo.report;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
me.zhengjie.modules.system.domain.vo.DeptVo
;
import
me.zhengjie.modules.system.domain.vo.SysUserVo
;
/**
...
...
@@ -11,6 +12,9 @@ import me.zhengjie.modules.system.domain.vo.SysUserVo;
@Data
public
class
CarSignatureReqVo
{
@ApiModelProperty
(
"签章部门vo"
)
private
DeptVo
deptVo
;
@ApiModelProperty
(
"检测报告vo"
)
private
ReportPdfVo
reportPdfVo
;
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/repository/ReportPdfMapper.java
View file @
0e645039
...
...
@@ -2,10 +2,12 @@ package me.zhengjie.modules.system.repository;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
me.zhengjie.modules.system.domain.vo.report.ReportPdfVo
;
import
org.springframework.stereotype.Repository
;
/**
* 检测报告PDF存放信息 mapper
* @author Lander
*/
@Repository
public
interface
ReportPdfMapper
extends
BaseMapper
<
ReportPdfVo
>
{
}
car-reptiles-system/src/main/java/me/zhengjie/modules/system/service/ReportService.java
View file @
0e645039
...
...
@@ -134,13 +134,14 @@ public class ReportService {
ReportPdfVo
reportPdfVo
=
reportPdfMapper
.
selectById
(
reportPdfId
);
AssertUtil
.
isNotNull
(
reportPdfVo
,
"不存在该报告详情,请刷新页面后重试"
);
//先清除掉未签章的pdf文件(省点空间)
FileUtil
.
del
(
reportPdfVo
.
getPath
()
);
DeptVo
deptVo
=
deptMapper
.
selectById
(
sysUserVo
.
getDeptId
());
AssertUtil
.
isNotNull
(
deptVo
,
"当前用户部门信息不存在"
);
//开始签章
CarSignatureReqVo
carSignatureReqVo
=
new
CarSignatureReqVo
();
carSignatureReqVo
.
setReportPdfVo
(
reportPdfVo
);
carSignatureReqVo
.
setSysUserVo
(
sysUserVo
);
carSignatureReqVo
.
setDeptVo
(
deptVo
);
//reportPdfVo = signatureUtil.electronicGM(reportPdfVo, sysUserVo);
HttpEntity
<
CarSignatureReqVo
>
httpEntity
=
new
HttpEntity
<>(
carSignatureReqVo
);
ResponseEntity
<
ResultVo
>
responseEntity
=
this
.
restTemplate
.
exchange
(
...
...
@@ -148,7 +149,7 @@ public class ReportService {
HttpMethod
.
POST
,
httpEntity
,
ResultVo
.
class
);
AssertUtil
.
isTrue
(
responseEntity
.
getStatusCode
()
==
HttpStatus
.
OK
&&
responseEntity
.
getBody
().
getData
()!=
null
,
"签章失败!请重试"
);
AssertUtil
.
isTrue
(
responseEntity
.
getStatusCode
()
==
HttpStatus
.
OK
&&
responseEntity
.
getBody
().
getData
()!=
null
,
responseEntity
.
getBody
().
getErrMsg
()
);
//更新数据库的报告详情
ReportPdfVo
reportPdfVos
=
JSONUtil
.
toBean
(
JSONUtil
.
toJsonPrettyStr
(
responseEntity
.
getBody
().
getData
()),
ReportPdfVo
.
class
);
...
...
car-reptiles-system/src/main/java/me/zhengjie/modules/system/util/CarReportUtil.java
View file @
0e645039
...
...
@@ -362,6 +362,15 @@ public class CarReportUtil {
//登录环保
WebDriver
driver
=
null
;
try
{
//把检测报告编号作为该报告文件的文件名
String
fileName
=
detailsReqVo
.
getReportNum
();
//如果已经下载有检测报告则直接return
String
reportHtmlPath
=
getReportPath
(
fileName
,
".html"
);
if
(
FileUtil
.
isNotEmpty
(
FileUtil
.
file
(
fileName
))){
return
getReportPath
(
fileName
,
".pdf"
);
}
//登录环保
driver
=
loginEp
(
username
,
password
,
null
);
...
...
@@ -434,15 +443,13 @@ public class CarReportUtil {
Document
parse1
=
Jsoup
.
parse
(
reportHtml
);
//把检测报告编号作为该报告文件的文件名
String
fileName
=
detailsReqVo
.
getReportNum
();
String
imgSrc
=
parse1
.
getElementById
(
"qrImg"
).
attr
(
"src"
);
Object
[]
cookies
=
reportDriver
.
manage
().
getCookies
().
toArray
();
byte
[]
respBytes
=
HttpUtil
.
createGet
(
imgSrc
).
header
(
"Cookie"
,
cookies
[
0
].
toString
()
+
";"
+
cookies
[
1
].
toString
()
+
";"
+
cookies
[
2
].
toString
()).
execute
().
bodyBytes
();
FileUtil
.
writeBytes
(
respBytes
,
getReportPath
(
fileName
,
".png"
));
//下载保存html检测报告
String
reportHtmlPath
=
getReportPath
(
fileName
,
".html"
);
//将二维码转换成base64流 踩坑: 不转base64的话,转PDF后,图片显示不出来
BASE64Encoder
encoder
=
new
BASE64Encoder
();
...
...
car-reptiles-system/src/main/resources/config/application-prod.yml
View file @
0e645039
...
...
@@ -4,9 +4,9 @@ spring:
druid
:
db-type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url
:
jdbc:log4jdbc:mysql://${DB_HOST:
localhost}:${DB_PORT:3306}/${DB_NAME:eladmin
}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
url
:
jdbc:log4jdbc:mysql://${DB_HOST:
127.0.0.1}:${DB_PORT:3306}/${DB_NAME:car-reptiles
}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username
:
${DB_USER:root}
password
:
${DB_PWD:
123456
}
password
:
${DB_PWD:
root
}
# 初始连接数
initial-size
:
5
# 最小连接数
...
...
car-reptiles-system/src/main/resources/config/application.yml
View file @
0e645039
pom.xml
View file @
0e645039
...
...
@@ -18,7 +18,7 @@
</modules>
<name>
环保车检系统 后台管理
</name>
<url>
http://auauz.net
</url>
<url></url>
<parent>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -209,6 +209,7 @@
</dependencies>
<build>
<finalName>
reptiles
</finalName>
<plugins>
<!-- 打包时跳过测试 -->
<plugin>
...
...
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