Commit 2d720f12 authored by cy's avatar cy

shrio跨域,修改vip方案查询分数区间

parent 12af6066
...@@ -193,13 +193,20 @@ ...@@ -193,13 +193,20 @@
<include refid="table"/> <include refid="table"/>
<where> <where>
is_delete =0 is_delete =0
<if test="type != null"> <if test="type != null">
and type =#{type} and type =#{type}
</if> </if>
<if test="total != null">
and lowest_mark=#{total} <if test="totalMax != null">
and #{totalMax} >= lowest_mark
</if> </if>
<if test="totalMin != null">
and lowest_mark >= #{totalMin}
</if>
<if test="locals != null and (locals.size)>0"> <if test="locals != null and (locals.size)>0">
and and
<foreach collection="locals" index="index" item="local" separator="or" open="(" close=")"> <foreach collection="locals" index="index" item="local" separator="or" open="(" close=")">
......
...@@ -31,15 +31,15 @@ public class SchemeVipVo implements Serializable { ...@@ -31,15 +31,15 @@ public class SchemeVipVo implements Serializable {
/** /**
* 文化课成绩 * 文化课成绩
*/ *//*
@ApiModelProperty(value = "文化课成绩", name = "cultureGrade") @ApiModelProperty(value = "文化课成绩", name = "cultureGrade")
private String cultureGrade; private String cultureGrade;
/** *//**
* 专业课成绩 * 专业课成绩
*/ *//*
@ApiModelProperty(value = "专业课成绩", name = "majorGrade") @ApiModelProperty(value = "专业课成绩", name = "majorGrade")
private String majorGrade; private String majorGrade;*/
/** /**
* 地区 * 地区
...@@ -48,10 +48,15 @@ public class SchemeVipVo implements Serializable { ...@@ -48,10 +48,15 @@ public class SchemeVipVo implements Serializable {
private String local; private String local;
/** /**
* 综合成绩 * 综合成绩(最高分)
*/
@ApiModelProperty(name = "totalMax",value = "综合成绩(最高分)")
private Integer totalMax;
/**
* 综合成绩(最低分)
*/ */
@ApiModelProperty(name = "total",value = "综合成绩") @ApiModelProperty(name = "totalMin",value = "综合成绩(最低分)")
private Integer total; private Integer totalMin;
/** /**
* 是否展示全部 0:否 1:是 * 是否展示全部 0:否 1:是
......
...@@ -370,9 +370,12 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -370,9 +370,12 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
return R.error("入参为空!"); return R.error("入参为空!");
} }
//综合成绩,地区 //综合成绩
Integer total = null == schemeVo.getTotal() ? null : schemeVo.getTotal(); Integer totalMax = null == schemeVo.getTotalMax() ? null : schemeVo.getTotalMax();
String local = null == schemeVo.getLocal() ? null : schemeVo.getLocal(); Integer totalMin = null == schemeVo.getTotalMin() ? null : schemeVo.getTotalMin();
//地区
List<String> locals = StringUtil.strToArrayStr(schemeVo.getLocal());
//1、根据userId获取用户信息 //1、根据userId获取用户信息
User user = usersMapper.selectById(schemeVo.getUserId()); User user = usersMapper.selectById(schemeVo.getUserId());
...@@ -380,6 +383,8 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -380,6 +383,8 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
return R.error("请先添加vip客户信息!"); return R.error("请先添加vip客户信息!");
} }
//2、获取考生成绩 //2、获取考生成绩
QueryWrapper<ScoreInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<ScoreInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", schemeVo.getUserId()); queryWrapper.eq("user_id", schemeVo.getUserId());
...@@ -387,8 +392,11 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -387,8 +392,11 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (null == scoreInfo) { if (null == scoreInfo) {
return R.error("无vip客户成绩!"); return R.error("无vip客户成绩!");
} }
//地区 //文化分
List<String> locals = StringUtil.strToArrayStr(schemeVo.getLocal()); Double majorGrade = scoreInfo.getMajorGrade();
//专业分
Double cultureGrade = scoreInfo.getCultureGrade();
//选取专业名称; //选取专业名称;
List<Integer> professionIds = StringUtil.strToArray(schemeVo.getProfessionIds()); List<Integer> professionIds = StringUtil.strToArray(schemeVo.getProfessionIds());
...@@ -413,7 +421,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -413,7 +421,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
return R.error("无文化课专科录取规则!"); return R.error("无文化课专科录取规则!");
} }
//本科类比文化分 = 本年录取分 -去年录取分 + 考生分数 /*//本科类比文化分 = 本年录取分 -去年录取分 + 考生分数
double firstCulture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade()); double firstCulture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade());
double cultureMax = Double.parseDouble(firstRule.getCultureMax().toString()); double cultureMax = Double.parseDouble(firstRule.getCultureMax().toString());
...@@ -423,9 +431,11 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -423,9 +431,11 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
double cultureMin = Double.parseDouble(secondRule.getCultureMin().toString()); double cultureMin = Double.parseDouble(secondRule.getCultureMin().toString());
if (secondCulture < cultureMin) { if (secondCulture < cultureMin) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!"); return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
} }*/
if(cultureGrade<secondRule.getCultureMin()){
list = getCultureVipList(firstRule, secondRule, total, locals, nameByIds, firstCulture, secondCulture); return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getCultureVipList(firstRule,secondRule,cultureGrade, totalMax,totalMin, locals, nameByIds);
} }
//(2)美术考生 //(2)美术考生
...@@ -444,14 +454,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -444,14 +454,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格 //判断考生是否有报取资格
//专科类比分 = 本年录取分 -去年录取分 + 考生分数 //专科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() + /* double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(schemeVo.getCultureGrade()); Double.parseDouble(schemeVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() + double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(schemeVo.getMajorGrade()); Double.parseDouble(schemeVo.getMajorGrade());
if (secondCulture < secondRule.getCultureMin() && secondMajor < secondRule.getProfessionMin()) { if (secondCulture < secondRule.getCultureMin() && secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!"); return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
} }*/
list = getArtsVipList(schemeVo, firstRule, secondRule, total, locals, nameByIds); if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getArtsVipList( firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
} }
//(3)文学编导考生 //(3)文学编导考生
...@@ -470,14 +483,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -470,14 +483,17 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格 //判断考生是否有报取资格
//专科类比分 = 本年录取分 -去年录取分 + 考生分数 //专科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() + /* double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(schemeVo.getCultureGrade()); Double.parseDouble(schemeVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() + double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(schemeVo.getMajorGrade()); Double.parseDouble(schemeVo.getMajorGrade());
if (secondCulture < secondRule.getCultureMin() || secondMajor < secondRule.getProfessionMin()) { if (secondCulture < secondRule.getCultureMin() || secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的专业成绩不满足报考条件,无法查询!"); return R.error("很抱歉,客户的专业成绩不满足报考条件,无法查询!");
}*/
if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
} }
list = getLiteratureVipList(schemeVo, firstRule, secondRule, total, locals, nameByIds); list = getLiteratureVipList(firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
} }
//(4)体育考生 //(4)体育考生
...@@ -497,16 +513,16 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -497,16 +513,16 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//判断考生是否有报取资格 //判断考生是否有报取资格
//综合成绩差值 //综合成绩差值
double value = secondRule.getCurrentYearCulture() - secondRule.getCultureMin(); double value = secondRule.getCurrentYearCulture() - secondRule.getCultureMin();
double culture = Double.parseDouble(schemeVo.getCultureGrade()); /* double culture = Double.parseDouble(schemeVo.getCultureGrade());
double major = Double.parseDouble(schemeVo.getMajorGrade()); double major = Double.parseDouble(schemeVo.getMajorGrade());*/
//计算综合成绩 //计算综合成绩
double totalv = major * 750 / 100 * 0.7 + culture * 0.3 - value; /* double totalv = major * 750 / 100 * 0.7 + culture * 0.3 - value;*/
if (totalv < secondRule.getCultureMin()) { if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!"); return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
} }
list = getSportsVipList(totalv, firstRule, secondRule, total, locals, nameByIds); list = getSportsVipList(firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
} }
//4判断是否展示全部方案 //4判断是否展示全部方案
...@@ -542,9 +558,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -542,9 +558,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称 * @param professionNames 专业名称
* @return vip文化生志愿列表 * @return vip文化生志愿列表
*/ */
private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule, Integer total, List<String> locals, private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule,Double cultureGrade, Integer totalMax,Integer totalMin, List<String> locals, List<String> professionNames) {
List<String> professionNames,
double firstCulture, double secondCulture) {
double cultureMax = firstRule.getCultureMax(); double cultureMax = firstRule.getCultureMax();
double cultureMin = firstRule.getCultureMin(); double cultureMin = firstRule.getCultureMin();
...@@ -553,14 +567,16 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -553,14 +567,16 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames); map.put("professionNames", professionNames);
map.put("locals", locals); map.put("locals", locals);
if (firstCulture < cultureMax && firstCulture >= cultureMin) { if (cultureGrade < cultureMax && totalMin >= cultureGrade) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_CULTURE.getCode()); map.put("type", SchemeTypeEnums.UNDERGRADUATE_CULTURE.getCode());
map.put("total", total); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
} else { } else {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_MAJOR.getCode()); map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_MAJOR.getCode());
map.put("total", total); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
} }
return list; return list;
...@@ -574,85 +590,96 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -574,85 +590,96 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称 * @param professionNames 专业名称
* @return 志愿方案列表 * @return 志愿方案列表
*/ */
private List<Volunteer> getArtsVipList(SchemeVipVo schemeVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total, List<String> locals, private List<Volunteer> getArtsVipList( AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, List<String> locals,
List<String> professionNames) { List<String> professionNames) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数 //本科类比分 = 本年录取分 -去年录取分 + 考生分数
double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade()); /*double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade());
double major = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(schemeVo.getMajorGrade()); double major = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(schemeVo.getMajorGrade());*/
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames); map.put("professionNames", professionNames);
map.put("locals", locals);
//1、考生是否能报取美术本科 //1、考生是否能报取美术本科
List<Volunteer> list = new ArrayList<>(); List<Volunteer> list = new ArrayList<>();
if (culture >= firstRule.getCultureMin() && major >= firstRule.getProfessionMin()) { if (cultureGrade >= firstRule.getCultureMin() && majorGrade >= firstRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_ARTS.getCode()); map.put("type", SchemeTypeEnums.UNDERGRADUATE_ARTS.getCode());
map.put("total", total); map.put("totalMax", totalMax);
map.put("locals", locals); map.put("totalMin", totalMin);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
return list; return list;
}else{
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_ARTS.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
list = volunteerMapper.getVolunteerListVip(map);
} }
//专科科类比分 = 本年录取分 -去年录取分 + 考生分数 //专科科类比分 = 本年录取分 -去年录取分 + 考生分数
double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() + /* double secondCulture = secondRule.getCurrentYearCulture() - secondRule.getCultureMin() +
Double.parseDouble(schemeVo.getCultureGrade()); Double.parseDouble(schemeVo.getCultureGrade());
double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() + double secondMajor = secondRule.getCurrentYearMajor() - secondRule.getProfessionMin() +
Double.parseDouble(schemeVo.getMajorGrade()); Double.parseDouble(schemeVo.getMajorGrade());*/
//2、考生是否能报取美术专科 //2、考生是否能报取美术专科
if (secondCulture >= secondRule.getCultureMin() && secondMajor >= secondRule.getProfessionMin()) { /* if (secondCulture >= secondRule.getCultureMin() && secondMajor >= secondRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_ARTS.getCode()); map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_ARTS.getCode());
map.put("total", total); map.put("total", total);
map.put("locals", locals); map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
} }*/
return list; return list;
} }
/** /**
* 获取vip文学编导生志愿方案 * 获取vip文学编导生志愿方案
* *
* @param queryVo 考生成绩
* @param firstRule 本科规则 * @param firstRule 本科规则
* @param secondRule 专科规则 * @param secondRule 专科规则
* @param professionNames 专业名称 * @param professionNames 专业名称
* @return 志愿方案列表 * @return 志愿方案列表
*/ */
private List<Volunteer> getLiteratureVipList(SchemeVipVo queryVo, AdmissionRule firstRule, AdmissionRule secondRule, Integer total,List<String> locals, private List<Volunteer> getLiteratureVipList(AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, List<String> locals,
List<String> professionNames) { List<String> professionNames) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数 //本科类比分 = 本年录取分 -去年录取分 + 考生分数
double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade()); /*double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade());
double major = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(queryVo.getMajorGrade()); double major = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(queryVo.getMajorGrade());*/
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames); map.put("professionNames", professionNames);
map.put("locals", locals);
//1、考生是否能报取美术本科 //1、考生是否能报取美术本科
List<Volunteer> list = new ArrayList<>(); List<Volunteer> list = new ArrayList<>();
if (culture >= firstRule.getCultureMin() && major >= firstRule.getProfessionMin()) { if (cultureGrade >= firstRule.getCultureMin() && majorGrade >= firstRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_LITERATURE.getCode()); map.put("type", SchemeTypeEnums.UNDERGRADUATE_LITERATURE.getCode());
map.put("total", total); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals); map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
return list; return list;
}else{
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
} }
//专科类比分 = 本年录取分 -去年录取分 + 考生分数 //专科类比分 = 本年录取分 -去年录取分 + 考生分数
double cultureSecond = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade()); /* double cultureSecond = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade());
double majorSecond = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(queryVo.getMajorGrade()); double majorSecond = firstRule.getCurrentYearMajor() - firstRule.getProfessionMin() + Double.parseDouble(queryVo.getMajorGrade());*/
//2、考生是否能报取美术专科 //2、考生是否能报取美术专科
if (cultureSecond >= secondRule.getCultureMin() && majorSecond >= secondRule.getProfessionMin()) { /* if (cultureSecond >= secondRule.getCultureMin() && majorSecond >= secondRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode()); map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
map.put("total", total); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals); map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
} }*/
return list; return list;
} }
...@@ -660,34 +687,42 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -660,34 +687,42 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
/** /**
* 获取vip体育生生志愿方案 * 获取vip体育生生志愿方案
* *
* @param total 考生综合成绩 * @param totalMax 考生综合成绩最高分
* @param firstRule 本科规则 * @param firstRule 本科规则
* @param secondRule 专科规 * @param secondRule 专科规
* @param professionNames 专业名称 * @param professionNames 专业名称
* @return 志愿方案列表 * @return 志愿方案列表
*/ */
private List<Volunteer> getSportsVipList(double total, AdmissionRule firstRule, AdmissionRule secondRule, Integer totalv,List<String> locals, private List<Volunteer> getSportsVipList(AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, List<String> locals,
List<String> professionNames) { List<String> professionNames) {
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames); map.put("professionNames", professionNames);
map.put("locals", locals);
//1、考生是否能报取体育本科 //1、考生是否能报取体育本科
List<Volunteer> list = new ArrayList<>(); List<Volunteer> list = new ArrayList<>();
if (total >= firstRule.getCultureMin()) { if (cultureGrade >= firstRule.getCultureMin()&&majorGrade>firstRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_SPORTS.getCode()); map.put("type", SchemeTypeEnums.UNDERGRADUATE_SPORTS.getCode());
map.put("total", totalv); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
}else{
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_SPORTS.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals); map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
return list;
} }
//2、考生是否能报取体育专科 //2、考生是否能报取体育专科
if (total >= secondRule.getCultureMin()) { /* if (total >= secondRule.getCultureMin()) {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_SPORTS.getCode()); map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_SPORTS.getCode());
map.put("total", totalv); map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals); map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map); list = volunteerMapper.getVolunteerListVip(map);
} }*/
return list; return list;
} }
......
...@@ -21,6 +21,7 @@ import org.apache.shiro.subject.Subject; ...@@ -21,6 +21,7 @@ import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter; import org.apache.shiro.web.filter.AccessControlFilter;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse; import javax.servlet.ServletResponse;
...@@ -76,6 +77,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{ ...@@ -76,6 +77,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{
log.info("KickoutSessionControlFilter Not Login begin......."); log.info("KickoutSessionControlFilter Not Login begin.......");
Subject subject = getSubject(request, response); Subject subject = getSubject(request, response);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
HttpServletRequest httpServletRequest=(HttpServletRequest) request;
HttpServletResponse httpServletResponse = (HttpServletResponse) response; HttpServletResponse httpServletResponse = (HttpServletResponse) response;
// 没有登陆或没有设置“记住我” // 没有登陆或没有设置“记住我”
HttpServletRequest request1 = (HttpServletRequest) request; HttpServletRequest request1 = (HttpServletRequest) request;
...@@ -85,7 +87,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{ ...@@ -85,7 +87,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{
if (!subject.isAuthenticated() && !subject.isRemembered()) { if (!subject.isAuthenticated() && !subject.isRemembered()) {
log.info("KickoutSessionControlFilter isAuthenticated and isRemembered Please login first ......."); log.info("KickoutSessionControlFilter isAuthenticated and isRemembered Please login first .......");
// 没有登陆,抛出异常 // 没有登陆,抛出异常
thrLogoutException(httpServletResponse, "1001", "Please login first"); thrLogoutException(httpServletRequest,httpServletResponse, "1001", "Please login first");
return false; return false;
} }
Session session = subject.getSession(); Session session = subject.getSession();
...@@ -114,7 +116,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{ ...@@ -114,7 +116,7 @@ public class KickoutSessionControlFilter extends AccessControlFilter{
try { try {
//退出登录 //退出登录
subject.logout(); subject.logout();
thrLogoutException(httpServletResponse, "1002", "您已经在其他地方登录,请重新登录。如有疑问请联系管理员!"); thrLogoutException(httpServletRequest,httpServletResponse, "1002", "您已经在其他地方登录,请重新登录。如有疑问请联系管理员!");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -182,13 +184,16 @@ public class KickoutSessionControlFilter extends AccessControlFilter{ ...@@ -182,13 +184,16 @@ public class KickoutSessionControlFilter extends AccessControlFilter{
} }
// 抛出未登录异常 // 抛出未登录异常
private void thrLogoutException(HttpServletResponse response,String ErrorCode,String ErrorMsg){ private void thrLogoutException(HttpServletRequest request,HttpServletResponse response,String ErrorCode,String ErrorMsg){
PrintWriter writer = null; PrintWriter writer = null;
try { try {
Result result = new Result(); Result result = new Result();
result.setResult(Result.RESULT_FLG.FAIL.getValue()); result.setResult(Result.RESULT_FLG.FAIL.getValue());
result.setErrorCode(ErrorCode); result.setErrorCode(ErrorCode);
result.setErrorMsg(ErrorMsg); result.setErrorMsg(ErrorMsg);
setHeader(request, response);
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.setContentType("application/json; charset=UTF-8"); response.setContentType("application/json; charset=UTF-8");
writer = response.getWriter(); writer = response.getWriter();
writer.write(JSON.toJSONString(result)); writer.write(JSON.toJSONString(result));
...@@ -202,6 +207,16 @@ public class KickoutSessionControlFilter extends AccessControlFilter{ ...@@ -202,6 +207,16 @@ public class KickoutSessionControlFilter extends AccessControlFilter{
} }
} }
} }
private void setHeader(HttpServletRequest request, HttpServletResponse response) {
//跨域的header设置
response.setHeader("Access-control-Allow-Origin", request.getHeader("Origin"));
response.setHeader("Access-Control-Allow-Methods", request.getMethod());
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", request.getHeader("Access-Control-Request-Headers"));
//防止乱码,适用于传输JSON数据
//Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild
response.setHeader("Content-Type", "application/json;charset=UTF-8");
response.setStatus(HttpStatus.OK.value());
}
} }
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