张天森
2022-09-23 7f26476bb092080e68dd0a17d4d299e70806f58a
update
7个文件已修改
73 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComSanShuoApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ExpertShowVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComSanShuoApi.java
@@ -58,4 +58,10 @@
    public R industryCenterDetail(@RequestParam("id") Long id){
        return communityService.industryCenterDetail(id);
    }
    @GetMapping("/expert/expertShowList")
    @ApiOperation("专家风采列表")
    public R expertShowList(@RequestParam(value = "level",required = false)Integer level,@RequestParam(value = "id",required = false)Long id){
        return communityService.expertShowList(level,id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ExpertShowVO.java
@@ -19,6 +19,9 @@
    @ApiModelProperty("专家数量")
    private Integer count;
    @ApiModelProperty("对应的行业分中心或街道/社区id")
    private Long id;
    @ApiModelProperty("子列表")
    List<ExpertShowVO> childList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10494,4 +10494,10 @@
     * */
    @GetMapping("sanshuo/comEvent/indexData/event")
    R eventIndexData(@RequestParam("type") Integer type);
    /**
     * 专家风采列表
     * */
    @GetMapping("/sanshuo/expert/expertShowList")
    R expertShowList(Integer level, Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -116,4 +116,13 @@
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        return comSanShuoExpertService.expertRange(loginUserInfo);
    }
    /**
     * 专家风采列表
     * */
    @GetMapping("/expertShowList")
    public R expertShowList(@RequestParam(value = "level",required = false)Integer level,
                            @RequestParam(value = "id",required = false)Long id){
        return comSanShuoExpertService.expertShowList(level,id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -40,4 +40,9 @@
     * 小程序获取专家列表
     * */
    R selectExpertList();
    /**
     * 专家风采列表
     * */
    R expertShowList(Integer level, Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -15,6 +15,7 @@
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.api.ComSanShuoExpertApi;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.entity.ComEvent;
import com.panzhihua.service_community.entity.ComSanshuoEvent;
@@ -255,4 +256,41 @@
    }
    /**
     * 专家风采列表
     * */
    @Override
    public R expertShowList(Integer level, Long id) {
        QueryWrapper<ComSanshuoExpert> wrapper=new QueryWrapper<>();
        wrapper.eq("level",level );
        if (level.equals(2)){
            wrapper.eq("industry_center_id", id);
        }else if (level.equals(3)){
            wrapper.eq("street_id",id );
        }else if (level.equals(4)){
            wrapper.eq("community_id",id );
        }
        List<ComSanshuoExpert> comSanshuoExperts = comSanshuoExpertDao.selectList(wrapper);
        for (ComSanshuoExpert comSanshuoExpert : comSanshuoExperts) {
            //获取成功率
            //查询成功率
            Integer count = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6));
            Integer successCount = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6).eq(ComEvent::getEventResult, 2));
            comSanshuoExpert.setCount(count);
            if (nonNull(count) && !count.equals(0)){
                comSanshuoExpert.setCount(count);
                if (nonNull(successCount) && !count.equals(successCount)){
                    //计算成功率
                    comSanshuoExpert.setRate(NumberUtil.div(successCount, count,2));
                }else {
                    comSanshuoExpert.setRate(new BigDecimal(0));
                }
            }else {
                comSanshuoExpert.setCount(0);
            }
        }
        return R.ok(comSanshuoExperts);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -66,19 +66,19 @@
            </if>
    </select>
    <select id="selectExpertIndustry" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.id from com_sanshuo_expert t
        left join com_sanshuo_industry_center t1 on t.industry_center_id=t1.id
        where t.level=2 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertStreet" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.street_id as id from com_sanshuo_expert t
        left join com_street t1 on t.street_id=t1.street_id
        where t.level=3 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertCommunity" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.community_id as id from com_sanshuo_expert t
        left join com_act t1 on t.community_id=t1.community_id
        where t.level=4 and t.status=1 and t.del_flag=1
        group by t1.name