huanghongfa
2022-06-29 9fa69058350b4edeb9f20968d65fc0b5bb4f3272
单位服务统计
10个文件已修改
151 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ActivityAnalysisVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ComActNeighborCircleAnalysisVO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | 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/NeighborApi.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActNeighborCircleService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
@@ -11,6 +11,9 @@
import com.panzhihua.common.model.vos.common.ComMngVolunteerServiceTypeVo;
import com.panzhihua.common.model.vos.common.ComMngVolunteerSkillVo;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.neighbor.ActivityAnalysisVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAnalysisVO;
import io.swagger.annotations.*;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@@ -35,11 +38,6 @@
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PageGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
/**
@@ -365,4 +363,10 @@
        comActActivityVO.setHasPrize(0);
        return communityService.addActivity(comActActivityVO);
    }
    @ApiOperation(value = "单位活动统计",response = ActivityAnalysisVO.class)
    @GetMapping("activity/unit/analysis")
    public R activityUnitAnalysis(@RequestParam(value = "year") Integer year,@RequestParam("communityId") Long communityId ){
        return communityService.institutionalUnitServiceAnalysis(year,communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ActivityAnalysisVO.java
@@ -1,4 +1,15 @@
package com.panzhihua.common.model.vos.neighbor;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ActivityAnalysisVO {
    @ApiModelProperty("机关单位总数")
    private Integer unitCount;
    @ApiModelProperty("统计数据")
    private List<ComActNeighborCircleAnalysisVO> dataList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ComActNeighborCircleAnalysisVO.java
@@ -1,4 +1,40 @@
package com.panzhihua.common.model.vos.neighbor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zts
 * @decribe
 * */
@Data
@ApiModel("机关单位服务统计返回类")
public class ComActNeighborCircleAnalysisVO {
    @ApiModelProperty("社区id")
    private Long communityId;
    @ApiModelProperty("机关单位报道社区")
    private String communityName;
    @ApiModelProperty("机关单位名称")
    private String unitName;
    @ApiModelProperty("服务时间统计")
    private String serviceTime;
    @ApiModelProperty("服务次数统计")
    private Integer serviceTimes;
    @ApiModelProperty("机关单位总数")
    private Integer unitCount;
    @ApiModelProperty("机关单位id")
    private Long unitId;
//    @ApiModelProperty("活动id")
//    private Long neighborCircleId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -9873,4 +9873,10 @@
     */
    @PostMapping("/comActAcidCheckRecord/update")
    R updateComActAcidCheckRecord(@RequestBody ComActAcidCheckRecordVO comActAcidCheckRecordVO);
    /**
     * 单位活动统计
     */
    @GetMapping("/neighbor/institutionalUnitServiceAnalysis")
    R institutionalUnitServiceAnalysis(@RequestParam(value = "year") Integer year,@RequestParam("communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/NeighborApi.java
@@ -387,4 +387,12 @@
        return this.comActNeighborCircleService.orderAndSolve(editNeighborCircleAdminVO);
    }
    /**
     * 机关单位服务统计排行
     * @return
     * */
    @GetMapping("institutionalUnitServiceAnalysis")
    public R institutionalUnitServiceAnalysis(@RequestParam(value = "year",required = false) Integer year,@RequestParam(value = "communityId",required = false) Long communityId){
        return this.comActNeighborCircleService.institutionalUnitServiceAnalysis(year,communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -93,4 +93,10 @@
    @Select("select account,plaintext_password as password from com_act where community_id = ${communityId}")
    ComActPasswordVo getCommunityPassword(@Param("communityId") Long communityId);
    @Select("select name from com_pb_check_unit where id=#{id}")
    String getUnitName(@Param("id") Long unitId);
    @Select("select count(id) from com_pb_check_unit")
    Integer getUnitCount();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -5,6 +5,7 @@
import com.panzhihua.common.model.dtos.PageBaseDTO;
import com.panzhihua.common.model.vos.community.StatisticsCommVO;
import com.panzhihua.common.model.vos.neighbor.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -14,10 +15,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO;
import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO;
import com.panzhihua.common.model.vos.screen.CarouselInfoVO;
import com.panzhihua.common.model.vos.screen.PieElementVO;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
@@ -143,4 +140,9 @@
    StatisticsCommVO getNeighborTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date);
    IPage<ComActNeighborCircleAdminVO> indexNeighborList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO);
    /**
     * 单位服务统计
     * */
    List<ComActNeighborCircleAnalysisVO> institutionalUnitServiceAnalysis(@Param("beginTime")String beginTime,@Param("endTime")String endTIme,@Param("communityId")Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActNeighborCircleService.java
@@ -234,5 +234,11 @@
     * @return
     */
    R orderAndSolve(EditNeighborCircleAdminVO editNeighborCircleAdminVO);
    /**
     * 机关单位服务统计排行
     * @return
     * */
    R institutionalUnitServiceAnalysis(Integer year,Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -1,14 +1,16 @@
package com.panzhihua.service_community.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import javax.annotation.Resource;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.service.ComActNeighborCircleTopicService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -70,6 +72,8 @@
    private UserService userService;
    @Resource
    private ComPbMemberDAO comPbMemberDAO;
    @Resource
    private ComActNeighborCircleDAO comActNeighborCircleDAO;
    /**
     * 分页查询邻里圈列表
     *
@@ -979,4 +983,34 @@
        }
        return R.ok(this.baseMapper.updateById(comActNeighborCircleDO));
    }
    @Override
    public R institutionalUnitServiceAnalysis(Integer year,Long communityId) {
        //根据年份获取一年的开始和结束时间
        String beginTime=null;
        String endTime=null;
        if (null != year && 0 !=year){
            beginTime= year.toString()+"-01-01" ;
            endTime=year.toString()+"-12-31";
        }
        //根据communityId分组获取活动时长,活动次数
        List<ComActNeighborCircleAnalysisVO> comActNeighborCircleAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime,endTime,communityId);
        //填充单位,社区信息
        if (comActNeighborCircleAnalysisVOS.size()>0){
            for (ComActNeighborCircleAnalysisVO vo : comActNeighborCircleAnalysisVOS) {
                if (ObjectUtils.isNotEmpty(vo)){
                    if (ObjectUtils.isNotEmpty(vo.getCommunityId())){
                        vo.setCommunityName(comActDAO.selectById(vo.getCommunityId()).getName());
                    }
                    if (ObjectUtils.isNotEmpty(vo.getUnitId())){
                        vo.setUnitName(comActDAO.getUnitName(vo.getUnitId()));
                    }
                }
            }
        }
        ActivityAnalysisVO activityAnalysisVO=new ActivityAnalysisVO();
        activityAnalysisVO.setDataList(comActNeighborCircleAnalysisVOS);
        activityAnalysisVO.setUnitCount(comActDAO.getUnitCount());
        return R.ok(activityAnalysisVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml
@@ -216,5 +216,19 @@
                left join com_act as ca on ca.community_id = canc.community_id
        where canc.id =#{circleId}
    </select>
    <select id="institutionalUnitServiceAnalysis"
            resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAnalysisVO">
        select canc.solve_unit_id as unitId,sum(canc.real_service_time) as serviceTime,count(canc.real_service_time) as serviceTimes
        from com_act_neighbor_circle as canc
        where canc.solve_unit_id&lt;>''
        <if test="beginTime != null">
            and canc.create_at between #{beginTime} and #{endTime}
        </if>
        <if test="communityId != null">
            and canc.communityId=#{communityId}
        </if>
        group by(canc.solve_unit_id)
        order by serviceTime
    </select>
</mapper>