Forráskód Böngészése

vci设备与客户端用户

bmmx 1 éve
szülő
commit
d9042797b7

+ 1 - 1
src/main/java/com/om/controller/admin/AppUserController.java

@@ -81,7 +81,7 @@ public class AppUserController {
         return userService.getPageList(dto);
     }
 
-    @PostMapping("/list")
+    @GetMapping("/list")
     @ApiOperation("获取客户端用户List集合")
     public Result<List<User>> list(){
 

+ 2 - 2
src/main/java/com/om/entity/vo/AppBindVO.java

@@ -9,8 +9,8 @@ import lombok.NoArgsConstructor;
 @Data
 public class AppBindVO {
 
-    private Integer appUserId;
+    private Integer userId;
 
-    private String sn;
+    private String vciSn;
 
 }

+ 13 - 7
src/main/java/com/om/service/impl/UserServiceImpl.java

@@ -163,10 +163,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
                 vciInfoVOList.add(vciInfoVO);
             }
-            if (defaultCount>1){
-                return Result.fail("设备已是默认状态").result(ResultCode.VCI_DEFAULTED);
-            }
-
             userLoginVO.setVciInfoList(vciInfoVOList);
         }
 
@@ -201,7 +197,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             throw new BadReqException("该维修厂不存在");
         }
         addUser.setDistributorName(distributor.getCompany());
-
         this.save(addUser);
 
         return Result.ok();
@@ -319,7 +314,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         Integer userId = user.getId();
 
         User userById = getById(userId);
+        String password = user.getPassword();
         BeanUtil.copyProperties(user, userById);
+        //密码加密
+        try {
+            password = AesUtil.Encrypt(password);
+        } catch (Exception e) {
+            throw new BizException("密码加密出错",ResultCode.PASSWORD_ENCRYPT_ERROR);
+        }
+        if (!password.equals(userById.getPassword())){
+            userById.setPassword(password);
+        }
+
         Integer distributorId = userById.getDistributorId();
         //根据id查询维修厂
         Distributor distributor = distributorService.getById(distributorId);
@@ -454,8 +460,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         if (BeanUtil.isEmpty(bindVO)){
             return Result.error().message("参数为空").result(ResultCode.NO_DATA);
         }
-        Integer userId = bindVO.getAppUserId();
-        String vciNum = bindVO.getSn();
+        Integer userId = bindVO.getUserId();
+        String vciNum = bindVO.getVciSn();
 
         LambdaQueryWrapper<VciInfo> vciInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
         vciInfoLambdaQueryWrapper.eq(VciInfo::getVciNum, vciNum);