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
24df301e
Commit
24df301e
authored
Jul 03, 2024
by
wdy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
dev - master 35 See merge request
!394
parents
5b84472b
66cda2a3
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 @
24df301e
...
@@ -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 @
24df301e
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
path
;
// 附件名称
@ApiModelProperty
(
"附件名称"
)
String
name
;
// 构造函数
public
AttachmentsVO
(
String
path
,
String
name
)
{
this
.
path
=
path
;
this
.
name
=
name
;
}
// 默认构造函数
public
AttachmentsVO
()
{
// 可以为空,或者初始化一些默认值
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
View file @
24df301e
...
@@ -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:
:
getPath
)
.
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:
:
getPath
)
.
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