From b2d178b267f0eaa12a3d1fd6da8928a9ef5d366b Mon Sep 17 00:00:00 2001
From: zhangtiansen <1292933220@qq.com>
Date: 星期三, 19 十月 2022 22:56:34 +0800
Subject: [PATCH] update

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java |   62 ++++++++++++++++--------------
 1 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
index f760afc..d027f9f 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -169,12 +169,17 @@
                 }else if (loginUserInfo.getType().equals(11)){
                     range=2;
                     id=loginUserInfo.getCommunityId();
+                }else if (loginUserInfo.getType().equals(7)){
+                    //街道后台
+                    range=3;
+                    id=loginUserInfo.getStreetId();
                 }
             }
         }
-        if (loginUserInfo.getAccount().equals("admin") || loginUserInfo.getAccount().equals("xiqu")){
+        if (loginUserInfo.getAccount().equals("admin")){
+            //三说会堂查看所有专家
             id=null;
-            range=null;
+            range=1;
         }
         IPage<ComSanshuoExpertVO> comSanshuoExpertVOIPage = comSanshuoExpertDao.expertPage(new Page(page, size), keyWord, range, id, level);
         for (ComSanshuoExpertVO record : comSanshuoExpertVOIPage.getRecords()) {
@@ -182,11 +187,13 @@
             record.setCount(comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, record.getId())));
             record.setSuccessCount(comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, record.getId()).eq(ComEvent::getEventResult,2 )));
             if (nonNull(record.getCount()) && nonNull(record.getSuccessCount())){
-                if (!(record.getCount().equals(0) && !record.getSuccessCount().equals(0))
-                record.setRate(NumberUtil.div(record.getSuccessCount(), record.getCount(),2));
+                if (!record.getCount().equals(0) && !record.getSuccessCount().equals(0)){
+                    record.setRate(NumberUtil.div(record.getSuccessCount(), record.getCount(),2));
+                }
+
             }
         }
-        return R.ok();
+        return R.ok(comSanshuoExpertVOIPage);
     }
 
     /**
@@ -199,6 +206,7 @@
             if (nonNull(expertShowVO.getLevel())){
                 if (1==expertShowVO.getLevel()) {
                     expertShowVO.setName("区三说会堂调解专家");
+                    // expertShowVO.setChildList(comSanshuoExpertDao.selectExpertVoList(expertShowVO.getLevel()));
                 }else if (2==expertShowVO.getLevel()){
                     expertShowVO.setName("行业分中心调解专家");
                     List<ExpertShowVO> expertShowVOS1 = comSanshuoExpertDao.selectExpertIndustry();
@@ -266,34 +274,30 @@
                 vo.setId(comSanshuoIndustryCenterDao.selectOne(new QueryWrapper<ComSanshuoIndustryCenter>().lambda().eq(ComSanshuoIndustryCenter::getAccount, loginUserInfo.getAccount())).getId());
                 list.add(vo);
                 return R.ok(list);
-            }else if (nonNull(loginUserInfo.getUserType())){
-                if (loginUserInfo.getUserType().equals(1)){
-                    //街道账号
-                    ComStreetDO comStreetDO = comStreetDAO.selectById(loginUserInfo.getStreetId());
-                    List<ExpertRangeVO> list=new ArrayList<>();
-                    ExpertRangeVO vo=new ExpertRangeVO();
-                    vo.setLevel(3);
-                    vo.setName(comStreetDO.getName()+"调解站");
-                    vo.setId(loginUserInfo.getStreetId());
-                    list.add(vo);
-                    return R.ok(list);
-                }
-                if (loginUserInfo.getUserType().equals(2)){
-                    //街道账号
-                    ComActDO comActDO = comActDAO.selectById(loginUserInfo.getCommunityId());
-                    List<ExpertRangeVO> list=new ArrayList<>();
-                    ExpertRangeVO vo=new ExpertRangeVO();
-                    vo.setLevel(4);
-                    vo.setName(comActDO.getName()+"调解站");
-                    vo.setId(loginUserInfo.getCommunityId());
-                    list.add(vo);
-                    return R.ok(list);
-                }
+            }else if (loginUserInfo.getType().equals(3)) {
+                //社区账号
+                ComActDO comStreetDO = comActDAO.selectById(loginUserInfo.getCommunityId());
+                List<ExpertRangeVO> list = new ArrayList<>();
+                ExpertRangeVO vo = new ExpertRangeVO();
+                vo.setLevel(4);
+                vo.setName(comStreetDO.getName() + "调解站");
+                vo.setId(loginUserInfo.getCommunityId());
+                list.add(vo);
+                return R.ok(list);
+            } else if (loginUserInfo.getType().equals(7)){
+                //街道账号
+                ComStreetDO comActDO = comStreetDAO.selectById(loginUserInfo.getStreetId());
+                List<ExpertRangeVO> list=new ArrayList<>();
+                ExpertRangeVO vo=new ExpertRangeVO();
+                vo.setLevel(4);
+                vo.setName(comActDO.getName()+"调解站");
+                vo.setId(loginUserInfo.getStreetId());
+                list.add(vo);
+                return R.ok(list);
             }
         }
         return R.fail();
     }
-
 
     /**
      * 小程序获取专家列表

--
Gitblit v1.7.1