张天森
2022-10-18 8b150e18f00be5980c93b87970798db573c32a1a
update
3个文件已修改
19 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComSanshuoExpertVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComSanshuoExpertVO.java
@@ -140,6 +140,10 @@
    @ApiModelProperty("调解成功率")
    private BigDecimal rate;
    @ApiModelProperty("调解成功次数")
    private Integer successCount;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -6,11 +6,13 @@
import cn.hutool.crypto.digest.MD5;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO;
import com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO;
import com.panzhihua.common.model.vos.sanshuo.ExpertShowVO;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
@@ -174,7 +176,16 @@
            id=null;
            range=null;
        }
        return R.ok(comSanshuoExpertDao.expertPage(new Page(page,size),keyWord,range,id,level));
        IPage<ComSanshuoExpertVO> comSanshuoExpertVOIPage = comSanshuoExpertDao.expertPage(new Page(page, size), keyWord, range, id, level);
        for (ComSanshuoExpertVO record : comSanshuoExpertVOIPage.getRecords()) {
            //获取调解次数和成功率
            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())){
                record.setRate(NumberUtil.div(record.getSuccessCount(), record.getCount(),2));
            }
        }
        return R.ok();
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml
@@ -294,7 +294,7 @@
        <if test="dto.type == 1">
            AND current_process_type=4
        </if>) as accepted,
        (SELECT count(id) FROM com_sanshuo_event_info as  t
        (SELECT count(t.id) FROM com_sanshuo_event_info as  t
        left join com_sanshuo_event_transfer_record as  t1
        on t.id=t1.event_id
        where t.event_process_status in (6,7)