上传代码

master
zhiyong.ning 4 years ago
parent 431ae0e4f0
commit 90b26c90ab
  1. 31
      src/main/java/com/yipin/liuwanr/controller/UserInfoController.java
  2. 172
      src/main/java/com/yipin/liuwanr/entity/ExperimentalTeaching.java
  3. 8
      src/main/java/com/yipin/liuwanr/mapper/UserInfoMapper.java
  4. 21
      src/main/java/com/yipin/liuwanr/service/UserInfoService.java

@ -301,7 +301,36 @@ public class UserInfoController {
}
/**
* 登陆
* 服务端登陆
*/
@GetMapping("/adminLogins")
Response adminLogins(@RequestParam("account") String account, @RequestParam("password") String password,HttpServletRequest req, HttpServletResponse res) {
Response resp = new Response();
UserInfo userInfo = new UserInfo();
if (account == null) {
resp.setStatus(300);
resp.setErrmessage("用户账号为空,登录失败!");
}else if(password ==null) {
resp.setStatus(300);
resp.setErrmessage("用户密码为空,登录失败!");
} else{
userInfo.setAccount(account);
userInfo.setPassword(password);
HashMap<String, Object> ret = userInfoService.adminLogins(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("/logins")
Response logins(@RequestParam("userId") Integer userId, @RequestParam("schoolId") Integer schoolId,@RequestParam("roleId") String roleId, HttpServletRequest req, HttpServletResponse res) {

@ -1,172 +0,0 @@
package com.yipin.liuwanr.entity;
import java.util.List;
/**
* 实验教学实体
*
* @author Ning
*/
public class ExperimentalTeaching {
//实验教学主键ID
private Integer id;
//实验班级名称
private String experimentalClassName;
//实验名称
private String experimentalName;
//绑定项目id
private Integer projectId;
//绑定项目名称
private String projectName;
//实验人数
private Integer experimentalNumber;
//实验时长
private String experimentDuration;
//发布类型
private Integer type;
//启动时间
private String startTime;
//结束时间
private String stopTime;
//状态
private Integer status;
//邀请码
private String invitationCode;
//是否启用邀请码
private Integer isCode;
//绑定用户Id
private Integer userId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getExperimentalClassName() {
return experimentalClassName;
}
public void setExperimentalClassName(String experimentalClassName) {
this.experimentalClassName = experimentalClassName;
}
public String getExperimentalName() {
return experimentalName;
}
public void setExperimentalName(String experimentalName) {
this.experimentalName = experimentalName;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public Integer getExperimentalNumber() {
return experimentalNumber;
}
public void setExperimentalNumber(Integer experimentalNumber) {
this.experimentalNumber = experimentalNumber;
}
public String getExperimentDuration() {
return experimentDuration;
}
public void setExperimentDuration(String experimentDuration) {
this.experimentDuration = experimentDuration;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getStopTime() {
return stopTime;
}
public void setStopTime(String stopTime) {
this.stopTime = stopTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getInvitationCode() {
return invitationCode;
}
public void setInvitationCode(String invitationCode) {
this.invitationCode = invitationCode;
}
public Integer getIsCode() {
return isCode;
}
public void setIsCode(Integer isCode) {
this.isCode = isCode;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
@Override
public String toString() {
return "ExperimentalTeaching{" +
"id=" + id +
", experimentalClassName='" + experimentalClassName + '\'' +
", experimentalName='" + experimentalName + '\'' +
", projectId=" + projectId +
", projectName='" + projectName + '\'' +
", experimentalNumber=" + experimentalNumber +
", experimentDuration='" + experimentDuration + '\'' +
", type=" + type +
", startTime='" + startTime + '\'' +
", stopTime='" + stopTime + '\'' +
", status=" + status +
", invitationCode='" + invitationCode + '\'' +
", isCode=" + isCode +
", userId=" + userId +
'}';
}
}

@ -46,7 +46,7 @@ public interface UserInfoMapper {
" <if test='schoolId!=null and schoolId !=\"\"'>and u.schoolId = #{schoolId} </if>",
" <if test='cityId!=null and cityId !=\"\" '>and s.cityId = #{cityId} </if>",
" <if test='roleId!=null and roleId !=\"\" '>and u.roleId LIKE CONCAT('%',#{roleId},'%')</if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName,u.account) LIKE CONCAT('%',#{searchContent},'%')</if>",
" <if test='searchContent!=null and searchContent !=\"\" '> AND CONCAT(u.userName, s.schoolName) LIKE CONCAT('%',#{searchContent},'%')</if>",
" <if test='month==3'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)</if>",
" <if test='month==6'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)</if>",
" <if test='month==9'>and u.creationTime>DATE_SUB(CURDATE(), INTERVAL 9 MONTH)</if>",
@ -127,6 +127,10 @@ public interface UserInfoMapper {
@Select("SELECT hui.schoolId,hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.userId = #{userId} ")
UserInfo logins(UserInfo userInfo);
//登陆
@Select("SELECT userId,userName,roleId from hr_user_info where isdel=0 and account = #{account} and password = #{password}")
UserInfo adminLogins(UserInfo userInfo);
//登陆账号密码
@Select("SELECT hui.schoolId,hui.account,hui.cityId,hui.countries,hui.creationTime,hui.dateBirth,hui.documentType,hui.educationDegree,hui.email,hui.iDNumber,hui.logInNumber,hui.phone,hui.provinceId,hui.sex,hui.uniqueIdentificationAccount,hui.userAvatars,hui.userId,hui.userName,hui.weChatID from hr_user_info hui where hui.isdel=0 and hui.account = #{account} and password = #{password} ")
UserInfo loginsAP(UserInfo userInfo);
@ -223,7 +227,7 @@ public interface UserInfoMapper {
"SELECT customerId,customerName,schoolId FROM customer where isdel = 0",
" <if test='searchContent!=null and searchContent !=\"\" '>and customerName like CONCAT('%',#{searchContent},'%')</if>",
" <if test='customerIds!=null'>"
+ "<foreach collection='customerIds' item='customerIds' open='and customerId not in (' separator=',' close=')'> #{customerIds}"
+ "<foreach collection='customerIds' item='customerIds' open='and schoolId not in (' separator=',' close=')'> #{customerIds}"
+ "</foreach>"
+ "</if>",
"</script> "})

@ -414,6 +414,27 @@ public class UserInfoService {
return resp;
}
//登陆
public HashMap<String, Object> adminLogins(UserInfo userInfo){
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
UserInfo user=userInfoMapper.adminLogins(userInfo);
if (user==null){
resp.put("retvalue","账号密码有误,请稍后再试!");
resp.put("retcode", 300);
}else{
resp.put("retvalue",user);
resp.put("retcode", 200);
}
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "登陆异常,请稍后再试!");
return resp;
}
return resp;
}
//登陆获取角色
public HashMap<String, Object> loginRole(Integer userId,Integer schoolId){
HashMap<String, Object> resp = new HashMap<String, Object>();

Loading…
Cancel
Save