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
856952d1
Commit
856952d1
authored
Feb 23, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增车企文件
parent
acc1f43f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
4 deletions
+117
-4
ReviewDetailsResult.java
...w/src/main/java/com/ruoyi/domain/ReviewDetailsResult.java
+12
-0
ReviewEnterpriseArchive.java
...c/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
+16
-0
ReviewEnterpriseArchiveMapper.java
.../java/com/ruoyi/mapper/ReviewEnterpriseArchiveMapper.java
+2
-0
ReviewEnterpriseArchiveService.java
...ava/com/ruoyi/service/ReviewEnterpriseArchiveService.java
+1
-0
ReviewEnterpriseArchiveServiceImpl.java
...uoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
+33
-0
ReviewEnterpriseArchiveController.java
...java/com/ruoyi/web/ReviewEnterpriseArchiveController.java
+40
-0
ReviewDetailsResultMapper.xml
...w/src/main/resources/mapper/ReviewDetailsResultMapper.xml
+5
-2
ReviewEnterpriseArchiveMapper.xml
...c/main/resources/mapper/ReviewEnterpriseArchiveMapper.xml
+8
-2
No files found.
quality-review/src/main/java/com/ruoyi/domain/ReviewDetailsResult.java
View file @
856952d1
package
com
.
ruoyi
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
...
...
@@ -78,4 +79,15 @@ public class ReviewDetailsResult implements Serializable {
@ApiModelProperty
(
"最后修改时间"
)
private
Date
lastModifyTime
;
@ApiModelProperty
(
"文件目录"
)
private
String
catalogue
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
@ApiModelProperty
(
"关联到车企留档文件"
)
private
Long
reviewEnterpriseArchiveId
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
"文件名称"
)
private
String
fileName
;
}
quality-review/src/main/java/com/ruoyi/domain/ReviewEnterpriseArchive.java
View file @
856952d1
...
...
@@ -27,46 +27,62 @@ public class ReviewEnterpriseArchive implements Serializable {
/**
* 企业名称
*/
@ApiModelProperty
(
"企业名称"
)
private
String
enterpriseName
;
/**
* 文件名称
*/
@ApiModelProperty
(
"文件名称"
)
private
String
fileName
;
/**
* 文件版本
*/
@ApiModelProperty
(
"文件版本"
)
private
String
version
;
/**
* 发布日期
*/
@ApiModelProperty
(
"发布日期"
)
private
Date
publishDate
;
/**
* 文件状态
*/
@ApiModelProperty
(
"文件状态"
)
private
String
status
;
/**
* 文件识别号
*/
@ApiModelProperty
(
"文件识别号"
)
private
String
identifyNumber
;
/**
* 存储位置
*/
@ApiModelProperty
(
"存储位置"
)
private
String
storage
;
/**
* 图片地址
*/
@ApiModelProperty
(
"图片地址"
)
private
String
photo
;
/**
* 关联到任务id
*/
@ApiModelProperty
(
"关联到任务id"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
taskId
;
@ApiModelProperty
(
"创建人"
)
private
String
createBy
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
}
\ No newline at end of file
quality-review/src/main/java/com/ruoyi/mapper/ReviewEnterpriseArchiveMapper.java
View file @
856952d1
...
...
@@ -20,6 +20,8 @@ public interface ReviewEnterpriseArchiveMapper extends BaseMapper<ReviewEnterpri
List
<
ReviewEnterpriseArchive
>
findByTaskId
(
@Param
(
"taskId"
)
Long
taskId
);
List
<
ReviewEnterpriseArchiveViewItemVO
>
findViewItemVOByTaskId
(
@Param
(
"taskId"
)
Long
taskId
);
Long
findFileName
(
@Param
(
"taskId"
)
Long
taskId
,
@Param
(
"fileName"
)
String
fileName
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/ReviewEnterpriseArchiveService.java
View file @
856952d1
...
...
@@ -15,4 +15,5 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
List
<
ReviewEnterpriseArchiveViewVO
>
view
(
Long
taskId
);
void
addEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
);
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewEnterpriseArchiveServiceImpl.java
View file @
856952d1
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.ReviewEnterpriseArchive
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO
;
import
com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO
;
import
com.ruoyi.service.ReviewEnterpriseArchiveService
;
import
com.ruoyi.mapper.ReviewEnterpriseArchiveMapper
;
import
com.ruoyi.system.service.ISysUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -24,6 +31,12 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Autowired
private
ReviewEnterpriseArchiveMapper
reviewEnterpriseArchiveMapper
;
@Autowired
private
ISysUserService
sysUserService
;
@Autowired
private
ReviewEnterpriseArchiveService
reviewEnterpriseArchiveService
;
@Override
public
List
<
ReviewEnterpriseArchiveViewVO
>
view
(
Long
taskId
)
{
...
...
@@ -34,6 +47,26 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
return
buildReviewEnterpriseArchiveViewVO
(
archives
,
viewItems
);
}
@Override
public
void
addEnterpriseArchive
(
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
SysUser
user
=
sysUserService
.
selectUserById
(
loginUser
.
getUserId
());
reviewEnterpriseArchive
.
setCreateBy
(
user
.
getNickName
());
reviewEnterpriseArchive
.
setCreateTime
(
new
Date
());
Long
sum
=
reviewEnterpriseArchiveMapper
.
findFileName
(
reviewEnterpriseArchive
.
getTaskId
(),
reviewEnterpriseArchive
.
getFileName
());
if
(
sum
>
0
)
{
throw
new
ServiceException
(
"新增文件名称重复,请检查"
,
HttpStatus
.
ERROR
);
}
else
{
reviewEnterpriseArchiveService
.
save
(
reviewEnterpriseArchive
);
}
}
private
List
<
ReviewEnterpriseArchiveViewVO
>
buildReviewEnterpriseArchiveViewVO
(
List
<
ReviewEnterpriseArchive
>
archives
,
List
<
ReviewEnterpriseArchiveViewItemVO
>
viewItems
)
{
List
<
ReviewEnterpriseArchiveViewVO
>
viewList
=
new
ArrayList
();
...
...
quality-review/src/main/java/com/ruoyi/web/ReviewEnterpriseArchiveController.java
0 → 100644
View file @
856952d1
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.domain.ReviewEnterpriseArchive
;
import
com.ruoyi.service.ReviewEnterpriseArchiveService
;
import
com.ruoyi.web.request.TaskCreateRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
import
org.apache.skywalking.apm.toolkit.trace.Tags
;
import
org.apache.skywalking.apm.toolkit.trace.Trace
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
@Api
(
tags
=
"车企文件"
)
@RestController
@RequestMapping
(
"/review/enterprise/archive"
)
public
class
ReviewEnterpriseArchiveController
extends
BaseController
{
@Autowired
private
ReviewEnterpriseArchiveService
reviewEnterpriseArchiveService
;
@ApiOperation
(
"新增车企文件"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"车企文件"
,
businessType
=
BusinessType
.
INSERT
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/add"
)
public
R
<
String
>
addEnterpriseArchive
(
@Validated
@RequestBody
ReviewEnterpriseArchive
reviewEnterpriseArchive
)
{
reviewEnterpriseArchiveService
.
addEnterpriseArchive
(
reviewEnterpriseArchive
);
return
R
.
ok
();
}
}
quality-review/src/main/resources/mapper/ReviewDetailsResultMapper.xml
View file @
856952d1
...
...
@@ -14,6 +14,9 @@
<result
property=
"userId"
column=
"user_id"
jdbcType=
"BIGINT"
/>
<result
property=
"userName"
column=
"user_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"lastModifyTime"
column=
"last_modify_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"catalogue"
column=
"catalogue"
jdbcType=
"VARCHAR"
/>
<result
property=
"reviewEnterpriseArchiveId"
column=
"review_enterprise_archive_id"
jdbcType=
"BIGINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
...
...
@@ -22,11 +25,11 @@
task_id from t_review_details_result
</sql>
<select
id=
"findByTaskId"
resultType=
"com.ruoyi.domain.ReviewDetailsResult"
>
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time FROM t_review_details_result WHERE task_id = #{taskId}
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time
, catalogue, review_enterprise_archive_id
FROM t_review_details_result WHERE task_id = #{taskId}
</select>
<select
id=
"findByTaskIdAndDetailsId"
resultType=
"com.ruoyi.domain.ReviewDetailsResult"
>
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time
SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time
, catalogue, review_enterprise_archive_id
FROM t_review_details_result
WHERE task_id = #{taskId} and review_details_id = #{reviewDetailsId}
</select>
...
...
quality-review/src/main/resources/mapper/ReviewEnterpriseArchiveMapper.xml
View file @
856952d1
...
...
@@ -6,7 +6,7 @@
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.domain.ReviewEnterpriseArchive"
>
<id
property=
"id"
column=
"id"
jdbcType=
"BIGINT"
/>
<result
property=
"enterpriseName"
column=
"enterpri
c
e_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"enterpriseName"
column=
"enterpri
s
e_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"fileName"
column=
"file_name"
jdbcType=
"VARCHAR"
/>
<result
property=
"version"
column=
"version"
jdbcType=
"VARCHAR"
/>
<result
property=
"publishDate"
column=
"publish_date"
jdbcType=
"DATE"
/>
...
...
@@ -15,10 +15,12 @@
<result
property=
"storage"
column=
"storage"
jdbcType=
"VARCHAR"
/>
<result
property=
"photo"
column=
"photo"
jdbcType=
"VARCHAR"
/>
<result
property=
"taskId"
column=
"task_id"
jdbcType=
"BIGINT"
/>
<result
property=
"createBy"
column=
"create_by"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<select
id=
"findByTaskId"
resultType=
"com.ruoyi.domain.ReviewEnterpriseArchive"
>
SELECT id, enterprise_name, file_name, version, publish_date, status, identify_number, storage, photo, task_id FROM t_review_enterprise_archive WHERE task_id = #{taskId}
SELECT id, enterprise_name, file_name, version, publish_date, status, identify_number, storage, photo, task_id
, create_by, create_time
FROM t_review_enterprise_archive WHERE task_id = #{taskId}
</select>
<select
id=
"findViewItemVOByTaskId"
resultType=
"com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO"
>
SELECT
...
...
@@ -34,4 +36,8 @@
LEFT JOIN t_review_enterprise_archive archive ON result.review_enterprise_archive_id = archive.id
WHERE result.task_id = #{taskId};
</select>
<select
id=
"findFileName"
resultType=
"java.lang.Long"
>
select COUNT(*) sum from t_review_enterprise_archive
where task_id = #{taskId} and file_name = #{fileName}
</select>
</mapper>
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