From 5f349fe34e3e33625f8593ec1b616f0c4528a12c Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期一, 27 九月 2021 10:33:45 +0800
Subject: [PATCH] Merge branch 'test' into 'test_bak'

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   64 ++++++++++++++++++++------------
 1 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
index e6bf2c5..9028f7d 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -1090,6 +1090,8 @@
                     throw new ServiceException("手机号已经存在");
                 } else if (e.getMessage().contains("union_account_type")) {
                     throw new ServiceException("账户已经存在");
+                }else if(e.getMessage().contains("23000")){
+                    throw new ServiceException("手机号已存在");
                 }
 
             }
@@ -2564,6 +2566,20 @@
         return R.fail();
     }
 
+    @Override
+    public R resetPasswordPatch(Long[] userId,String password) {
+        if(userId!=null){
+            for(Long user:userId){
+                SysUserDO sysUserDO = new SysUserDO();
+                sysUserDO.setUserId(user);
+                String encode = new BCryptPasswordEncoder().encode(password);
+                sysUserDO.setPassword(encode);
+                userDao.updateById(sysUserDO);
+            }
+        }
+        return R.ok();
+    }
+
     /**
      * 便民服务新增商家账号
      * @param convenientMerchantDTO
@@ -2628,34 +2644,34 @@
     }
 
     /**
-     * 修改便民服务商家绑定账号
-     * @param userId 用户id
-     * @param account 修改账户
-     * @return 修改结果
-     */
-    @Override
-    public R putUserAccount(Long userId, String account) {
-        SysUserDO sysUserDO = userDao.selectById(userId);
-        if (isNull(sysUserDO)) {
-            return R.fail("用户不存在");
-        }
-        String oldAccount = sysUserDO.getAccount();
-        sysUserDO.setAccount(account);
-        int result = userDao.updateById(sysUserDO);
-        if (result > 0) {
-            SysRoleDO sysRoleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>()
-                    .lambda().eq(SysRoleDO::getRoleKey, Constants.CONVENIENT_MERCHANT_ROLE_KEY + oldAccount));
-            if (nonNull(sysRoleDO)) {
-                sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + account);
-                roleDAO.updateById(sysRoleDO);
-            }
-        }
-        return R.ok();
+ * 修改便民服务商家绑定账号
+ * @param userId 用户id
+ * @param account 修改账户
+ * @return 修改结果
+ */
+@Override
+public R putUserAccount(Long userId, String account) {
+    SysUserDO sysUserDO = userDao.selectById(userId);
+    if (isNull(sysUserDO)) {
+        return R.fail("用户不存在");
     }
+    String oldAccount = sysUserDO.getAccount();
+    sysUserDO.setAccount(account);
+    int result = userDao.updateById(sysUserDO);
+    if (result > 0) {
+        SysRoleDO sysRoleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>()
+                .lambda().eq(SysRoleDO::getRoleKey, Constants.CONVENIENT_MERCHANT_ROLE_KEY + oldAccount));
+        if (nonNull(sysRoleDO)) {
+            sysRoleDO.setRoleKey(Constants.CONVENIENT_MERCHANT_ROLE_KEY + account);
+            roleDAO.updateById(sysRoleDO);
+        }
+    }
+    return R.ok();
+}
 
     @Override
     public R disableOrEnableMerchantUsers(DisableOrEnableConvenientMerchantDTO disableOrEnableConvenientMerchantDTO) {
-        userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getIds());
+        userDao.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO.getType(), disableOrEnableConvenientMerchantDTO.getUserIds());
         return R.ok();
     }
 }

--
Gitblit v1.7.1