From 6eedee7783ed45d5238dc72a9569cc1f33a77e3a Mon Sep 17 00:00:00 2001 From: xy <748613696@qq.com> Date: Thu, 18 Jun 2026 15:29:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(user):=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B3=A8=E5=86=8C=E9=80=BB=E8=BE=91=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0Redis=E9=94=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改设备模板和监测点位置的Redis键格式,统一添加冒号后缀 - 移除未使用的ResponseEntity导入 - 简化用户注册流程,移除重复的手机号验证逻辑 - 在网关配置中添加新的白名单接口路径 --- .../njcn/redis/pojo/enums/AppRedisKey.java | 4 +- .../src/main/resources/bootstrap-sjzx.yml | 1 + .../user/service/impl/AppUserServiceImpl.java | 56 ++++++++----------- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java index 715f249db..e4d04397d 100644 --- a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java +++ b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java @@ -13,7 +13,7 @@ public interface AppRedisKey { /** * 设备模板前缀 */ - String MODEL = "MODEL"; + String MODEL = "MODEL:"; /** @@ -39,7 +39,7 @@ public interface AppRedisKey { /** * 监测点位置数据 */ - String LINE_POSITION = "LINEPOSITION"; + String LINE_POSITION = "LINEPOSITION:"; /** * rocketMQ消费key diff --git a/pqs-gateway/src/main/resources/bootstrap-sjzx.yml b/pqs-gateway/src/main/resources/bootstrap-sjzx.yml index 441af6c47..741462103 100644 --- a/pqs-gateway/src/main/resources/bootstrap-sjzx.yml +++ b/pqs-gateway/src/main/resources/bootstrap-sjzx.yml @@ -249,6 +249,7 @@ whitelist: - /harmonic-boot/comAccess/getComAccessData - /harmonic-boot/harmonic/getHistoryResult - /event-boot/transient/getTransientAnalyseWave + - /cs-system-boot/appVersion/getLastData # - /** #开始 # - /advance-boot/** diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/AppUserServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/AppUserServiceImpl.java index 8636e4378..4653f9205 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/AppUserServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/AppUserServiceImpl.java @@ -25,7 +25,6 @@ import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -106,37 +105,30 @@ public class AppUserServiceImpl extends ServiceImpl impleme throw new BusinessException(UserResponseEnum.DEV_CODE_WRONG); } judgeCode(phone, code); - String password = null; - //先根据手机号查询是否已被注册 - User user = this.lambdaQuery().eq(User::getPhone,phone).ne(User::getState,0).one(); - if (!Objects.isNull(user)){ - throw new BusinessException(UserResponseEnum.REGISTER_PHONE_REPEAT); - } else { - //新增用户配置表 - UserSet userSet = userSetService.addAppUserSet(); - //新增用户表 - User newUser = cloneUserBoToUser(phone,devCode,userSet); - //新增用户角色关系表 - Role role = roleService.getRoleByCode(AppRoleEnum.TOURIST.getCode()); - userRoleService.addUserRole(newUser.getId(), Collections.singletonList(role.getId())); - //消息默认配置 - AppInfoSet appInfoSet = new AppInfoSet(); - appInfoSet.setUserId(newUser.getId()); - appInfoSet.setHarmonicInfo(1); - appInfoSet.setEventInfo(1); - appInfoSet.setRunInfo(1); - appInfoSet.setAlarmInfo(1); - appInfoSet.setIticFunction(0); - appInfoSet.setF47Function(0); - appInfoSetService.save(appInfoSet); - //发送用户初始密码 - password = redisUtil.getStringByKey(newUser.getId()); - String content = SmsUtil.getLianTongMessageTemplate("3", password); - smsSendService.sendSmsWithRetry(phone,content,"verify_code"); - redisUtil.delete(newUser.getId()); - //删除验证码 - deleteCode(phone); - } + //新增用户配置表 + UserSet userSet = userSetService.addAppUserSet(); + //新增用户表 + User newUser = cloneUserBoToUser(phone,devCode,userSet); + //新增用户角色关系表 + Role role = roleService.getRoleByCode(AppRoleEnum.TOURIST.getCode()); + userRoleService.addUserRole(newUser.getId(), Collections.singletonList(role.getId())); + //消息默认配置 + AppInfoSet appInfoSet = new AppInfoSet(); + appInfoSet.setUserId(newUser.getId()); + appInfoSet.setHarmonicInfo(1); + appInfoSet.setEventInfo(1); + appInfoSet.setRunInfo(1); + appInfoSet.setAlarmInfo(1); + appInfoSet.setIticFunction(0); + appInfoSet.setF47Function(0); + appInfoSetService.save(appInfoSet); + //发送用户初始密码 + String password = redisUtil.getStringByKey(newUser.getId()); + String content = SmsUtil.getLianTongMessageTemplate("3", password); + smsSendService.sendSmsWithRetry(phone,content,"verify_code"); + redisUtil.delete(newUser.getId()); + //删除验证码 + deleteCode(phone); } @Override