35 changed files with 2307 additions and 8 deletions
@ -0,0 +1,179 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.stats; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 党员先锋-机关日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
public class FactPartyMemberVanguardAgencyDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机构ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 父级机关ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 统计日期 关联日期dim表 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 党员建组数 |
|||
*/ |
|||
private Integer groupCount; |
|||
|
|||
/** |
|||
* 党员建组数占比 |
|||
*/ |
|||
private BigDecimal groupRatio; |
|||
|
|||
/** |
|||
* 组内党员人数 |
|||
*/ |
|||
private Integer groupMemberCount; |
|||
|
|||
/** |
|||
* 组内党员人数占比 |
|||
*/ |
|||
private BigDecimal groupMemberRatio; |
|||
|
|||
/** |
|||
* 党员发布话题数 |
|||
*/ |
|||
private Integer topicCount; |
|||
|
|||
/** |
|||
* 党员发布话题数占比 |
|||
*/ |
|||
private BigDecimal topicRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数 |
|||
*/ |
|||
private Integer issueCount; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数占比 |
|||
*/ |
|||
private BigDecimal issueRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数占比 |
|||
*/ |
|||
private BigDecimal projectRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数 |
|||
*/ |
|||
private Integer projectClosedCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数占比 |
|||
*/ |
|||
private BigDecimal projectClosedRatio; |
|||
|
|||
private Integer groupTotal; |
|||
private Integer groupMemberTotal; |
|||
private Integer topicTotal; |
|||
private Integer issueTotal; |
|||
private Integer projectTotal; |
|||
private Integer projectClosedTotal; |
|||
|
|||
/** |
|||
* 删除标识 未删除:0,已删除:1 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,179 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.stats; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 党员先锋-网格日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
public class FactPartyMemberVanguardGridDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机构ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 统计日期 关联日期dim表 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 党员建组数 |
|||
*/ |
|||
private Integer groupCount; |
|||
|
|||
/** |
|||
* 党员建组数占比 |
|||
*/ |
|||
private BigDecimal groupRatio; |
|||
|
|||
/** |
|||
* 组内党员人数 |
|||
*/ |
|||
private Integer groupMemberCount; |
|||
|
|||
/** |
|||
* 组内党员人数占比 |
|||
*/ |
|||
private BigDecimal groupMemberRatio; |
|||
|
|||
/** |
|||
* 党员发布话题数 |
|||
*/ |
|||
private Integer topicCount; |
|||
|
|||
/** |
|||
* 党员发布话题数占比 |
|||
*/ |
|||
private BigDecimal topicRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数 |
|||
*/ |
|||
private Integer issueCount; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数占比 |
|||
*/ |
|||
private BigDecimal issueRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数占比 |
|||
*/ |
|||
private BigDecimal projectRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数 |
|||
*/ |
|||
private Integer projectClosedCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数占比 |
|||
*/ |
|||
private BigDecimal projectClosedRatio; |
|||
|
|||
private Integer groupTotal; |
|||
private Integer groupMemberTotal; |
|||
private Integer topicTotal; |
|||
private Integer issueTotal; |
|||
private Integer projectTotal; |
|||
private Integer projectClosedTotal; |
|||
|
|||
/** |
|||
* 删除标识 未删除:0,已删除:1 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 党员先锋-机关日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Mapper |
|||
public interface FactPartyMemberVanguardAgencyDailyDao extends BaseDao<FactPartyMemberVanguardAgencyDailyEntity> { |
|||
|
|||
/** |
|||
* 删除日统计数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 17:19 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return int |
|||
*/ |
|||
int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 党员先锋-网格日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Mapper |
|||
public interface FactPartyMemberVanguardGridDailyDao extends BaseDao<FactPartyMemberVanguardGridDailyEntity> { |
|||
/** |
|||
* 删除日统计数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 17:19 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return int |
|||
*/ |
|||
int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); |
|||
} |
@ -0,0 +1,149 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员先锋-机关日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_party_member_vanguard_agency_daily") |
|||
public class FactPartyMemberVanguardAgencyDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机构ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 父级机关ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 统计日期 关联日期dim表 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 党员建组数 |
|||
*/ |
|||
private Integer groupCount; |
|||
|
|||
private Integer groupTotal; |
|||
private Integer groupMemberTotal; |
|||
private Integer topicTotal; |
|||
private Integer issueTotal; |
|||
private Integer projectTotal; |
|||
private Integer projectClosedTotal; |
|||
|
|||
/** |
|||
* 党员建组数占比 |
|||
*/ |
|||
private BigDecimal groupRatio; |
|||
|
|||
/** |
|||
* 组内党员人数 |
|||
*/ |
|||
private Integer groupMemberCount; |
|||
|
|||
/** |
|||
* 组内党员人数占比 |
|||
*/ |
|||
private BigDecimal groupMemberRatio; |
|||
|
|||
/** |
|||
* 党员发布话题数 |
|||
*/ |
|||
private Integer topicCount; |
|||
|
|||
/** |
|||
* 党员发布话题数占比 |
|||
*/ |
|||
private BigDecimal topicRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数 |
|||
*/ |
|||
private Integer issueCount; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数占比 |
|||
*/ |
|||
private BigDecimal issueRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数占比 |
|||
*/ |
|||
private BigDecimal projectRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数 |
|||
*/ |
|||
private Integer projectClosedCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数占比 |
|||
*/ |
|||
private BigDecimal projectClosedRatio; |
|||
|
|||
} |
@ -0,0 +1,149 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 党员先锋-网格日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_party_member_vanguard_grid_daily") |
|||
public class FactPartyMemberVanguardGridDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机构ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 统计日期 关联日期dim表 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 党员建组数 |
|||
*/ |
|||
private Integer groupCount; |
|||
|
|||
private Integer groupTotal; |
|||
private Integer groupMemberTotal; |
|||
private Integer topicTotal; |
|||
private Integer issueTotal; |
|||
private Integer projectTotal; |
|||
private Integer projectClosedTotal; |
|||
|
|||
/** |
|||
* 党员建组数占比 |
|||
*/ |
|||
private BigDecimal groupRatio; |
|||
|
|||
/** |
|||
* 组内党员人数 |
|||
*/ |
|||
private Integer groupMemberCount; |
|||
|
|||
/** |
|||
* 组内党员人数占比 |
|||
*/ |
|||
private BigDecimal groupMemberRatio; |
|||
|
|||
/** |
|||
* 党员发布话题数 |
|||
*/ |
|||
private Integer topicCount; |
|||
|
|||
/** |
|||
* 党员发布话题数占比 |
|||
*/ |
|||
private BigDecimal topicRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数 |
|||
*/ |
|||
private Integer issueCount; |
|||
|
|||
/** |
|||
* 党员发布话题转议题数占比 |
|||
*/ |
|||
private BigDecimal issueRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数 |
|||
*/ |
|||
private Integer projectCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目数占比 |
|||
*/ |
|||
private BigDecimal projectRatio; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数 |
|||
*/ |
|||
private Integer projectClosedCount; |
|||
|
|||
/** |
|||
* 党员发布话题转项目结案数占比 |
|||
*/ |
|||
private BigDecimal projectClosedRatio; |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.dto.StatsFormDTO; |
|||
import com.epmet.dto.group.form.GroupStatsFormDTO; |
|||
import com.epmet.dto.group.form.GroupTotalFormDTO; |
|||
|
|||
/** |
|||
* 党员先锋相关统计 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/13 15:07 |
|||
*/ |
|||
public interface StatsPartyMemberVanguardService { |
|||
/** |
|||
* 组织统计 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/13 15:13 |
|||
* @param formDTO |
|||
* @return void |
|||
*/ |
|||
void agencyStats(StatsFormDTO formDTO); |
|||
|
|||
/** |
|||
* 网格统计 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/13 15:13 |
|||
* @param formDTO |
|||
* @return void |
|||
*/ |
|||
void gridStats(StatsFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,414 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.constant.OrgTypeConstant; |
|||
import com.epmet.dto.StatsFormDTO; |
|||
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |
|||
import com.epmet.dto.stats.DimAgencyDTO; |
|||
import com.epmet.dto.stats.DimGridDTO; |
|||
import com.epmet.entity.stats.DimGridEntity; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; |
|||
import com.epmet.service.StatsPartyMemberVanguardService; |
|||
import com.epmet.service.evaluationindex.extract.todata.*; |
|||
import com.epmet.service.stats.*; |
|||
import com.epmet.util.DimIdGenerator; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.math.BigDecimal; |
|||
import java.text.DateFormat; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Calendar; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2021/5/13 15:13 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVanguardService { |
|||
|
|||
@Resource |
|||
private DimCustomerService dimCustomerService; |
|||
@Resource |
|||
private DimAgencyService dimAgencyService; |
|||
@Resource |
|||
private DimGridService dimGridService; |
|||
@Resource |
|||
private FactPartyMemberVanguardAgencyDailyService factPartyMemberVanguardAgencyDailyService; |
|||
@Resource |
|||
private FactPartyMemberVanguardGridDailyService factPartyMemberVanguardGridDailyService; |
|||
@Resource |
|||
private FactOriginGroupMainDailyService factOriginGroupMainDailyService; |
|||
@Resource |
|||
private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; |
|||
@Resource |
|||
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|||
@Resource |
|||
private FactOriginIssueMainDailyService factOriginIssueMainDailyService; |
|||
@Resource |
|||
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 组织统计 |
|||
* |
|||
* @param formDTO |
|||
* @return void |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/13 15:13 |
|||
*/ |
|||
@Override |
|||
public void agencyStats(StatsFormDTO formDTO) { |
|||
Date date = yesterday(); |
|||
//入参有时间的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { |
|||
date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
} |
|||
//入参有客户Id的则按客户Id执行,没有的则全部客户都执行
|
|||
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|||
customerAgencyStats(formDTO.getCustomerId(), date); |
|||
} else { |
|||
int pageNo = 1; |
|||
int pageSize = 100; |
|||
List<String> customerIdList; |
|||
do { |
|||
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|||
if (CollectionUtils.isNotEmpty(customerIdList)) { |
|||
for (String customerId : customerIdList) { |
|||
try { |
|||
//遍历统计每一个客户数据
|
|||
customerAgencyStats(customerId, date); |
|||
} catch (Exception e) { |
|||
log.error("Error creating model JSON", e); |
|||
} |
|||
} |
|||
} |
|||
} while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); |
|||
} |
|||
} |
|||
|
|||
private void customerAgencyStats(String customerId, Date date) { |
|||
//1:查询日期各维度表Id
|
|||
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); |
|||
|
|||
//2:根据客户Id查询机关维度表数据
|
|||
log.info("根据客户Id查询机关维度数据,对应客户Id:" + customerId); |
|||
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); |
|||
dimAgencyDTO.setCustomerId(customerId); |
|||
List<DimAgencyDTO> dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); |
|||
|
|||
if (CollectionUtils.isNotEmpty(dimAgencyList)) { |
|||
List<FactPartyMemberVanguardAgencyDailyEntity> vanguardList = dimAgencyList.stream().map(item -> initAgencyDailyEntity(item, dimId)).collect(Collectors.toList()); |
|||
//党员建组占比统计
|
|||
Map<String, OrgStatisticsResultDTO> groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!groupStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = groupStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupCount(dto.getCount()); |
|||
item.setGroupRatio(dto.getRatio()); |
|||
item.setGroupTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
//小组成员党员占比统计
|
|||
Map<String, OrgStatisticsResultDTO> memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!memberStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = memberStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题占比统计
|
|||
Map<String, OrgStatisticsResultDTO> topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!topicStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = topicStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题转议题占比统计
|
|||
Map<String, OrgStatisticsResultDTO> issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!issueStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = issueStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题转项目占比统计
|
|||
Map<String, OrgStatisticsResultDTO> projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!projectStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = projectStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//项目结案占比统计
|
|||
Map<String, OrgStatisticsResultDTO> closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.AGENCY); |
|||
if (!closedStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = closedStatic.get(item.getAgencyId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//删除旧数据
|
|||
factPartyMemberVanguardAgencyDailyService.deleteDailyData(customerId, dimId.getDateId()); |
|||
//批量插入
|
|||
factPartyMemberVanguardAgencyDailyService.insertBatch(vanguardList); |
|||
} |
|||
} |
|||
/** |
|||
* 网格统计 |
|||
* |
|||
* @param formDTO |
|||
* @return void |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/13 15:13 |
|||
*/ |
|||
@Override |
|||
public void gridStats(StatsFormDTO formDTO) { |
|||
Date date = yesterday(); |
|||
//入参有时间的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { |
|||
date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
} |
|||
//入参有客户Id的则按客户Id执行,没有的则全部客户都执行
|
|||
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|||
customerAgencyStats(formDTO.getCustomerId(), date); |
|||
} else { |
|||
int pageNo = 1; |
|||
int pageSize = 100; |
|||
List<String> customerIdList; |
|||
do { |
|||
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|||
if (CollectionUtils.isNotEmpty(customerIdList)) { |
|||
for (String customerId : customerIdList) { |
|||
try { |
|||
//遍历统计每一个客户数据
|
|||
customerGridStats(customerId, date); |
|||
} catch (Exception e) { |
|||
log.error("Error creating model JSON", e); |
|||
} |
|||
} |
|||
} |
|||
} while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); |
|||
} |
|||
} |
|||
|
|||
private void customerGridStats(String customerId, Date date) { |
|||
//1:查询日期各维度表Id
|
|||
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); |
|||
|
|||
//2:根据客户Id查询机关维度表数据
|
|||
log.info("根据客户Id查询网格维度数据,对应客户Id:" + customerId); |
|||
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); |
|||
dimAgencyDTO.setCustomerId(customerId); |
|||
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId); |
|||
|
|||
if (CollectionUtils.isNotEmpty(dimGridList)) { |
|||
List<FactPartyMemberVanguardGridDailyEntity> vanguardList = |
|||
dimGridList.stream().map(item -> initGridDailyEntity(item, dimId)).collect(Collectors.toList()); |
|||
//党员建组占比统计
|
|||
Map<String, OrgStatisticsResultDTO> groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!groupStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = groupStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupCount(dto.getCount()); |
|||
item.setGroupRatio(dto.getRatio()); |
|||
item.setGroupTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
//小组成员党员占比统计
|
|||
Map<String, OrgStatisticsResultDTO> memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!memberStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = memberStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题占比统计
|
|||
Map<String, OrgStatisticsResultDTO> topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!topicStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = topicStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题转议题占比统计
|
|||
Map<String, OrgStatisticsResultDTO> issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!issueStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = issueStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//党员发布话题转项目占比统计
|
|||
Map<String, OrgStatisticsResultDTO> projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!projectStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = projectStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//项目结案占比统计
|
|||
Map<String, OrgStatisticsResultDTO> closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, |
|||
dimId.getDateId(), OrgTypeConstant.GRID); |
|||
if (!closedStatic.isEmpty()) { |
|||
vanguardList.forEach(item -> { |
|||
OrgStatisticsResultDTO dto = closedStatic.get(item.getGridId()); |
|||
if (null != dto) { |
|||
item.setGroupMemberCount(dto.getCount()); |
|||
item.setGroupMemberRatio(dto.getRatio()); |
|||
item.setGroupMemberTotal(dto.getSum()); |
|||
} |
|||
}); |
|||
} |
|||
//删除旧数据
|
|||
factPartyMemberVanguardGridDailyService.deleteDailyData(customerId, dimId.getDateId()); |
|||
//批量插入
|
|||
factPartyMemberVanguardGridDailyService.insertBatch(vanguardList); |
|||
} |
|||
} |
|||
|
|||
|
|||
private Date yesterday() { |
|||
Date date = new Date(); |
|||
try { |
|||
DateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
Calendar calendar = Calendar.getInstance(); |
|||
calendar.set(Calendar.HOUR_OF_DAY, -24); |
|||
String str = sdf.format(calendar.getTime()); |
|||
date = sdf.parse(str); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return date; |
|||
} |
|||
|
|||
private FactPartyMemberVanguardAgencyDailyEntity initAgencyDailyEntity(DimAgencyDTO agency, DimIdGenerator.DimIdBean dimId) { |
|||
FactPartyMemberVanguardAgencyDailyEntity entity = new FactPartyMemberVanguardAgencyDailyEntity(); |
|||
entity.setCustomerId(agency.getCustomerId()); |
|||
entity.setAgencyId(agency.getId()); |
|||
entity.setPid(agency.getPid()); |
|||
entity.setDateId(dimId.getDateId()); |
|||
entity.setWeekId(dimId.getWeekId()); |
|||
entity.setMonthId(dimId.getMonthId()); |
|||
entity.setQuarterId(dimId.getQuarterId()); |
|||
entity.setYearId(dimId.getYearId()); |
|||
entity.setGroupCount(NumConstant.ZERO); |
|||
entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setGroupTotal(NumConstant.ZERO); |
|||
entity.setGroupMemberCount(NumConstant.ZERO); |
|||
entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setGroupMemberTotal(NumConstant.ZERO); |
|||
entity.setTopicCount(NumConstant.ZERO); |
|||
entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setTopicTotal(NumConstant.ZERO); |
|||
entity.setIssueCount(NumConstant.ZERO); |
|||
entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setIssueTotal(NumConstant.ZERO); |
|||
entity.setProjectCount(NumConstant.ZERO); |
|||
entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setProjectTotal(NumConstant.ZERO); |
|||
entity.setProjectClosedCount(NumConstant.ZERO); |
|||
entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setProjectClosedTotal(NumConstant.ZERO); |
|||
return entity; |
|||
} |
|||
|
|||
|
|||
private FactPartyMemberVanguardGridDailyEntity initGridDailyEntity(DimGridEntity grid, DimIdGenerator.DimIdBean dimId) { |
|||
FactPartyMemberVanguardGridDailyEntity entity = new FactPartyMemberVanguardGridDailyEntity(); |
|||
entity.setCustomerId(grid.getCustomerId()); |
|||
entity.setAgencyId(grid.getAgencyId()); |
|||
entity.setGridId(grid.getId()); |
|||
entity.setDateId(dimId.getDateId()); |
|||
entity.setWeekId(dimId.getWeekId()); |
|||
entity.setMonthId(dimId.getMonthId()); |
|||
entity.setQuarterId(dimId.getQuarterId()); |
|||
entity.setYearId(dimId.getYearId()); |
|||
entity.setGroupCount(NumConstant.ZERO); |
|||
entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setGroupTotal(NumConstant.ZERO); |
|||
entity.setGroupMemberCount(NumConstant.ZERO); |
|||
entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setGroupMemberTotal(NumConstant.ZERO); |
|||
entity.setTopicCount(NumConstant.ZERO); |
|||
entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setTopicTotal(NumConstant.ZERO); |
|||
entity.setIssueCount(NumConstant.ZERO); |
|||
entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setIssueTotal(NumConstant.ZERO); |
|||
entity.setProjectCount(NumConstant.ZERO); |
|||
entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setProjectTotal(NumConstant.ZERO); |
|||
entity.setProjectClosedCount(NumConstant.ZERO); |
|||
entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); |
|||
entity.setProjectClosedTotal(NumConstant.ZERO); |
|||
return entity; |
|||
} |
|||
} |
@ -0,0 +1,105 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.stats; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员先锋-机关日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
public interface FactPartyMemberVanguardAgencyDailyService extends BaseService<FactPartyMemberVanguardAgencyDailyEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<FactPartyMemberVanguardAgencyDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
PageData<FactPartyMemberVanguardAgencyDailyDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<FactPartyMemberVanguardAgencyDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
List<FactPartyMemberVanguardAgencyDailyDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return FactPartyMemberVanguardAgencyDailyDTO |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
FactPartyMemberVanguardAgencyDailyDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void save(FactPartyMemberVanguardAgencyDailyDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void update(FactPartyMemberVanguardAgencyDailyDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 清除日数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 15:55 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return void |
|||
*/ |
|||
void deleteDailyData(String customerId, String dateId); |
|||
} |
@ -0,0 +1,105 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.stats; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员先锋-网格日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
public interface FactPartyMemberVanguardGridDailyService extends BaseService<FactPartyMemberVanguardGridDailyEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<FactPartyMemberVanguardGridDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
PageData<FactPartyMemberVanguardGridDailyDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<FactPartyMemberVanguardGridDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
List<FactPartyMemberVanguardGridDailyDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return FactPartyMemberVanguardGridDailyDTO |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
FactPartyMemberVanguardGridDailyDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void save(FactPartyMemberVanguardGridDailyDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void update(FactPartyMemberVanguardGridDailyDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-13 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 清除日数据 |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 15:55 |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return void |
|||
*/ |
|||
void deleteDailyData(String customerId, String dateId); |
|||
} |
@ -0,0 +1,118 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.stats.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.stats.FactPartyMemberVanguardAgencyDailyDao; |
|||
import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; |
|||
import com.epmet.service.stats.FactPartyMemberVanguardAgencyDailyService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员先锋-机关日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.STATS) |
|||
public class FactPartyMemberVanguardAgencyDailyServiceImpl extends BaseServiceImpl<FactPartyMemberVanguardAgencyDailyDao, FactPartyMemberVanguardAgencyDailyEntity> implements FactPartyMemberVanguardAgencyDailyService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<FactPartyMemberVanguardAgencyDailyDTO> page(Map<String, Object> params) { |
|||
IPage<FactPartyMemberVanguardAgencyDailyEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, FactPartyMemberVanguardAgencyDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<FactPartyMemberVanguardAgencyDailyDTO> list(Map<String, Object> params) { |
|||
List<FactPartyMemberVanguardAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardAgencyDailyDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<FactPartyMemberVanguardAgencyDailyEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<FactPartyMemberVanguardAgencyDailyEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public FactPartyMemberVanguardAgencyDailyDTO get(String id) { |
|||
FactPartyMemberVanguardAgencyDailyEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardAgencyDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(FactPartyMemberVanguardAgencyDailyDTO dto) { |
|||
FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(FactPartyMemberVanguardAgencyDailyDTO dto) { |
|||
FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 清除日数据 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return void |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 15:55 |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void deleteDailyData(String customerId, String dateId) { |
|||
baseDao.deleteDailyData(customerId, dateId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,118 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.stats.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.stats.FactPartyMemberVanguardGridDailyDao; |
|||
import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; |
|||
import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; |
|||
import com.epmet.service.stats.FactPartyMemberVanguardGridDailyService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 党员先锋-网格日统计数据 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.STATS) |
|||
public class FactPartyMemberVanguardGridDailyServiceImpl extends BaseServiceImpl<FactPartyMemberVanguardGridDailyDao, FactPartyMemberVanguardGridDailyEntity> implements FactPartyMemberVanguardGridDailyService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<FactPartyMemberVanguardGridDailyDTO> page(Map<String, Object> params) { |
|||
IPage<FactPartyMemberVanguardGridDailyEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, FactPartyMemberVanguardGridDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<FactPartyMemberVanguardGridDailyDTO> list(Map<String, Object> params) { |
|||
List<FactPartyMemberVanguardGridDailyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardGridDailyDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<FactPartyMemberVanguardGridDailyEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<FactPartyMemberVanguardGridDailyEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public FactPartyMemberVanguardGridDailyDTO get(String id) { |
|||
FactPartyMemberVanguardGridDailyEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardGridDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(FactPartyMemberVanguardGridDailyDTO dto) { |
|||
FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(FactPartyMemberVanguardGridDailyDTO dto) { |
|||
FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 清除日数据 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return void |
|||
* @author zhaoqifeng |
|||
* @date 2021/5/17 15:55 |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void deleteDailyData(String customerId, String dateId) { |
|||
baseDao.deleteDailyData(customerId, dateId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.stats.FactPartyMemberVanguardAgencyDailyDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity" id="factPartyMemberVanguardAgencyDailyMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="dateId" column="DATE_ID"/> |
|||
<result property="weekId" column="WEEK_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="quarterId" column="QUARTER_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="groupCount" column="GROUP_COUNT"/> |
|||
<result property="groupRatio" column="GROUP_RATIO"/> |
|||
<result property="groupMemberCount" column="GROUP_MEMBER_COUNT"/> |
|||
<result property="groupMemberRatio" column="GROUP_MEMBER_RATIO"/> |
|||
<result property="topicCount" column="TOPIC_COUNT"/> |
|||
<result property="topicRatio" column="TOPIC_RATIO"/> |
|||
<result property="issueCount" column="ISSUE_COUNT"/> |
|||
<result property="issueRatio" column="ISSUE_RATIO"/> |
|||
<result property="projectCount" column="PROJECT_COUNT"/> |
|||
<result property="projectRatio" column="PROJECT_RATIO"/> |
|||
<result property="projectClosedCount" column="PROJECT_CLOSED_COUNT"/> |
|||
<result property="projectClosedRatio" column="PROJECT_CLOSED_RATIO"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<delete id="deleteDailyData"> |
|||
delete from fact_party_member_vanguard_agency_daily where customer_id = #{customerId} and DATE_ID = #{dateId} |
|||
</delete> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.stats.FactPartyMemberVanguardGridDailyDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity" id="factPartyMemberVanguardGridDailyMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="dateId" column="DATE_ID"/> |
|||
<result property="weekId" column="WEEK_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="quarterId" column="QUARTER_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="groupCount" column="GROUP_COUNT"/> |
|||
<result property="groupRatio" column="GROUP_RATIO"/> |
|||
<result property="groupMemberCount" column="GROUP_MEMBER_COUNT"/> |
|||
<result property="groupMemberRatio" column="GROUP_MEMBER_RATIO"/> |
|||
<result property="topicCount" column="TOPIC_COUNT"/> |
|||
<result property="topicRatio" column="TOPIC_RATIO"/> |
|||
<result property="issueCount" column="ISSUE_COUNT"/> |
|||
<result property="issueRatio" column="ISSUE_RATIO"/> |
|||
<result property="projectCount" column="PROJECT_COUNT"/> |
|||
<result property="projectRatio" column="PROJECT_RATIO"/> |
|||
<result property="projectClosedCount" column="PROJECT_CLOSED_COUNT"/> |
|||
<result property="projectClosedRatio" column="PROJECT_CLOSED_RATIO"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<delete id="deleteDailyData"> |
|||
delete from fact_party_member_vanguard_grid_daily where customer_id = #{customerId} and DATE_ID = #{dateId} |
|||
</delete> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue