manailin
2022-09-21 d6aabd981bf80cd57c09819f42b1c4e79f1904f9
Merge remote-tracking branch 'origin/sanshuohuitang_dev' into sanshuohuitang_dev
20个文件已修改
4个文件已添加
740 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/constants/UserConstants.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/IndexDateDTO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComSanshuoExpertVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/EventRateVO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/IndexDateVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/MediateTypeVO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoApi.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoEventController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComEventMapper.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoExpertDao.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComSanshuoExpert.java 7 ●●●●● 补丁 | 查看 | 原始文档 | 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/CommediateTypeService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/IComEventService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/CommediateTypeServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml 294 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/constants/UserConstants.java
@@ -16,4 +16,6 @@
    public static final String NEWS_ID = "news_media_id:";
    public static final String NEWS_LIST = "news_list:";
    public static final String SANSHUO_INDUSTRY_CENTER_ROLE="1559112102373756911";
    public static final String SANSHUO_EXPERT_ROLE="1559112102373756955";
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/IndexDateDTO.java
New file
@@ -0,0 +1,17 @@
package com.panzhihua.common.model.dtos.community.sanshuo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import springfox.documentation.annotations.ApiIgnore;
@Data
@ApiModel("大屏事件入参(区三说会堂,行业分中心,街道,社区数据)")
public class IndexDateDTO {
    @ApiModelProperty("1区三说会堂,2行业分中心,3街道、镇,4社区/村,空为所有")
    private Integer type;
    @ApiModelProperty("行业分中心id或街道id或社区id(type=1不传,type=2传行业分中心id,type=3传街道id,type=4传社区id)")
    private Long id;
    @ApiModelProperty(hidden = true)
    private Integer level;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ComSanshuoExpertVO.java
@@ -4,6 +4,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@@ -130,4 +131,12 @@
    @ApiModelProperty("办结事项")
    private String solveEvents;
    @ApiModelProperty("调解次数")
    private Integer count;
    @ApiModelProperty("调解成功率")
    private BigDecimal rate;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/EventRateVO.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.common.model.vos.sanshuo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("事件级别占比统计")
public class EventRateVO {
    @ApiModelProperty("级别")
    private String name;
    @ApiModelProperty("占比")
    private BigDecimal rate;
    @ApiModelProperty("数量")
    private Integer count;
    private Integer type;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/IndexDateVO.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.common.model.vos.sanshuo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ApiModel("大屏事件数据统计(三说会堂,行业分中心,街道,社区)")
public class IndexDateVO {
    @ApiModelProperty("受理案件")
    private Integer accept;
    @ApiModelProperty("正在调解")
    private Integer accepting;
    @ApiModelProperty("已完成调解")
    private Integer accepted;
    @ApiModelProperty("经验累计")
    private Integer total;
    @ApiModelProperty("调解专家")
    private Integer expert;
    @ApiModelProperty("调解成功")
    private Integer success;
    @ApiModelProperty("调解失败")
    private Integer fail;
    @ApiModelProperty("成功率")
    private BigDecimal successRate;
    @ApiModelProperty("本月新增")
    private Integer monthIncrease;
    @ApiModelProperty("本月办结")
    private Integer monthFinish;
    @ApiModelProperty("X轴")
    private List<String> X;
    @ApiModelProperty("Y轴:新增案件")
    private List<Integer> Y1;
    @ApiModelProperty("Y轴:办结案件")
    private List<Integer> Y2;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/MediateTypeVO.java
New file
@@ -0,0 +1,18 @@
package com.panzhihua.common.model.vos.sanshuo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("事件类型统计")
public class MediateTypeVO {
    @ApiModelProperty("事件类型")
    private String name;
    @ApiModelProperty("数量")
    private Integer count;
    @ApiModelProperty("占比")
    private BigDecimal rate;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -13,10 +13,7 @@
import com.panzhihua.common.model.dtos.community.dpc.PageDpcDTO;
import com.panzhihua.common.model.dtos.community.enterprise.*;
import com.panzhihua.common.model.dtos.community.reserve.*;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.*;
import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO;
import com.panzhihua.common.model.dtos.community.GetIdentityEidTokenDTO;
import com.panzhihua.common.model.dtos.community.cluster.PageClusterMemberDto;
@@ -10485,4 +10482,16 @@
    @GetMapping("/sanshuo/expert/expertRange")
    R expertRange();
    /**
     * 大屏事件统计
     * */
    @PostMapping("/sanshuo/comEvent/indexData")
    R sanshuoIndexDate(IndexDateDTO indexDateDTO);
    /**
     * 事件占比统计饼图
     * */
    @GetMapping("/indexData/event")
    R eventIndexData(@RequestParam("type") Integer type);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoApi.java
@@ -1,15 +1,10 @@
package com.panzhihua.community_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.*;
import com.panzhihua.common.model.vos.IndexDataVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.ComSanShuoIndustryCenterVO;
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.sanshuo.*;
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -151,4 +146,15 @@
    public R expertRange(){
        return communityService.expertRange();
    }
    @PostMapping("/indexData")
    @ApiOperation(value = "大屏各级别事件统计",response = IndexDateVO.class)
    public R indexData(@RequestBody IndexDateDTO indexDateDTO){
        return communityService.sanshuoIndexDate(indexDateDTO);
    }
    @GetMapping("/indexData/event")
    @ApiOperation(value = "事件统计饼图",response = EventRateVO.class)
    public R eventIndexData(@RequestParam("type") @ApiParam("1受理级别2专家级别3时间类型分类") Integer type){
        return communityService.eventIndexData(type);
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoEventController.java
@@ -1,6 +1,7 @@
package com.panzhihua.community_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.ComEventArchiveVO;
import com.panzhihua.common.model.vos.sanshuo.ComEventConciliationVO;
@@ -38,6 +39,7 @@
    @Resource
    private CommunitySanShuoService comEventService;
    /**
@@ -242,4 +244,6 @@
    public R calculate() {
        return comEventService.calculate();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java
@@ -6,6 +6,7 @@
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.entity.ComMediateType;
import com.panzhihua.service_community.entity.ComSanshuoEvent;
@@ -78,4 +79,5 @@
        comMediateType.setModifyUser(this.getLoginUserInfo().getUserId());
        return R.ok(commediateTypeService.updateById(comMediateType));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventController.java
@@ -3,6 +3,8 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.enums.SanShuoEventStatusEnum;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.dtos.user.IndexDataDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.ComEventArchiveVO;
@@ -313,4 +315,21 @@
    public R calculate() {
        return comEventService.calculate();
    }
    /**
     * 大屏事件统计
     * @param indexDataDTO 查询参数
     * */
    @PostMapping("/indexData")
    public R indexData(@RequestBody IndexDateDTO indexDataDTO ){
        return comEventService.indexData(indexDataDTO);
    }
    /**
     * 大屏事件统计(事件和专家各级别占比)
     * */
    @GetMapping("/indexData/event")
    public R eventIndexData(@RequestParam Integer type){
        return comEventService.eventIndexData(type);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -51,6 +51,7 @@
     * */
    @GetMapping("/appletsList")
    public R appList(){
        comSanShuoExpertService.selectExpertList();
        return R.ok(comSanShuoExpertService.list(new QueryWrapper<ComSanshuoExpert>().eq("status",1).eq("del_flag",1)));
    }
@@ -72,7 +73,6 @@
    public R backList(@RequestParam(value = "keyWord",required = false) String keyWord,
                      @RequestParam(value = "page",required = false)Integer page,
                      @RequestParam(value = "size",required = false)Integer size){
        //TODO 获取当前账号级别确定范围
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        return comSanShuoExpertService.expertPage(keyWord,page,size,loginUserInfo);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComEventMapper.java
@@ -3,11 +3,17 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.IndexDataVO;
import com.panzhihua.common.model.vos.sanshuo.ComEventCalculateVO;
import com.panzhihua.common.model.vos.sanshuo.EventRateVO;
import com.panzhihua.common.model.vos.sanshuo.IndexDateVO;
import com.panzhihua.common.model.vos.sanshuo.MediateTypeVO;
import com.panzhihua.service_community.entity.ComEvent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
 * 三说会堂事件表Mapper
@@ -39,4 +45,45 @@
   List<ComEvent> listByComEvent(@Param("comEvent") ComEvent comEvent);
    List<ComEventCalculateVO> calculate();
    /**
     * 大屏事件统计
     * @param indexDateDTO
     * @return 处理结果
     * @author zhangtiansen
     * */
    IndexDateVO dateAnalysis(@Param("dto") IndexDateDTO indexDateDTO,@Param("beginDate") Date beginDate, @Param("endDate")Date endDate);
    /**
     * 大屏事件统计-月新增
     * @param beginDate 开始时间
     * @param endDate 结束时间
     * @author zhangtiansen
     * */
    Integer dateAnalysisY(@Param("beginDate") Date beginDate, @Param("endDate")Date endDate, @Param("dto") IndexDateDTO indexDateDTO);
    /**
     * 大屏事件统计-月办结
     * @param beginDate 开始时间
     *  @param endDate 结束时间
     * @author zhangtiansen
     * */
    Integer dateAnalysisYTwo(@Param("beginDate")Date beginDate,@Param("endDate")Date endDate,@Param("dto") IndexDateDTO indexDateDTO);
    /**
     * 大屏事件级别统计
     * */
    List<EventRateVO> eventRate();
    /**
     * 大屏统计-专家级别占比
     * */
    List<EventRateVO> expertRate();
    /**
     * 大屏统计-事件类型占比
     * */
    List<EventRateVO> mediateTypeRate();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoExpertDao.java
@@ -50,9 +50,11 @@
     * */
    List<ExpertShowVO> selectExpertCommunity();
    /**
     * 获取范围内的
     * 小程序获取专家列表
     * */
    List<ComSanshuoExpert> selectExpertList();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComSanshuoExpert.java
@@ -6,6 +6,7 @@
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
@@ -117,6 +118,12 @@
    private String unit;
    @TableField(exist = false)
    private Integer count;
    @TableField(exist = false)
    private BigDecimal rate;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    @Override
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -35,4 +35,9 @@
     * 专家级别与单位范围
     * */
    R expertRange(LoginUserInfoVO loginUserInfo);
    /**
     * 小程序获取专家列表
     * */
    R selectExpertList();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/CommediateTypeService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.entity.ComMediateType;
@@ -21,4 +22,5 @@
     * @return 处理结果
     * */
    R addOrUpdate(ComMediateTypeDTO comMediateTypeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/IComEventService.java
@@ -2,6 +2,8 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.dtos.user.IndexDataDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.ComEventArchiveVO;
@@ -87,4 +89,15 @@
    R calculate();
    R archiveRequest(ComEventArchiveVO comEventArchiveVO, LoginUserInfoVO sysUser);
    /**
     * 大屏事件统计
     * @param indexDataDTO  查询入参
     * */
    R indexData(IndexDateDTO indexDataDTO);
    /**
     * 大屏事件统计
     * */
    R eventIndexData(Integer type);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -1,11 +1,16 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
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.constants.ReturnMsgConstants;
import com.panzhihua.common.enums.SanShuoEventStatusEnum;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.dtos.user.IndexDataDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.sanshuo.*;
@@ -21,12 +26,16 @@
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import static java.util.Objects.nonNull;
/**
 * Description 三说会堂事件表业务层实现类
@@ -56,6 +65,9 @@
    @Resource
    private ComSanShuoIndustryCenterService comSanShuoIndustryCenterService;
    @Resource
    private ComEventMapper comEventMapper;
    @Override
    public R pageByComEvent(ComEvent comEvent, Page pagination) {
@@ -286,6 +298,136 @@
        return comEventTransferRecordService.insertComEventTransferRecord(comEventTransferRecord);
    }
    /**
     * 大屏事件统计
     * @param indexDataDTO  查询入参
     * */
    @Override
    public R indexData(IndexDateDTO indexDataDTO) {
        IndexDateVO vo = comEventMapper.dateAnalysis(indexDataDTO,DateUtil.beginOfMonth(new Date()),DateUtil.endOfMonth(new Date()));
        //计算率
        if (nonNull(vo.getSuccess()) && !vo.getSuccess().equals(0)){
            if (nonNull(vo.getAccepted()) && !vo.getAccepted().equals(0)){
                //计算成功率
                vo.setSuccessRate(NumberUtil.div(vo.getSuccess(),vo.getAccepted(),2));
            }
        }
        //折线图X轴
        List<Date> dates = pastTwelveMoth();
        vo.setX(getYAndM(dates));
        //新增
        List<Integer> Y1=new ArrayList<>();
        List<Integer> Y2=new ArrayList<>();
        for (Date date : dates) {
            Y1.add(comEventMapper.dateAnalysisY(date,DateUtil.endOfMonth(date),indexDataDTO));
            Y2.add(comEventMapper.dateAnalysisYTwo(date,DateUtil.endOfMonth(date),indexDataDTO));
        }
        vo.setY1(Y1);
        vo.setY2(Y2);
        return R.ok(vo);
    }
    @Override
    public R eventIndexData(Integer type) {
        //获取事件总数
        Integer eventCount = comEventMapper.selectCount(new QueryWrapper<ComEvent>().notIn("event_process_status", (7), (8)));
        if (type.equals(1)){
            //受理级别占比
            List<EventRateVO> eventRateVOS = comEventMapper.eventRate();
            for (EventRateVO eventRateVO : eventRateVOS) {
                if (nonNull(eventRateVO)){
                    eventRateVO.setName(typeToName(eventRateVO.getType()));
                    if (nonNull(eventCount) && !eventCount.equals(0)){
                        //计算占比
                        eventRateVO.setRate(NumberUtil.div(eventRateVO.getCount(),eventCount,2));
                    }
                }
            }
            return R.ok(eventRateVOS);
        }else if (type.equals(2)){
            //专家级别
            List<EventRateVO> eventRateVOS = comEventMapper.expertRate();
            for (EventRateVO eventRateVO : eventRateVOS) {
                if (nonNull(eventRateVO)){
                    eventRateVO.setName(typeToNameExpert(eventRateVO.getType()));
                    if (nonNull(eventCount) && !eventCount.equals(0)){
                        //计算占比
                        eventRateVO.setRate(NumberUtil.div(eventRateVO.getCount(),eventCount,2));
                    }
                }
            }
            return R.ok(eventRateVOS);
        }else{
            //事件类型占比
            List<EventRateVO> eventRateVOS = comEventMapper.mediateTypeRate();
            for (EventRateVO eventRateVO : eventRateVOS) {
                if (nonNull(eventRateVO)){
                    if (nonNull(eventCount) && !eventCount.equals(0)){
                        //计算占比
                        eventRateVO.setRate(NumberUtil.div(eventRateVO.getCount(),eventCount,2));
                    }
                }
            }
            return R.ok(eventRateVOS);
        }
    }
    public String typeToName(Integer type){
        switch (type){
            case 1:
                return "行业分中心受理";
            case 2:
                return "街道调解站受理";
            case 3:
                return "社区调解站受理";
            case 4:
                return "区三说会堂受理";
        }
        return null;
    }
    public String typeToNameExpert(Integer type){
        switch (type){
            case 1:
                return "区三说会堂专家";
            case 2:
                return "行业分中心专家";
            case 3:
                return "街道调解站专家";
            case 4:
                return "社区调解站专家";
        }
        return null;
    }
    /**
     * 过去12个月的月份
     * */
    private List<Date> pastTwelveMoth(){
        List<Date> list=new ArrayList<>();
        Date now = new Date();
        for (int i = 0; i < 12; i++) {
            //本月
            DateTime dateTime = DateUtil.beginOfMonth(now);
            DateUtil.format(dateTime,"yyyy-MM-dd");
            list.add(dateTime);
            //减一天进入下一个月
            now=DateUtil.offsetDay(dateTime,-1);
        }
        return list;
    }
    /**
     * 截取年,月
     * */
    private List<String> getYAndM(List<Date> dateList){
        List<String> list=new ArrayList<>();
        for (Date date : dateList) {
            list.add(DateUtil.format(date,"yyyy-MM").toString());
        }
        return list;
    }
    private Boolean checkExist(String sn, Long id) {
        ComEvent comEvent = new ComEvent();
        comEvent.setOrderSn(sn);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -1,7 +1,9 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.crypto.digest.MD5;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
@@ -14,6 +16,8 @@
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.entity.ComEvent;
import com.panzhihua.service_community.entity.ComSanshuoEvent;
import com.panzhihua.service_community.entity.ComSanshuoExpert;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
@@ -24,6 +28,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -43,6 +48,8 @@
    private ComStreetDAO comStreetDAO;
    @Resource
    private ComActDAO comActDAO;
    @Resource
    private ComEventMapper comEventMapper;
    /**
@@ -219,4 +226,33 @@
    }
    /**
     * 小程序获取专家列表
     * */
    @Override
    public R selectExpertList() {
        List<ComSanshuoExpert> comSanshuoExperts = comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getStatus, 1).eq(ComSanshuoExpert::getDelFlag, 1));
        //设置成功率
        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/java/com/panzhihua/service_community/service/impl/CommediateTypeServiceImpl.java
@@ -6,8 +6,10 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.service_community.dao.ComEventMapper;
import com.panzhihua.service_community.dao.ComMediateTypeDao;
import com.panzhihua.service_community.entity.ComMediateType;
import com.panzhihua.service_community.service.CommediateTypeService;
@@ -25,6 +27,8 @@
    @Resource
    private ComMediateTypeDao comMediateTypeDao;
    @Resource
    private ComEventMapper comEventMapper;
    /**
     * 后台获取事件列表
@@ -61,4 +65,5 @@
        mediateType.setCreateDate(new Date());
        return R.ok(comMediateTypeDao.insert(mediateType));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComEventMapper.xml
@@ -66,5 +66,299 @@
        from com_sanshuo_event_info
        group by event_process_status
    </select>
    <select id="dateAnalysis" resultType="com.panzhihua.common.model.vos.sanshuo.IndexDateVO">
        SELECT
        (SELECT count(id) FROM com_sanshuo_event_info
        where event_process_status  in (3,5,6)
        AND user_event_status not in(3,4)
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 1">
            AND type=4
        </if>
        ) as accept,
        (SELECT count(id) FROM com_sanshuo_event_info
        where event_process_status = 5
        AND user_event_status not in(3,4)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as accepting,
        (SELECT count(id) FROM com_sanshuo_event_info
        where event_process_status = 6
        AND user_event_status not in(3)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                 AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as accepted,
        (SELECT count(id) FROM com_sanshuo_event_info
        where event_process_status in (6,7)
        AND user_event_status not in(3,4)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as expirences,
        (select count(id) FROM com_sanshuo_event_info
        where event_result=1
        AND user_event_status not in(3,4)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as success,
        (select count(id) FROM com_sanshuo_event_info
        where event_result=2
        AND user_event_status not in(3,4)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as fail,
        (select count(id) from com_sanshuo_expert where `status`=1 and del_flag=1
        AND user_event_status not in(3,4)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as expert,
        (select count(id) from com_sanshuo_event_info WHERE
        create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
        AND event_process_status not in (8)
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as monthIncrease,
        (select count(id) from com_sanshuo_event_info WHERE
        create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
        AND event_process_status not in (8)
        AND event_process_status = 6
        <if test="dto.type == 1">
            AND type=4
        </if>
        <if test="dto.type == 2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>) as monthFinish
        FROM com_sanshuo_event_info limit 1
    </select>
    <select id="dateAnalysisY" resultType="java.lang.Integer">
        SELECT COUNT(id) FROM com_sanshuo_event_info
        WHERE create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
        <if test="dto.type != null">
            <if test="dto.type == 1">
                AND type=4
            </if>
            <if test="dto.type==2">
                 AND type=1
                <if test="dto.id != null">
                    AND center_id=#{dto.id}
                </if>
            </if>
            <if test="dto.type == 3">
                AND type=2
                <if test="dto.id != null">
                    AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
                </if>
            </if>
            <if test="dto.type == 4">
                AND type=3
                <if test="dto.id != null">
                    AND request_user_community=#{dto.id}
                </if>
            </if>
        </if>
    </select>
    <select id="dateAnalysisYTwo" resultType="java.lang.Integer">
        SELECT COUNT(id) FROM com_sanshuo_event_info
        WHERE create_at BETWEEN DATE_FORMAT(#{beginDate}, '%Y-%m-%d 00:00:00') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d 23:59:59')
        AND event_process_status=6
        <if test="dto.type != null">
            <if test="dto.type == 1">
                AND type=4
            </if>
        <if test="dto.type==2">
            AND type=1
            <if test="dto.id != null">
                AND center_id=#{dto.id}
            </if>
        </if>
        <if test="dto.type == 3">
            AND type=2
            <if test="dto.id != null">
                AND request_user_community in (select com_act.community_id from com_act where street_id=#{dto.id})
            </if>
        </if>
        <if test="dto.type == 4">
            AND type=3
            <if test="dto.id != null">
                AND request_user_community=#{dto.id}
            </if>
        </if>
        </if>
    </select>
    <select id="eventRate" resultType="com.panzhihua.common.model.vos.sanshuo.EventRateVO">
        select count(id) as count,type from com_sanshuo_event_info
        where event_process_status not in(7.8)
        group by type
    </select>
    <select id="expertRate" resultType="com.panzhihua.common.model.vos.sanshuo.EventRateVO">
        select count(t.id) as count,t1.level as type  from com_sanshuo_event_info t
        left join com_sanshuo_expert t1 on t.specialist_id=t1.id
        where t.event_process_status not in(7.8)
        group by t1.level
    </select>
    <select id="mediateTypeRate" resultType="com.panzhihua.common.model.vos.sanshuo.EventRateVO">
        select count(t.id) as count,t1.name from com_sanshuo_event_info t
        left join com_mediate_type t1 on t.event_category=t1.id
        where t.event_process_status not in(7.8)
        group by t.event_category
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -83,4 +83,9 @@
        where t.level=4 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertList" resultType="com.panzhihua.service_community.entity.ComSanshuoExpert">
        select t.*,count (select id from com_sanshuo_event_info where specialist_id = t.id )from com_sanshuo_expert as t
        left join com_sanshuo_event_info t1 on t.id=t1.specialist_id
        where t.status=1 and t.del_flag=1
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -3683,6 +3683,16 @@
                sysUserDO.setType(administratorsUserVO.getType());
            }
            userDao.insert(sysUserDO);
            //分配权限
            SysUserRoleDO sysUserRole=new SysUserRoleDO();
            sysUserRole.setUserId(sysUserDO.getUserId());
            if (sysUserDO.getType().equals(11)){
                sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_EXPERT_ROLE));
            }else{
                sysUserRole.setRoleId(Long.parseLong(UserConstants.SANSHUO_INDUSTRY_CENTER_ROLE));
            }
            //配置权限
            sysUserRoleDAO.insert(sysUserRole);
            return R.ok();
        }
        return R.fail("账户名已存在");