张天森
2022-07-06 0cbbecaafcfdb30d3e7370f85bbe3f3123499309
双争后台统计
37个文件已修改
6个文件已添加
865 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/BcRegionApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ServiceStaticBackstageDTO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/PageVO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ProvinceCityReturnVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ActivityAnalysisVO.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/PartyMemberAnalysisVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ServiceStaticsVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/UnitActivityAnalysisVO.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BcRegionApi.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidRecordApi.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BcRegionApi.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/NeighborApi.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbCheckUnitDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComPbCheckUnit.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPbMemberDO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BcRegionService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActNeighborCircleService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/BcRegionMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml 75 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngBuildingMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/bootstrap.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/BcRegionApi.java
@@ -30,7 +30,7 @@
    @ApiOperation("四级联动接口")
    @GetMapping("levelList")
    public R levelList(){
        return this.communityService.levelList();
    public R levelList(@RequestParam("level")Integer level,@RequestParam("code")String code){
        return this.communityService.levelList(level,code);
    }
}
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
@@ -12,6 +12,7 @@
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.ActivityAnalysisVO;
import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAnalysisVO;
import io.swagger.annotations.*;
import org.springframework.util.ObjectUtils;
@@ -38,6 +39,11 @@
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;
/**
@@ -363,10 +369,17 @@
        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);
    @GetMapping("activity/analysis")
    public R activityUnitAnalysis(@RequestParam(value = "year",required = false) Integer year,
                                  @RequestParam(value = "type",required = false) Integer type,
                                  @RequestParam(value = "range",required = false)Integer range,
                                  @RequestParam(value = "communityId",required = false) Long communityId,
                                  @RequestParam(value = "page",required = false) Integer page,
                                  @RequestParam(value = "size",required = false) Integer size,
                                  @RequestParam(value = "belongTo",required = false) String belongTo){
        return communityService.institutionalUnitServiceAnalysis(year,type,range,communityId,page,size,belongTo);
    }
}
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
@@ -251,5 +251,7 @@
    public R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO){
        return this.communityService.serviceStatic(serviceStaticDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/resources/bootstrap.yml
@@ -35,4 +35,4 @@
  decrypt: true
  encrypt: true
  aesKey: Ryo7M3n8loC5
  sensitive: true
  sensitive: true
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ServiceStaticBackstageDTO.java
New file
@@ -0,0 +1,22 @@
package com.panzhihua.common.model.dtos.neighbor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("社区后台双争统计传参")
public class ServiceStaticBackstageDTO {
    @ApiModelProperty("年份")
    private String year;
    @ApiModelProperty("单位归属")
    private String beLongTo;
    @ApiModelProperty("排序方式 1服务次数 2服务时长")
    private Integer orderBy;
    @ApiModelProperty("页数")
    private Integer pageNum;
    @ApiModelProperty("页数")
    private Integer pageSize;
    @ApiModelProperty("查询类型 1报道单位统计 2报道党员统计")
    private Integer type;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java
@@ -225,6 +225,7 @@
    @ApiModelProperty("报道单位id")
    private Long checkUnitId;
    public String retrieveRelationName() {
        return this.type == 3 ? relationName : name;
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/PageVO.java
New file
@@ -0,0 +1,27 @@
package com.panzhihua.common.model.vos;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel(value = "分页工具类")
public class PageVO<T> implements Serializable {
    @ApiModelProperty("记录")
    private T records;
    @ApiModelProperty("总页数")
    private Integer pages;
    @ApiModelProperty("当前页")
    private Integer page;
    @ApiModelProperty("总记录数")
    private Integer recordsCount;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityVO.java
@@ -293,4 +293,5 @@
    private String phone;
    @ApiModelProperty("单位id")
    private Long checkUnitId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ProvinceCityReturnVO.java
@@ -10,5 +10,6 @@
@Data
public class ProvinceCityReturnVO {
    private String name;
    private String code;
    private List<ProvinceCityReturnVO> provinceCityReturnVOList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ActivityAnalysisVO.java
@@ -1,5 +1,6 @@
package com.panzhihua.common.model.vos.neighbor;
import com.panzhihua.common.model.vos.PageVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -10,6 +11,25 @@
    @ApiModelProperty("机关单位总数")
    private Integer unitCount;
    @ApiModelProperty("统计数据")
    private List<ComActNeighborCircleAnalysisVO> dataList;
    @ApiModelProperty("党员总数")
    private Integer partyMemberCount;
    @ApiModelProperty("单位统计数据列表")
    private PageVO<List<UnitActivityAnalysisVO>> unitList;
    @ApiModelProperty("党员统计数据列表")
    private PageVO<List<PartyMemberAnalysisVO>> partyMemberList;
    @ApiModelProperty("机关单位服务总次数")
    private Integer unitServiceTotalCount;
    @ApiModelProperty("机关单位服务总时长")
    private Integer unitServiceTotalTime;
    @ApiModelProperty("党员服务总次数")
    private Integer partyMemberServiceTotalCount;
    @ApiModelProperty("党员服务总时长")
    private Integer partyMemberServiceTotalTime;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/PartyMemberAnalysisVO.java
New file
@@ -0,0 +1,28 @@
package com.panzhihua.common.model.vos.neighbor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel
public class PartyMemberAnalysisVO {
    @ApiModelProperty("党员姓名")
    private String memberName;
    @ApiModelProperty("所属单位")
    private String belongUnit;
    @ApiModelProperty("所属社区")
    private String belongCommunity;
    @ApiModelProperty("服务次数")
    private Integer serviceTimes;
    @ApiModelProperty("服务时长")
    private Integer serviceTime;
    @ApiModelProperty("党员id")
    private Long memberId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ServiceStaticsVO.java
@@ -24,3 +24,4 @@
    @ApiModelProperty("单位活动列表")
    private List<ComActActivityVO> workActivityList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/UnitActivityAnalysisVO.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.common.model.vos.neighbor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel
public class UnitActivityAnalysisVO implements Serializable {
    @ApiModelProperty("单位名称")
    private String unitName;
    @ApiModelProperty("报道社区名称")
    private String communityName;
    @ApiModelProperty("服务次数")
    private Integer serviceTimes;
    @ApiModelProperty("服务时长")
    private Integer serviceTime;
    @ApiModelProperty("单位id'")
    private Long unitId;
    @ApiModelProperty("报道社区id")
    private String communityId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java
@@ -59,4 +59,7 @@
    private Date endTime;
    @ApiModelProperty(value = "特长类别")
    private String specialtyName;
    @ApiModelProperty("归属区")
    private String belongTo;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -36,6 +36,8 @@
import com.panzhihua.common.model.vos.community.raffle.ComActRaffleVO;
import com.panzhihua.common.model.vos.community.reserve.ComActReserveDangerAreaVO;
import com.panzhihua.common.model.vos.community.social.*;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import com.panzhihua.common.model.vos.community.*;
import org.springframework.beans.BeanUtils;
@@ -5944,6 +5946,7 @@
    @PostMapping("/neighbor/serviceStatic")
    R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO);
    /**
     * 获取系统配置value
     * @param key   系统配置code
@@ -9880,12 +9883,20 @@
    @PostMapping("/comActAcidCheckRecord/update")
    R updateComActAcidCheckRecord(@RequestBody ComActAcidCheckRecordVO comActAcidCheckRecordVO);
    @GetMapping("/bcRegion/levelList")
    R levelList(@RequestParam("level")Integer level,@RequestParam("code")String code);
    @GetMapping("/bcRegion/levelListBackstage")
    R levelListBackstage();
    /**
     * 单位活动统计
     */
    @GetMapping("/neighbor/institutionalUnitServiceAnalysis")
    R institutionalUnitServiceAnalysis(@RequestParam(value = "year") Integer year,@RequestParam("communityId") Long communityId);
    @GetMapping("/neighbor/activityAnalysis")
    R institutionalUnitServiceAnalysis(@RequestParam(value = "year",required = false) Integer year,@RequestParam(value = "type",required = false) Integer type,
                                       @RequestParam(value = "range",required = false)Integer range,@RequestParam(value = "communityId",required = false) Long communityId,
                                       @RequestParam(value = "page",required = false) Integer page,
                                       @RequestParam(value = "size",required = false) Integer size,
                                       @RequestParam(value = "belongTo",required = false) String  belongTo);
    @GetMapping("/bcRegion/levelList")
    R levelList();
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BcRegionApi.java
@@ -8,6 +8,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -33,6 +34,6 @@
    @ApiOperation("四级联动接口")
    @GetMapping("levelList")
    public R levelList(){
        return this.communityService.levelList();
        return this.communityService.levelListBackstage();
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidRecordApi.java
@@ -186,17 +186,17 @@
                            e.printStackTrace();
                        }
                    }
//                    if(StringUtils.isNotEmpty(li.getAcidImage())){
//                        try {
//                            File image=new File(sourceFile+"/"+li.getName()+"核酸截图.jpg");
//                            FileUtils.copyURLToFile(new URL(li.getAcidImage()),image);
//                            comActAcidRecordExcelVO.setAcidImage(new URL(li.getAcidImage()));
//                            //comActAcidRecordExcelVO.setColorImage(new URL(li.getColorImage()));
//                            //comActAcidRecordExcelVO.setVaccinationImage(new URL(li.getVaccinationImage()));
//                        } catch (Exception e) {
//                            e.printStackTrace();
//                        }
//                    }
                    if(StringUtils.isNotEmpty(li.getAcidImage())&&li.getLocalCity().contains("仁和区")){
                        try {
                            File image=new File(sourceFile+"/"+li.getName()+"核酸截图.jpg");
                            FileUtils.copyURLToFile(new URL(li.getAcidImage()),image);
                            //comActAcidRecordExcelVO.setAcidImage(new URL(li.getAcidImage()));
                            //comActAcidRecordExcelVO.setColorImage(new URL(li.getColorImage()));
                            //comActAcidRecordExcelVO.setVaccinationImage(new URL(li.getVaccinationImage()));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                    if(li.getCheckStatus()==0){
                        comActAcidRecordExcelVO.setCheckStatus("否");
                    }
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java
@@ -1,5 +1,6 @@
package com.panzhihua.community_backstage.api;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
@@ -75,6 +76,10 @@
    @PostMapping("/page")
    public R queryByPage(@RequestBody PageComPbCheckUnitDto comPbCheckUnit) {
        //comPbCheckUnit.setCommunityId(this.getCommunityId());
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            comPbCheckUnit.setBelongTo(this.getLoginUserInfo().getName());
        }
        return this.comPbCheckUnitService.queryByPage(comPbCheckUnit);
    }
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java
@@ -23,6 +23,7 @@
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.community.ComActActivityTypeVO;
import com.panzhihua.common.model.vos.neighbor.ActivityAnalysisVO;
import com.panzhihua.common.model.vos.user.SysTemplateConfigVO;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Value;
@@ -1285,4 +1286,16 @@
        }
        return R.fail("未查询到用户");
    }
    @ApiOperation(value = "单位活动统计",response = ActivityAnalysisVO.class)
    @GetMapping("/analysis")
    public R activityUnitAnalysis(@RequestParam(value = "year",required = false) Integer year,
                                  @RequestParam(value = "type",required = false) Integer type,
                                  @RequestParam(value = "range",required = false)Integer range,
                                  @RequestParam(value = "communityId",required = false) Long communityId,
                                  @RequestParam(value = "belongTo",required = false) String  belongTo,
                                  @RequestParam(value = "page",required = false) Integer page,
                                  @RequestParam(value = "size",required = false) Integer size){
        return communityService.institutionalUnitServiceAnalysis(year,type,range,communityId,page,size,belongTo);
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java
@@ -11,6 +11,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ArrayUtil;
import com.panzhihua.common.listen.ComPbCheckUnitExcelListen;
import com.panzhihua.common.listen.ComPbMemberRoleExcelListen;
import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto;
@@ -195,7 +196,10 @@
    @ApiOperation(value = "新增党员")
    @PostMapping("addpartybuildingmember")
    public R addPartyBuildingMember(@RequestBody PartyBuildingMemberVO partyBuildingMemberVO) {
        Long communityId = this.getCommunityId();
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            partyBuildingMemberVO.setBelongTo(this.getLoginUserInfo().getName());
        }
        R r = partyBuildingService.addPartyBuildingMember(partyBuildingMemberVO);
        if (R.isOk(r)) {
            R r1 = userService.updateUserIsPartymemberByPhone(partyBuildingMemberVO.getPhone());
@@ -282,6 +286,10 @@
    @PostMapping("pagepartyorganization")
    public R pagePartyOrganization(@RequestBody PagePartyOrganizationVO pagePartyOrganizationVO) {
        //pagePartyOrganizationVO.setCommunityId(this.getCommunityId());
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            pagePartyOrganizationVO.setBelongTo(this.getLoginUserInfo().getName());
        }
        return partyBuildingService.pagePartyOrganization(pagePartyOrganizationVO);
    }
    @ApiOperation(value = "党员时长信息导出", response = PartyBuildingMemberVO.class)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BcRegionApi.java
@@ -43,7 +43,12 @@
        return this.bcRegionService.pageList(province,city,country,town);
    }
    @GetMapping("levelList")
    public R levelList(){
        return this.bcRegionService.levelList();
    public R levelList(@RequestParam("level")Integer level,@RequestParam("code")String code){
        return this.bcRegionService.levelList(level,code);
    }
    @GetMapping("levelListBackstage")
    public R levelListBackstage(){
        return this.bcRegionService.levelListBackstage();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/NeighborApi.java
@@ -391,12 +391,34 @@
     * 机关单位服务统计排行
     * @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);
    @GetMapping("/activityAnalysis")
    public R institutionalUnitServiceAnalysis(@RequestParam(value = "year",required = false) Integer year,@RequestParam(value = "type",required = false) Integer type,
                                              @RequestParam(value = "range",required = false)Integer range,@RequestParam(value = "communityId",required = false) Long communityId,
                                              @RequestParam(value = "page",required = false) Integer page,
                                              @RequestParam(value = "belongTo",required = false) String  belongTo,
                                              @RequestParam(value = "size",required = false) Integer size){
        return this.comActNeighborCircleService.institutionalUnitServiceAnalysis(year,type,range,communityId,page,size,belongTo);
    }
    /**
     * 小程序服务统计
     * @param serviceStaticDTO
     * @return
     */
    @PostMapping("/serviceStatic")
    public R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO){
        return this.comActNeighborCircleService.serviceStatic(serviceStaticDTO);
    }
    /**
     * 后台统计
     * @param serviceStaticDTO
     * @return
     */
    @PostMapping("/serviceStaticBackstage")
    public R serviceStaticBackstage(@RequestBody ServiceStaticBackstageDTO serviceStaticDTO){
        return this.comActNeighborCircleService.serviceStaticBackstage(serviceStaticDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -99,4 +99,14 @@
    @Select("select count(id) from com_pb_check_unit")
    Integer getUnitCount();
    @Select("select count(id) from com_pb_member where audit_result=1")
    Integer selectUnitCount();
    @Select("select count(id) from com_pb_check_unit")
    Integer selectMemberCount();
    @Select("select name from com_pb_check_unit where id=#{id}")
    String selectUnitName(@Param("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -143,7 +143,7 @@
    ServiceStaticsVO selectStatsCheckUnit(@Param("checkUnitId") Long checkUnitId,@Param("date")String date);
    ServiceStaticsVO selectStatsUser(@Param("phone") String phone,@Param("date")String date);
    ServiceStaticsVO selectStatsUser(@Param("phone") String phone, @Param("date")String date);
    List<ComActNeighborCircleAppVO> selectListByCheckUnitId(@Param("checkUnitId")Long checkUnitId,@Param("date")String date);
@@ -151,6 +151,9 @@
    /**
     * 单位服务统计
     * */
    List<ComActNeighborCircleAnalysisVO> institutionalUnitServiceAnalysis(@Param("beginTime")String beginTime,@Param("endTime")String endTIme,@Param("communityId")Long communityId);
     */
    List<UnitActivityAnalysisVO> institutionalUnitServiceAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("belongTo") String belongTo);
    List<UnitActivityAnalysisVO> institutionalUnitActivityAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("belongTo") String belongTo);
    List<PartyMemberAnalysisVO> institutionalPartyMemberServiceAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("belongTo") String belongTo);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComPbCheckUnitDao.java
New file
@@ -0,0 +1,10 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.entity.ComPbCheckUnit;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ComPbCheckUnitDao extends BaseMapper<ComPbCheckUnit> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComPbCheckUnit.java
New file
@@ -0,0 +1,174 @@
package com.panzhihua.service_community.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("党建-报到单位")
public class ComPbCheckUnit implements Serializable {
    private static final long serialVersionUID = 171585961585758185L;
    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private Long communityId;
    /**
     * 单位名称
     */
    @ApiModelProperty(value = "单位名称")
    private String name;
    /**
     * 单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)
     */
    @ApiModelProperty(value = "单位类别(1.国有企业 2.国有控股企业 3.外资企业 4.合资企业 5.私营企业 6.事业单位 7.国家行政机关 8.政府)")
    private Integer type;
    /**
     * 负责人
     */
    @ApiModelProperty(value = "负责人")
    private String contacts;
    /**
     * 负责人联系电话
     */
    @ApiModelProperty(value = "负责人联系电话")
    private String phone;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createAt;
    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    private Long createBy;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    private Date updateAt;
    /**
     * 修改人id
     */
    @ApiModelProperty(value = "修改人id")
    private Long updateBy;
    private String orgName;
    /**
     * 单位logo
     */
    @ApiModelProperty(value = "单位logo")
    private String logo;
    /**
     * 党组织人数
     */
    @ApiModelProperty(value = "党组织人数")
    private Integer partyNum;
    /**
     * 单位地址
     */
    @ApiModelProperty(value = "单位地址")
    private String address;
    /**
     * 管理员账号
     */
    @ApiModelProperty(value = "管理员账号")
    private String adminPhone;
    /**
     * 管理员名称
     */
    @ApiModelProperty(value = "管理员名称")
    private String adminName;
    /**
     * 特长描述
     */
    @ApiModelProperty(value = "特长描述")
    private String specialtyName;
    /**
     * 帮扶社区id
     */
    @ApiModelProperty(value = "帮扶社区id")
    private Long helpCommunityId;
    /**
     * 小区id
     */
    @ApiModelProperty(value = "小区id")
    private Long villageId;
    /**
     * 单位性质
     */
    @ApiModelProperty(value = "单位性质")
    private String natureName;
    /**
     * 单位性质id
     */
    @ApiModelProperty(value = "单位性质id")
    private Integer natureId;
    /**
     * 帮扶社区名字
     */
    @ApiModelProperty(value = "帮扶社区名字")
    private String helpCommunityName;
    private String helpCommunityContacts;
    private String helpCommunityContactsName;
    private String otherRemark;
    private String villageName;
    /**
     * 单位所属
     */
    @ApiModelProperty(value = "单位所属")
    private String belongTo;
    /**
     * 联系人json
     */
    @ApiModelProperty(value = "联系人json")
    private String adminJson;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComPbMemberDO.java
@@ -89,4 +89,5 @@
    private Long checkUnitId;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BcRegionService.java
@@ -25,5 +25,11 @@
     * 四级联动列表
     * @return
     */
    R levelList();
    R levelList(Integer level,String code);
    /**
     * 四级联动列表
     * @return
     */
    R levelListBackstage();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActNeighborCircleService.java
@@ -246,5 +246,15 @@
     * 机关单位服务统计排行
     * @return
     * */
    R institutionalUnitServiceAnalysis(Integer year,Long communityId);
    R institutionalUnitServiceAnalysis(Integer year, Integer type, Integer range,Long communityId,Integer page,Integer size,String belongTo);
    /**
     * 后台服务统计
     * @param serviceStaticDTO
     * @return
     */
    R serviceStaticBackstage(ServiceStaticBackstageDTO serviceStaticDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcRegionServiceImpl.java
@@ -35,18 +35,59 @@
    }
    @Override
    public R levelList() {
    public R levelList(Integer level,String code) {
        if(level==1){
            List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
            return R.ok(firstLevel);
        }
        if(level==2){
            List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(code);
            return R.ok(secondLevel);
        }
        if(level==3){
            List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(code);
            return R.ok(thirdLevel);
        }
        if(level==4){
            List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(code);
            return R.ok(fourthLevel);
        }
        return R.fail("参数错误");
//        if(stringRedisTemplate.hasKey("levelList")){
//            return R.ok(stringRedisTemplate.opsForValue().get("levelList"));
//        }
//        else {
//            List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
//            firstLevel.forEach(provinceCityReturnVO -> {
//                List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getCode());
//                secondLevel.forEach(provinceCityReturnVO1 -> {
//                    List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getCode());
//                    thirdLevel.forEach(provinceCityReturnVO2 -> {
//                        List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getCode());
//                        provinceCityReturnVO2.setProvinceCityReturnVOList(fourthLevel);
//                    });
//                    provinceCityReturnVO1.setProvinceCityReturnVOList(thirdLevel);
//                });
//                provinceCityReturnVO.setProvinceCityReturnVOList(secondLevel);
//            });
//            stringRedisTemplate.opsForValue().set("levelList", JSON.toJSONString(firstLevel));
//            return R.ok(firstLevel);
//        }
    }
    @Override
    public R levelListBackstage() {
        if(stringRedisTemplate.hasKey("levelList")){
            return R.ok(stringRedisTemplate.opsForValue().get("levelList"));
        }
        else {
            List<ProvinceCityReturnVO> firstLevel=this.baseMapper.selectFirst();
            firstLevel.forEach(provinceCityReturnVO -> {
                List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getName());
                List<ProvinceCityReturnVO> secondLevel=this.baseMapper.selectSecond(provinceCityReturnVO.getCode());
                secondLevel.forEach(provinceCityReturnVO1 -> {
                    List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getName());
                    List<ProvinceCityReturnVO> thirdLevel=this.baseMapper.selectThird(provinceCityReturnVO1.getCode());
                    thirdLevel.forEach(provinceCityReturnVO2 -> {
                        List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getName());
                        List<ProvinceCityReturnVO> fourthLevel=this.baseMapper.selectFourth(provinceCityReturnVO2.getCode());
                        provinceCityReturnVO2.setProvinceCityReturnVOList(fourthLevel);
                    });
                    provinceCityReturnVO1.setProvinceCityReturnVOList(thirdLevel);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
@@ -154,6 +154,12 @@
            String dangerArea = comActAcidRecordVO.getDangerArea();
            String outsideCity = comActAcidRecordVO.getOutsideCity();
            String acidTest = comActAcidRecordVO.getAcidTest();
            if(StringUtils.isEmpty(acidTest)){
                acidTest="阴性";
            }
            if(StringUtils.isEmpty(travelCard)){
                travelCard="否";
            }
            if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是")
                    || dangerArea.equals("是") || outsideCity.equals("是") || acidTest.equals("阳性")) {
                //风险人员
@@ -394,6 +400,9 @@
        if(StringUtils.isEmpty(acidTest)){
            acidTest="阴性";
        }
        if(StringUtils.isEmpty(travelCard)){
            travelCard="否";
        }
        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是")
            || outsideCity.equals("是") || acidTest.equals("阳性")) {
            // 风险人员
@@ -445,6 +454,12 @@
        String dangerArea = comActAcidRecordVO.getDangerArea();
        String outsideCity = comActAcidRecordVO.getOutsideCity();
        String acidTest = comActAcidRecordVO.getAcidTest();
        if(StringUtils.isEmpty(acidTest)){
            acidTest="阴性";
        }
        if(StringUtils.isEmpty(travelCard)){
            travelCard="否";
        }
        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是")
                || outsideCity.equals("是") || acidTest.equals("阳性")) {
            // 风险人员
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -92,6 +92,7 @@
    @Resource
    private ComPbCheckUnitDao comPbCheckUnitDao;
    /**
     * 新增社区活动
     * 
@@ -127,6 +128,7 @@
        if(comActActivityVO.getType()==5){
            comPbCheckUnitDao.selectOne(new QueryWrapper<ComPbCheckUnit>().lambda().eq(ComPbCheckUnit::getAdminPhone,comActActivityVO.getPhone()).last("limit 1"));
        }
        boolean save = this.save(comActActivityDO);
        if (!save) {
            return R.fail();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -5,9 +5,10 @@
import javax.annotation.Resource;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.PageUtil;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo;
import com.panzhihua.common.model.vos.PageVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.service.ComActNeighborCircleTopicService;
import org.apache.commons.lang3.ObjectUtils;
@@ -991,6 +992,7 @@
        ServiceStaticsVO serviceStaticsVO=new ServiceStaticsVO();
        if(serviceStaticDTO.getCheckUnitId()!=null){
            serviceStaticsVO=this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear());
            serviceStaticsVO=this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear());
            serviceStaticsVO.setServiceProjecList(this.baseMapper.selectListByCheckUnitId(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear()));
            serviceStaticsVO.setServiceActivityList(comActActivityDAO.selectListByRelationId(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear()));
        }
@@ -1008,32 +1010,184 @@
    }
    @Override
    public R institutionalUnitServiceAnalysis(Integer year,Long communityId) {
        //根据年份获取一年的开始和结束时间
    public R institutionalUnitServiceAnalysis(Integer year, Integer type, Integer range, Long communityId,Integer page,Integer size,String belongTo) {
        ActivityAnalysisVO activityVO=new ActivityAnalysisVO();
        String beginTime=null;
        String endTime=null;
        if (null != year && 0 !=year){
            beginTime= year.toString()+"-01-01" ;
            endTime=year.toString()+"-12-31";
        if (null != year){
            //设置开始,截止时间
            beginTime=year.toString().concat("-01-01");
            endTime=year.toString().concat("-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());
        //统计党员,单位总数
        activityVO.setPartyMemberCount(comActDAO.selectUnitCount());
        activityVO.setUnitCount(comActDAO.selectMemberCount());
        //获取单位活动统计数据(邻里圈)
        List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, belongTo);
        //获取单位活动统计数据(活动)
        List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, belongTo);
        if (unitActivityAnalysisVOS.size()>0){
            for (UnitActivityAnalysisVO unitActivityAnalysisVO : unitActivityAnalysisVOS){
                if (ObjectUtils.isNotEmpty(unitActivityAnalysisVO)){
                    if (ObjectUtils.isNotEmpty(unitActivityAnalysisVO.getUnitId())){
                        //设置单位名称
                        unitActivityAnalysisVO.setUnitName(comActDAO.selectUnitName(unitActivityAnalysisVO.getUnitId()));
                        //统计活动表中的活动信息
                    }
                    if (ObjectUtils.isNotEmpty(vo.getUnitId())){
                        vo.setUnitName(comActDAO.getUnitName(vo.getUnitId()));
                    if (ObjectUtils.isNotEmpty(unitActivityAnalysisVO.getCommunityId())){
                        unitActivityAnalysisVO.setCommunityName(comActDAO.selectById(unitActivityAnalysisVO.getCommunityId()).getName());
                    }
                }
            }
        }
        ActivityAnalysisVO activityAnalysisVO=new ActivityAnalysisVO();
        activityAnalysisVO.setDataList(comActNeighborCircleAnalysisVOS);
        activityAnalysisVO.setUnitCount(comActDAO.getUnitCount());
        return R.ok(activityAnalysisVO);
        //活动表数据处理
        if (unitActivityAnalysisVOS1.size()>0){
            for (UnitActivityAnalysisVO vo : unitActivityAnalysisVOS1) {
                if(ObjectUtils.isNotEmpty(vo)){
                    if (ObjectUtils.isNotEmpty(vo.getUnitId())){
                        //判断邻里圈统计中是否已有该单位数据
                        Map<String, Integer> param = alreadyAnalysis(vo.getUnitId(), unitActivityAnalysisVOS);
                        if (param.get("flag")==1){
                            //已有数据,将时长,次数相加
                            Integer serviceTime = vo.getServiceTime();
                            Integer serviceTimes = vo.getServiceTimes();
                            unitActivityAnalysisVOS.get(param.get("index")).setServiceTime(unitActivityAnalysisVOS.get(param.get("index")).getServiceTime()+serviceTime);
                            unitActivityAnalysisVOS.get(param.get("index")).setServiceTimes(unitActivityAnalysisVOS.get(param.get("index")).getServiceTimes()+serviceTimes);
                        }else {
                            //新数据,获取单位,社区名
                            vo.setUnitName(comActDAO.selectUnitName(vo.getUnitId()));
                            if (ObjectUtils.isNotEmpty(vo.getCommunityId())) {
                                vo.setCommunityName(comActDAO.selectById(vo.getCommunityId()).getName());
                            }
                            unitActivityAnalysisVOS.add(vo);
                        }
                    }
                }
            }
        }
        //获取党员活动统计数据
        List<PartyMemberAnalysisVO> partyMemberAnalysisVOS = comActNeighborCircleDAO.institutionalPartyMemberServiceAnalysis(beginTime, endTime, belongTo);
        //统计总时长和总次数
        Integer unitServiceCount=0;
        Integer unitServiceTotalTime=0;
        Integer memberServiceCount=0;
        Integer memberServiceTotalTome=0;
        for (UnitActivityAnalysisVO vo : unitActivityAnalysisVOS) {
            unitServiceCount+=vo.getServiceTime();
            unitServiceTotalTime+=vo.getServiceTimes();
        }
        for (PartyMemberAnalysisVO vo : partyMemberAnalysisVOS) {
            memberServiceCount+=vo.getServiceTime();
            memberServiceTotalTome+=vo.getServiceTimes();
        }
        activityVO.setUnitServiceTotalCount(unitServiceCount);
        activityVO.setUnitServiceTotalTime(unitServiceTotalTime);
        activityVO.setPartyMemberServiceTotalCount(memberServiceCount);
        activityVO.setPartyMemberServiceTotalTime(memberServiceTotalTome);
        //处理排序
        if (null != type){
            if (type.equals(1)){
                //按时长排序
                ListUtil.sortByProperty(unitActivityAnalysisVOS, "serviceTime");
                ListUtil.sortByProperty(partyMemberAnalysisVOS, "serviceTime");
            }else if (type.equals(2)){
                //按次数排序
                ListUtil.sortByProperty(unitActivityAnalysisVOS, "serviceTimes");
                ListUtil.sortByProperty(partyMemberAnalysisVOS, "serviceTimes");
            }
        }
        //处理分页
        PageVO<List<UnitActivityAnalysisVO>> unitPage=new PageVO<>();
        PageVO<List<PartyMemberAnalysisVO>> memberPage=new PageVO<>();
        if (ObjectUtils.isNotEmpty(page) && ObjectUtils.isNotEmpty(size)){
            //分页处理
            unitPage.setRecordsCount(unitActivityAnalysisVOS.size());
            unitPage.setPage(page);
            unitPage.setPages(getPages(unitPage.getRecordsCount(),size ));
            memberPage.setPage(page);
            memberPage.setRecordsCount(partyMemberAnalysisVOS.size());
            memberPage.setPages(getPages(memberPage.getRecordsCount(), size));
            //处理分页的结果
            unitPage.setRecords(subUnitList((ArrayList) unitActivityAnalysisVOS, page,size));
            memberPage.setRecords(subUnitList((ArrayList)partyMemberAnalysisVOS,page ,size));
        }else {
            unitPage.setRecords(unitActivityAnalysisVOS);
            memberPage.setRecords(partyMemberAnalysisVOS);
        }
        activityVO.setUnitList(unitPage);
        activityVO.setPartyMemberList(memberPage);
        return R.ok(activityVO);
    }
    @Override
    public R serviceStaticBackstage(ServiceStaticBackstageDTO serviceStaticDTO) {
        return null;
    }
    /**
     * 判断活动统计列表中是否已有该单位的数据
     * */
    public Map<String,Integer> alreadyAnalysis(Long unitId,List<UnitActivityAnalysisVO> list){
        Map<String,Integer> map=new HashMap<>();
        if (list.size()>0){
            for (int i=0;i<list.size();i++) {
                UnitActivityAnalysisVO vo = list.get(i);
                if (ObjectUtils.isNotEmpty(vo)){
                    if (ObjectUtils.isNotEmpty(vo.getUnitId())){
                        if (unitId.equals(vo.getUnitId())){
                            map.put("index",i );
                            map.put("flag",1 );
                            return map;
                        }
                    }
                }
            }
        }
        map.put("flag",0 );
        return map;
    }
    /**
     * 计算总页数
     * */
    public Integer getPages(Integer record,Integer size){
        if (null != record && null != size){
            int pages = PageUtil.totalPage(record, size);
            return pages;
        }
        return 0;
    }
    /**
     * 分页截取
     * */
    public List<Object> subUnitList(List<Object> list, int page, int size){
        try {
            //计算endIndex是否超出List大小
            final Boolean flag=((page-1)*size+size) > list.size();
            if (1 == page || 0 == page){
                //第一页
                return list.subList(0,size);
            }else if (flag){
                return ListUtil.sub(list, (page-1)*size-1, list.size()-1);
            }
            else {
                return list.subList((page-1)*size, (page-1)*size+size);
            }
        }catch (Exception e){
            //返回原集合
            return list;
        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/bootstrap.yml
@@ -40,4 +40,4 @@
  metrics:
    tags:
      application: huacheng-community
      application: huacheng-community
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/BcRegionMapper.xml
@@ -36,18 +36,18 @@
    </select>
    <select id="selectFirst" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
        select distinct province as name from area_index_2022
        select distinct  name,code from area_code_2022 where level=1
    </select>
    <select id="selectSecond" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
        select distinct city as name from area_index_2022 where province = #{name} and city !='攀枝花市'
        select distinct  name,code from area_code_2022 where level=2 and pcode=#{name} and name !='攀枝花市'
    </select>
    <select id="selectThird" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
        select distinct county as name from area_index_2022 where city = #{name}
        select distinct  name,code from area_code_2022 where level=3 and pcode=#{name}
    </select>
    <select id="selectFourth" resultType="com.panzhihua.common.model.vos.community.ProvinceCityReturnVO">
        select distinct town as name from area_index_2022 where county = #{name}
        select distinct  name,code from area_code_2022 where level=4 and pcode=#{name}
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -286,4 +286,5 @@
        SELECT * FROM `com_act_activity`
        WHERE community_id = #{communityId} and type = 3 and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml
@@ -216,27 +216,13 @@
                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>
    <select id="selectStatsCheckUnit" resultType="com.panzhihua.common.model.vos.neighbor.ServiceStaticsVO">
        select count(t1.checkId) as times,sum(t1.hours) as hours from  ((select real_service_time as hours,solve_unit_id  as checkId  from com_act_neighbor_circle  where order_type = 1 and solve_status = 4 and solve_unit_id = #{checkUnitId} and create_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')) union all
                                                                        (select duration as hours,check_unit_id as checkId from com_act_activity  where check_unit_id = #{checkUnitId} and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59'))) t1
         select count(t1.checkId) as times,sum(t1.hours) as hours from
         ((select real_service_time as hours,solve_unit_id  as checkId  from com_act_neighbor_circle  where order_type = 1 and solve_status = 4 and solve_unit_id = #{checkUnitId} and create_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59'))
          union all
         (select duration as hours,check_unit_id as checkId from com_act_activity  where check_unit_id = #{checkUnitId} and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59'))) t1
    </select>
    <select id="selectListByCheckUnitId" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO">
        SELECT
            canc.*,
@@ -274,4 +260,57 @@
                left join sys_user su1 on su1.user_id = canc.solve_id
        where is_del = 2 and su1.phone = #{phone} and canc.create_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')
    </select>
    <select id="institutionalUnitServiceAnalysis"
            resultType="com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO">
        select canc.solve_unit_id as unitId,sum(canc.real_service_time) as serviceTime,count(canc.real_service_time) as serviceTimes,canc.community_id as communityId,cpcu.belong_to
        from com_act_neighbor_circle as canc
        left join com_pb_check_unit as cpcu on canc.solve_unit_id=cpcu.id
        where canc.solve_unit_id&lt;>''
        <if test="beginTime != null">
            and canc.create_at between #{beginTime} and #{endTime}
        </if>
        <if test="belongTo != null and belongTo != ''">
            and belong_to=#{belongTo}
        </if>
        group by(canc.solve_unit_id)
        order by serviceTime
    </select>
    <select id="institutionalUnitActivityAnalysis"
            resultType="com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO">
        SELECT count(caa.check_unit_id) as serviceTimes,sum(caa.duration) as serviceTime,caa.check_unit_id as unitId,caa.community_id as communityId,cpcu.belong_to
        FROM com_act_activity as caa
        left join com_pb_check_unit as cpcu on caa.check_unit_id=cpcu.id
        where check_unit_id&lt;>''
        <if test="beginTime != null">
            and caa.create_at between #{beginTime} and #{endTime}
        </if>
        <if test="belongTo != null and belongTo != ''">
            and belong_to=#{belongTo}
        </if>
        GROUP BY (caa.check_unit_id)
        order by serviceTime
    </select>
    <select id="institutionalPartyMemberServiceAnalysis"
            resultType="com.panzhihua.common.model.vos.neighbor.PartyMemberAnalysisVO">
        SELECT count(caa.sponsor_id) as serviceTimes,sum(caa.duration) as serviceTime,caa.check_unit_id as unitId
        ,caa.community_id as communityId,cpm.id as memberId,cpm.name as memberName,cpcu.name as belongUnit,ca.name as belongCommunity,cpcu.belong_to
        FROM `com_act_activity` as caa
        left join com_act_act_sign as caas on caa.id=caas.activity_id
        <!--left join com_pb_member as cpm on caas.user_id=cpm.id-->
        left join com_pb_member as cpm on caa.sponsor_id=cpm.id
        left join com_pb_check_unit as cpcu on cpm.check_unit_id=cpcu.id
        left join com_act as ca on cpm.community_id=ca.community_id
        where caa.sponsor_id&lt;>''
        <if test="beginTime != null">
            and caa.create_at between #{beginTime} and #{endTime}
        </if>
        <if test="belongTo != null and belongTo != ''">
            and belong_to=#{belongTo}
        </if>
        GROUP BY (caa.sponsor_id)
        having serviceTimes&lt;>'' and serviceTime&lt;>''
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngBuildingMapper.xml
@@ -80,7 +80,7 @@
                    and cmv.alley like concat(#{pageBuildingListDto.keyWord},'%')
                </if>
            </where>
        order by alley asc
        order by cmb.id desc
    </select>
    <select id="buildingListHeaderStatisticsAdmin" resultType="com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo">
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -33,7 +33,7 @@
            <if test="dto.type != null">
                and cpcu.`type` = #{dto.type}
            </if>
            <if test="dto.communityId != null">
            <if test="dto.communityId != null and dto.communityId!=0">
                and cpcu.community_id = #{dto.communityId}
            </if>
            <if test="dto.keyWord != null and dto.keyWord != ''">
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -86,7 +86,7 @@
            <if test="dto.orgId != null">
                and m.org_id = #{dto.orgId}
            </if>
            <if test="dto.communityId != null">
            <if test="dto.communityId != null and dto.communityId !=0">
                and m.community_id = ${dto.communityId}
            </if>
            <if test="dto.keyWord != null and dto.keyWord != ''">
@@ -104,6 +104,9 @@
            <if test="dto.specialtyName != null and dto.specialtyName !=''">
                and m.specialty_name like concat('%',#{dto.specialtyName},'%')
            </if>
            <if test="dto.belongTo !=null and dto.belongTo !=''">
                and cpcu.belong_to = #{dto.belongTo}
            </if>
        </where>
        order by m.create_at desc
    </select>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -415,6 +415,11 @@
            if(count>0){
                loginUserInfoVO.setIsCheckUnitAdmin(1);
            }
            Long checkUnitId=userDao.selectCheckUnitId(phone);
            if(checkUnitId!=null){
                loginUserInfoVO.setCheckUnitId(checkUnitId);
            }
            else {
                loginUserInfoVO.setIsCheckUnitAdmin(0);
            }
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/bootstrap.yml
@@ -28,4 +28,4 @@
  metrics:
    tags:
      application: huacheng-user
      application: huacheng-user
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -560,7 +560,6 @@
    <select id="selectOrgAdmin" resultType="Integer">
        select count(*) from com_pb_check_unit where admin_phone like concat('%',#{phone},'%')
    </select>
    <select id="selectCheckUnitId" resultType="Long">
        select check_unit_id from com_pb_member where phone = #{phone} limit 1
    </select>