重构用户实体类
This commit is contained in:
parent
bde50770ca
commit
54faad2d67
@ -332,7 +332,7 @@ public class SysUserController {
|
|||||||
@PostMapping("/adminUpdatePassword")
|
@PostMapping("/adminUpdatePassword")
|
||||||
public String adminUpdatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
public String adminUpdatePassword(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
||||||
// 要修改的用户的id
|
// 要修改的用户的id
|
||||||
Integer userId = (Integer) map.get("userId");
|
Long userId = (Long) map.get("userId");
|
||||||
String newPassword = (String) map.get("newPassword");
|
String newPassword = (String) map.get("newPassword");
|
||||||
String confirmPassword = (String) map.get("confirmPassword");
|
String confirmPassword = (String) map.get("confirmPassword");
|
||||||
// 验证token
|
// 验证token
|
||||||
@ -416,7 +416,7 @@ public class SysUserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/updateExpireDate")
|
@PostMapping("/updateExpireDate")
|
||||||
public String updateExpireDate(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
public String updateExpireDate(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
||||||
Integer userId = (Integer) map.get("userId");
|
Long userId = (Long) map.get("userId");
|
||||||
Integer timeNum = (Integer) map.get("timeNum");
|
Integer timeNum = (Integer) map.get("timeNum");
|
||||||
String keepType = (String) map.get("keepType");
|
String keepType = (String) map.get("keepType");
|
||||||
if ("1".equals(keepType)) {
|
if ("1".equals(keepType)) {
|
||||||
@ -435,7 +435,7 @@ public class SysUserController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/updateOverTime")
|
@PostMapping("/updateOverTime")
|
||||||
public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) {
|
||||||
Integer userId = (Integer) map.get("userId");
|
Long userId = (Long) map.get("userId");
|
||||||
String overTime = (String) map.get("overTime");
|
String overTime = (String) map.get("overTime");
|
||||||
return sysUserService.updateOverTime(userId, overTime);
|
return sysUserService.updateOverTime(userId, overTime);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public interface RelRoleAuthorityDao extends JpaRepository<RelRoleAuthorityEntit
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Query(value = "select authority_id from rel_role_authority where user_id = ?", nativeQuery = true)
|
@Query(value = "select authority_id from rel_role_authority where user_id = ?", nativeQuery = true)
|
||||||
List<Integer> selectAuthorityByUserId(@Param("userId") Integer userId);
|
List<Integer> selectAuthorityByUserId(@Param("userId") Long userId);
|
||||||
|
|
||||||
@Query(value = "SELECT * FROM rel_role_authority WHERE authority_id = ?1", nativeQuery = true)
|
@Query(value = "SELECT * FROM rel_role_authority WHERE authority_id = ?1", nativeQuery = true)
|
||||||
List<RelRoleAuthorityEntity> selectByAuthorityId(Integer authorityId);
|
List<RelRoleAuthorityEntity> selectByAuthorityId(Integer authorityId);
|
||||||
|
@ -98,40 +98,40 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Integer>, JpaSp
|
|||||||
*/
|
*/
|
||||||
@Query(value = "update sys_user set password = ?2 where id = ?1", nativeQuery = true)
|
@Query(value = "update sys_user set password = ?2 where id = ?1", nativeQuery = true)
|
||||||
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
||||||
void updatePassword(Integer userId, String newPassword);
|
void updatePassword(Long userId, String newPassword);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询用户的信息
|
* 根据id查询用户的信息
|
||||||
*/
|
*/
|
||||||
@Query(value = "select * from sys_user where id = ?", nativeQuery = true)
|
@Query(value = "select * from sys_user where id = ?", nativeQuery = true)
|
||||||
SysUserEntity selectByUserId(Integer userId);
|
SysUserEntity selectByUserId(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id修改账户的到期时间
|
* 根据id修改账户的到期时间
|
||||||
*/
|
*/
|
||||||
@Query(value = "update sys_user set over_time = ?2 where id = ?1", nativeQuery = true)
|
@Query(value = "update sys_user set over_time = ?2 where id = ?1", nativeQuery = true)
|
||||||
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
||||||
void updateOverTime(Integer userId, String overTime);
|
void updateOverTime(Long userId, String overTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将账户的期限修改为永久有效
|
* 将账户的期限修改为永久有效
|
||||||
*/
|
*/
|
||||||
@Query(value = "update sys_user set over_time = '永久' and day_num = 1 where id = ?", nativeQuery = true)
|
@Query(value = "update sys_user set over_time = '永久' and day_num = 1 where id = ?", nativeQuery = true)
|
||||||
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
||||||
void updateDayNum(Integer userId);
|
void updateDayNum(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录用户登录次数
|
* 记录用户登录次数
|
||||||
*/
|
*/
|
||||||
@Query(value = "update sys_user set login_num = ?2 where id = ?1", nativeQuery = true)
|
@Query(value = "update sys_user set login_num = ?2 where id = ?1", nativeQuery = true)
|
||||||
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
||||||
void updateLoginNum(Integer userId, Integer loginNum);
|
void updateLoginNum(Long userId, Integer loginNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改登陆时间
|
* 修改登陆时间
|
||||||
*/
|
*/
|
||||||
@Query(value = "update sys_user set login_last_time = ?2 where id = ?1", nativeQuery = true)
|
@Query(value = "update sys_user set login_last_time = ?2 where id = ?1", nativeQuery = true)
|
||||||
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
||||||
void updateLoginLastTime(Integer userId, String loginLastTime);
|
void updateLoginLastTime(Long userId, String loginLastTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,11 @@ import java.io.Serializable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* RelRoleAuthority 表实体类
|
* RelRoleAuthority 表实体类
|
||||||
|
*
|
||||||
* @author tajochen
|
* @author tajochen
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name="rel_role_authority")
|
@Table(name = "rel_role_authority")
|
||||||
public class RelRoleAuthorityEntity implements Serializable {
|
public class RelRoleAuthorityEntity implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +17,7 @@ public class RelRoleAuthorityEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_role_authority_seq_gen")
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "rel_role_authority_seq_gen")
|
||||||
@SequenceGenerator(name = "rel_role_authority_seq_gen", sequenceName = "rel_role_authority_id_seq",allocationSize = 1)
|
@SequenceGenerator(name = "rel_role_authority_seq_gen", sequenceName = "rel_role_authority_id_seq", allocationSize = 1)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
@ -25,7 +26,10 @@ public class RelRoleAuthorityEntity implements Serializable {
|
|||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private Integer authorityId;
|
private Integer authorityId;
|
||||||
|
|
||||||
private Integer userId;
|
private Long userId;
|
||||||
|
|
||||||
|
public RelRoleAuthorityEntity() {
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -51,21 +55,16 @@ public class RelRoleAuthorityEntity implements Serializable {
|
|||||||
this.authorityId = authorityId;
|
this.authorityId = authorityId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUserId() {
|
public Long getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserId(Integer userId) {
|
public void setUserId(Long userId) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "RelRoleAuthorityEntity{" +
|
return "RelRoleAuthorityEntity{" + "id=" + id + ", roleId=" + roleId + ", authorityId=" + authorityId + ", userId=" + userId + '}';
|
||||||
"id=" + id +
|
|
||||||
", roleId=" + roleId +
|
|
||||||
", authorityId=" + authorityId +
|
|
||||||
", userId=" + userId +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,7 @@ package com.xkrs.model.entity;
|
|||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SysUser 表实体类
|
|
||||||
*
|
|
||||||
* @author tajochen
|
|
||||||
*/
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "sys_user")
|
@Table(name = "sys_user")
|
||||||
public class SysUserEntity implements Serializable {
|
public class SysUserEntity implements Serializable {
|
||||||
@ -20,60 +13,49 @@ public class SysUserEntity implements Serializable {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen")
|
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sys_user_seq_gen")
|
||||||
@SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq", allocationSize = 1)
|
@SequenceGenerator(name = "sys_user_seq_gen", sequenceName = "sys_user_id_seq", allocationSize = 1)
|
||||||
private Integer id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
@Column(length = 16, nullable = false, unique = true, columnDefinition = "varchar(16)")
|
@Column(nullable = false, unique = true)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户真实姓名
|
* 用户真实姓名
|
||||||
*/
|
*/
|
||||||
@Column(length = 32, columnDefinition = "varchar(32)")
|
|
||||||
private String reallyName;
|
private String reallyName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
@Column(length = 64, nullable = false, columnDefinition = "varchar(64)")
|
@Column(nullable = false)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
@Column(length = 32, nullable = false, columnDefinition = "varchar(32)")
|
@Column(nullable = false)
|
||||||
private String salt;
|
private String salt;
|
||||||
|
|
||||||
@Column(length = 16, unique = true, columnDefinition = "varchar(16)")
|
@Column(unique = true)
|
||||||
private String telephone;
|
private String telephone;
|
||||||
|
|
||||||
@Column(length = 32, columnDefinition = "varchar(32)")
|
|
||||||
private String countyCode;
|
private String countyCode;
|
||||||
|
|
||||||
@Column(columnDefinition = "varchar(192)")
|
|
||||||
private String signature;
|
private String signature;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private Integer activeFlag;
|
private Integer activeFlag;
|
||||||
|
|
||||||
@Column(nullable = false, columnDefinition = "smallint")
|
@Column(nullable = false)
|
||||||
private Integer statusCode;
|
private Integer statusCode;
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String addTime;
|
private String addTime;
|
||||||
|
|
||||||
private LocalDateTime lastEntryTime;
|
|
||||||
|
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private Integer deleteFlag;
|
private Integer deleteFlag;
|
||||||
|
|
||||||
@Column(columnDefinition = "varchar(64)")
|
|
||||||
private String lastEntryIp;
|
private String lastEntryIp;
|
||||||
|
|
||||||
/**
|
|
||||||
* 账号的使用天数
|
|
||||||
*/
|
|
||||||
private Integer dayNum;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号到期的时间
|
* 账号到期的时间
|
||||||
*/
|
*/
|
||||||
@ -82,10 +64,8 @@ public class SysUserEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 账号类别
|
* 账号类别
|
||||||
*/
|
*/
|
||||||
@Column(length = 64, columnDefinition = "varchar(64)")
|
|
||||||
private String accountType;
|
private String accountType;
|
||||||
|
|
||||||
@Column(length = 64, columnDefinition = "varchar(64)")
|
|
||||||
private String countyName;
|
private String countyName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -134,14 +114,20 @@ public class SysUserEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String pushRegID;
|
private String pushRegID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VIP时间范围列表Json
|
||||||
|
*/
|
||||||
|
@Column(columnDefinition = "varchar(10240)")
|
||||||
|
private String vipTimeRangeJson;
|
||||||
|
|
||||||
public SysUserEntity() {
|
public SysUserEntity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Integer id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,14 +211,6 @@ public class SysUserEntity implements Serializable {
|
|||||||
this.addTime = addTime;
|
this.addTime = addTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalDateTime getLastEntryTime() {
|
|
||||||
return lastEntryTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLastEntryTime(LocalDateTime lastEntryTime) {
|
|
||||||
this.lastEntryTime = lastEntryTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getDeleteFlag() {
|
public Integer getDeleteFlag() {
|
||||||
return deleteFlag;
|
return deleteFlag;
|
||||||
}
|
}
|
||||||
@ -249,14 +227,6 @@ public class SysUserEntity implements Serializable {
|
|||||||
this.lastEntryIp = lastEntryIp;
|
this.lastEntryIp = lastEntryIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getDayNum() {
|
|
||||||
return dayNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDayNum(Integer dayNum) {
|
|
||||||
this.dayNum = dayNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOverTime() {
|
public String getOverTime() {
|
||||||
return overTime;
|
return overTime;
|
||||||
}
|
}
|
||||||
@ -353,8 +323,16 @@ public class SysUserEntity implements Serializable {
|
|||||||
this.pushRegID = pushRegID;
|
this.pushRegID = pushRegID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getVipTimeRangeJson() {
|
||||||
|
return vipTimeRangeJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVipTimeRangeJson(String vipTimeRangeJson) {
|
||||||
|
this.vipTimeRangeJson = vipTimeRangeJson;
|
||||||
|
}
|
||||||
|
|
||||||
@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 + ", remark='" + remark + '\'' + ", agentOrgId=" + agentOrgId + ", pushUserAccount='" + pushUserAccount + '\'' + ", pushRegID='" + pushRegID + '\'' + '}';
|
return "SysUserEntity{" + "id=" + id + ", userName='" + userName + '\'' + ", reallyName='" + reallyName + '\'' + ", password='" + password + '\'' + ", salt='" + salt + '\'' + ", telephone='" + telephone + '\'' + ", countyCode='" + countyCode + '\'' + ", signature='" + signature + '\'' + ", activeFlag=" + activeFlag + ", statusCode=" + statusCode + ", addTime='" + addTime + '\'' + ", deleteFlag=" + deleteFlag + ", lastEntryIp='" + lastEntryIp + '\'' + ", overTime='" + overTime + '\'' + ", accountType='" + accountType + '\'' + ", countyName='" + countyName + '\'' + ", loginNum=" + loginNum + ", loginLastTime='" + loginLastTime + '\'' + ", userAgent='" + userAgent + '\'' + ", vipLevel=" + vipLevel + ", receiveSms=" + receiveSms + ", remark='" + remark + '\'' + ", agentOrgId=" + agentOrgId + ", pushUserAccount='" + pushUserAccount + '\'' + ", pushRegID='" + pushRegID + '\'' + ", vipTimeRangeJson='" + vipTimeRangeJson + '\'' + '}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,14 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统权限服务接口
|
* 系统权限服务接口
|
||||||
|
*
|
||||||
* @author tajochen
|
* @author tajochen
|
||||||
*/
|
*/
|
||||||
public interface SysAuthorityService {
|
public interface SysAuthorityService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取权限实体列表根据用户名
|
* 获取权限实体列表根据用户名
|
||||||
|
*
|
||||||
* @param userName
|
* @param userName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -19,5 +21,5 @@ public interface SysAuthorityService {
|
|||||||
|
|
||||||
List<SysAuthorityEntity> findAllByIdIn(List<Integer> id);
|
List<SysAuthorityEntity> findAllByIdIn(List<Integer> id);
|
||||||
|
|
||||||
List<Integer> selectAuthorityByUserId(Integer userId);
|
List<Integer> selectAuthorityByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public interface SysUserService {
|
|||||||
* @param confirmPassword
|
* @param confirmPassword
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String adminUpdatePassword(Integer userId, String newPassword, String confirmPassword);
|
String adminUpdatePassword(Long userId, String newPassword, String confirmPassword);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取系统用户实体根据用户名
|
* 获取系统用户实体根据用户名
|
||||||
@ -135,7 +135,7 @@ public interface SysUserService {
|
|||||||
* @param dayNum
|
* @param dayNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String updateExpireDateDay(Integer userId, Integer dayNum);
|
String updateExpireDateDay(Long userId, Integer dayNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按月份修改账号到期时间
|
* 按月份修改账号到期时间
|
||||||
@ -144,7 +144,7 @@ public interface SysUserService {
|
|||||||
* @param dayNum
|
* @param dayNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String updateExpireDateMonth(Integer userId, Integer dayNum);
|
String updateExpireDateMonth(Long userId, Integer dayNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按年份修改账号到期时间
|
* 按年份修改账号到期时间
|
||||||
@ -153,7 +153,7 @@ public interface SysUserService {
|
|||||||
* @param dayNum
|
* @param dayNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String updateExpireDateYear(Integer userId, Integer dayNum);
|
String updateExpireDateYear(Long userId, Integer dayNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置账号时间永久有效
|
* 设置账号时间永久有效
|
||||||
@ -161,7 +161,7 @@ public interface SysUserService {
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String updatePermanent(Integer userId);
|
String updatePermanent(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改账号到期时间
|
* 修改账号到期时间
|
||||||
@ -170,7 +170,7 @@ public interface SysUserService {
|
|||||||
* @param overTime
|
* @param overTime
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String updateOverTime(Integer userId, String overTime);
|
String updateOverTime(Long userId, String overTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录用户登录次数
|
* 记录用户登录次数
|
||||||
@ -178,7 +178,7 @@ public interface SysUserService {
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @param loginNum
|
* @param loginNum
|
||||||
*/
|
*/
|
||||||
void updateLoginNum(Integer userId, Integer loginNum);
|
void updateLoginNum(Long userId, Integer loginNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录用户登录时间
|
* 记录用户登录时间
|
||||||
@ -186,6 +186,6 @@ public interface SysUserService {
|
|||||||
* @param userId
|
* @param userId
|
||||||
* @param loginLastTime
|
* @param loginLastTime
|
||||||
*/
|
*/
|
||||||
void updateLoginLastTime(Integer userId, String loginLastTime);
|
void updateLoginLastTime(Long userId, String loginLastTime);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,6 @@ import com.xkrs.dao.RelRoleAuthorityDao;
|
|||||||
import com.xkrs.dao.SysAuthorityDao;
|
import com.xkrs.dao.SysAuthorityDao;
|
||||||
import com.xkrs.model.entity.SysAuthorityEntity;
|
import com.xkrs.model.entity.SysAuthorityEntity;
|
||||||
import com.xkrs.service.SysAuthorityService;
|
import com.xkrs.service.SysAuthorityService;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -13,6 +11,7 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统权限服务实现
|
* 系统权限服务实现
|
||||||
|
*
|
||||||
* @author tajochen
|
* @author tajochen
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@ -35,7 +34,7 @@ public class SysAuthorityServiceImpl implements SysAuthorityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Integer> selectAuthorityByUserId(Integer userId) {
|
public List<Integer> selectAuthorityByUserId(Long userId) {
|
||||||
return relRoleAuthorityDao.selectAuthorityByUserId(userId);
|
return relRoleAuthorityDao.selectAuthorityByUserId(userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,6 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
sysUserEntity.setStatusCode(0);
|
sysUserEntity.setStatusCode(0);
|
||||||
sysUserEntity.setAddTime(dateTimeToString(LocalDateTime.now()));
|
sysUserEntity.setAddTime(dateTimeToString(LocalDateTime.now()));
|
||||||
sysUserEntity.setDeleteFlag(0);
|
sysUserEntity.setDeleteFlag(0);
|
||||||
sysUserEntity.setDayNum(7);
|
|
||||||
sysUserEntity.setLoginNum(0);
|
sysUserEntity.setLoginNum(0);
|
||||||
sysUserEntity.setCountyCode(countyCode);
|
sysUserEntity.setCountyCode(countyCode);
|
||||||
sysUserEntity.setCountyName(countyName);
|
sysUserEntity.setCountyName(countyName);
|
||||||
@ -196,7 +195,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
sysUserDao.save(sysUserEntity);
|
sysUserDao.save(sysUserEntity);
|
||||||
|
|
||||||
RelUserRoleEntity relUserRoleEntity = new RelUserRoleEntity();
|
RelUserRoleEntity relUserRoleEntity = new RelUserRoleEntity();
|
||||||
relUserRoleEntity.setUserId(sysUserEntity.getId().longValue());
|
relUserRoleEntity.setUserId(sysUserEntity.getId());
|
||||||
relUserRoleEntity.setRoleId(2);
|
relUserRoleEntity.setRoleId(2);
|
||||||
|
|
||||||
RelRoleAuthorityEntity relRoleAuthorityEntity = new RelRoleAuthorityEntity();
|
RelRoleAuthorityEntity relRoleAuthorityEntity = new RelRoleAuthorityEntity();
|
||||||
@ -335,7 +334,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String adminUpdatePassword(Integer userId, String newPassword, String confirmPassword) {
|
public String adminUpdatePassword(Long userId, String newPassword, String confirmPassword) {
|
||||||
if (!newPassword.equals(confirmPassword)) {
|
if (!newPassword.equals(confirmPassword)) {
|
||||||
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "两次密码输入不一致", locale);
|
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, "两次密码输入不一致", locale);
|
||||||
}
|
}
|
||||||
@ -359,7 +358,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String updateExpireDateDay(Integer userId, Integer dayNum) {
|
public String updateExpireDateDay(Long userId, Integer dayNum) {
|
||||||
long l = dayNum.longValue();
|
long l = dayNum.longValue();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
||||||
@ -386,7 +385,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String updateExpireDateMonth(Integer userId, Integer dayNum) {
|
public String updateExpireDateMonth(Long userId, Integer dayNum) {
|
||||||
long l = dayNum.longValue();
|
long l = dayNum.longValue();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
||||||
@ -413,7 +412,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String updateExpireDateYear(Integer userId, Integer dayNum) {
|
public String updateExpireDateYear(Long userId, Integer dayNum) {
|
||||||
long l = dayNum.longValue();
|
long l = dayNum.longValue();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
SysUserEntity sysUserEntity = sysUserDao.selectByUserId(userId);
|
||||||
@ -439,7 +438,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String updatePermanent(Integer userId) {
|
public String updatePermanent(Long userId) {
|
||||||
sysUserDao.updateDayNum(userId);
|
sysUserDao.updateDayNum(userId);
|
||||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
||||||
}
|
}
|
||||||
@ -453,7 +452,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public String updateOverTime(Integer userId, String overTime) {
|
public String updateOverTime(Long userId, String overTime) {
|
||||||
sysUserDao.updateOverTime(userId, overTime);
|
sysUserDao.updateOverTime(userId, overTime);
|
||||||
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale);
|
||||||
}
|
}
|
||||||
@ -466,7 +465,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void updateLoginNum(Integer userId, Integer loginNum) {
|
public void updateLoginNum(Long userId, Integer loginNum) {
|
||||||
sysUserDao.updateLoginNum(userId, loginNum);
|
sysUserDao.updateLoginNum(userId, loginNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -478,7 +477,7 @@ public class SysUserServiceImpl implements SysUserService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void updateLoginLastTime(Integer userId, String loginLastTime) {
|
public void updateLoginLastTime(Long userId, String loginLastTime) {
|
||||||
sysUserDao.updateLoginLastTime(userId, loginLastTime);
|
sysUserDao.updateLoginLastTime(userId, loginLastTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user