Commit 19a8f263 by xuwenhao

修改用户输入密码格式、优化实体类字段

parent 2924fb84
...@@ -104,6 +104,7 @@ public class SysProfileController extends BaseController ...@@ -104,6 +104,7 @@ public class SysProfileController extends BaseController
LoginUser loginUser = getLoginUser(); LoginUser loginUser = getLoginUser();
String userName = loginUser.getUsername(); String userName = loginUser.getUsername();
String password = loginUser.getPassword(); String password = loginUser.getPassword();
userService.checkPasswordUnique(newPassword);
if (!SecurityUtils.matchesPassword(oldPassword, password)) if (!SecurityUtils.matchesPassword(oldPassword, password))
{ {
return AjaxResult.error("修改密码失败,旧密码错误"); return AjaxResult.error("修改密码失败,旧密码错误");
......
...@@ -197,6 +197,7 @@ public class SysUserController extends BaseController ...@@ -197,6 +197,7 @@ public class SysUserController extends BaseController
{ {
userService.checkUserAllowed(user); userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId()); userService.checkUserDataScope(user.getUserId());
userService.checkPasswordUnique(user.getPassword());
user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
user.setUpdateBy(getUsername()); user.setUpdateBy(getUsername());
return toAjax(userService.resetPwd(user)); return toAjax(userService.resetPwd(user));
......
...@@ -277,4 +277,8 @@ public interface ISysUserService { ...@@ -277,4 +277,8 @@ public interface ISysUserService {
* 根据userId更新openId * 根据userId更新openId
* */ * */
public boolean updateOpenId(Long userId, String openId); public boolean updateOpenId(Long userId, String openId);
/**检查密码是否符合条件(密码必须包含大小写字母、数字、特殊字符中的任意三种)*/
void checkPasswordUnique(String password);
} }
...@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; ...@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
...@@ -583,4 +584,18 @@ public class SysUserServiceImpl implements ISysUserService { ...@@ -583,4 +584,18 @@ public class SysUserServiceImpl implements ISysUserService {
public boolean updateOpenId(Long userId, String openId) { public boolean updateOpenId(Long userId, String openId) {
return userMapper.updateOpenId(userId,openId) > 0; return userMapper.updateOpenId(userId,openId) > 0;
} }
/**
* 检查密码是否符合条件(密码必须包含大小写字母、数字、特殊字符中的任意三种)
* @param password
*/
@Override
public void checkPasswordUnique(String password) {
// String pattern = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$";
String pattern = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,}$";
boolean matches = Pattern.matches(pattern, password);
if (matches == false){
throw new ServiceException("密码必须包含大小写字母、数字、特殊字符中的任意三种");
}
}
} }
...@@ -117,6 +117,7 @@ public class SchoolTeacherController extends BaseController { ...@@ -117,6 +117,7 @@ public class SchoolTeacherController extends BaseController {
schoolTeacherService.checkTeacherCodeUnique(schoolTeacherVO); schoolTeacherService.checkTeacherCodeUnique(schoolTeacherVO);
schoolTeacherService.checkTeacherTelUnique(schoolTeacherVO); schoolTeacherService.checkTeacherTelUnique(schoolTeacherVO);
schoolTeacherService.checkIdCardUnique(schoolTeacherVO); schoolTeacherService.checkIdCardUnique(schoolTeacherVO);
schoolTeacherService.checkPasswordUnique(schoolTeacherVO);
if(StringUtils.isNotEmpty(schoolTeacherVO.getEmail())){ if(StringUtils.isNotEmpty(schoolTeacherVO.getEmail())){
schoolTeacherService.checkEmailUnique(schoolTeacherVO); schoolTeacherService.checkEmailUnique(schoolTeacherVO);
} }
......
...@@ -36,6 +36,9 @@ public class SchoolCirculation extends OurBaseEntity ...@@ -36,6 +36,9 @@ public class SchoolCirculation extends OurBaseEntity
/** 借用期限(天) */ /** 借用期限(天) */
private Long deadline; private Long deadline;
/** 归还状态(0=未归还,1=已归还)" */
private String returnState;
/** 归还日期 */ /** 归还日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date returnTime; private Date returnTime;
...@@ -59,7 +62,4 @@ public class SchoolCirculation extends OurBaseEntity ...@@ -59,7 +62,4 @@ public class SchoolCirculation extends OurBaseEntity
/** 备注 */ /** 备注 */
private String remark; private String remark;
/** 借出状态(0=未归还,1=已归还)" */
private String returnState;
} }
...@@ -4,6 +4,7 @@ import java.util.Date; ...@@ -4,6 +4,7 @@ import java.util.Date;
import com.core.domain.OurBaseEntity; import com.core.domain.OurBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import lombok.Data; import lombok.Data;
/** /**
...@@ -29,6 +30,9 @@ public class SchoolReceive extends OurBaseEntity ...@@ -29,6 +30,9 @@ public class SchoolReceive extends OurBaseEntity
/** 领用人 */ /** 领用人 */
private String recipientBy; private String recipientBy;
/** 退还状态(0=未退还,1=已退还)" */
private String returnState;
/** 退还日期 */ /** 退还日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date returnTime; private Date returnTime;
...@@ -52,4 +56,5 @@ public class SchoolReceive extends OurBaseEntity ...@@ -52,4 +56,5 @@ public class SchoolReceive extends OurBaseEntity
/** 备注 */ /** 备注 */
private String remark; private String remark;
} }
...@@ -81,7 +81,7 @@ public class CountServiceImpl implements ICountService { ...@@ -81,7 +81,7 @@ public class CountServiceImpl implements ICountService {
int officialNum = flowMapper.getTodoTotal(userId,UNDONE); int officialNum = flowMapper.getTodoTotal(userId,UNDONE);
/**调查问卷任务数*/ /**调查问卷任务数*/
int investigate = examMainMapper.getTodoTotal(userId); // int investigate = examMainMapper.getTodoTotal(userId);
/**采购申请审批任务数*/ /**采购申请审批任务数*/
int purchaseRequisition = getNum(PURCHASEREQUEST, userId.toString()); int purchaseRequisition = getNum(PURCHASEREQUEST, userId.toString());
...@@ -97,7 +97,7 @@ public class CountServiceImpl implements ICountService { ...@@ -97,7 +97,7 @@ public class CountServiceImpl implements ICountService {
vo.setTLeaveNum(tLeaveNum); vo.setTLeaveNum(tLeaveNum);
vo.setOfficialNum(officialNum); vo.setOfficialNum(officialNum);
vo.setInvestigate(investigate); // vo.setInvestigate(investigate);
vo.setPurchaseRequisition(purchaseRequisition); vo.setPurchaseRequisition(purchaseRequisition);
vo.setSLeaveNum(sLeaveNum); vo.setSLeaveNum(sLeaveNum);
vo.setAuditoriumNum(auditoriumNum); vo.setAuditoriumNum(auditoriumNum);
......
...@@ -34,6 +34,7 @@ import yangtz.cs.liu.campus.vo.teacher.TeacherNameListVo; ...@@ -34,6 +34,7 @@ import yangtz.cs.liu.campus.vo.teacher.TeacherNameListVo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotNull; import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotNull;
...@@ -415,6 +416,21 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S ...@@ -415,6 +416,21 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S
} }
} }
/**
* 检查密码是否符合条件(密码必须包含大小写字母、数字、特殊字符中的任意三种)
* @param schoolTeacherVO
*/
@Override
public void checkPasswordUnique(SchoolTeacherVO schoolTeacherVO) {
String password = schoolTeacherVO.getPassword();
// String pattern = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[A-Za-z\\d]{8,}$";
String pattern = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,}$";
boolean matches = Pattern.matches(pattern, password);
if (matches == false){
throw new ServiceException("密码必须包含大小写字母、数字、特殊字符中的任意三种");
}
}
@Override @Override
public int insert(SchoolTeacherVO schoolTeacherVO) { public int insert(SchoolTeacherVO schoolTeacherVO) {
......
...@@ -90,6 +90,8 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> { ...@@ -90,6 +90,8 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> {
/**检查邮箱账号是否唯一*/ /**检查邮箱账号是否唯一*/
void checkEmailUnique(SchoolTeacherVO schoolTeacher); void checkEmailUnique(SchoolTeacherVO schoolTeacher);
/**检查密码是否符合条件(密码必须包含大小写字母,数字)*/
void checkPasswordUnique(SchoolTeacherVO schoolTeacherVO);
/** /**
* 新增教师 * 新增教师
...@@ -142,4 +144,6 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> { ...@@ -142,4 +144,6 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> {
* 根据userId 查询 openId * 根据userId 查询 openId
*/ */
String getOpenIdByUserId(Long userId); String getOpenIdByUserId(Long userId);
} }
...@@ -58,6 +58,10 @@ public class SchoolCirculationVo extends BaseEntity ...@@ -58,6 +58,10 @@ public class SchoolCirculationVo extends BaseEntity
@Excel(name = "借用期限(天)") @Excel(name = "借用期限(天)")
private Long deadline; private Long deadline;
/** 归还状态(0=未归还,1=已归还)" */
@Excel(name = "归还状态", readConverterExp = "1=已归还,0=未归还")
private String returnState;
/** 归还日期 */ /** 归还日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "归还日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
...@@ -88,8 +92,4 @@ public class SchoolCirculationVo extends BaseEntity ...@@ -88,8 +92,4 @@ public class SchoolCirculationVo extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String remark; private String remark;
/** 借出状态(0=未归还,1=已归还)" */
@Excel(name = "借出状态")
private String returnState;
} }
...@@ -49,6 +49,10 @@ public class SchoolReceiveVo extends BaseEntity ...@@ -49,6 +49,10 @@ public class SchoolReceiveVo extends BaseEntity
@Excel(name = "领用人") @Excel(name = "领用人")
private String recipientBy; private String recipientBy;
/** 退还状态(0=未退还,1=已退还)" */
@Excel(name = "退还状态", readConverterExp = "1=已退还,0=未退还")
private String returnState;
/** 退还日期 */ /** 退还日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "退还日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "退还日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
......
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