用户表添加备注字段,管理员可以编辑备注。
This commit is contained in:
parent
7d6a328cf0
commit
0a386ed8a2
@ -8,6 +8,7 @@ import com.xkrs.dao.SysUserDao;
|
|||||||
import com.xkrs.model.entity.SysUserEntity;
|
import com.xkrs.model.entity.SysUserEntity;
|
||||||
import com.xkrs.model.qo.SysUserQo;
|
import com.xkrs.model.qo.SysUserQo;
|
||||||
import com.xkrs.model.qo.SysUserReceiveSmsQo;
|
import com.xkrs.model.qo.SysUserReceiveSmsQo;
|
||||||
|
import com.xkrs.model.qo.SysUserRemarkQo;
|
||||||
import com.xkrs.model.qo.SysUserVipLevelQo;
|
import com.xkrs.model.qo.SysUserVipLevelQo;
|
||||||
import com.xkrs.model.validation.SysUserQoInsert;
|
import com.xkrs.model.validation.SysUserQoInsert;
|
||||||
import com.xkrs.model.validation.SysUserQoUpdate;
|
import com.xkrs.model.validation.SysUserQoUpdate;
|
||||||
@ -108,6 +109,20 @@ public class SysUserController {
|
|||||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@RequestMapping(value = "/updateremark", method = RequestMethod.POST)
|
||||||
|
public String updateRemark(@RequestBody SysUserRemarkQo sysUserRemarkQo) {
|
||||||
|
// 获取区域信息
|
||||||
|
Locale locale = LocaleContextHolder.getLocale();
|
||||||
|
Integer id = sysUserRemarkQo.getId();
|
||||||
|
Optional<SysUserEntity> optionalById = sysUserDao.findById(id);
|
||||||
|
if (optionalById.isEmpty()) {
|
||||||
|
return outputEncapsulationObject(PromptMessageEnum.PARAM_ILLEGAL, "修改失败,用户找不到", locale);
|
||||||
|
}
|
||||||
|
sysUserDao.updateRemark(id, sysUserRemarkQo.getRemark());
|
||||||
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录用户Token验证
|
* 登录用户Token验证
|
||||||
*
|
*
|
||||||
|
@ -24,6 +24,10 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Integer> {
|
|||||||
@Query(value = "UPDATE sys_user SET receive_sms = ?2 WHERE id = ?1", nativeQuery = true)
|
@Query(value = "UPDATE sys_user SET receive_sms = ?2 WHERE id = ?1", nativeQuery = true)
|
||||||
void updateReceiveSms(Integer id, Integer receiveSms);
|
void updateReceiveSms(Integer id, Integer receiveSms);
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query(value = "UPDATE sys_user SET remark = ?2 WHERE id = ?1", nativeQuery = true)
|
||||||
|
void updateRemark(Integer id, String remark);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查系统用户名是否存在
|
* 检查系统用户名是否存在
|
||||||
*
|
*
|
||||||
@ -96,7 +100,7 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Integer> {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName,lastEntryIp,loginNum,loginLastTime,vipLevel,receiveSms) " + "from SysUserEntity")
|
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName,lastEntryIp,loginNum,loginLastTime,vipLevel,receiveSms,remark) " + "from SysUserEntity")
|
||||||
List<SysUserVo> selectAll();
|
List<SysUserVo> selectAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -105,7 +109,7 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Integer> {
|
|||||||
* @param userName
|
* @param userName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName,lastEntryIp,loginNum,loginLastTime,vipLevel,receiveSms) " + "from SysUserEntity where userName = :userName")
|
@Query(value = "select new com.xkrs.model.vo.SysUserVo (id,reallyName,telephone,countyCode,activeFlag,addTime,overTime,dayNum,accountType,countyName,lastEntryIp,loginNum,loginLastTime,vipLevel,receiveSms,remark) " + "from SysUserEntity where userName = :userName")
|
||||||
SysUserVo selectUserByUserName(String userName);
|
SysUserVo selectUserByUserName(String userName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,6 +114,11 @@ public class SysUserEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer receiveSms;
|
private Integer receiveSms;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
public SysUserEntity() {
|
public SysUserEntity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,8 +306,16 @@ public class SysUserEntity implements Serializable {
|
|||||||
this.receiveSms = receiveSms;
|
this.receiveSms = receiveSms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SysUserEntity{" + "id=" + id + ", userName='" + userName + '\'' + ", reallyName='" + reallyName + '\'' + ", password='" + password + '\'' + ", salt='" + salt + '\'' + ", telephone='" + telephone + '\'' + ", countyCode='" + countyCode + '\'' + ", signature='" + signature + '\'' + ", activeFlag=" + activeFlag + ", statusCode=" + statusCode + ", addTime='" + addTime + '\'' + ", lastEntryTime=" + lastEntryTime + ", deleteFlag=" + deleteFlag + ", lastEntryIp='" + lastEntryIp + '\'' + ", dayNum=" + dayNum + ", overTime='" + overTime + '\'' + ", accountType='" + accountType + '\'' + ", countyName='" + countyName + '\'' + ", loginNum=" + loginNum + ", loginLastTime='" + loginLastTime + '\'' + ", userAgent='" + userAgent + '\'' + ", vipLevel=" + vipLevel + ", receiveSms=" + receiveSms + '}';
|
return "SysUserEntity{" + "id=" + id + ", userName='" + userName + '\'' + ", reallyName='" + reallyName + '\'' + ", password='" + password + '\'' + ", salt='" + salt + '\'' + ", telephone='" + telephone + '\'' + ", countyCode='" + countyCode + '\'' + ", signature='" + signature + '\'' + ", activeFlag=" + activeFlag + ", statusCode=" + statusCode + ", addTime='" + addTime + '\'' + ", lastEntryTime=" + lastEntryTime + ", deleteFlag=" + deleteFlag + ", lastEntryIp='" + lastEntryIp + '\'' + ", dayNum=" + dayNum + ", overTime='" + overTime + '\'' + ", accountType='" + accountType + '\'' + ", countyName='" + countyName + '\'' + ", loginNum=" + loginNum + ", loginLastTime='" + loginLastTime + '\'' + ", userAgent='" + userAgent + '\'' + ", vipLevel=" + vipLevel + ", receiveSms=" + receiveSms + ", remark='" + remark + '\'' + '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
src/main/java/com/xkrs/model/qo/SysUserRemarkQo.java
Normal file
33
src/main/java/com/xkrs/model/qo/SysUserRemarkQo.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.xkrs.model.qo;
|
||||||
|
|
||||||
|
import com.xkrs.model.validation.SysUserQoUpdate;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
public class SysUserRemarkQo {
|
||||||
|
|
||||||
|
@NotNull(message = "{SysUser.id.blank}", groups = {SysUserQoUpdate.class})
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@NotNull(message = "{SysUser.remark.blank}", groups = {SysUserQoUpdate.class})
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
public SysUserRemarkQo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
}
|
@ -39,7 +39,9 @@ public class SysUserVo implements Serializable {
|
|||||||
|
|
||||||
private Integer receiveSms;
|
private Integer receiveSms;
|
||||||
|
|
||||||
public SysUserVo(Integer id, String reallyName, String telephone, String countyCode, Integer activeFlag, String addTime, String overTime, Integer dayNum, String accountType, String countyName, String lastEntryIp, Integer loginNum, String loginLastTime, Integer vipLevel, Integer receiveSms) {
|
private String remark;
|
||||||
|
|
||||||
|
public SysUserVo(Integer id, String reallyName, String telephone, String countyCode, Integer activeFlag, String addTime, String overTime, Integer dayNum, String accountType, String countyName, String lastEntryIp, Integer loginNum, String loginLastTime, Integer vipLevel, Integer receiveSms, String remark) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.reallyName = reallyName;
|
this.reallyName = reallyName;
|
||||||
this.telephone = telephone;
|
this.telephone = telephone;
|
||||||
@ -55,6 +57,7 @@ public class SysUserVo implements Serializable {
|
|||||||
this.loginLastTime = loginLastTime;
|
this.loginLastTime = loginLastTime;
|
||||||
this.vipLevel = vipLevel;
|
this.vipLevel = vipLevel;
|
||||||
this.receiveSms = receiveSms;
|
this.receiveSms = receiveSms;
|
||||||
|
this.remark = remark;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@ -176,5 +179,12 @@ public class SysUserVo implements Serializable {
|
|||||||
public void setReceiveSms(Integer receiveSms) {
|
public void setReceiveSms(Integer receiveSms) {
|
||||||
this.receiveSms = receiveSms;
|
this.receiveSms = receiveSms;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
}
|
@ -169,6 +169,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
sysUserEntity.setCountyName(countyName);
|
sysUserEntity.setCountyName(countyName);
|
||||||
sysUserEntity.setVipLevel(0);
|
sysUserEntity.setVipLevel(0);
|
||||||
sysUserEntity.setReceiveSms(0);
|
sysUserEntity.setReceiveSms(0);
|
||||||
|
sysUserEntity.setRemark("");//备注
|
||||||
sysUserDao.save(sysUserEntity);
|
sysUserDao.save(sysUserEntity);
|
||||||
|
|
||||||
RelUserRoleEntity relUserRoleEntity = new RelUserRoleEntity();
|
RelUserRoleEntity relUserRoleEntity = new RelUserRoleEntity();
|
||||||
|
Loading…
Reference in New Issue
Block a user