Commit cd73181e by 龙于生 Committed by 284718418@qq.com

修改检测用户是否存在接口 状态判断

parent b6cca82e
...@@ -720,6 +720,9 @@ public class LoginController { ...@@ -720,6 +720,9 @@ public class LoginController {
private Result<QyzxEmpLogin> loginhan(QyzxEmpLogin qyzxEmpLogin1, HttpServletRequest request) { private Result<QyzxEmpLogin> loginhan(QyzxEmpLogin qyzxEmpLogin1, HttpServletRequest request) {
if (qyzxEmpLogin1 == null) if (qyzxEmpLogin1 == null)
return ResultUtil.error("帐号不存在!"); return ResultUtil.error("帐号不存在!");
if (qyzxEmpLogin1.getSts().equals(9)) {
return ResultUtil.error("9","服务器变更");
}
String ip; String ip;
try { try {
ip = UserIp.getIpAddr(request); ip = UserIp.getIpAddr(request);
......
...@@ -2,10 +2,15 @@ package cn.timer.api.controller.check; ...@@ -2,10 +2,15 @@ package cn.timer.api.controller.check;
import cn.timer.api.bean.qyzx.QyzxEmpLogin; import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.serverurl.CompanyServerUrl; import cn.timer.api.bean.serverurl.CompanyServerUrl;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -20,6 +25,11 @@ import java.util.List; ...@@ -20,6 +25,11 @@ import java.util.List;
@RequestMapping(value = "/check", produces = { "application/json" }) @RequestMapping(value = "/check", produces = { "application/json" })
public class CheckController { public class CheckController {
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private QyzxEmpLoginMapper qyzxEmpLoginMapper;
@GetMapping(value = "/company_server_url_list") @GetMapping(value = "/company_server_url_list")
@ApiOperation(value = "公司服务端地址列表", httpMethod = "GET", notes = "公司服务端地址列表") @ApiOperation(value = "公司服务端地址列表", httpMethod = "GET", notes = "公司服务端地址列表")
...@@ -42,10 +52,38 @@ public class CheckController { ...@@ -42,10 +52,38 @@ public class CheckController {
List<QyzxEmpLogin> qyzxEmpLogins = QyzxEmpLogin.builder().build() List<QyzxEmpLogin> qyzxEmpLogins = QyzxEmpLogin.builder().build()
.selectList(new QueryWrapper<QyzxEmpLogin>() .selectList(new QueryWrapper<QyzxEmpLogin>()
.lambda().eq(QyzxEmpLogin::getPhone, account).eq(QyzxEmpLogin::getSts, 1)); .lambda().eq(QyzxEmpLogin::getPhone, account).eq(QyzxEmpLogin::getSts, 1));
//System.out.println(qyzxEmpLogins); //System.out.println(qyzxEmpLogins);
if (qyzxEmpLogins.size()==0){ if (qyzxEmpLogins.size() > 0){
YgglMainEmp userInfo = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getPhone, YgglMainEmp::getBmgwId, YgglMainEmp::getOrgCode)
.eq(YgglMainEmp::getEmpNum, qyzxEmpLogins.get(0).getId())
.eq(YgglMainEmp::getOrgCode, qyzxEmpLogins.get(0).getOrgId()));
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogins.get(0).getId());
QysDto ctrl = qys.get(0);
if (userInfo == null) {
return ResultUtil.error("账户不存在");
}
if (ctrl.getStatus() == null || ctrl.getStatus().equals(0)) {
//return ResultUtil.error("帐号被禁用");
return ResultUtil.error("账户不存在");
}
if (ctrl.getStatus().equals(9)) {
//return ResultUtil.error("9","服务器变更");
return ResultUtil.error("账户不存在");
}
}else{
return ResultUtil.error("账户不存在"); return ResultUtil.error("账户不存在");
} }
return ResultUtil.success("OK"); return ResultUtil.success("OK");
} }
......
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