Commit 03a0d007 authored by cy's avatar cy

vip用户方案查询,客户端方案修改

parent f6cc3205
......@@ -562,4 +562,17 @@ public class StringUtil {
}
return result;
}
public static List<String> strToArrayStr(String s) {
if (StringUtils.isEmpty(s)) {
return new ArrayList<>();
}
List<String> result = new ArrayList<>();
String[] str = s.split(",");
for (String string : str) {
result.add(string);
}
return result;
}
}
......@@ -199,10 +199,15 @@
<if test="total != null">
and lowest_mark=#{total}
</if>
<if test="local != null">
and nature LIKE CONCAT('%',#{local},'%')
<if test="locals != null and (locals.size)>0">
and
<foreach collection="locals" index="index" item="local" separator="or" open="(" close=")">
nature LIKE CONCAT('%',#{local},'%')
</foreach>
</if>
<if test="professionNames != null">
<if test="professionNames != null and (professionNames.size)>0">
and
<foreach collection="professionNames" index="index" item="id" separator="or" open="(" close=")">
major_name LIKE CONCAT('%',#{id},'%')
......
......@@ -124,6 +124,12 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
volunteer.setQueryTime(schemeQueryRecord.getCreateTime());
}
result.sort(Comparator.comparing(Volunteer::getLowestMark).reversed());
//最低位次为空,则用--代替
for(Volunteer info : result){
if(info.getLowestRank() == null){
info.setLowestRank("--");
}
}
return R.ok(result);
}
......@@ -169,6 +175,11 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
List<Integer> ids = list.stream().map(UserVolunteer::getVolunteerId).collect(Collectors.toList());
List<Volunteer> result = volunteerMapper.getListByIds(ids);
for(Volunteer info :result){
if(null == info.getLowestRank()){
info.setLowestRank("0");
}
}
result.sort(Comparator.comparing(Volunteer::getLowestMark).reversed());
//调用工具生成PDF
try {
......
......@@ -158,10 +158,10 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格
//专科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(queryVo.getMajorGrade());
Double.parseDouble(queryVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(queryVo.getMajorGrade());
if (secondCulture < secondRule.getCultureMin() && secondMajor < secondRule.getProfessionMin()) {
if (secondCulture < secondRule.getCultureMin() || secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,您的成绩不满足报考条件,无法查询!");
}
......@@ -271,7 +271,13 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
SetQueryTime(list);
volunteerVo.setVolunteers(list);
volunteerVo.setTotal(list.size());
//为空的最低位次用--代替
List<Volunteer> volunteers = volunteerVo.getVolunteers();
for (Volunteer info : volunteers) {
if (null == info.getLowestRank()) {
info.setLowestRank("--");
}
}
return R.ok(volunteerVo);
}
......@@ -381,6 +387,8 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (null == scoreInfo) {
return R.error("无vip客户成绩!");
}
//地区
List<String> locals = StringUtil.strToArrayStr(schemeVo.getLocal());
//选取专业名称;
List<Integer> professionIds = StringUtil.strToArray(schemeVo.getProfessionIds());
......@@ -417,7 +425,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getCultureVipList(firstRule, secondRule, total, local, nameByIds, firstCulture, secondCulture);
list = getCultureVipList(firstRule, secondRule, total, locals, nameByIds, firstCulture, secondCulture);
}
//(2)美术考生
......@@ -437,13 +445,13 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格
//专科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(schemeVo.getMajorGrade());
Double.parseDouble(schemeVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(schemeVo.getMajorGrade());
if (secondCulture < secondRule.getCultureMin() && secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getArtsVipList(schemeVo, firstRule, secondRule, total, local, nameByIds);
list = getArtsVipList(schemeVo, firstRule, secondRule, total, locals, nameByIds);
}
//(3)文学编导考生
......@@ -463,13 +471,13 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格
//专科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(schemeVo.getMajorGrade());
Double.parseDouble(schemeVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(schemeVo.getMajorGrade());
if (secondCulture < secondRule.getCultureMin() || secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的专业成绩不满足报考条件,无法查询!");
}
list = getLiteratureVipList(schemeVo, firstRule, secondRule, total, local, nameByIds);
list = getLiteratureVipList(schemeVo, firstRule, secondRule, total, locals, nameByIds);
}
//(4)体育考生
......@@ -498,7 +506,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getSportsVipList(totalv, firstRule, secondRule, total, local, nameByIds);
list = getSportsVipList(totalv, firstRule, secondRule, total, locals, nameByIds);
}
//4判断是否展示全部方案
......@@ -534,7 +542,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return vip文化生志愿列表
*/
private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule, Integer total, String local,
private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule, Integer total, List<String> locals,
List<String> professionNames,
double firstCulture, double secondCulture) {
double cultureMax = firstRule.getCultureMax();
......@@ -544,16 +552,15 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
List<Volunteer> list = new ArrayList<>();
Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames);
map.put("locals", locals);
if (firstCulture < cultureMax && firstCulture >= cultureMin) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_CULTURE.getCode());
map.put("total", total);
map.put("local", local);
list = volunteerMapper.getVolunteerListVip(map);
} else {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_MAJOR.getCode());
map.put("total", total);
map.put("local", local);
list = volunteerMapper.getVolunteerListVip(map);
}
return list;
......@@ -567,7 +574,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getArtsVipList(SchemeVipVo schemeVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total, String local,
private List<Volunteer> getArtsVipList(SchemeVipVo schemeVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total, List<String> locals,
List<String> professionNames) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数
double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade());
......@@ -582,7 +589,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (culture >= firstRule.getCultureMin() && major >= firstRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_ARTS.getCode());
map.put("total", total);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
return list;
}
......@@ -599,7 +606,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_ARTS.getCode());
map.put("total", total);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
}
return list;
......@@ -614,7 +621,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getLiteratureVipList(SchemeVipVo queryVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total, String local,
private List<Volunteer> getLiteratureVipList(SchemeVipVo queryVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total,List<String> locals,
List<String> professionNames) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数
double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade());
......@@ -629,7 +636,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
map.put("type", SchemeTypeEnums.UNDERGRADUATE_LITERATURE.getCode());
map.put("total", total);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
return list;
}
......@@ -643,7 +650,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (cultureSecond >= secondRule.getCultureMin() && majorSecond >= secondRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
map.put("total", total);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
}
......@@ -659,7 +666,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getSportsVipList(double total, AdmissionRule firstRule, AdmissionRule secondRule, Integer totalv, String local,
private List<Volunteer> getSportsVipList(double total, AdmissionRule firstRule, AdmissionRule secondRule, Integer totalv,List<String> locals,
List<String> professionNames) {
Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames);
......@@ -669,7 +676,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (total >= firstRule.getCultureMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_SPORTS.getCode());
map.put("total", totalv);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
return list;
}
......@@ -678,7 +685,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (total >= secondRule.getCultureMin()) {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_SPORTS.getCode());
map.put("total", totalv);
map.put("local", local);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
}
......@@ -880,22 +887,25 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//2、考生是否能报取美术专科
if (cultureSecond >= secondRule.getCultureMin() && majorSecond >= secondRule.getProfessionMin()) {
//浮动分数
double upGrade = totalSecond + secondRule.getUpMark();
double downGrade = totalSecond - secondRule.getDownMark();
map.put("upGrade", upGrade);
map.put("downGrade", downGrade);
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
list = volunteerMapper.getVolunteerList(map);
// double upGrade = totalSecond + secondRule.getUpMark();
// double downGrade = totalSecond - secondRule.getDownMark();
// map.put("upGrade", upGrade);
// map.put("downGrade", downGrade);
// map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
// list = volunteerMapper.getVolunteerList(map);
//
// log.info(Integer.toString(list.size()));
// //如果数据不满足最大数量,取不限专业最低分补充
// if (list.size() < secondRule.getNumber()) {
// List<Volunteer> fillList = fillUpVolunteer(list, secondRule.getNumber(), upGrade, downGrade,
// SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
// list.addAll(fillList);
// }
//文学编导专科一批返回全部数据
list = volunteerMapper.getVolunteerByType(SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
log.info(Integer.toString(list.size()));
//如果数据不满足最大数量,取不限专业最低分补充
if (list.size() < secondRule.getNumber()) {
List<Volunteer> fillList = fillUpVolunteer(list, secondRule.getNumber(), upGrade, downGrade,
SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
list.addAll(fillList);
}
}
return list;
}
......
......@@ -115,7 +115,6 @@ public class SendSmsSerViceImpl implements SendSmsSerVice {
public R<Boolean> valid(String phone, String code, Integer type, String source) {
String value = SceneType.getNameByCode(type);
//获取短信验证码key
//String key = CachePrefix.SMS_CODE.getPrefix() + value + "_" + source + "_" + phone;
String key = CachePrefix.SMS_CODE.getPrefix() + "_" + source + "_" + phone;
//判断缓存是否过期
long time = redisService.getExpire(key);
......
......@@ -56,9 +56,6 @@ public class VolunteerListener extends AnalysisEventListener<Volunteer> {
if (StringUtils.isEmpty(volunteer.getAcademy())) {
throw new RuntimeException("院校不能为空!");
}
if (StringUtils.isBlank(volunteer.getLowestRank())) {
volunteer.setLowestRank("--");
}
if (StringUtils.isEmpty(volunteer.getCourseDemand())) {
throw new RuntimeException("选考科目要求不能为空!");
......
......@@ -386,10 +386,7 @@ public class VolunteerManager {
for (Volunteer volunteer : list) {
volunteer.setSchemeId(schemeInfo.getId());
volunteer.setType(schemeInfo.getType());
if (!SchemeTypeEnums.UNDERGRADUATE_CULTURE.getCode().equals(volunteer.getType()) ||
!SchemeTypeEnums.JUNIOR_COLLEGE_MAJOR.getCode().equals(volunteer.getType())) {
volunteer.setLowestRank(null);
}
}
boolean bool = volunteerService.saveBatch(list);
if (!bool) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment