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
136f3d82
Commit
136f3d82
authored
Jul 02, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wangdingyi' into 'dev'
车企文件添加 See merge request
!392
parents
c2ae76e3
40a23af7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
13 deletions
+76
-13
ReviewEnterpriseArchive.java
...c/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
+10
-3
AttachmentsVO.java
...view/src/main/java/com/ruoyi/domain/vo/AttachmentsVO.java
+28
-0
ReviewEnterpriseArchiveServiceImpl.java
...uoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
+38
-10
No files found.
quality-review/src/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
View file @
136f3d82
...
@@ -9,6 +9,7 @@ import java.util.Date;
...
@@ -9,6 +9,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.domain.vo.AttachmentsVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -69,11 +70,17 @@ public class ReviewEnterpriseArchive implements Serializable {
...
@@ -69,11 +70,17 @@ public class ReviewEnterpriseArchive implements Serializable {
private
String
storage
;
private
String
storage
;
/**
/**
*
图片
地址
*
附件
地址
*/
*/
@ApiModelProperty
(
"
图片
地址"
)
@ApiModelProperty
(
"
附件
地址"
)
private
String
photo
;
private
String
photo
;
/**
* 附件名称
*/
@ApiModelProperty
(
"附件名称"
)
private
String
photoName
;
/**
/**
* 关联到任务id
* 关联到任务id
*/
*/
...
@@ -90,6 +97,6 @@ public class ReviewEnterpriseArchive implements Serializable {
...
@@ -90,6 +97,6 @@ public class ReviewEnterpriseArchive implements Serializable {
@ApiModelProperty
(
"附件"
)
@ApiModelProperty
(
"附件"
)
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
[]
url
;
List
<
AttachmentsVO
>
url
;
}
}
\ No newline at end of file
quality-review/src/main/java/com/ruoyi/domain/vo/AttachmentsVO.java
0 → 100644
View file @
136f3d82
package
com
.
ruoyi
.
domain
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@Data
@Accessors
(
chain
=
true
)
public
class
AttachmentsVO
{
// 附件路径
@ApiModelProperty
(
"附件路径"
)
String
url
;
// 附件名称
@ApiModelProperty
(
"附件名称"
)
String
name
;
// 构造函数
public
AttachmentsVO
(
String
url
,
String
name
)
{
this
.
url
=
url
;
this
.
name
=
name
;
}
// 默认构造函数
public
AttachmentsVO
()
{
// 可以为空,或者初始化一些默认值
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
View file @
136f3d82
...
@@ -11,9 +11,7 @@ import com.ruoyi.common.utils.SecurityUtils;
...
@@ -11,9 +11,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import
com.ruoyi.common.utils.StringUtils
;
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.*
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.mapper.TaskMapper
;
import
com.ruoyi.service.ReviewEnterpriseArchiveService
;
import
com.ruoyi.service.ReviewEnterpriseArchiveService
;
import
com.ruoyi.mapper.ReviewEnterpriseArchiveMapper
;
import
com.ruoyi.mapper.ReviewEnterpriseArchiveMapper
;
...
@@ -34,6 +32,7 @@ import java.util.Date;
...
@@ -34,6 +32,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
ruoyi
.
common
.
utils
.
DateUtils
.
getNowDate
;
import
static
com
.
ruoyi
.
common
.
utils
.
DateUtils
.
getNowDate
;
...
@@ -151,9 +150,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -151,9 +150,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
throw
new
ServiceException
(
"新增文件名称重复,请检查"
,
HttpStatus
.
ERROR
);
throw
new
ServiceException
(
"新增文件名称重复,请检查"
,
HttpStatus
.
ERROR
);
}
else
{
}
else
{
// 将附件地址存入photo字段中
// 将附件地址存入photo字段中
if
(
reviewEnterpriseArchive
.
getUrl
()
!=
null
&&
reviewEnterpriseArchive
.
getUrl
().
length
!=
0
)
{
if
(
reviewEnterpriseArchive
.
getUrl
()
!=
null
&&
reviewEnterpriseArchive
.
getUrl
().
size
()
!=
0
)
{
String
joinUrl
=
StringUtils
.
join
(
reviewEnterpriseArchive
.
getUrl
(),
","
);
reviewEnterpriseArchive
.
setPhoto
(
joinUrl
);
String
photo
=
reviewEnterpriseArchive
.
getUrl
().
stream
()
.
map
(
AttachmentsVO:
:
getUrl
)
.
collect
(
Collectors
.
joining
(
","
));
String
photoName
=
reviewEnterpriseArchive
.
getUrl
().
stream
()
.
map
(
AttachmentsVO:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
));
reviewEnterpriseArchive
.
setPhoto
(
photo
);
reviewEnterpriseArchive
.
setPhotoName
(
photoName
);
}
}
reviewEnterpriseArchiveService
.
save
(
reviewEnterpriseArchive
);
reviewEnterpriseArchiveService
.
save
(
reviewEnterpriseArchive
);
...
@@ -185,7 +193,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -185,7 +193,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Override
@Override
public
ReviewEnterpriseArchive
getInfo
(
ReviewEnterpriseArchiveGetInfoRequest
request
)
{
public
ReviewEnterpriseArchive
getInfo
(
ReviewEnterpriseArchiveGetInfoRequest
request
)
{
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
request
.
getId
());
ReviewEnterpriseArchive
reviewEnterpriseArchive
=
reviewEnterpriseArchiveMapper
.
selectById
(
request
.
getId
());
reviewEnterpriseArchive
.
setUrl
(
reviewEnterpriseArchive
.
getPhoto
().
split
(
","
));
// 按逗号拆分字符串
String
[]
photoUrls
=
reviewEnterpriseArchive
.
getPhoto
().
split
(
","
);
String
[]
photoNames
=
reviewEnterpriseArchive
.
getPhotoName
().
split
(
","
);
// 将拆分后的字符串配对创建AttachmentsVO对象,并加入到List中
List
<
AttachmentsVO
>
attachmentsVOList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
photoUrls
.
length
;
i
++)
{
AttachmentsVO
vo
=
new
AttachmentsVO
(
photoUrls
[
i
],
photoNames
[
i
]);
attachmentsVOList
.
add
(
vo
);
}
reviewEnterpriseArchive
.
setUrl
(
attachmentsVOList
);
return
reviewEnterpriseArchive
;
return
reviewEnterpriseArchive
;
}
}
...
@@ -251,9 +270,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
...
@@ -251,9 +270,18 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Override
@Override
public
void
editEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
public
void
editEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
// 将附件地址存入photo字段中
// 将附件地址存入photo字段中
if
(
reviewEnterpriseArchive
.
getUrl
()
!=
null
&&
reviewEnterpriseArchive
.
getUrl
().
length
!=
0
)
{
if
(
reviewEnterpriseArchive
.
getUrl
()
!=
null
&&
reviewEnterpriseArchive
.
getUrl
().
size
()
!=
0
)
{
String
joinUrl
=
StringUtils
.
join
(
reviewEnterpriseArchive
.
getUrl
(),
","
);
reviewEnterpriseArchive
.
setPhoto
(
joinUrl
);
String
photo
=
reviewEnterpriseArchive
.
getUrl
().
stream
()
.
map
(
AttachmentsVO:
:
getUrl
)
.
collect
(
Collectors
.
joining
(
","
));
String
photoName
=
reviewEnterpriseArchive
.
getUrl
().
stream
()
.
map
(
AttachmentsVO:
:
getName
)
.
collect
(
Collectors
.
joining
(
","
));
reviewEnterpriseArchive
.
setPhoto
(
photo
);
reviewEnterpriseArchive
.
setPhotoName
(
photoName
);
}
}
reviewEnterpriseArchiveService
.
updateById
(
reviewEnterpriseArchive
);
reviewEnterpriseArchiveService
.
updateById
(
reviewEnterpriseArchive
);
}
}
...
...
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