Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
54cef189
Commit
54cef189
authored
Mar 07, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.91isoft.com:90/wangfei/vehicle-quality-review
into wangdingyi
parents
3d2e0f12
13cc92c6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
164 additions
and
31 deletions
+164
-31
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+9
-0
PdfTemplateManagementService.java
.../java/com/ruoyi/service/PdfTemplateManagementService.java
+2
-1
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+21
-16
PdfTemplateManagementController.java
...n/java/com/ruoyi/web/PdfTemplateManagementController.java
+93
-7
PdfFileRequest.java
...w/src/main/java/com/ruoyi/web/request/PdfFileRequest.java
+31
-0
application-prod.yml
ruoyi-admin/src/main/resources/application-prod.yml
+1
-1
application.yml
ruoyi-admin/src/main/resources/application.yml
+1
-1
logback.xml
ruoyi-admin/src/main/resources/logback.xml
+5
-4
SecurityConfig.java
.../main/java/com/ruoyi/framework/config/SecurityConfig.java
+1
-1
No files found.
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
54cef189
...
...
@@ -155,6 +155,15 @@ public class Task {
@ApiModelProperty
(
"选择的项目"
)
private
String
taskList
;
@ApiModelProperty
(
"整车信息安全检验报告模板"
)
private
String
retentionUrl
;
@ApiModelProperty
(
"企业留档文件存储地址"
)
private
String
vehicleInformationUrl
;
@ApiModelProperty
(
"车型试验原始记录模板"
)
private
String
modelTestUrl
;
@ApiModelProperty
(
"指向待执行节点的指针[0、1、2]"
)
private
int
pointer
;
...
...
quality-review/src/main/java/com/ruoyi/service/PdfTemplateManagementService.java
View file @
54cef189
...
...
@@ -17,8 +17,9 @@ public interface PdfTemplateManagementService {
/**
* 企业留档文件PDF下载
* @param taskId
* @return
* @throws Exception
*/
String
generateRetentionFile
()
throws
Exception
;
String
generateRetentionFile
(
Long
taskId
)
throws
Exception
;
}
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
View file @
54cef189
...
...
@@ -6,10 +6,13 @@ import com.ruoyi.common.utils.DateUtils;
import
com.ruoyi.common.utils.PdfBaseWriter
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.vo.PhotoStorageVO
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO
;
import
com.ruoyi.service.PdfTemplateManagementService
;
import
com.ruoyi.service.ReviewEnterpriseArchiveService
;
import
io.minio.MinioClient
;
import
io.minio.ObjectWriteArgs
;
import
io.minio.PutObjectArgs
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -43,6 +46,9 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
@Value
(
"${minio.secretKey}"
)
private
String
secretKey
;
@Autowired
private
ReviewEnterpriseArchiveService
reviewEnterpriseArchiveService
;
/**
* 检验报告PDF下载
* @param response
...
...
@@ -109,10 +115,12 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
/**
* 企业留档文件PDF下载
* @param taskId
* @return
* @throws Exception
*/
@Override
public
String
generateRetentionFile
()
throws
Exception
{
public
String
generateRetentionFile
(
Long
taskId
)
throws
Exception
{
ByteArrayOutputStream
outputStream
=
new
ByteArrayOutputStream
();
// 新建
PdfBaseWriter
document
=
new
PdfBaseWriter
(
outputStream
);
...
...
@@ -141,26 +149,23 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
List
<
String
>
list
=
Arrays
.
asList
(
"文件名称"
,
"文件目录"
,
"标准章节"
,
"标准要求"
,
"审查要点"
);
float
[]
columnWidths
=
{
20
,
20
,
20
,
70
,
70
};
PdfPTable
table
=
document
.
createWithHeaderTable
(
list
,
columnWidths
);
document
.
writeCell
(
"A文件"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"B文件"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"C文件"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"车辆制造商应具备车辆全生命周期的汽车信息安全管理体系"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"E文件"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"F文件"
,
Element
.
ALIGN_LEFT
,
1
,
2
,
table
);
document
.
writeCell
(
"1.1"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"5.1"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"要求1"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"要点1"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"1.2"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"5.2"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"要求2"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
"要点2"
,
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
// 查询数据
List
<
ReviewEnterpriseArchiveViewVO
>
viewList
=
reviewEnterpriseArchiveService
.
view
(
taskId
);
for
(
ReviewEnterpriseArchiveViewVO
view
:
viewList
)
{
document
.
writeCell
(
view
.
getFileName
(),
Element
.
ALIGN_LEFT
,
1
,
view
.
getItems
().
size
(),
table
);
view
.
getItems
().
forEach
(
item
->
{
document
.
writeCell
(
item
.
getCatalogue
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
item
.
getChapter
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
item
.
getStandard
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
document
.
writeCell
(
item
.
getKeyPoint
(),
Element
.
ALIGN_LEFT
,
1
,
1
,
table
);
});
}
document
.
addContent
(
table
);
// 关闭
document
.
close
();
// 上传到Minio
return
uploadMinio
(
outputStream
,
"企业留档文件"
);
return
uploadMinio
(
outputStream
,
"企业留档文件"
+
"_"
+
taskId
);
}
/**
...
...
quality-review/src/main/java/com/ruoyi/web/PdfTemplateManagementController.java
View file @
54cef189
package
com
.
ruoyi
.
web
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.ruoyi.common.annotation.Anonymous
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.service.PdfTemplateManagementService
;
import
com.ruoyi.service.TaskService
;
import
com.ruoyi.web.request.PdfFileRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -20,6 +25,9 @@ import javax.servlet.http.HttpServletResponse;
@RequestMapping
(
"/pdf"
)
public
class
PdfTemplateManagementController
{
@Autowired
private
TaskService
taskService
;
@Autowired
private
PdfTemplateManagementService
pdfTemplateManagementService
;
...
...
@@ -42,15 +50,15 @@ public class PdfTemplateManagementController {
/**
* 企业留档文件PDF下载
* @param re
sponse
* @param re
quest
*/
@Anonymous
@ApiOperation
(
"企业留档文件PDF下载"
)
@
GetMapping
(
value
=
"/retentionFile"
,
produces
=
"application/json
"
)
public
R
<
String
>
downloadRetentionFile
()
{
@
PostMapping
(
"/retentionFile
"
)
public
R
<
String
>
downloadRetentionFile
(
@Validated
@RequestBody
PdfFileRequest
request
)
{
try
{
// demo-模板
String
url
=
pdfTemplateManagementService
.
generateRetentionFile
();
String
url
=
pdfTemplateManagementService
.
generateRetentionFile
(
request
.
getTaskId
()
);
return
R
.
ok
(
url
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -58,4 +66,82 @@ public class PdfTemplateManagementController {
}
}
/**
* 下载PDF通用(三个PDF)
* @param request
* @return
*/
@Anonymous
@ApiOperation
(
"下载PDF通用"
)
@PostMapping
(
"/download"
)
public
R
<
String
>
downloadPdf
(
@Validated
@RequestBody
PdfFileRequest
request
)
{
// 根据taskId、pdf类型判断库里存不存在minio地址
String
url
=
""
;
Task
task
=
taskService
.
getOne
(
new
QueryWrapper
<
Task
>().
lambda
().
eq
(
Task:
:
getId
,
request
.
getTaskId
()));
try
{
switch
(
request
.
getType
())
{
case
0
:
url
=
task
.
getVehicleInformationUrl
();
if
(
StrUtil
.
isBlank
(
url
))
{
// TODO 生成整车
}
break
;
case
1
:
url
=
task
.
getRetentionUrl
();
if
(
StrUtil
.
isBlank
(
url
))
{
// 根据任务ID新生成
url
=
pdfTemplateManagementService
.
generateRetentionFile
(
request
.
getTaskId
());
// 更改
taskService
.
update
(
new
UpdateWrapper
<
Task
>().
lambda
().
eq
(
Task:
:
getId
,
request
.
getTaskId
()).
set
(
Task:
:
getRetentionUrl
,
url
));
}
break
;
case
2
:
url
=
task
.
getModelTestUrl
();
if
(
StrUtil
.
isBlank
(
url
))
{
// TODO 生成车型
}
break
;
default
:
break
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
fail
();
}
return
R
.
ok
(
url
);
}
/**
* 更新PDF通用
* @param request
*/
@Anonymous
@ApiOperation
(
"更新PDF通用"
)
@PostMapping
(
"/update"
)
public
R
<
String
>
updatePdf
(
@Validated
@RequestBody
PdfFileRequest
request
)
{
String
url
=
""
;
try
{
switch
(
request
.
getType
())
{
case
0
:
// TODO 更新整车
break
;
case
1
:
// 根据任务ID新生成
url
=
pdfTemplateManagementService
.
generateRetentionFile
(
request
.
getTaskId
());
// 更改
taskService
.
update
(
new
UpdateWrapper
<
Task
>().
lambda
().
eq
(
Task:
:
getId
,
request
.
getTaskId
()).
set
(
Task:
:
getRetentionUrl
,
url
));
break
;
case
2
:
// 更新
// TODO 更新车型
break
;
default
:
break
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
fail
();
}
return
R
.
ok
(
url
);
}
}
quality-review/src/main/java/com/ruoyi/web/request/PdfFileRequest.java
0 → 100644
View file @
54cef189
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotNull
;
/**
* PDF文件请求DTO
* @author gxk
*/
@Data
@Builder
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
public
class
PdfFileRequest
{
@ApiModelProperty
(
"任务ID"
)
@NotNull
(
message
=
"任务ID不能为空"
)
private
Long
taskId
;
@ApiModelProperty
(
"PDF类型(0-整车、1-企业留档、2-车型)"
)
@NotNull
(
message
=
"PDF类型不能为空"
)
private
Integer
type
;
}
ruoyi-admin/src/main/resources/application-prod.yml
View file @
54cef189
...
...
@@ -141,7 +141,7 @@ xss:
# 排除链接(多个用逗号分隔)
excludes
:
/system/notice
# 匹配链接
urlPatterns
:
/
system/*,/monitor/*,/tool/
*
urlPatterns
:
/*
minio
:
url
:
${MINIO_URL}
...
...
ruoyi-admin/src/main/resources/application.yml
View file @
54cef189
...
...
@@ -143,7 +143,7 @@ xss:
# 排除链接(多个用逗号分隔)
excludes
:
/system/notice
# 匹配链接
urlPatterns
:
/
system/*,/monitor/*,/tool/
*
urlPatterns
:
/*
minio
:
url
:
http://49.232.167.247:22038
...
...
ruoyi-admin/src/main/resources/logback.xml
View file @
54cef189
...
...
@@ -89,16 +89,16 @@
</appender>
<!-- 系统模块日志级别控制 -->
<logger
name=
"com.ruoyi"
level=
"
info
"
/>
<logger
name=
"com.ruoyi"
level=
"
debug
"
/>
<!-- Spring日志级别控制 -->
<logger
name=
"org.springframework"
level=
"warn"
/>
<root
level=
"
info
"
>
<root
level=
"
debug
"
>
<appender-ref
ref=
"console"
/>
</root>
<!--系统操作日志-->
<root
level=
"
info
"
>
<root
level=
"
debug
"
>
<appender-ref
ref=
"file_info"
/>
<appender-ref
ref=
"file_error"
/>
<appender-ref
ref=
"console"
/>
...
...
@@ -106,8 +106,9 @@
</root>
<!--系统用户操作日志-->
<logger
name=
"sys-user"
level=
"
info
"
>
<logger
name=
"sys-user"
level=
"
debug
"
>
<appender-ref
ref=
"sys-user"
/>
<appender-ref
ref=
"console"
/>
</logger>
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
View file @
54cef189
...
...
@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.
authorizeRequests
()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
).
permitAll
()
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
,
"/prod-api/captchaImage"
).
permitAll
()
// 静态资源,可匿名访问
.
antMatchers
(
HttpMethod
.
GET
,
"/"
,
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/profile/**"
).
permitAll
()
.
antMatchers
(
"/swagger-ui.html"
,
"/websocket/**"
,
"/swagger-resources/**"
,
"/webjars/**"
,
"/*/api-docs"
,
"/druid/**"
).
permitAll
()
...
...
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