Merge remote-tracking branch 'origin/master'

hehai
zhiyong.ning 4 years ago
commit 0a667048bb
  1. 2
      src/main/java/com/msdw/tms/api/ClassTeachingApi.java
  2. 4
      src/main/java/com/msdw/tms/api/UserControllerApi.java
  3. 29
      src/main/java/com/msdw/tms/controller/UserController.java
  4. 2
      src/main/java/com/msdw/tms/entity/vo/UserEntityVo.java
  5. 2
      src/main/resources/mapper/tms/ClassTeachingDao.xml
  6. 48
      src/main/resources/mapper/tms/UserDao.xml

@ -2,10 +2,8 @@ package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.ExperimentalTeachingEntity;
import com.msdw.tms.entity.vo.ProjectRecordVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestParam;
@Api(value = "用户端班级实验", tags = "用户端班级实验信息")
public interface ClassTeachingApi {

@ -2,6 +2,7 @@ package com.msdw.tms.api;
import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -14,4 +15,7 @@ public interface UserControllerApi {
@ApiOperation(value = "个人中心信息修改",notes = "个人中心信息修改")
R update(UserEntity userEntity);
@ApiOperation(value = "更新密码",notes = "更新密码")
R examinePassword(UserEntityVo entity);
}

@ -1,5 +1,7 @@
package com.msdw.tms.controller;
import cn.hutool.system.UserInfo;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.msdw.tms.api.UserControllerApi;
import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R;
@ -7,6 +9,7 @@ import com.msdw.tms.entity.UserEntity;
import com.msdw.tms.entity.vo.UserEntityVo;
import com.msdw.tms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
@ -78,6 +81,30 @@ public class UserController implements UserControllerApi {
return R.ok();
}
/**
* 校验密码
* @param entity 封装用户id和输入的原密码和新密码
* @return R 响应的状态信息
*/
@Override
@Transactional
@PostMapping("/examinePassword")
public R examinePassword(@RequestBody UserEntityVo entity){
Integer userid = entity.getUserid();//用户id
String password = entity.getPassword();//用户输入的当前密码
String newPassword = entity.getNewPassword();//获取用户输入的新密码
UserEntity byId = userService.getById(userid);//获取用户个人信息
UserEntity user = new UserEntity();//用于封装数据
if (password.equals(byId.getPassword())==true){
user.setUserid(userid).setPassword(newPassword);
boolean b = userService.updateById(user);
if (b==true){
return R.ok();
}else{return R.error("更新密码失败,请稍后重试");}
}else{
return R.error(403,"原密码错误,更新密码失败!!!");
}
}
}

@ -35,5 +35,7 @@ public class UserEntityVo extends UserEntity implements Serializable {
private String professionalName;
private List<UserEntity> user;
//新密码
private String newPassword;
}

@ -21,6 +21,8 @@
tms_experimental_teaching
WHERE
is_del=0
AND
start_time >='2020-01-01 00:00:00'
<if test="cla.status!=null">and `status` = #{cla.status}</if>
<if test="cla.condition!=null">and ( project_name like concat('%',#{cla.condition},'%') or experimental_class_name like concat('%',#{cla.condition},'%') )</if>
<if test="cla.startTime!=null and cla.endTime!=null">and stop_time between #{cla.endTime} and #{cla.startTime}</if>

@ -5,31 +5,41 @@
<select id="getByUserId" parameterType="com.msdw.tms.entity.UserEntity" resultType="com.msdw.tms.entity.vo.UserEntityVo">
SELECT
u.userId,
userName,
sex,
countries,
p.provinceName as provinceName,
c.cityName as cityName,
IDNumber,
educationDegree,
schoolName,
account,
phone,
email,
weChatID,
'password'
u.sex,
u.countries,
c.cityName,
u.dateBirth,
u.weChatID,
u.IDNumber,
u.documentType,
u.educationDegree,
pro.provinceName,
s.schoolName AS userSchoolName,
per.schoolName,
per.disciplineName,
per.professionalClassName,
per.professionalName,
per.personalCareerId,
c.cityName AS personalCityName,
pro.provinceName AS personalProvinceName
FROM
hr_user_info u,
province p,
hr_personal_file per,
school s,
city c,
school s
province pro
WHERE
u.userId = #{userid}
AND u.provinceId = p.provinceId
AND p.provinceId = c.provinceId
AND c.cityId = u.cityId
per.schoolId = s.schoolId
AND u.provinceId = pro.provinceId
AND u.schoolId = s.schoolId
AND p.isdel = #{isdel}
AND u.cityId = c.cityId
AND u.isdel = #{isdel}
AND u.provinceId = c.provinceId
AND u.userId = per.userId
AND per.userId = #{userid}
AND pro.isdel = #{isdel}
AND c.isdel = #{isdel}
AND s.isdel = #{isdel}
</select>

Loading…
Cancel
Save