From 6e907cce72e42a349123800d697aa99f3360783e Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期四, 17 十一月 2022 15:58:46 +0800
Subject: [PATCH] Merge branch 'local_20221104' into huacheng_test

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java |   48 +++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 45 insertions(+), 3 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 36aee16..15f8cd4 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
@@ -331,6 +331,14 @@
             return R.fail();
         }
         LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
+        //获取后台商家user
+        SysUserDO sysUser = userDao.selectOne(
+                new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType, 5).eq(SysUserDO::getPhone, sysUserDO.getPhone()).eq(SysUserDO::getAppId, appId));
+        //判断是否是商家账号
+        if (nonNull(sysUser)){
+            loginUserInfoVO.setBackstageUserId(sysUser.getUserId());
+            loginUserInfoVO.setBackstageType(5);
+        }
         if (nonNull(sysUserDO.getStreetId())){
             loginUserInfoVO.setStreetId(sysUserDO.getStreetId());
         }
@@ -369,6 +377,13 @@
             int i = userDao.isDpcMember(sysUserDO.getPhone(), sysUserDO.getName());
             if (i>0){
                 loginUserInfoVO.setIsDpcMember(1);
+            }
+        }
+        //是否为物业公司账号
+        if (nonNull(sysUserDO.getPhone())){
+            Long propertyAccount = userDao.isPropertyAccount(sysUserDO.getPhone());
+            if (nonNull(propertyAccount)){
+                loginUserInfoVO.setPropertyId(propertyAccount);
             }
         }
         return R.ok(loginUserInfoVO);
@@ -523,6 +538,21 @@
             int i = userDao.isDpcMember(phone, sysUserDO.getName());
             if (i>0){
                 loginUserInfoVO.setIsDpcMember(1);
+            }
+        }
+        //获取后台商家user
+        SysUserDO sysUser = userDao.selectOne(
+                new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getType, 5).eq(SysUserDO::getPhone, sysUserDO.getPhone()).eq(SysUserDO::getAppId, "wx118de8a734d269f0"));
+        //判断是否是商家账号
+        if (nonNull(sysUser)){
+            loginUserInfoVO.setBackstageUserId(sysUser.getUserId());
+            loginUserInfoVO.setBackstageType(5);
+        }
+        //是否为物业公司账号
+        if (nonNull(sysUserDO.getPhone())){
+            Long propertyAccount = userDao.isPropertyAccount(sysUserDO.getPhone());
+            if (nonNull(propertyAccount)){
+                loginUserInfoVO.setPropertyId(propertyAccount);
             }
         }
         return R.ok(loginUserInfoVO);
@@ -1364,6 +1394,7 @@
         log.info("======================type"+administratorsUserVO.getType());
         if (administratorsUserVO.getType().equals(20)){
             roleId=1559112102373756548L;
+            administratorsUserVO.setType(3);
         }
         log.info("=======================roleId"+roleId);
         SysRoleDO roleDO = roleDAO.selectById(roleId);
@@ -2856,7 +2887,8 @@
     @Transactional(rollbackFor = Exception.class)
     public R addConvenientMerchantUser(ConvenientMerchantDTO convenientMerchantDTO) {
         SysUserDO sysUserDO;
-        sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, convenientMerchantDTO.getAccount()));
+        sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, convenientMerchantDTO.getAccount())
+                .eq(SysUserDO::getPhone,convenientMerchantDTO.getMobilePhone()).eq(SysUserDO::getAppId,"wx118de8a734d269f0"));
         if (nonNull(sysUserDO)) {
             return R.fail("账户已经存在");
         }
@@ -2865,10 +2897,10 @@
         String encode = new BCryptPasswordEncoder().encode(convenientMerchantDTO.getPassword());
         BeanUtils.copyProperties(convenientMerchantDTO, sysUserDO);
         sysUserDO.setAccount(convenientMerchantDTO.getAccount());
-        sysUserDO.setType(10);
+        sysUserDO.setType(5);
         sysUserDO.setAreaId(null);
         sysUserDO.setStatus(1);
-        sysUserDO.setPhone(null);
+        sysUserDO.setPhone(convenientMerchantDTO.getMobilePhone());
         sysUserDO.setName(convenientMerchantDTO.getContacts());
         sysUserDO.setPassword(encode);
         try {
@@ -3973,6 +4005,16 @@
         return R.ok(sysUserFeedbackDOS);
     }
 
+    @Override
+    public R propertyCheck(String phone) {
+        Long propertyAccount = userDao.isPropertyAccount(phone);
+        log.info("==============物业公司id"+propertyAccount);
+        if (isNull(propertyAccount)){
+            return R.fail();
+        }
+        return R.ok(propertyAccount);
+    }
+
 
     @Override
     public R getAreaAndStreet() {

--
Gitblit v1.7.1