Commit c1e00cfe authored by cy's avatar cy

修改VIP用户信息,banner图添加类型,vip方案文化类本科判断

parent 9645e978
......@@ -61,5 +61,5 @@ public interface BannerMapper extends BaseMapper<Banner> {
*/
int editStatus(@Param("id") Integer id, @Param("status") Integer status);
List<Banner> getTopBanners(@Param("type") Integer type);
List<Banner> getTopBanners(@Param("type") Integer type );
}
......@@ -60,4 +60,6 @@ public interface UsersMapper extends BaseMapper<User> {
List<User> test(@Param("list") List<String> list);
List<User> getUserByStaffId(Map<String, Object> map);
Integer getVipUserNumbers(Map<String, Object> map);
}
......@@ -117,7 +117,10 @@
<include refid="cols_all"/>
from
<include refid="table"/>
where status=1 and type=#{type}
</select>
<update id="editStatus">
......
......@@ -71,7 +71,8 @@
<if test="createTime != null">and create_time &gt;= #{createTime}</if>
<if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
<if test="isVip != null">and is_vip = #{isVip}</if>
<if test="openid != null">and openid =#{openid}</if>
<if test="openid != null">and openid =#{openid},</if>
<if test="vipMobile != null">vip_mobile =#{vipMobile}</if>
</sql>
<insert id="add" parameterType="cn.wisenergy.model.app.User" keyProperty="id" useGeneratedKeys="true">
......@@ -123,16 +124,16 @@
<where>
is_delete=0 and is_vip = 2
<if test="startTime != null">
<if test="startTime != null and startTime !=''">
and create_time
between #{startTime}
</if>
<if test="endTime != null">and #{endTime}</if>
<if test="endTime != null and endTime !=''">and #{endTime}</if>
<if test="userName != null">and user_name like ('%' #{userName} '%')</if>
<if test="userName != null and userName !=''">and user_name like ('%' #{userName} '%')</if>
<if test="phone != null">and phone like ('%' #{phone} '%')</if>
<if test="phone != null and phone !=''">and phone like ('%' #{phone} '%')</if>
order by create_time desc
<if test="pageNo != null">
limit #{pageNo},#{pageSize}
......@@ -205,5 +206,31 @@
</where>
</select>
<select id="getVipUserNumbers" resultType="java.lang.Integer">
SELECT COUNT(id)
FROM
<include refid="table"/>
<where>
is_delete=0 and is_vip = 1
<if test="list != null and (list.size)>0">
and id in
<foreach collection="list" index="index" item="id" separator="," open="(" close=")">
#{id.userVipId}
</foreach>
</if>
<if test="startTime != null">
and create_time
between #{startTime}
</if>
<if test="endTime != null">and #{endTime}</if>
<if test="userName != null">and user_name like ('%' #{userName} '%')</if>
<if test="phone != null">and phone like ('%' #{phone} '%')</if>
</where>
</select>
</mapper>
......@@ -49,9 +49,9 @@ public class Banner implements Serializable {
private Integer isHaveImage;
/**
* 广告类型: 1:顶部广告 2:底部广告
* 广告类型: 1:顶部广告 2:底部广告 3:app
*/
@ApiModelProperty(value = "广告类型: 1:顶部广告 2:底部广告",name = "type")
@ApiModelProperty(value = "广告类型: 1:顶部广告 2:底部广告 3:App",name = "type")
private Integer type;
/**
......@@ -77,4 +77,6 @@ public class Banner implements Serializable {
*/
@ApiModelProperty(value = "标题",name = "title")
private String title;
}
......@@ -21,9 +21,9 @@ public class BannerDto {
/**
* 广告类型: 1:顶部广告 2:底部广告
* 广告类型: 1:顶部广告 2:底部广告 3:App
*/
@ApiModelProperty(value = "广告类型: 1:顶部广告 2:底部广告",name = "type")
@ApiModelProperty(value = "广告类型: 1:顶部广告 2:底部广告 3:App",name = "type")
private Integer type;
/**
......@@ -55,4 +55,6 @@ public class BannerDto {
*/
@ApiModelProperty(value = "标题",name = "title")
private String title;
}
......@@ -71,4 +71,10 @@ public class UserCommitDto implements Serializable {
@ApiModelProperty(value = "flag:1:添加 2:编辑", name = "scoreInfo")
private Integer flag;
/**
* vip用户电话
*/
@ApiModelProperty(value = "vip用户电话", name = "vipMobile")
private String vipMobile;
}
......@@ -51,4 +51,10 @@ public class UserShowVo implements Serializable {
*/
@ApiModelProperty(value = "学生成绩信息",name = "scoreInfo")
private ScoreInfo scoreInfo;
/**
* vip用户电话
*/
@ApiModelProperty(value = "vip用户电话",name = "VipMobile")
private String VipMobile;
}
......@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse;
......@@ -84,7 +85,6 @@ public class SchemeRecordServiceImpl extends ServiceImpl<SchemeRecordMapper, Sch
map.put("userId", queryVo.getUserId());
int total = schemeRecordMapper.count(map);
//根据用户id,查询方案记录列表
List<SchemeQueryRecord> list = schemeRecordMapper.getByUserId(queryVo.getUserId(),
queryVo.getStartNum(), queryVo.getEndNum());
......
......@@ -384,7 +384,6 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
}
//2、获取考生成绩
QueryWrapper<ScoreInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", schemeVo.getUserId());
......@@ -432,10 +431,10 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (secondCulture < cultureMin) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}*/
if(cultureGrade<secondRule.getCultureMin()){
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getCultureVipList(firstRule,secondRule,cultureGrade, totalMax,totalMin, locals, nameByIds);
if (cultureGrade < secondRule.getCultureMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getCultureVipList(firstRule, secondRule, cultureGrade, totalMax, totalMin, locals, nameByIds);
}
//(2)美术考生
......@@ -461,10 +460,10 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (secondCulture < secondRule.getCultureMin() && secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}*/
if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getArtsVipList( firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
if (cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getArtsVipList(firstRule, secondRule, cultureGrade, majorGrade, totalMax, totalMin, locals, nameByIds);
}
//(3)文学编导考生
......@@ -490,10 +489,10 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
if (secondCulture < secondRule.getCultureMin() || secondMajor < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的专业成绩不满足报考条件,无法查询!");
}*/
if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
if (cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getLiteratureVipList(firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
list = getLiteratureVipList(firstRule, secondRule, cultureGrade, majorGrade, totalMax, totalMin, locals, nameByIds);
}
//(4)体育考生
......@@ -517,12 +516,12 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
double major = Double.parseDouble(schemeVo.getMajorGrade());*/
//计算综合成绩
/* double totalv = major * 750 / 100 * 0.7 + culture * 0.3 - value;*/
if(cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()){
/* double totalv = major * 750 / 100 * 0.7 + culture * 0.3 - value;*/
if (cultureGrade < secondRule.getCultureMin() || majorGrade < secondRule.getProfessionMin()) {
return R.error("很抱歉,客户的成绩不满足报考条件,无法查询!");
}
list = getSportsVipList(firstRule,secondRule,cultureGrade,majorGrade,totalMax,totalMin, locals, nameByIds);
list = getSportsVipList(firstRule, secondRule, cultureGrade, majorGrade, totalMax, totalMin, locals, nameByIds);
}
//4判断是否展示全部方案
......@@ -558,7 +557,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return vip文化生志愿列表
*/
private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule,Double cultureGrade, Integer totalMax,Integer totalMin, List<String> locals, List<String> professionNames) {
private List<Volunteer> getCultureVipList(AdmissionRule firstRule, AdmissionRule secondRule, Double cultureGrade, Integer totalMax, Integer totalMin, List<String> locals, List<String> professionNames) {
double cultureMax = firstRule.getCultureMax();
double cultureMin = firstRule.getCultureMin();
......@@ -567,7 +566,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames);
map.put("locals", locals);
if (cultureGrade < cultureMax && totalMin >= cultureGrade) {
if (cultureGrade <= cultureMax && cultureGrade >= cultureMin) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_CULTURE.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
......@@ -590,7 +589,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getArtsVipList( AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, 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) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数
/*double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(schemeVo.getCultureGrade());
......@@ -607,7 +606,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
map.put("totalMin", totalMin);
list = volunteerMapper.getVolunteerListVip(map);
return list;
}else{
} else {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_ARTS.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
......@@ -640,7 +639,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getLiteratureVipList(AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, 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) {
//本科类比分 = 本年录取分 -去年录取分 + 考生分数
/*double culture = firstRule.getCurrentYearCulture() - firstRule.getCultureMin() + Double.parseDouble(queryVo.getCultureGrade());
......@@ -659,7 +658,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
return list;
}else{
} else {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_LITERATURE.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
......@@ -687,27 +686,27 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
/**
* 获取vip体育生生志愿方案
*
* @param totalMax 考生综合成绩最高分
* @param totalMax 考生综合成绩最高分
* @param firstRule 本科规则
* @param secondRule 专科规
* @param professionNames 专业名称
* @return 志愿方案列表
*/
private List<Volunteer> getSportsVipList(AdmissionRule firstRule ,AdmissionRule secondRule,Double cultureGrade,Double majorGrade, Integer totalMax,Integer totalMin, 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) {
Map<String, Object> map = new HashMap<>(16);
map.put("professionNames", professionNames);
map.put("locals", locals);
//1、考生是否能报取体育本科
List<Volunteer> list = new ArrayList<>();
if (cultureGrade >= firstRule.getCultureMin()&&majorGrade>firstRule.getProfessionMin()) {
if (cultureGrade >= firstRule.getCultureMin() && majorGrade > firstRule.getProfessionMin()) {
map.put("type", SchemeTypeEnums.UNDERGRADUATE_SPORTS.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
map.put("locals", locals);
list = volunteerMapper.getVolunteerListVip(map);
}else{
} else {
map.put("type", SchemeTypeEnums.JUNIOR_COLLEGE_SPORTS.getCode());
map.put("totalMax", totalMax);
map.put("totalMin", totalMin);
......
......@@ -240,7 +240,8 @@ public class StaffUserVipServiceImpl extends ServiceImpl<LocalMapper, Local> imp
PageInfo<UserInfoDto> info = new PageInfo<>();
info.setPageSize(null==queryVo.getPageSize()?0:queryVo.getPageSize());
info.setPageNum(null==queryVo.getPageNo()?0:queryVo.getPageNo());
info.setTotal(usersMapper.getUserNumbers(map));
info.setTotal(usersMapper.getVipUserNumbers(map));
info.setList(list);
return R.ok(info);
......
......@@ -231,7 +231,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
user.setSex(userDto.getSex());
user.setExamType(userDto.getStudentType());
user.setUserName(userDto.getUserName());
user.setVipMobile(userDto.getVipMobile());
//3、要提交的用户的成绩信息
ScoreInfo scoreInfo = scoreInfoMapper.getByUserId(userDto.getUserId());
......@@ -285,7 +285,9 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
userShowVo.setSex(user.getSex());
userShowVo.setStudentType(user.getExamType());
userShowVo.setUserName(user.getUserName());
if(user.getVipMobile()!=null){
userShowVo.setVipMobile(user.getVipMobile());
}
//获取成绩信息
QueryWrapper<ScoreInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", user.getId());
......
......@@ -465,7 +465,7 @@ public class VolunteerManager {
userInfo.setPassword(secret);
userInfo.setIsDelete(0);
userInfo.setSource(source);
userInfo.setIsVip(2);
int count = usersMapper.add(userInfo);
if (count == 0) {
return R.error("考生注册失败!");
......
......@@ -78,8 +78,8 @@ public class BannerController {
}
@ApiOperation(value = "获取顶部/底部广告", notes = "获取顶部/底部广告", httpMethod = "GET")
@ApiImplicitParam(name = "type", value = "广告类型:1:顶部 2:底部", dataType = "int", required = true)
@ApiOperation(value = "获取顶部/底部广告/app", notes = "获取顶部/底部广告/app", httpMethod = "GET")
@ApiImplicitParam(name = "type", value = "广告类型:1:顶部 2:底部 3:App", dataType = "int", required = true)
@GetMapping("/getBanners")
public R<List<Banner>> getBanners(Integer type) {
log.info("BannerController[]getBanners[]input.param.type:" + type);
......
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