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
3a207190
Commit
3a207190
authored
Jul 01, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
标准下检验项排序&车企文件上传附件 See merge request
!379
parents
7fb0439d
0e318103
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
3 deletions
+50
-3
ReviewEnterpriseArchive.java
...c/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
+5
-0
ReviewEnterpriseArchiveService.java
...ava/com/ruoyi/service/ReviewEnterpriseArchiveService.java
+5
-0
ReviewEnterpriseArchiveServiceImpl.java
...uoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
+17
-1
StandardInspectionItemRelationServiceImpl.java
...rvice/impl/StandardInspectionItemRelationServiceImpl.java
+22
-1
ReviewEnterpriseArchiveController.java
...java/com/ruoyi/web/ReviewEnterpriseArchiveController.java
+1
-1
No files found.
quality-review/src/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
View file @
3a207190
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -87,4 +88,8 @@ public class ReviewEnterpriseArchive implements Serializable {
...
@@ -87,4 +88,8 @@ public class ReviewEnterpriseArchive implements Serializable {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
private
Date
createTime
;
@ApiModelProperty
(
"附件"
)
@TableField
(
exist
=
false
)
private
String
[]
url
;
}
}
\ No newline at end of file
quality-review/src/main/java/com/ruoyi/service/ReviewEnterpriseArchiveService.java
View file @
3a207190
...
@@ -45,4 +45,9 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
...
@@ -45,4 +45,9 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
// 导入车企文件
// 导入车企文件
void
importEnterprise
(
List
<
EnterpriseImportFileVO
>
list
,
Long
taskId
,
HttpServletResponse
response
);
void
importEnterprise
(
List
<
EnterpriseImportFileVO
>
list
,
Long
taskId
,
HttpServletResponse
response
);
/**
* 编辑车企文件
* @param reviewEnterpriseArchive
*/
void
editEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
View file @
3a207190
...
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
...
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.domain.ReviewEnterpriseArchive
;
import
com.ruoyi.domain.ReviewEnterpriseArchive
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.vo.EnterpriseImportFileVO
;
import
com.ruoyi.domain.vo.EnterpriseImportFileVO
;
...
@@ -149,13 +150,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -149,13 +150,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
if
(
sum
>
0
)
{
if
(
sum
>
0
)
{
throw
new
ServiceException
(
"新增文件名称重复,请检查"
,
HttpStatus
.
ERROR
);
throw
new
ServiceException
(
"新增文件名称重复,请检查"
,
HttpStatus
.
ERROR
);
}
else
{
}
else
{
// 将附件地址存入photo字段中
String
joinUrl
=
StringUtils
.
join
(
reviewEnterpriseArchive
.
getUrl
(),
","
);
reviewEnterpriseArchive
.
setPhoto
(
joinUrl
);
reviewEnterpriseArchiveService
.
save
(
reviewEnterpriseArchive
);
reviewEnterpriseArchiveService
.
save
(
reviewEnterpriseArchive
);
ReviewEnterpriseArchiveFindByTaskIdRequest
request
=
new
ReviewEnterpriseArchiveFindByTaskIdRequest
();
ReviewEnterpriseArchiveFindByTaskIdRequest
request
=
new
ReviewEnterpriseArchiveFindByTaskIdRequest
();
request
.
setTaskId
(
reviewEnterpriseArchive
.
getTaskId
());
request
.
setTaskId
(
reviewEnterpriseArchive
.
getTaskId
());
// 根据任务id查询任务底下的所有车企文件
List
<
ReviewEnterpriseArchive
>
list
=
reviewEnterpriseArchiveMapper
.
findEnterpriseArchiveByTaskId
(
request
);
List
<
ReviewEnterpriseArchive
>
list
=
reviewEnterpriseArchiveMapper
.
findEnterpriseArchiveByTaskId
(
request
);
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
for
(
ReviewEnterpriseArchive
archive
:
list
)
{
for
(
ReviewEnterpriseArchive
archive
:
list
)
{
// 如果库里的企业名称不是新增时传入的企业名称则修改
if
(!
Objects
.
equals
(
archive
.
getEnterpriseName
(),
reviewEnterpriseArchive
.
getEnterpriseName
()))
{
if
(!
Objects
.
equals
(
archive
.
getEnterpriseName
(),
reviewEnterpriseArchive
.
getEnterpriseName
()))
{
archive
.
setEnterpriseName
(
reviewEnterpriseArchive
.
getEnterpriseName
());
archive
.
setEnterpriseName
(
reviewEnterpriseArchive
.
getEnterpriseName
());
}
}
...
@@ -176,7 +182,9 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -176,7 +182,9 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Override
@Override
public
ReviewEnterpriseArchive
getInfo
(
ReviewEnterpriseArchiveGetInfoRequest
request
)
{
public
ReviewEnterpriseArchive
getInfo
(
ReviewEnterpriseArchiveGetInfoRequest
request
)
{
return
reviewEnterpriseArchiveMapper
.
selectById
(
request
.
getId
());
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
request
.
getId
());
reviewEnterpriseArchive
.
setUrl
(
reviewEnterpriseArchive
.
getPhoto
().
split
(
","
));
return
reviewEnterpriseArchive
;
}
}
...
@@ -237,6 +245,14 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -237,6 +245,14 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
}
}
reviewEnterpriseArchiveMapper
.
insertEnterprise
(
list
);
reviewEnterpriseArchiveMapper
.
insertEnterprise
(
list
);
}
}
@Override
public
void
editEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
// 将附件地址存入photo字段中
String
joinUrl
=
StringUtils
.
join
(
reviewEnterpriseArchive
.
getUrl
(),
","
);
reviewEnterpriseArchive
.
setPhoto
(
joinUrl
);
reviewEnterpriseArchiveService
.
updateById
(
reviewEnterpriseArchive
);
}
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StandardInspectionItemRelationServiceImpl.java
View file @
3a207190
...
@@ -9,7 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -9,7 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Transactional
@Transactional
...
@@ -21,6 +25,23 @@ public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<Stand
...
@@ -21,6 +25,23 @@ public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<Stand
@Override
@Override
public
List
<
DictDataVO
>
getByStandardId
(
Long
standardId
)
{
public
List
<
DictDataVO
>
getByStandardId
(
Long
standardId
)
{
return
standardInspectionItemRelationMapper
.
getListByStandardId
(
standardId
);
List
<
DictDataVO
>
list
=
standardInspectionItemRelationMapper
.
getListByStandardId
(
standardId
);
// 定义期望的排序关键字
List
<
String
>
desiredOrder
=
Arrays
.
asList
(
"sraif"
,
"grfis"
,
"trfis"
);
// 使用流API对list进行排序
List
<
DictDataVO
>
sortedList
=
new
ArrayList
<>();
// 首先,创建一个映射表,键为dictValue,值为DictDataVO对象
Map
<
String
,
DictDataVO
>
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
DictDataVO:
:
getDictValue
,
vo
->
vo
));
// 然后,根据desiredOrder中的顺序从映射表中提取元素
for
(
String
order
:
desiredOrder
)
{
if
(
map
.
containsKey
(
order
))
{
sortedList
.
add
(
map
.
get
(
order
));
}
}
return
sortedList
;
}
}
}
}
quality-review/src/main/java/com/ruoyi/web/ReviewEnterpriseArchiveController.java
View file @
3a207190
...
@@ -93,7 +93,7 @@ public class ReviewEnterpriseArchiveController extends BaseController {
...
@@ -93,7 +93,7 @@ public class ReviewEnterpriseArchiveController extends BaseController {
@Log
(
title
=
"编辑车企文件"
,
businessType
=
BusinessType
.
UPDATE
)
@Log
(
title
=
"编辑车企文件"
,
businessType
=
BusinessType
.
UPDATE
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/edit"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/edit"
)
public
R
<
String
>
editEnterpriseArchive
(
@Validated
@RequestBody
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
public
R
<
String
>
editEnterpriseArchive
(
@Validated
@RequestBody
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
reviewEnterpriseArchiveService
.
updateById
(
reviewEnterpriseArchive
);
reviewEnterpriseArchiveService
.
editEnterpriseArchive
(
reviewEnterpriseArchive
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
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