updates
This commit is contained in:
parent
d2e23e93ad
commit
9355100df8
|
|
@ -75,7 +75,8 @@ public class ShiroConfig {
|
|||
}
|
||||
}
|
||||
|
||||
filterChainDefinitionMap.put("/mini/user/phoneLogin","anon");//小程序登录
|
||||
filterChainDefinitionMap.put("/mini/user/phoneLogin","anon");//小程序手机号登录
|
||||
filterChainDefinitionMap.put("/mini/user/login","anon");//小程序登录
|
||||
filterChainDefinitionMap.put("/mini/article/**","anon");//小程序-文章
|
||||
filterChainDefinitionMap.put("/wx/pay/v1/payNotify","anon");//订单支付回调校验
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ public class QueryRecommendMajorVO extends ArtBaseDTO {
|
|||
@ApiModelProperty(value = "录取方式")
|
||||
private String rulesEnrollProbability;
|
||||
|
||||
@ApiModelProperty(value = "录取方式List")
|
||||
private List<String> rulesEnrollProbabilityList;
|
||||
|
||||
@ApiModelProperty(value = "成绩id")
|
||||
private String scoreId;
|
||||
/*public void setBatch(String batch) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.mini.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.xkcoding.http.HttpUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -12,13 +13,11 @@ import org.jeecg.common.constant.CommonConstant;
|
|||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.common.util.PasswordUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.common.util.*;
|
||||
import org.jeecg.modules.mini.dto.VipDTO;
|
||||
import org.jeecg.modules.mini.service.MiniUserService;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
import org.jeecg.modules.system.model.SysLoginModel;
|
||||
import org.jeecg.modules.system.model.WxModel;
|
||||
import org.jeecg.modules.system.service.ISysUserService;
|
||||
import org.jeecg.modules.yx.service.IYxOrderService;
|
||||
|
|
@ -28,6 +27,7 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
|
|
@ -82,6 +82,53 @@ public class MiniUserController {
|
|||
return Result.OK("保存成功");
|
||||
}
|
||||
|
||||
@ApiOperation("登录接口")
|
||||
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||
public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel){
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = sysLoginModel.getUsername();
|
||||
String password = sysLoginModel.getPassword();
|
||||
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUser::getUsername,username);
|
||||
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
||||
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//2. 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
String syspassword = sysUser.getPassword();
|
||||
if (!syspassword.equals(userpassword)) {
|
||||
result.error500("用户名或密码错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
//用户登录信息
|
||||
//1.生成token
|
||||
String token = JwtUtil.sign(username, syspassword);
|
||||
// 设置token缓存有效时间
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
|
||||
JSONObject obj = new JSONObject();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
//获取vip信息
|
||||
VipDTO vipDTO = miniUserService.getUserVip(sysUser.getId());
|
||||
if (vipDTO!=null) {
|
||||
obj.put("vipInfo",vipDTO);
|
||||
}else{
|
||||
obj.put("vipInfo",null);
|
||||
}
|
||||
obj.put("token", token);
|
||||
obj.put("openId", "openId");
|
||||
obj.put("sessionKey", "sessionKey");
|
||||
obj.put("userInfo", loginUser);
|
||||
return Result.OK(obj);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/phoneLogin")
|
||||
@ApiOperation(value = "小程序手机号登录")
|
||||
|
|
|
|||
|
|
@ -245,16 +245,52 @@ public class YxHistoryMajorEnrollController extends JeecgController<YxHistoryMaj
|
|||
long start = System.currentTimeMillis();
|
||||
int index = 0;
|
||||
try {
|
||||
Map<String, YxSchool> schoolNameMap = yxSchoolService.mapsForSchoolName();
|
||||
Collection<YxSchool> schoolCodeList = schoolNameMap.values();
|
||||
//Map<String, YxSchool> schoolNameMap = yxSchoolService.mapsForSchoolName();
|
||||
//Collection<YxSchool> schoolCodeList = schoolNameMap.values();
|
||||
String schoolCode = null;
|
||||
String schoolName = null;
|
||||
String majorName = null;
|
||||
String majorType = null;
|
||||
String batch = null;
|
||||
String enrollmentCode = null;
|
||||
String year = null;
|
||||
String category = null;
|
||||
String rulesEnrollProbability = null;
|
||||
String probabilityOperator = null;
|
||||
BigDecimal admissionLine = null;
|
||||
Integer enrollNum = null;
|
||||
Integer admissionNum = null;
|
||||
String detail = null;
|
||||
List<YxHistoryMajorEnroll> list = ExcelImportUtil.importExcel(file.getInputStream(), YxHistoryMajorEnroll.class, params);
|
||||
for (YxHistoryMajorEnroll yxHistoryMajorEnroll : list) {
|
||||
index++;
|
||||
schoolCode = yxHistoryMajorEnroll.getSchoolCode();
|
||||
schoolName = yxHistoryMajorEnroll.getSchoolName();
|
||||
AssertUtils.isTrue(schoolCodeList.contains(schoolCode),String.format("行[%s],学校代码[%s]未在系统找到",index,schoolCode));
|
||||
schoolCode = yxHistoryMajorEnroll.getSchoolCode();//学校代码
|
||||
schoolName = yxHistoryMajorEnroll.getSchoolName();//学校名称
|
||||
majorName = yxHistoryMajorEnroll.getMajorName();//专业名称
|
||||
batch = yxHistoryMajorEnroll.getBatch();//批次
|
||||
enrollmentCode = yxHistoryMajorEnroll.getEnrollmentCode();//招生代码
|
||||
majorType = yxHistoryMajorEnroll.getMajorType();//专业类型
|
||||
category = yxHistoryMajorEnroll.getCategory();//科类
|
||||
rulesEnrollProbability = yxHistoryMajorEnroll.getRulesEnrollProbability();//录取方式
|
||||
probabilityOperator = yxHistoryMajorEnroll.getProbabilityOperator();//录取概率计算规则运算符
|
||||
admissionLine = yxHistoryMajorEnroll.getAdmissionLine();//录取线
|
||||
enrollNum = yxHistoryMajorEnroll.getEnrollNum();//招生人数
|
||||
admissionNum = yxHistoryMajorEnroll.getAdmissionNum();//录取人数
|
||||
detail = yxHistoryMajorEnroll.getDetail();//备注
|
||||
AssertUtils.notEmpty(schoolCode, String.format("行[%s],请输入学校代码", index));
|
||||
AssertUtils.notEmpty(schoolName, String.format("行[%s],请输入学校名称", index));
|
||||
AssertUtils.notEmpty(batch, String.format("行[%s],请输入批次", index));
|
||||
AssertUtils.notEmpty(enrollmentCode, String.format("行[%s],请输入招生代码", index));
|
||||
AssertUtils.notEmpty(majorName, String.format("行[%s],请输入专业名称", index));
|
||||
AssertUtils.notEmpty(majorType, String.format("行[%s],请输入专业类型", index));
|
||||
//=========================================================================
|
||||
AssertUtils.notEmpty(year, String.format("行[%s],请输入年份", index));
|
||||
AssertUtils.notEmpty(category, String.format("行[%s],请输入科类", index));
|
||||
AssertUtils.notEmpty(rulesEnrollProbability, String.format("行[%s],请输入录取方式", index));
|
||||
AssertUtils.notEmpty(probabilityOperator, String.format("行[%s],请输入录取方式运算符", index));
|
||||
AssertUtils.notNull(admissionLine, String.format("行[%s],请输入录取线", index));
|
||||
AssertUtils.notNull(enrollNum, String.format("行[%s],请输入招生人数", index));
|
||||
AssertUtils.notNull(admissionNum, String.format("行[%s],请输入录取人数", index));
|
||||
}
|
||||
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class YxHistoryMajorEnroll implements Serializable {
|
|||
@ApiModelProperty(value = "年份")
|
||||
private java.lang.String year;
|
||||
/**科类(文科/理科)*/
|
||||
@Excel(name = "科类(文科/理科)", width = 15)
|
||||
@Excel(name = "科类", width = 15)
|
||||
@ApiModelProperty(value = "科类(文科/理科)")
|
||||
private java.lang.String category;
|
||||
/**录取方式*/
|
||||
|
|
@ -80,8 +80,8 @@ public class YxHistoryMajorEnroll implements Serializable {
|
|||
@ApiModelProperty(value = "录取方式")
|
||||
private java.lang.String rulesEnrollProbability;
|
||||
/**录取概率计算规则运算符*/
|
||||
@Excel(name = "录取概率计算规则运算符", width = 15)
|
||||
@ApiModelProperty(value = "录取概率计算规则运算符")
|
||||
@Excel(name = "录取方式运算符", width = 15)
|
||||
@ApiModelProperty(value = "录取方式运算符")
|
||||
private java.lang.String probabilityOperator;
|
||||
/**省控线*/
|
||||
//@Excel(name = "省控线", width = 15)
|
||||
|
|
@ -96,8 +96,8 @@ public class YxHistoryMajorEnroll implements Serializable {
|
|||
@ApiModelProperty(value = "招生人数")
|
||||
private java.lang.Integer enrollNum;
|
||||
|
||||
@Excel(name = "录取数", width = 15)
|
||||
@ApiModelProperty(value = "录取数")
|
||||
@Excel(name = "录取人数", width = 15)
|
||||
@ApiModelProperty(value = "录取人数")
|
||||
private java.lang.Integer admissionNum;
|
||||
|
||||
//@Excel(name = "一志愿录取数", width = 15)
|
||||
|
|
|
|||
|
|
@ -90,9 +90,16 @@
|
|||
</foreach>
|
||||
</if>
|
||||
<!--录取方式-->
|
||||
<if test="queryvo.rulesEnrollProbability!=null and queryvo.rulesEnrollProbability!=''">
|
||||
<!--<if test="queryvo.rulesEnrollProbability!=null and queryvo.rulesEnrollProbability!=''">
|
||||
AND cm.rules_enroll_probability_sx = #{queryvo.rulesEnrollProbability}
|
||||
</if>-->
|
||||
<if test="queryvo.rulesEnrollProbabilityList!=null and queryvo.rulesEnrollProbabilityList.size>0">
|
||||
AND cm.rules_enroll_probability_sx in
|
||||
<foreach collection="queryvo.rulesEnrollProbabilityList" index="index" item="b" open="(" separator="," close=")">
|
||||
#{b}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--办学性质-->
|
||||
<if test="queryvo.schoolNatureList!=null and queryvo.schoolNatureList.size>0">
|
||||
AND s.school_nature in
|
||||
|
|
|
|||
|
|
@ -177,6 +177,11 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
|
|||
if (StringUtils.isNotBlank(queryRecommendMajorVO.getKyjxStrs())) {
|
||||
queryRecommendMajorVO.setKyjxList(Arrays.asList(queryRecommendMajorVO.getKyjxStrs().split(",")));
|
||||
}
|
||||
//录取方式
|
||||
String rulesEnrollProbability = queryRecommendMajorVO.getRulesEnrollProbability();
|
||||
if (StringUtils.isNotBlank(rulesEnrollProbability)) {
|
||||
queryRecommendMajorVO.setRulesEnrollProbabilityList(Arrays.asList(rulesEnrollProbability.split(",")));
|
||||
}
|
||||
|
||||
//获取推荐志愿信息service
|
||||
List<RecommendMajorDTO> recommendMajorList = baseMapper.recommendMajorList(activeCurrentUserScore.getCalculationTableName(),queryRecommendMajorVO);
|
||||
|
|
|
|||
Loading…
Reference in New Issue