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
13726306
Commit
13726306
authored
Feb 22, 2022
by
Mindfaker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
45c08615
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
6 deletions
+56
-6
application-coreTest.yml
server-core/src/main/resources/application-coreTest.yml
+1
-1
SpecialSqlMapper.java
...a/cn/exploring/engine/server/db/dao/SpecialSqlMapper.java
+24
-0
ClassService.java
...a/cn/exploring/engine/server/db/service/ClassService.java
+4
-2
StudentInfoService.java
...xploring/engine/server/db/service/StudentInfoService.java
+17
-1
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+10
-2
No files found.
server-core/src/main/resources/application-coreTest.yml
View file @
13726306
...
...
@@ -99,7 +99,7 @@ server:
local
:
storagePath
:
storage
# 这个地方应该是wx模块的WxStorageController的fetch方法对应的地址
address
:
https://base.exploring.cn/test-e
mba-server
/wx/storage/fetch/
address
:
https://base.exploring.cn/test-e
ngine-class-work
/wx/storage/fetch/
# 阿里云对象存储配置信息
aliyun
:
endpoint
:
oss-cn-zhangjiakou.aliyuncs.com
...
...
server-db/src/main/java/cn/exploring/engine/server/db/dao/SpecialSqlMapper.java
View file @
13726306
...
...
@@ -231,6 +231,30 @@ public interface SpecialSqlMapper {
@Param
(
"page"
)
Integer
page
,
@Param
(
"limit"
)
Integer
limit
,
@Param
(
"sort"
)
String
sort
,
@Param
(
"order"
)
String
order
);
/**
* 打卡评分
* @param
* @return
*/
@Select
(
"<script> "
+
"SELECT count(*) as count_info FROM "
+
"(SELECT * FROM "
+
"(SELECT id, student_unique_id, `name`, class_id, add_time FROM student_info WHERE deleted = FALSE "
+
"<if test = 'studentName != null'> AND `name` like '%${studentName}%' </if>"
+
"<if test = 'studentUniqueId != null'> AND student_unique_id like '%${studentUniqueId}%' </if>"
+
"<if test = 'classId != null'> AND class_id = ${classId} </if>"
+
") target_stu INNER JOIN ("
+
"SELECT student_id, record_time, point FROM student_point_info WHERE deleted = FALSE "
+
"<if test = 'startTime != null'> AND record_time >= '${startTime}' </if>"
+
"<if test = 'endTime != null'> AND '${endTime} ' >= record_time </if>"
+
" ) point_info ON target_stu.id = point_info.student_id) t1 "
+
" LEFT JOIN (SELECT id, class_name FROM class_info WHERE deleted = FALSE ) t2 ON t1.class_id = t2.id "
+
"</script>"
)
Map
<
String
,
String
>
selectPointCount
(
@Param
(
"studentName"
)
String
studentName
,
@Param
(
"studentUniqueId"
)
String
studentUniqueId
,
@Param
(
"classId"
)
Integer
classId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
/**
* 随机选择一个的学生
* @param classId
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/ClassService.java
View file @
13726306
...
...
@@ -41,8 +41,10 @@ public class ClassService {
if
(
idList
!=
null
&&
idList
.
size
()
>
0
)
{
criteria
.
andIdIn
(
idList
);
}
criteria
.
andDeletedEqualTo
(
false
).
andClassNameEqualTo
(
className
);
if
(!
StringUtils
.
isEmpty
(
className
))
{
criteria
.
andClassNameEqualTo
(
className
);
}
criteria
.
andDeletedEqualTo
(
false
);
return
classInfoMapper
.
selectByExample
(
example
);
}
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentInfoService.java
View file @
13726306
...
...
@@ -38,6 +38,9 @@ public class StudentInfoService {
* @return
*/
public
String
addStudentInfo
(
StudentInfo
studentInfo
)
{
if
(
selectStudentInfoByUniqueId
(
studentInfo
.
getStudentUniqueId
())
!=
null
)
{
return
"Fail 学号重复! 请重新输入学号"
;
}
LocalDateTime
now
=
LocalDateTime
.
now
();
studentInfo
.
setAddTime
(
now
);
studentInfo
.
setUpdateTime
(
now
);
...
...
@@ -73,12 +76,25 @@ public class StudentInfoService {
public
Object
batchDeleted
(
List
<
Integer
>
idList
)
{
List
<
StudentInfo
>
studentInfoList
=
selectStudentInfo
(
null
,
null
,
idList
);
studentInfoList
.
forEach
(
x
->
{
x
.
setDeleted
(
false
);
x
.
setDeleted
(
null
);
updateStudentInfo
(
x
);
});
return
"batch deleted OK"
;
}
/**
* 根据标记学号进行查询
* @param uniqueId
* @return
*/
public
StudentInfo
selectStudentInfoByUniqueId
(
String
uniqueId
)
{
StudentInfoExample
example
=
new
StudentInfoExample
();
StudentInfoExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andDeletedEqualTo
(
false
).
andStudentUniqueIdEqualTo
(
uniqueId
);
return
studentInfoMapper
.
selectOneByExample
(
example
);
}
/**
* 检索学生相关的信息
* @param studentName
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
13726306
...
...
@@ -6,9 +6,11 @@ import cn.exploring.engine.server.db.domain.StudentPointInfo;
import
cn.exploring.engine.server.db.domain.StudentPointInfoExample
;
import
cn.exploring.engine.server.db.util.Util
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
...
...
@@ -23,9 +25,15 @@ public class StudentPointService {
@Resource
SpecialSqlMapper
specialSqlMapper
;
public
List
<
Map
>
selectPointByWeb
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
Integer
page
,
Integer
limit
,
String
sort
,
String
order
)
{
public
Map
selectPointByWeb
(
String
studentName
,
String
studentUniqueId
,
Integer
classId
,
String
startTime
,
String
endTime
,
Integer
page
,
Integer
limit
,
String
sort
,
String
order
)
{
List
<
Map
>
dataList
=
specialSqlMapper
.
selectPoint
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
,
page
,
limit
,
sort
,
order
);
return
dataList
.
stream
().
map
((
Function
<
Map
,
Map
>)
Util:
:
exchangeMapKeyName
).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
countInfoData
=
specialSqlMapper
.
selectPointCount
(
studentName
,
studentUniqueId
,
classId
,
startTime
,
endTime
);
Integer
countInfo
=
StringUtils
.
isEmpty
(
countInfoData
.
get
(
"count_info"
))
?
0
:
Integer
.
parseInt
(
countInfoData
.
get
(
"count_info"
).
toString
());
List
<
Map
>
targetDataList
=
dataList
.
stream
().
map
((
Function
<
Map
,
Map
>)
Util:
:
exchangeMapKeyName
).
collect
(
Collectors
.
toList
());
return
new
HashMap
()
{{
put
(
"items"
,
targetDataList
);
put
(
"total"
,
countInfo
);
}};
}
/**
...
...
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