diff --git a/src/main/java/com/xkrs/controller/SysUserController.java b/src/main/java/com/xkrs/controller/SysUserController.java index 019ab80..4af9038 100644 --- a/src/main/java/com/xkrs/controller/SysUserController.java +++ b/src/main/java/com/xkrs/controller/SysUserController.java @@ -60,7 +60,7 @@ public class SysUserController { */ @Transactional(rollbackFor = Exception.class) @RequestMapping(value = "/updateSysUser", method = RequestMethod.POST) - public String updateSysUser(@RequestBody Map paramMap) { + public String updateSysUser(@RequestHeader(value = "Authorization") String token, @RequestBody Map paramMap) { String userIdArray = paramMap.get("userIdArray"); String overTime = paramMap.get("overTime"); String remark = paramMap.get("remark"); @@ -395,14 +395,4 @@ public class SysUserController { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "true", locale); } - /** - * 修改账号到期时间 - */ - @PostMapping("/updateOverTime") - public String updateOverTime(@RequestBody Map map, @RequestHeader(value = "Authorization") String token) { - Long userId = (Long) map.get("userId"); - String overTime = (String) map.get("overTime"); - return sysUserService.updateOverTime(userId, overTime); - } - } diff --git a/src/main/java/com/xkrs/dao/SysUserDao.java b/src/main/java/com/xkrs/dao/SysUserDao.java index 7d2e6e4..1e8b6e2 100644 --- a/src/main/java/com/xkrs/dao/SysUserDao.java +++ b/src/main/java/com/xkrs/dao/SysUserDao.java @@ -76,13 +76,6 @@ public interface SysUserDao extends JpaRepository, JpaSpeci @Query(value = "select * from sys_user where id = ?", nativeQuery = true) SysUserEntity selectByUserId(Long userId); - /** - * 根据id修改账户的到期时间 - */ - @Query(value = "update sys_user set over_time = ?2 where id = ?1", nativeQuery = true) - @Modifying(clearAutomatically = true) - void updateOverTime(Long userId, String overTime); - /** * 记录用户登录次数 */ diff --git a/src/main/java/com/xkrs/service/SysUserService.java b/src/main/java/com/xkrs/service/SysUserService.java index 9c2193b..e9e55a3 100644 --- a/src/main/java/com/xkrs/service/SysUserService.java +++ b/src/main/java/com/xkrs/service/SysUserService.java @@ -1,7 +1,7 @@ package com.xkrs.service; -import com.xkrs.model.qo.SysUserQo; import com.xkrs.model.entity.SysUserEntity; +import com.xkrs.model.qo.SysUserQo; import javax.servlet.http.HttpServletRequest; import java.util.List; @@ -109,15 +109,6 @@ public interface SysUserService { */ SysUserEntity getUserByUserName(String userName); - /** - * 修改账号到期时间 - * - * @param userId - * @param overTime - * @return - */ - String updateOverTime(Long userId, String overTime); - /** * 记录用户登录次数 * diff --git a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java index e218585..5a26599 100644 --- a/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/SysUserServiceImpl.java @@ -1,18 +1,10 @@ package com.xkrs.service.impl; import com.xkrs.common.encapsulation.PromptMessageEnum; -import com.xkrs.dao.StreetDao; -import com.xkrs.model.entity.StreetEntity; +import com.xkrs.dao.*; +import com.xkrs.model.entity.*; import com.xkrs.model.qo.SysUserQo; import com.xkrs.service.RedisService; -import com.xkrs.dao.RelRoleAuthorityDao; -import com.xkrs.dao.RelUserRoleDao; -import com.xkrs.dao.SysRoleDao; -import com.xkrs.dao.SysUserDao; -import com.xkrs.model.entity.RelRoleAuthorityEntity; -import com.xkrs.model.entity.RelUserRoleEntity; -import com.xkrs.model.entity.SysRoleEntity; -import com.xkrs.model.entity.SysUserEntity; import com.xkrs.service.SysUserService; import com.xkrs.utilsnew.VipTimeRangeUtils; import org.apache.http.util.TextUtils; @@ -32,8 +24,8 @@ import java.util.List; import java.util.Locale; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; -import static com.xkrs.utilsold.DateTimeUtil.dateTimeToString; import static com.xkrs.utilsnew.EncryptDecryptUtil.encry256; +import static com.xkrs.utilsold.DateTimeUtil.dateTimeToString; /** * 系统用户服务实现 @@ -302,16 +294,6 @@ public class SysUserServiceImpl implements SysUserService { return sysUserEntityList.get(0); } - /** - * 修改账号到期时间 - */ - @Transactional(rollbackFor = Exception.class) - @Override - public String updateOverTime(Long userId, String overTime) { - sysUserDao.updateOverTime(userId, overTime); - return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功", locale); - } - /** * 记录用户登录次数 */