Merge remote-tracking branch 'origin/master'

master
jiakun.lin 4 years ago
commit 9850b6dc47
  1. 8
      src/main/java/com/yipin/liuwanr/controller/CustomerController.java
  2. 32
      src/main/java/com/yipin/liuwanr/controller/UserInfoController.java
  3. 2
      src/main/java/com/yipin/liuwanr/mapper/CustomerMapper.java
  4. 2
      src/main/java/com/yipin/liuwanr/service/UserInfoService.java

@ -241,12 +241,18 @@ public class CustomerController {
* 查询学校 * 查询学校
*/ */
@GetMapping("/querySchool") @GetMapping("/querySchool")
Response querySchool(@RequestParam String schoolName) { Response querySchool(@RequestParam String schoolName,@RequestParam Integer provinceId,@RequestParam Integer cityId) {
Response resp = new Response(); Response resp = new Response();
School school = new School(); School school = new School();
if (schoolName != null || schoolName != "") { if (schoolName != null || schoolName != "") {
school.setSchoolName(schoolName); school.setSchoolName(schoolName);
} }
if (provinceId !=null){
school.setProvinceId(provinceId);
}
school.setCityId(cityId);
if (cityId !=null ){
}
HashMap<String, Object> ret = customerService.querySchool(school); HashMap<String, Object> ret = customerService.querySchool(school);
resp.setStatus(200); resp.setStatus(200);
resp.setErrmessage("Parameter effective"); resp.setErrmessage("Parameter effective");

@ -305,7 +305,37 @@ public class UserInfoController {
* 登陆查询学校/电子科大 * 登陆查询学校/电子科大
*/ */
@GetMapping("/loginSchoolClient") @GetMapping("/loginSchoolClient")
Response loginSchoolClient(@RequestParam("account") String account, @RequestParam("password") String password , HttpServletRequest req, HttpServletResponse res) { Response loginSchoolClient(@RequestParam("account") String account, @RequestParam("password") String password, @RequestParam("schoolId") Integer schoolId , HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
userInfo.setSchoolId(schoolId);//暂定学校id
if (account == null || account=="") {
resp.setStatus(300);
resp.setErrmessage("用户账号为空,登录失败!");
}else if(password ==null || password=="") {
resp.setStatus(300);
resp.setErrmessage("用户密码为空,登录失败!");
}else{
userInfo.setAccount(account);
userInfo.setPassword(password);
HashMap<String, Object> ret = userInfoService.loginSchoolClient(userInfo);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
/**
* 登陆查询学校/职战
*/
@GetMapping("/zzLoginSchoolClient")
Response zzLoginSchoolClient(@RequestParam("account") String account, @RequestParam("password") String password , HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response(); Response resp = new Response();
UserInfo userInfo = new UserInfo(); UserInfo userInfo = new UserInfo();
userInfo.setSchoolId(2105);//暂定学校id userInfo.setSchoolId(2105);//暂定学校id

@ -89,6 +89,8 @@ public interface CustomerMapper {
//查询行业 //查询行业
@Select({"<script>", @Select({"<script>",
"SELECT schoolId,schoolName,provinceId,cityId,level,provinceName,cityName from school where isdel = 0", "SELECT schoolId,schoolName,provinceId,cityId,level,provinceName,cityName from school where isdel = 0",
" <if test='provinceId!=null'>and provinceId = #{provinceId} </if>",
" <if test='cityId!=null'>and cityId = #{cityId} </if>",
" <if test='schoolName!=null and schoolName!=\"\"'>and schoolName like concat('%',#{schoolName},'%') </if>", " <if test='schoolName!=null and schoolName!=\"\"'>and schoolName like concat('%',#{schoolName},'%') </if>",
"</script> "}) "</script> "})
List<School> querySchool(School school); List<School> querySchool(School school);

@ -454,7 +454,7 @@ public class UserInfoService {
List<Student> studentList = userInfoMapper.queryStudentAll(id,roleId,schoolId); List<Student> studentList = userInfoMapper.queryStudentAll(id,roleId,schoolId);
obj.put("studentList",studentList); obj.put("studentList",studentList);
ValueOperations<String, String> redis = stringRedisTemplate.opsForValue(); ValueOperations<String, String> redis = stringRedisTemplate.opsForValue();
redis.set(token,date, 30 * 60, TimeUnit.SECONDS); redis.set(token,date, 24, TimeUnit.HOURS);
resp.put("retcode", 200); resp.put("retcode", 200);
resp.put("retvalue", obj); resp.put("retvalue", obj);
}else { }else {

Loading…
Cancel
Save