| | |
| | | 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 org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | comActActivityVO.setHasPrize(0); |
| | | return communityService.addActivity(comActActivityVO); |
| | | } |
| | | @ApiOperation(value = "单位活动统计",response = ActivityAnalysisVO.class) |
| | | @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){ |
| | | return communityService.institutionalUnitServiceAnalysis(year,type,range,communityId); |
| | | } |
| | | |
| | | } |
| | |
| | | public R order(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO){ |
| | | return this.communityService.order(editNeighborCircleAdminVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "服务统计",response = ServiceStaticsVO.class) |
| | | @PostMapping("/serviceStatic") |
| | | public R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO){ |
| | | return this.communityService.serviceStatic(serviceStaticDTO); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.neighbor; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | @Data |
| | | @ApiModel("服务统计参数") |
| | | public class ServiceStaticDTO { |
| | | @ApiModelProperty("单位id") |
| | | private Long checkUnitId; |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | @ApiModelProperty("年份") |
| | | private String year; |
| | | } |
| | |
| | | @ApiModelProperty("是否单位管理员 1是 0否") |
| | | private Integer isCheckUnitAdmin; |
| | | |
| | | @ApiModelProperty("报道单位id") |
| | | private Long checkUnitId; |
| | | |
| | | |
| | | public String retrieveRelationName() { |
| | | return this.type == 3 ? relationName : name; |
| | | } |
| | |
| | | private Long relationId; |
| | | @ApiModelProperty("关联手机") |
| | | private String phone; |
| | | @ApiModelProperty("单位id") |
| | | private Long checkUnitId; |
| | | |
| | | } |
New file |
| | |
| | | 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 Integer partyMemberCount; |
| | | |
| | | @ApiModelProperty("单位统计数据列表") |
| | | private List<UnitActivityAnalysisVO> unitList; |
| | | |
| | | @ApiModelProperty("党员统计数据列表") |
| | | private List<PartyMemberAnalysisVO> partyMemberList; |
| | | } |
| | |
| | | private Integer solveStatus; |
| | | @ApiModelProperty("接单人id") |
| | | private Long solveId; |
| | | @ApiModelProperty("接单单位id") |
| | | private Long solveUnitId; |
| | | |
| | | @ApiModelProperty("反馈内容") |
| | | private String solveContent; |
| | | @ApiModelProperty("反馈图片") |
New file |
| | |
| | | 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; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.neighbor; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("服务统计返回") |
| | | public class ServiceStaticsVO { |
| | | @ApiModelProperty("次数") |
| | | private Integer times; |
| | | @ApiModelProperty("时长") |
| | | private Integer hours; |
| | | @ApiModelProperty("服务项目列表") |
| | | private List<ComActNeighborCircleAppVO> serviceProjecList; |
| | | @ApiModelProperty("服务活动列表") |
| | | private List<ComActActivityVO> serviceActivityList; |
| | | @ApiModelProperty("单位活动列表") |
| | | private List<ComActActivityVO> workActivityList; |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.vos.neighbor; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class UnitActivityAnalysisVO { |
| | | @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; |
| | | } |
| | | |
| | |
| | | @PostMapping("/neighbor/update") |
| | | R order(@RequestBody EditNeighborCircleAdminVO editNeighborCircleAdminVO); |
| | | |
| | | @PostMapping("/neighbor/serviceStatic") |
| | | R serviceStatic(@RequestBody ServiceStaticDTO serviceStaticDTO); |
| | | |
| | | |
| | | /** |
| | | * 获取系统配置value |
| | | * @param key 系统配置code |
| | |
| | | |
| | | @GetMapping("/bcRegion/levelListBackstage") |
| | | R levelListBackstage(); |
| | | |
| | | /** |
| | | * 单位活动统计 |
| | | */ |
| | | @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 ); |
| | | } |
| | |
| | | return this.comActNeighborCircleService.orderAndSolve(editNeighborCircleAdminVO); |
| | | } |
| | | |
| | | /** |
| | | * 机关单位服务统计排行 |
| | | * @return |
| | | * */ |
| | | @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){ |
| | | return this.comActNeighborCircleService.institutionalUnitServiceAnalysis(year,type,range,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 小程序服务统计 |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<PartyMemberDetailExcelVO> exportPartyMemberDetail(@Param("commonPage") CommonPage commonPage); |
| | | |
| | | List<ComActActivityVO> selectListByRelationId(@Param("relationId") Long relationId,@Param("date")String date); |
| | | |
| | | /** |
| | | * 查询进行中活动 |
| | | * @param communityId 社区id |
| | | * @return 活动列表 |
| | | */ |
| | | List<ComActActivityVO> selectListByCommunityId(@Param("communityId") Long communityId,@Param("date") String date); |
| | | |
| | | } |
| | |
| | | |
| | | @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(); |
| | | |
| | | @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); |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | StatisticsCommVO getNeighborTotalPolylineDate(@Param("communityId") Long communityId, @Param("date") String date); |
| | | |
| | | IPage<ComActNeighborCircleAdminVO> indexNeighborList(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); |
| | | |
| | | ServiceStaticsVO selectStatsCheckUnit(@Param("checkUnitId") Long checkUnitId,@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); |
| | | |
| | | List<ComActNeighborCircleAppVO> selectListByPhone(@Param("phone")String phone,@Param("date")String date); |
| | | |
| | | /** |
| | | * 单位服务统计 |
| | | */ |
| | | List<UnitActivityAnalysisVO> institutionalUnitServiceAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("communityId") Long communityId); |
| | | List<UnitActivityAnalysisVO> institutionalUnitActivityAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("communityId") Long communityId); |
| | | |
| | | List<PartyMemberAnalysisVO> institutionalPartyMemberServiceAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme, @Param("communityId") Long communityId); |
| | | } |
New file |
| | |
| | | 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> { |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
| | | |
| | |
| | | private Long relationId; |
| | | |
| | | private String phone; |
| | | |
| | | private Long checkUnitId; |
| | | } |
| | |
| | | |
| | | private String helpOrgContent; |
| | | |
| | | private Long solveUnitId; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActNeighborCircleDO{" + "id=" + id + ", releaseId=" + releaseId + ", releasePhone=" + releasePhone |
| | |
| | | */ |
| | | private String refuseReason; |
| | | |
| | | private String phone; |
| | | |
| | | private Long checkUnitId; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | R orderAndSolve(EditNeighborCircleAdminVO editNeighborCircleAdminVO); |
| | | |
| | | /** |
| | | * 服务统计 |
| | | * @param serviceStaticDTO |
| | | * @return |
| | | */ |
| | | R serviceStatic(ServiceStaticDTO serviceStaticDTO); |
| | | |
| | | /** |
| | | * 机关单位服务统计排行 |
| | | * @return |
| | | * */ |
| | | R institutionalUnitServiceAnalysis(Integer year, Integer type, Integer range,Long communityId); |
| | | |
| | | /** |
| | | * 后台服务统计 |
| | | * @param serviceStaticDTO |
| | | * @return |
| | | */ |
| | | R serviceStaticBackstage(ServiceStaticBackstageDTO serviceStaticDTO); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.service_community.entity.ComPbCheckUnit; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | private ComActActivityCodeService comActActivityCodeService; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComPbCheckUnitDao comPbCheckUnitDao; |
| | | |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | if(comActActivityVO.getType()==4){ |
| | | comActActivityDO.setIsProject(1); |
| | | } |
| | | 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(); |
| | |
| | | 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 com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | 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; |
| | |
| | | private UserService userService; |
| | | @Resource |
| | | private ComPbMemberDAO comPbMemberDAO; |
| | | @Resource |
| | | private ComActActivityDAO comActActivityDAO; |
| | | @Resource ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | |
| | | /** |
| | | * 分页查询邻里圈列表 |
| | | * |
| | |
| | | } |
| | | return R.ok(this.baseMapper.updateById(comActNeighborCircleDO)); |
| | | } |
| | | |
| | | @Override |
| | | public R serviceStatic(ServiceStaticDTO serviceStaticDTO) { |
| | | 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())); |
| | | } |
| | | else { |
| | | serviceStaticsVO=this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(),serviceStaticDTO.getYear()); |
| | | serviceStaticsVO.setServiceProjecList(this.baseMapper.selectListByPhone(serviceStaticDTO.getPhone(),serviceStaticDTO.getYear())); |
| | | ComPbMemberDO comPbMemberDO=comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getPhone,serviceStaticDTO.getPhone()).last("limit 1")); |
| | | if(comPbMemberDO!=null){ |
| | | serviceStaticsVO.setWorkActivityList(comActActivityDAO.selectListByRelationId(comPbMemberDO.getCheckUnitId(),serviceStaticDTO.getYear())); |
| | | serviceStaticsVO.setServiceActivityList(comActActivityDAO.selectListByCommunityId(comPbMemberDO.getCommunityId(),serviceStaticDTO.getYear())); |
| | | } |
| | | |
| | | } |
| | | return R.ok(serviceStaticsVO); |
| | | } |
| | | |
| | | @Override |
| | | public R institutionalUnitServiceAnalysis(Integer year, Integer type, Integer range, Long communityId) { |
| | | ActivityAnalysisVO activityVO=new ActivityAnalysisVO(); |
| | | String beginTime=null; |
| | | String endTime=null; |
| | | if (null != year){ |
| | | //设置开始,截止时间 |
| | | beginTime=year.toString().concat("-01-01"); |
| | | endTime=year.toString().concat("-12-31"); |
| | | } |
| | | //统计党员,单位总数 |
| | | activityVO.setPartyMemberCount(comActDAO.selectUnitCount()); |
| | | activityVO.setUnitCount(comActDAO.selectMemberCount()); |
| | | //获取单位活动统计数据(邻里圈) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS = comActNeighborCircleDAO.institutionalUnitServiceAnalysis(beginTime, endTime, communityId); |
| | | //获取单位活动统计数据(活动) |
| | | List<UnitActivityAnalysisVO> unitActivityAnalysisVOS1 = comActNeighborCircleDAO.institutionalUnitActivityAnalysis(beginTime, endTime, communityId); |
| | | 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(unitActivityAnalysisVO.getCommunityId())){ |
| | | unitActivityAnalysisVO.setCommunityName(comActDAO.selectById(unitActivityAnalysisVO.getCommunityId()).getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //活动表数据处理 |
| | | 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, communityId); |
| | | activityVO.setUnitList(unitActivityAnalysisVOS); |
| | | activityVO.setPartyMemberList(partyMemberAnalysisVOS); |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </if> |
| | | order by t.begin_at desc |
| | | </select> |
| | | |
| | | <select id="selectListByRelationId" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT a.id, a.activity_name, u.`name` sponsorName, a.activity_addr, a.participant_max, a.contact_name, |
| | | a.volunteer_max, |
| | | a.`status`, a.publish_at, |
| | | a.is_qr_code, a.begin_at, a.end_at, a.sign_up_begin, a.sign_up_end, a.reward_way, a.activity_type, a.have_integral_reward ,a.reward_integral,a.party_member_max,a.party_member_min,a.cover,a.type,a.duration |
| | | FROM com_act_activity a |
| | | LEFT JOIN sys_user u ON a.sponsor_id=u.user_id |
| | | LEFT JOIN (SELECT * FROM com_act_act_sign WHERE `status` = 1) s ON a.id=s.activity_id |
| | | where a.check_unit_id = #{relationId} and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59') |
| | | </select> |
| | | |
| | | <select id="selectListByCommunityId" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | 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> |
| | |
| | | where canc.id =#{circleId} |
| | | </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> |
| | | <select id="selectListByCheckUnitId" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO"> |
| | | SELECT |
| | | canc.*, |
| | | su.nick_name as name, |
| | | su.community_id, |
| | | ca.`name` as communityName, |
| | | canct.name as topicName, |
| | | su.image_url as headUrl |
| | | FROM |
| | | com_act_neighbor_circle AS canc |
| | | left join sys_user as su on su.user_id = canc.release_id |
| | | left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id |
| | | left join com_act as ca on ca.community_id = canc.community_id |
| | | where is_del = 2 and canc.solve_unit_id = #{checkUnitId} and canc.create_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59') |
| | | </select> |
| | | |
| | | <select id="selectStatsUser" 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_id as checkId from com_act_neighbor_circle canc left join sys_user su on canc.solve_id = su.user_id where order_type = 2 and solve_status = 4 and su.phone = #{phone} and canc.create_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59')) union all |
| | | (select duration as hours,caas.user_id as checkId from com_act_activity caa LEFT JOIN com_act_act_sign caas on caa.id = caas.activity_id left join sys_user su on caas.user_id = su.user_id where caas.`status` = 1 and su.phone =#{phone} and publish_at between concat(#{date},'-01-01 00:00:00') and concat(#{date},'-12-31 23:59:59'))) t1 |
| | | </select> |
| | | |
| | | <select id="selectListByPhone" resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO"> |
| | | SELECT |
| | | canc.*, |
| | | su.nick_name as name, |
| | | su.community_id, |
| | | ca.`name` as communityName, |
| | | canct.name as topicName, |
| | | su.image_url as headUrl |
| | | FROM |
| | | com_act_neighbor_circle AS canc |
| | | left join sys_user as su on su.user_id = canc.release_id |
| | | left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id |
| | | left join com_act as ca on ca.community_id = canc.community_id |
| | | 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 |
| | | from com_act_neighbor_circle as canc |
| | | where canc.solve_unit_id<>'' |
| | | <if test="beginTime != null"> |
| | | and canc.create_at between #{beginTime} and #{endTime} |
| | | </if> |
| | | group by(canc.solve_unit_id) |
| | | <if test="communityId != null"> |
| | | having canc.community_id=#{communityId} |
| | | </if> |
| | | 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 |
| | | FROM com_act_activity as caa |
| | | where check_unit_id<>'' |
| | | <if test="beginTime != null"> |
| | | and caa.create_at between #{beginTime} and #{endTime} |
| | | </if> |
| | | GROUP BY (caa.check_unit_id) |
| | | <if test="communityId != null"> |
| | | having caa.community_id=#{communityId} |
| | | </if> |
| | | 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 |
| | | 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_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<>'' |
| | | <if test="beginTime != null"> |
| | | and caa.create_at between #{beginTime} and #{endTime} |
| | | </if> |
| | | GROUP BY (caa.sponsor_id) |
| | | having serviceTimes<>'' and serviceTime<>'' |
| | | <if test="communityId != null"> |
| | | and caa.community_id=#{communityId} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | Integer selectOrgAdmin(@Param("phone") String phone); |
| | | |
| | | /** |
| | | * 查询报道单位id |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | Long selectCheckUnitId(@Param("phone") String phone); |
| | | |
| | | |
| | | /** |
| | | * 根据社区名称查询区县社区联动关系 |
| | | * @param relationName |
| | | * @return |
| | |
| | | if(count>0){ |
| | | loginUserInfoVO.setIsCheckUnitAdmin(1); |
| | | } |
| | | Long checkUnitId=userDao.selectCheckUnitId(phone); |
| | | if(checkUnitId!=null){ |
| | | loginUserInfoVO.setCheckUnitId(checkUnitId); |
| | | } |
| | | |
| | | else { |
| | | loginUserInfoVO.setIsCheckUnitAdmin(0); |
| | | } |
| | |
| | | <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> |
| | | |
| | | </mapper> |