Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car-database-api
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
中汽研标准应用数据库
car-database-api
Commits
92d1f3d7
Commit
92d1f3d7
authored
Sep 13, 2024
by
yuanshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.版本号问题=>当评审通过之后会获取当前评审所关联的standard进行最新版本号的更新
parent
e8d0e9f4
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
4 deletions
+102
-4
VersionUtils.java
...y-review/src/main/java/com/ruoyi/common/VersionUtils.java
+55
-0
Standard.java
quality-review/src/main/java/com/ruoyi/domain/Standard.java
+5
-0
SystemReviewTask.java
...view/src/main/java/com/ruoyi/domain/SystemReviewTask.java
+2
-0
ReviewSceneChangeTaskMapper.java
...in/java/com/ruoyi/mapper/ReviewSceneChangeTaskMapper.java
+3
-1
StandardMapper.java
...review/src/main/java/com/ruoyi/mapper/StandardMapper.java
+2
-0
ReviewSceneChangeTaskServiceImpl.java
.../ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
+24
-2
ReviewSceneChangeTaskMapper.xml
...src/main/resources/mapper/ReviewSceneChangeTaskMapper.xml
+6
-1
StandardMapper.xml
quality-review/src/main/resources/mapper/StandardMapper.xml
+5
-0
No files found.
quality-review/src/main/java/com/ruoyi/common/VersionUtils.java
0 → 100644
View file @
92d1f3d7
package
com
.
ruoyi
.
common
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
VersionUtils
{
/*
* 获取当前日期,格式化为yyyyMM
* @return 当前日期的字符串表示,格式为yyyyMM
* */
public
static
String
getCurrentDate
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMM"
);
return
sdf
.
format
(
new
Date
());
}
/*
* 生成最新版本号
* @param currentVersion 当前最新版本号,例如“20240913-1”
* @return 增加后的最新版本号
* */
public
static
String
incrementVersion
(
String
currentVersion
){
//将版本号按照“-” 拆分成日期和版本号部分
String
[]
parts
=
currentVersion
.
split
(
"-"
);
if
(
parts
.
length
!=
2
){
throw
new
ServiceException
(
"当前版本格式有问题"
,
HttpStatus
.
ERROR
);
}
//获取当前日期部分(yyyyMM)
String
currentDate
=
getCurrentDate
();
//获取日期部分
String
versionDate
=
parts
[
0
];
//版本号中的日期部分
//获取版本号部分,并将其转为整数后+1
int
versionNumber
=
Integer
.
parseInt
(
parts
[
1
]);
//如果当前月份与版本号中的日期一致,则递增版本号
if
(
currentDate
.
equals
(
versionDate
)){
versionNumber
++;
return
currentDate
+
"-"
+
versionNumber
;
}
else
{
//如果当前月份不同,则重新开始版本号,从 1 开始
return
currentDate
+
"-"
+
versionNumber
;
}
}
/*
* 初始化版本号,格式为yyyyMM-1
* @return 新的初始版本号
* */
public
static
String
initializeVersion
()
{
return
getCurrentDate
()
+
"-1"
;
}
}
quality-review/src/main/java/com/ruoyi/domain/Standard.java
View file @
92d1f3d7
...
@@ -69,4 +69,9 @@ public class Standard {
...
@@ -69,4 +69,9 @@ public class Standard {
@ApiModelProperty
(
"要点名称"
)
@ApiModelProperty
(
"要点名称"
)
private
String
keypointName
;
private
String
keypointName
;
@ApiModelProperty
(
"原始版本"
)
private
String
originalVersion
;
@ApiModelProperty
(
"最新版本"
)
private
String
currentVersion
;
}
}
quality-review/src/main/java/com/ruoyi/domain/SystemReviewTask.java
View file @
92d1f3d7
...
@@ -182,4 +182,6 @@ public class SystemReviewTask {
...
@@ -182,4 +182,6 @@ public class SystemReviewTask {
@ApiModelProperty
(
"企业名称"
)
@ApiModelProperty
(
"企业名称"
)
private
String
enterpriseName
;
private
String
enterpriseName
;
}
}
quality-review/src/main/java/com/ruoyi/mapper/ReviewSceneChangeTaskMapper.java
View file @
92d1f3d7
...
@@ -69,7 +69,9 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
...
@@ -69,7 +69,9 @@ public interface ReviewSceneChangeTaskMapper extends BaseMapper<ReviewSceneChang
/*
/*
* 查看评审人员评审意见
* 查看评审人员评审意见
* */
* */
List
<
ReviewOpinionResponse
>
getReviewerOpinion
(
@Param
(
"id"
)
Long
id
);
List
<
ReviewOpinionResponse
>
getReviewerOpinion
(
@Param
(
"id"
)
Long
id
,
@Param
(
"userId"
)
Long
userId
);
Long
getinspectStandardIdByTaskId
(
@Param
(
"taskId"
)
Long
taskId
);
}
}
...
...
quality-review/src/main/java/com/ruoyi/mapper/StandardMapper.java
View file @
92d1f3d7
...
@@ -38,4 +38,6 @@ public interface StandardMapper extends BaseMapper<Standard> {
...
@@ -38,4 +38,6 @@ public interface StandardMapper extends BaseMapper<Standard> {
List
<
String
>
getTypeList
(
@Param
(
"getChapterListRequest"
)
GetChapterListRequest
getChapterListRequest
);
List
<
String
>
getTypeList
(
@Param
(
"getChapterListRequest"
)
GetChapterListRequest
getChapterListRequest
);
List
<
ReviewStandardChapterListResponse
>
getChapterList
(
@Param
(
"type"
)
String
type
);
List
<
ReviewStandardChapterListResponse
>
getChapterList
(
@Param
(
"type"
)
String
type
);
Standard
findStandardById
(
@Param
(
"inspectStandardId"
)
Long
inspectStandardId
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/ReviewSceneChangeTaskServiceImpl.java
View file @
92d1f3d7
...
@@ -3,14 +3,18 @@ package com.ruoyi.service.impl;
...
@@ -3,14 +3,18 @@ package com.ruoyi.service.impl;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.toolkit.Db
;
import
com.baomidou.mybatisplus.extension.toolkit.Db
;
import
com.ruoyi.common.VersionUtils
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
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.exception.ServiceException
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.ReviewSceneChangeTask
;
import
com.ruoyi.domain.ReviewSceneChangeTask
;
import
com.ruoyi.domain.ReviewSceneChangeTaskUserRelation
;
import
com.ruoyi.domain.ReviewSceneChangeTaskUserRelation
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.framework.web.domain.server.Sys
;
import
com.ruoyi.framework.web.domain.server.Sys
;
import
com.ruoyi.mapper.ReviewKeyPointMapper
;
import
com.ruoyi.mapper.ReviewKeyPointMapper
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.service.*
;
import
com.ruoyi.service.*
;
import
com.ruoyi.mapper.ReviewSceneChangeTaskMapper
;
import
com.ruoyi.mapper.ReviewSceneChangeTaskMapper
;
import
com.ruoyi.system.mapper.SysUserRoleMapper
;
import
com.ruoyi.system.mapper.SysUserRoleMapper
;
...
@@ -63,6 +67,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
...
@@ -63,6 +67,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
@Autowired
@Autowired
private
TestUseCaseService
testUseCaseService
;
private
TestUseCaseService
testUseCaseService
;
@Autowired
private
StandardMapper
standardMapper
;
@Override
@Override
public
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
throws
IOException
{
public
void
create
(
ReviewSceneChangeTask
reviewSceneChangeTask
)
throws
IOException
{
...
@@ -222,7 +229,20 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
...
@@ -222,7 +229,20 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
// 更新审核标准
// 更新审核标准
reviewSceneService
.
change
(
task
);
reviewSceneService
.
change
(
task
);
// TODO 评审通过修改标准版本号,每月第一天次数从1开始
// TODO 评审通过修改标准版本号,每月第一天次数从1开始
//如果评审通过那么 通过当前评审任务的id获取的InspectStandardId
Long
inspectStandardId
=
reviewSceneChangeTaskMapper
.
getinspectStandardIdByTaskId
(
taskId
);
//用inspectStandardId去标准表里寻找到关联的标准信息
Standard
standard
=
standardMapper
.
findStandardById
(
inspectStandardId
);
//获取关联标准之后修改当前标准的最新版本号
if
(
standard
!=
null
){
//获取关联标准之后修改当前标准的最新版本号
String
currentVersion
=
standard
.
getCurrentVersion
();
String
newVersion
=
VersionUtils
.
incrementVersion
(
currentVersion
);
//更新标准的版本号
standard
.
setCurrentVersion
(
newVersion
);
standardMapper
.
updateById
(
standard
);
}
//场景变更时发送信息
//场景变更时发送信息
if
(
Objects
.
equals
(
task
.
getOperationSort
(),
"ADD_SCENE"
)
||
Objects
.
equals
(
task
.
getOperationSort
(),
"DELETE_SCENE"
))
{
if
(
Objects
.
equals
(
task
.
getOperationSort
(),
"ADD_SCENE"
)
||
Objects
.
equals
(
task
.
getOperationSort
(),
"DELETE_SCENE"
))
{
// 通知受影响的问卷
// 通知受影响的问卷
...
@@ -580,7 +600,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
...
@@ -580,7 +600,9 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
* */
* */
@Override
@Override
public
List
<
ReviewOpinionResponse
>
getReviewerOpinion
(
Long
id
)
{
public
List
<
ReviewOpinionResponse
>
getReviewerOpinion
(
Long
id
)
{
List
<
ReviewOpinionResponse
>
list
=
reviewSceneChangeTaskMapper
.
getReviewerOpinion
(
id
);
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
Long
userId
=
loginUser
.
getUserId
();
List
<
ReviewOpinionResponse
>
list
=
reviewSceneChangeTaskMapper
.
getReviewerOpinion
(
id
,
userId
);
return
list
;
return
list
;
}
}
...
...
quality-review/src/main/resources/mapper/ReviewSceneChangeTaskMapper.xml
View file @
92d1f3d7
...
@@ -168,7 +168,12 @@
...
@@ -168,7 +168,12 @@
<select
id=
"getReviewerOpinion"
resultType=
"com.ruoyi.web.response.ReviewOpinionResponse"
>
<select
id=
"getReviewerOpinion"
resultType=
"com.ruoyi.web.response.ReviewOpinionResponse"
>
select name,comment,decision,decision_time
select name,comment,decision,decision_time
from t_review_scene_change_task_user_relation
from t_review_scene_change_task_user_relation
where task_id = #{id}
where task_id = #{id} and user_id != #{userId}
</select>
<select
id=
"getinspectStandardIdByTaskId"
resultType=
"java.lang.Long"
>
select inspect_standard_id
from t_review_scene_change_task
where id = #{taskId}
</select>
</select>
</mapper>
</mapper>
quality-review/src/main/resources/mapper/StandardMapper.xml
View file @
92d1f3d7
...
@@ -77,4 +77,9 @@
...
@@ -77,4 +77,9 @@
from t_review_standard
from t_review_standard
where type = #{type}
where type = #{type}
</select>
</select>
<select
id=
"findStandardById"
resultType=
"com.ruoyi.domain.Standard"
>
select *
from t_standard
where id = #{inspectStandardId}
</select>
</mapper>
</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