Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
engine-class-work
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
liuchengjiu
engine-class-work
Commits
e82c0cbc
Commit
e82c0cbc
authored
Jul 24, 2023
by
Ryan Loong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改增加点名次数的逻辑
parent
cc033ddf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
StudentInfoService.java
...xploring/engine/server/db/service/StudentInfoService.java
+15
-6
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+0
-2
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentInfoService.java
View file @
e82c0cbc
...
...
@@ -99,12 +99,16 @@ public class StudentInfoService {
* @param classId
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
StudentVo
selectStudentInfo
(
Integer
classId
,
Integer
maxCall
)
{
return
beanSearcher
.
searchFirst
(
StudentVo
.
class
,
MapUtils
.
builder
()
.
field
(
StudentVo:
:
getDeleted
,
StudentInfo
.
NOT_DELETED
).
op
(
Equal
.
class
)
.
field
(
StudentVo:
:
getClassId
,
classId
).
op
(
Equal
.
class
)
.
field
(
StudentVo:
:
getCallTimes
,
maxCall
).
op
(
LessThan
.
class
)
StudentVo
record
=
beanSearcher
.
searchFirst
(
StudentVo
.
class
,
MapUtils
.
builder
()
.
field
(
StudentVo:
:
getDeleted
,
StudentInfo
.
NOT_DELETED
).
op
(
Equal
.
class
)
.
field
(
StudentVo:
:
getClassId
,
classId
).
op
(
Equal
.
class
)
.
field
(
StudentVo:
:
getCallTimes
,
maxCall
).
op
(
LessThan
.
class
)
.
build
());
increaseCallTime
(
record
);
return
record
;
}
/**
...
...
@@ -396,12 +400,17 @@ public class StudentInfoService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
increaseCallTimeByPrimaryKey
(
Integer
id
)
{
StudentInfo
studentInfo
=
selectByPrimaryKey
(
id
);
increaseCallTime
(
studentInfoMapper
.
selectByPrimaryKey
(
id
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
increaseCallTime
(
StudentInfo
studentInfo
)
{
Integer
callTimes
=
studentInfo
.
getCallTimes
();
studentInfo
.
setCallTimes
(
callTimes
+
1
);
studentInfo
.
setUpdateTime
(
LocalDateTime
.
now
());
int
i
=
studentInfoMapper
.
updateByExampleSelective
(
studentInfo
,
new
StudentInfoExample
().
createCriteria
().
andDeletedEqualTo
(
StudentInfo
.
NOT_DELETED
).
andIdEqualTo
(
id
).
andCallTimesEqualTo
(
callTimes
).
example
(),
new
StudentInfoExample
().
createCriteria
().
andDeletedEqualTo
(
StudentInfo
.
NOT_DELETED
).
andIdEqualTo
(
studentInfo
.
getId
()
).
andCallTimesEqualTo
(
callTimes
).
example
(),
StudentInfo
.
Column
.
updateTime
,
StudentInfo
.
Column
.
callTimes
);
if
(
i
<=
0
)
{
throw
new
RuntimeException
(
"更新点名次数失败"
);
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
e82c0cbc
...
...
@@ -104,8 +104,6 @@ public class StudentPointService {
studentPoint
.
setAddTime
(
now
);
studentPoint
.
setDeleted
(
false
);
studentPointInfoMapper
.
insert
(
studentPoint
);
studentInfoService
.
increaseCallTimeByPrimaryKey
(
studentPoint
.
getStudentId
());
return
"add OK"
;
}
...
...
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