diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java b/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java index 125141b..4dc3690 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/controller/IUserController.java @@ -15,8 +15,6 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; - /** * I茅台用户Controller * @@ -151,6 +149,6 @@ public R edit(@RequestBody IUser iUser) { @PreAuthorize("@ss.resourceAuth()") @DeleteMapping(value = "/{mobiles}", name = "删除I茅台用户") public R remove(@PathVariable Long[] mobiles) { - return R.ok(iUserMapper.deleteBatchIds(Arrays.asList(mobiles))); + return R.ok(iUserMapper.deleteIUser(mobiles)); } } diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java b/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java index 142174f..c83969c 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/entity/IUser.java @@ -136,7 +136,7 @@ public IUser(Long mobile, String deviceId, JSONObject jsonObject) { this.mobile = mobile; this.token = data.getString("token"); this.cookie = data.getString("cookie"); - this.deviceId = deviceId.toUpperCase(); + this.deviceId = deviceId.toLowerCase(); this.jsonResult = StringUtils.substring(jsonObject.toJSONString(), 0, 2000); if (StringUtils.isEmpty(this.remark)) { diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java b/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java index 1a5d71d..889abbb 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/mapper/IUserMapper.java @@ -70,4 +70,5 @@ default List selectReservationUserByMinute(int minute) { @Select("UPDATE i_user SET `minute` = (SELECT FLOOR(RAND() * 59 + 1)) WHERE random_minute = \"0\"") void updateUserMinuteBatch(); + int deleteIUser(Long[] iUserId); } diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/service/IUserService.java b/campus-modular/src/main/java/com/oddfar/campus/business/service/IUserService.java index ef2a880..76165c3 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/service/IUserService.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/service/IUserService.java @@ -62,5 +62,5 @@ public interface IUserService { * @param iUserId id * @return */ - int deleteIUser(Long iUserId); + int deleteIUser(Long[] iUserId); } diff --git a/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IUserServiceImpl.java b/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IUserServiceImpl.java index cacf414..0e8897f 100644 --- a/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IUserServiceImpl.java +++ b/campus-modular/src/main/java/com/oddfar/campus/business/service/impl/IUserServiceImpl.java @@ -34,7 +34,7 @@ public PageResult page(IUser iUser) { public int insertIUser(Long mobile, String deviceId, JSONObject jsonObject) { JSONObject data = jsonObject.getJSONObject("data"); if (StringUtils.isEmpty(deviceId)) { - deviceId = UUID.randomUUID().toString().toUpperCase(); + deviceId = UUID.randomUUID().toString().toLowerCase(); } IUser user = iUserMapper.selectById(mobile); @@ -73,7 +73,7 @@ public int insertIUser(IUser iUser) { } if (StringUtils.isEmpty(iUser.getDeviceId())) { - iUser.setDeviceId(UUID.randomUUID().toString().toUpperCase()); + iUser.setDeviceId(UUID.randomUUID().toString().toLowerCase()); } iUser.setCreateUser(SecurityUtils.getUserId()); return iUserMapper.insert(iUser); @@ -94,7 +94,7 @@ public void updateUserMinuteBatch() { } @Override - public int deleteIUser(Long iUserId) { - return iUserMapper.deleteById(iUserId); + public int deleteIUser(Long[] iUserId) { + return iUserMapper.deleteIUser(iUserId); } } diff --git a/campus-modular/src/main/resources/mapper/IUserMapper.xml b/campus-modular/src/main/resources/mapper/IUserMapper.xml index 348ec72..0bcfe64 100644 --- a/campus-modular/src/main/resources/mapper/IUserMapper.xml +++ b/campus-modular/src/main/resources/mapper/IUserMapper.xml @@ -3,4 +3,10 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + delete from i_user where mobile in + + #{id} + +