Commit c04378a7 authored by licc's avatar licc

表结构修改调整

parent 752aff90
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<result column="head_image" property="headImage"/> <result column="head_image" property="headImage"/>
<result column="sex" property="sex"/> <result column="sex" property="sex"/>
<result column="school" property="school"/> <result column="school" property="school"/>
<result column="student_type" property="studentType"/> <result column="exam_type" property="examType"/>
<result column="source" property="source"/> <result column="source" property="source"/>
<result column="is_delete" property="isDelete"/> <result column="is_delete" property="isDelete"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
</sql> </sql>
<sql id="cols_exclude_id"> <sql id="cols_exclude_id">
user_name,password, phone,head_image,sex,school, student_type,is_delete,create_time,update_time user_name,password, phone,head_image,sex,school, exam_type,is_delete,create_time,update_time
</sql> </sql>
<sql id="vals"> <sql id="vals">
#{userName},#{password},#{phone},#{headImage},#{sex},#{school},#{studentType}, #{source}, #{userName},#{password},#{phone},#{headImage},#{sex},#{school},#{examType}, #{source},
#{isDelete},now(),now() #{isDelete},now(),now()
</sql> </sql>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<if test="headImage != null">head_image =#{headImage},</if> <if test="headImage != null">head_image =#{headImage},</if>
<if test="sex != null">sex =#{sex},</if> <if test="sex != null">sex =#{sex},</if>
<if test="school != null">school =#{school},</if> <if test="school != null">school =#{school},</if>
<if test="studentType != null">inspector_name = #{studentType},</if> <if test="examType != null">exam_type = #{examType},</if>
<if test="source != null">source = #{source},</if> <if test="source != null">source = #{source},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
update_time =now() update_time =now()
......
package cn.wisenergy.model.app; package cn.wisenergy.model.app;
import cn.wisenergy.model.common.BaseEntity; import cn.wisenergy.model.common.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -16,6 +17,7 @@ import java.util.Date; ...@@ -16,6 +17,7 @@ import java.util.Date;
*/ */
@Data @Data
@ApiModel(value = "AccountUsers") @ApiModel(value = "AccountUsers")
@TableName("user")
public class UserInfo extends BaseEntity implements Serializable { public class UserInfo extends BaseEntity implements Serializable {
private static final long serialVersionUID = 2525339404301884673L; private static final long serialVersionUID = 2525339404301884673L;
...@@ -37,6 +39,12 @@ public class UserInfo extends BaseEntity implements Serializable { ...@@ -37,6 +39,12 @@ public class UserInfo extends BaseEntity implements Serializable {
@ApiModelProperty(name="password",value = "用户密码") @ApiModelProperty(name="password",value = "用户密码")
private String password; private String password;
/**
* 来源 1:pc 2:移动端
*/
@ApiModelProperty(name = "来源 1:pc 2:移动端",value = "source")
private Integer source;
/** /**
* 电话号码 * 电话号码
*/ */
...@@ -65,19 +73,8 @@ public class UserInfo extends BaseEntity implements Serializable { ...@@ -65,19 +73,8 @@ public class UserInfo extends BaseEntity implements Serializable {
* 学生类型 * 学生类型
*/ */
@ApiModelProperty(name = "examType",value = "考生类型 1:文化课考生 2:美术生 3:体育生 4:文学编导考生") @ApiModelProperty(name = "examType",value = "考生类型 1:文化课考生 2:美术生 3:体育生 4:文学编导考生")
private Integer studentType; private Integer examType;
/**
* 用户剩余查询次数
*/
@ApiModelProperty(name = "queryLimit",value = "用户剩余查询次数")
private Integer queryLimit;
/**
* 用户充值总额
*/
@ApiModelProperty(name = "moneyAmount",value = "充值总额")
private String moneyAmount;
/** /**
* 是否删除 * 是否删除
*/ */
......
...@@ -66,7 +66,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp ...@@ -66,7 +66,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
//3、保存方案查询记录 //3、保存方案查询记录
SchemeQueryRecord schemeQueryRecord = new SchemeQueryRecord(); SchemeQueryRecord schemeQueryRecord = new SchemeQueryRecord();
schemeQueryRecord.setMajorName(""); schemeQueryRecord.setMajorName("");
schemeQueryRecord.setStudentType(userInfo.getStudentType()); schemeQueryRecord.setStudentType(userInfo.getExamType());
schemeQueryRecord.setUserId(userInfo.getId()); schemeQueryRecord.setUserId(userInfo.getId());
schemeQueryRecord.setIsDelete(0); schemeQueryRecord.setIsDelete(0);
double score = Double.parseDouble(queryVo.getCultureGrade()) + Double.parseDouble(queryVo.getMajorGrade()); double score = Double.parseDouble(queryVo.getCultureGrade()) + Double.parseDouble(queryVo.getMajorGrade());
......
...@@ -6,6 +6,7 @@ import cn.wisenergy.mapper.UsersMapper; ...@@ -6,6 +6,7 @@ import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.model.app.UserInfo; import cn.wisenergy.model.app.UserInfo;
import cn.wisenergy.model.vo.UserInfoVo; import cn.wisenergy.model.vo.UserInfoVo;
import cn.wisenergy.service.app.UserLoginService; import cn.wisenergy.service.app.UserLoginService;
import cn.wisenergy.service.common.Common;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -104,7 +105,23 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, UserInfo> imp ...@@ -104,7 +105,23 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, UserInfo> imp
@Override @Override
public R<Boolean> resetPassword(Integer userId) { public R<Boolean> resetPassword(Integer userId) {
return null; log.info("volunteer-service[]UserLoginServiceImpl[]resetPassword[]input.param.userId:" + userId);
if (null == userId) {
return R.error("入参为空!");
}
//获取用户信息
UserInfo userInfo = usersMapper.selectById(userId);
//加密重置密码
String password = Md5Util.digestMD5(Common.RESET_PASSWORD_VALUE);
userInfo.setPassword(password);
int count = usersMapper.edit(userInfo);
if (count == 0) {
return R.ok(1, false);
}
return R.ok(0, true);
} }
@Override @Override
......
...@@ -98,7 +98,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen ...@@ -98,7 +98,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
//2、要提交的用户信息 //2、要提交的用户信息
user.setSchool(userInfo.getSchool()); user.setSchool(userInfo.getSchool());
user.setSex(userInfo.getSex()); user.setSex(userInfo.getSex());
user.setStudentType(userInfo.getStudentType()); user.setExamType(userInfo.getStudentType());
user.setUserName(userInfo.getUserName()); user.setUserName(userInfo.getUserName());
user.setIsDelete(0); user.setIsDelete(0);
...@@ -149,7 +149,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen ...@@ -149,7 +149,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, UserInfo> implemen
userShowVo.setId(userInfo.getId()); userShowVo.setId(userInfo.getId());
userShowVo.setSchool(userInfo.getSchool()); userShowVo.setSchool(userInfo.getSchool());
userShowVo.setSex(userInfo.getSex()); userShowVo.setSex(userInfo.getSex());
userShowVo.setStudentType(userInfo.getStudentType()); userShowVo.setStudentType(userInfo.getExamType());
userShowVo.setUserName(userInfo.getUserName()); userShowVo.setUserName(userInfo.getUserName());
//获取成绩信息 //获取成绩信息
......
...@@ -8,14 +8,9 @@ package cn.wisenergy.service.common; ...@@ -8,14 +8,9 @@ package cn.wisenergy.service.common;
public class Common { public class Common {
/** /**
* 注册标识 * 重置密码
*/ */
public static final String REGISTER="register"; public static final String RESET_PASSWORD_VALUE = "123456";
/**
* 编辑标识
*/
public static final String LOGIN_EDIT="login_edit";
} }
...@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -32,8 +33,8 @@ public class UserController { ...@@ -32,8 +33,8 @@ public class UserController {
@ApiOperation(value = "用户管理",notes = "用户管理",httpMethod = "POST") @ApiOperation(value = "用户管理",notes = "用户管理",httpMethod = "POST")
@ApiImplicitParam(name ="queryVo" ) @ApiImplicitParam(name ="queryVo" )
@PostMapping("/manage") @PostMapping("/manage")
public R manageUser(UserQueryVo queryVo){ public R manageUser(@RequestBody UserQueryVo queryVo){
log.info("UserController[].manageUser[].input.param:queryV0:{}"+queryVo); log.info("UserController[].manageUser[].input.param:queryV0:"+queryVo);
//查询用户信息 //查询用户信息
R<PageInfo<UserInfoDto>> userList = userService.getUserList(queryVo); R<PageInfo<UserInfoDto>> userList = userService.getUserList(queryVo);
//返回数据 //返回数据
......
package cn.wisenergy.web.admin.controller.app; package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.service.app.UserLoginService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -16,4 +22,18 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,4 +22,18 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/user/login") @RequestMapping("/user/login")
@Slf4j @Slf4j
public class UserLongController { public class UserLongController {
@Autowired
private UserLoginService userLoginService;
@ApiOperation(value = "重置密码", notes = "重置密码", httpMethod = "POST")
@PostMapping("/resetPassword")
public R<Boolean> resetPassword(Integer userId) {
log.info("volunteer-service[]UserLongController[]resetPassword[]input.param.userId:" + userId);
if (null == userId) {
return R.error("入参不能为空!");
}
return userLoginService.resetPassword(userId);
}
} }
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