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
ad7f00d5
Commit
ad7f00d5
authored
Mar 19, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增任务名称验重
parent
c0e27106
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
54 deletions
+69
-54
TaskMapper.java
...ity-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
+2
-0
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+63
-54
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+4
-0
No files found.
quality-review/src/main/java/com/ruoyi/mapper/TaskMapper.java
View file @
ad7f00d5
...
...
@@ -35,4 +35,6 @@ public interface TaskMapper extends BaseMapper<Task> {
Task
getByUserIdTemporary
(
@Param
(
"userId"
)
Long
userId
);
Task
getBySubtaskId
(
@Param
(
"subId"
)
Long
subId
);
Long
findTaskName
(
@Param
(
"taskName"
)
String
taskName
);
}
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
ad7f00d5
...
...
@@ -5,8 +5,10 @@ import cn.hutool.core.util.ObjectUtil;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.DataStatisticsUtils
;
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.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
...
...
@@ -17,6 +19,7 @@ import com.ruoyi.service.*;
import
com.ruoyi.system.service.ISysUserService
;
import
com.ruoyi.web.request.*
;
import
com.ruoyi.web.response.DataStatisticsResponse
;
import
com.ruoyi.web.response.ResultCountResponse
;
import
com.ruoyi.web.response.TaskFindResponse
;
import
com.ruoyi.web.response.TaskGetInfoResponse
;
import
org.apache.poi.ss.formula.functions.T
;
...
...
@@ -105,6 +108,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
@Override
public
void
createTask
(
TaskCreateRequest
request
)
{
Long
sum
=
taskMapper
.
findTaskName
(
request
.
getTaskName
());
if
(
sum
>
0
)
{
throw
new
ServiceException
(
"任务名称重复,请检查"
,
HttpStatus
.
ERROR
);
}
else
{
// 构建任务创建者
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
SysUser
initiator
=
sysUserService
.
selectUserById
(
loginUser
.
getUserId
());
...
...
@@ -171,6 +179,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskMapper
.
deleteById
(
temporaryStorageTask
.
getId
());
}
}
}
@Override
public
List
<
TaskFindResponse
>
findPending
(
TaskFindPendingRequest
request
,
Long
userId
)
{
...
...
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
ad7f00d5
...
...
@@ -276,6 +276,10 @@
FROM t_task
WHERE system_review_task_id = #{subId} OR car_review_task_id = #{subId}
</select>
<select
id=
"findTaskName"
resultType=
"java.lang.Long"
>
select COUNT(*) sum from t_task
where task_name = #{taskName}
</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