Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
Project
Project
Details
Activity
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
licc
volunteer_service
Commits
56cfc490
Commit
56cfc490
authored
May 08, 2021
by
cy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案优化,个人信息返回综合分
parent
7ae9aec0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
23 deletions
+79
-23
RefillCardMapper.xml
...rgy-mapper/src/main/resources/mapper/RefillCardMapper.xml
+0
-1
UserShowVo.java
...model/src/main/java/cn/wisenergy/model/vo/UserShowVo.java
+6
-0
RefillCardService.java
...main/java/cn/wisenergy/service/app/RefillCardService.java
+1
-0
RefillCardServiceImpl.java
.../cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
+1
-2
SchemeServiceImpl.java
...java/cn/wisenergy/service/app/impl/SchemeServiceImpl.java
+53
-15
UserServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
+13
-1
RefillCardController.java
...energy/web/admin/controller/app/RefillCardController.java
+1
-0
application-dev.yml
wisenergy-web-admin/src/main/resources/application-dev.yml
+2
-2
application.yml
wisenergy-web-admin/src/main/resources/application.yml
+2
-2
No files found.
wisenergy-mapper/src/main/resources/mapper/RefillCardMapper.xml
View file @
56cfc490
...
...
@@ -80,7 +80,6 @@
<include
refid=
"table"
/>
<where>
is_delete=0
order by create_time desc
limit #{pageNo},#{pageSize}
</where>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/vo/UserShowVo.java
View file @
56cfc490
...
...
@@ -63,4 +63,10 @@ public class UserShowVo implements Serializable {
*/
@ApiModelProperty
(
value
=
"类型(专科、本科)"
,
name
=
"gradeType"
)
private
String
gradeType
;
/**
* 综合成绩
*/
@ApiModelProperty
(
value
=
"综合成绩"
,
name
=
"ComprehensiveScore"
)
private
Double
ComprehensiveScore
;
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/RefillCardService.java
View file @
56cfc490
...
...
@@ -6,6 +6,7 @@ import cn.wisenergy.model.dto.RefillCardDto;
import
com.github.pagehelper.PageInfo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
public
interface
RefillCardService
{
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/RefillCardServiceImpl.java
View file @
56cfc490
...
...
@@ -162,8 +162,7 @@ public class RefillCardServiceImpl implements RefillCardService {
}).
collect
(
Collectors
.
toList
());
// 设置文件名称
String
fileName
=
batchNumber
;
response
.
setHeader
(
"Content-disposition"
,
"attachment;filename="
+
fileName
+
".xlsx"
);
response
.
setHeader
(
"Content-disposition"
,
"attachment;filename="
+
batchNumber
+
".xlsx"
);
// sheet名称
EasyExcel
.
write
(
response
.
getOutputStream
(),
ExportCardDto
.
class
).
sheet
(
batchNumber
).
doWrite
(
resultBo
);
return
R
.
ok
(
0
,
true
);
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/SchemeServiceImpl.java
View file @
56cfc490
...
...
@@ -1030,35 +1030,73 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
for
(
Map
.
Entry
<
Double
,
List
<
Volunteer
>>
entry
:
mapObj
.
entrySet
())
{
List
<
Volunteer
>
volunteers
=
entry
.
getValue
();
if
(
volunteers
.
size
()
>
1
)
{
Random
mRandom
=
new
Random
();
int
count
=
mRandom
.
nextInt
(
volunteers
.
size
());
//判断限制专业
String
courseDemand
=
volunteers
.
get
(
count
).
getCourseDemand
();
if
(
courseDemand
.
contains
(
"和"
)){
String
[]
course
=
courseDemand
.
split
(
"和"
);
for
(
String
co
:
course
)
{
if
(!
classStr
.
contains
(
co
))
{
volunteers
.
remove
(
count
);
break
;
if
(
volunteers
.
size
()
>
2
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Random
mRandom
=
new
Random
();
int
count
=
mRandom
.
nextInt
(
volunteers
.
size
());
//判断限制专业
String
courseDemand
=
volunteers
.
get
(
count
).
getCourseDemand
();
if
(
courseDemand
.
contains
(
"和"
)){
String
[]
course
=
courseDemand
.
split
(
"和"
);
for
(
String
co
:
course
)
{
if
(!
classStr
.
contains
(
co
))
{
volunteers
.
remove
(
count
);
break
;
}
}
}
else
{
resultList
.
add
(
volunteers
.
get
(
count
));
volunteers
.
remove
(
count
);
otherList
.
addAll
(
volunteers
);
}
}
else
{
resultList
.
add
(
volunteers
.
get
(
count
));
volunteers
.
remove
(
count
);
otherList
.
addAll
(
volunteers
);
}
}
else
{
resultList
.
addAll
(
volunteers
);
}
if
(
resultList
.
size
()
>=
totalNumber
)
{
Collections
.
shuffle
(
resultList
);
return
resultList
.
subList
(
0
,
totalNumber
);
}
}
Map
<
Double
,
List
<
Volunteer
>>
mapObje
=
otherList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Volunteer:
:
getLowestMark
));
for
(
Map
.
Entry
<
Double
,
List
<
Volunteer
>>
entry
:
mapObje
.
entrySet
())
{
List
<
Volunteer
>
volunteers
=
entry
.
getValue
();
if
(
volunteers
.
size
()
>
2
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
Random
mRandom
=
new
Random
();
int
count
=
mRandom
.
nextInt
(
volunteers
.
size
());
//判断限制专业
String
courseDemand
=
volunteers
.
get
(
count
).
getCourseDemand
();
if
(
courseDemand
.
contains
(
"和"
)){
String
[]
course
=
courseDemand
.
split
(
"和"
);
for
(
String
co
:
course
)
{
if
(!
classStr
.
contains
(
co
))
{
volunteers
.
remove
(
count
);
break
;
}
}
}
else
{
resultList
.
add
(
volunteers
.
get
(
count
));
volunteers
.
remove
(
count
);
otherList
.
addAll
(
volunteers
);
}
}
}
else
{
resultList
.
addAll
(
volunteers
);
}
if
(
resultList
.
size
()
>=
totalNumber
)
{
Collections
.
shuffle
(
resultList
);
return
resultList
.
subList
(
0
,
totalNumber
);
}
}
//从剩下的数据中随机抽取,添满数组
Collections
.
shuffle
(
otherList
);
if
(
resultList
.
size
()
<
totalNumber
)
{
int
num
=
totalNumber
-
resultList
.
size
();
List
<
Volunteer
>
volunteers
=
new
ArrayList
<>();
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserServiceImpl.java
View file @
56cfc490
...
...
@@ -32,6 +32,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -279,6 +281,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
userShowVo
.
setScoreInfo
(
scoreInfo
);
//文化课考生
if
(
StudentType
.
CULTURE_STUDENT
.
getCode
().
equals
(
user
.
getExamType
()))
{
userShowVo
.
setComprehensiveScore
(
scoreInfo
.
getCultureGrade
());
AdmissionRule
firstRule
=
admissionRuleMapper
.
getByType
(
SchemeTypeEnums
.
UNDERGRADUATE_CULTURE
.
getCode
());
if
(
null
!=
firstRule
)
{
if
(
scoreInfo
.
getCultureGrade
()
>=
firstRule
.
getCultureMin
())
{
...
...
@@ -290,6 +293,9 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
//美术考生
if
(
StudentType
.
ART_STUDENT
.
getCode
().
equals
(
user
.
getExamType
()))
{
//综合成绩=专业成绩*750/300*70%+文化成绩*30%
double
score
=
scoreInfo
.
getMajorGrade
()
*
750
/
300
*
0.7
+
scoreInfo
.
getCultureGrade
()
*
0.3
;
userShowVo
.
setComprehensiveScore
(
new
BigDecimal
(
score
).
setScale
(
2
,
RoundingMode
.
UP
).
doubleValue
());
AdmissionRule
firstRule
=
admissionRuleMapper
.
getByType
(
SchemeTypeEnums
.
UNDERGRADUATE_ARTS
.
getCode
());
if
(
null
!=
firstRule
)
{
if
(
scoreInfo
.
getCultureGrade
()
>=
firstRule
.
getCultureMin
()
&&
scoreInfo
.
getMajorGrade
()
>=
firstRule
.
getProfessionMin
())
{
...
...
@@ -301,6 +307,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
//文学编导考生
if
(
StudentType
.
LITERATURE_STUDENT
.
getCode
().
equals
(
user
.
getExamType
()))
{
//综合成绩=专业成绩*750/300*70%+文化成绩*30%
Double
score
=
scoreInfo
.
getMajorGrade
()
*
750
/
300
*
0.7
+
scoreInfo
.
getCultureGrade
()
*
0.3
;
userShowVo
.
setComprehensiveScore
(
new
BigDecimal
(
score
).
setScale
(
2
,
RoundingMode
.
UP
).
doubleValue
());
AdmissionRule
firstRule
=
admissionRuleMapper
.
getByType
(
SchemeTypeEnums
.
UNDERGRADUATE_LITERATURE
.
getCode
());
if
(
null
!=
firstRule
)
{
if
(
scoreInfo
.
getCultureGrade
()
>=
firstRule
.
getCultureMin
()
&&
scoreInfo
.
getMajorGrade
()
>=
firstRule
.
getProfessionMin
())
{
...
...
@@ -312,8 +322,10 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
//体育考生
if
(
StudentType
.
SPORTS_STUDENT
.
getCode
().
equals
(
user
.
getExamType
()))
{
//综合成绩=专业成绩*750/100*70%+文化成绩*30%
AdmissionRule
firstRule
=
admissionRuleMapper
.
getByType
(
SchemeTypeEnums
.
UNDERGRADUATE_SPORTS
.
getCode
());
double
total
=
scoreInfo
.
getMajorGrade
()
*
750
/
100
*
0.7
+
scoreInfo
.
getCultureGrade
()
*
0.3
;
userShowVo
.
setComprehensiveScore
(
new
BigDecimal
(
total
).
setScale
(
2
,
RoundingMode
.
UP
).
doubleValue
());
if
(
null
!=
firstRule
)
{
if
(
total
>=
firstRule
.
getCultureMin
())
{
userShowVo
.
setGradeType
(
GradeType
.
UNDERGRADUATE
.
getDescription
());
...
...
@@ -321,7 +333,6 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
userShowVo
.
setGradeType
(
GradeType
.
SPECIALTY
.
getDescription
());
}
}
}
}
return
R
.
ok
(
userShowVo
);
...
...
@@ -537,5 +548,6 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
userKnownDto
.
setCreateTime
(
userKnown
.
getCreateTime
());
return
R
.
ok
(
userKnownDto
);
}
}
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/RefillCardController.java
View file @
56cfc490
...
...
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletResponse
;
import
java.math.BigInteger
;
import
java.util.Date
;
@Api
(
tags
=
"充值卡管理"
)
@RestController
...
...
wisenergy-web-admin/src/main/resources/application-dev.yml
View file @
56cfc490
...
...
@@ -3,8 +3,8 @@ spring:
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
#
url: jdbc:mysql://192.168.110.165:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://localhost:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://192.168.110.165:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
#
url: jdbc:mysql://localhost:3306/volunteer?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
#url: jdbc:mysql://rm-bp1i44rtb091fk06coo.mysql.rds.aliyuncs.com:3306/volunteer?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false
username
:
root
password
:
adm4HYservice$
...
...
wisenergy-web-admin/src/main/resources/application.yml
View file @
56cfc490
...
...
@@ -4,8 +4,8 @@ server:
max-threads
:
1000
min-spare-threads
:
30
#
port: 8997
port
:
8080
port
:
8997
#
port: 8080
connection-timeout
:
5000ms
spring
:
...
...
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