Browse Source
# Conflicts: # epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java # epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.javadev_shibei_match
151 changed files with 7657 additions and 192 deletions
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.constant; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 3:49 下午 |
||||
|
*/ |
||||
|
public interface ProjectEvaluateConstant { |
||||
|
|
||||
|
// BigDecimal BAD = new BigDecimal(NumConstant.SIXTY);
|
||||
|
// BigDecimal GOOD = new BigDecimal(NumConstant.EIGHTY);
|
||||
|
// BigDecimal PERFECT = new BigDecimal(NumConstant.ONE_HUNDRED);
|
||||
|
|
||||
|
Integer BAD = NumConstant.SIXTY; |
||||
|
Integer GOOD = NumConstant.EIGHTY; |
||||
|
Integer PERFECT = NumConstant.ONE_HUNDRED; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,155 @@ |
|||||
|
/** |
||||
|
* 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.extract; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-小组相关 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class FactOriginGroupMainDailyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 组的Id |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) |
||||
|
Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” |
||||
|
*/ |
||||
|
private String groupState; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在机关Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在组织的父机关Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在组织所有父类Id集合 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的时期 |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的周期 |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的月份 |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的季度 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的年 |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 群众人数 |
||||
|
*/ |
||||
|
private Integer resiMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 组内总人数 |
||||
|
*/ |
||||
|
private Integer memberTotal; |
||||
|
|
||||
|
/** |
||||
|
* 群主ID |
||||
|
*/ |
||||
|
private String groupOwnerId; |
||||
|
|
||||
|
/** |
||||
|
* 群主是否热心居民 可以update |
||||
|
*/ |
||||
|
private Integer isOwnerHearted; |
||||
|
|
||||
|
/** |
||||
|
* 群主是否党员 可以update |
||||
|
*/ |
||||
|
private Integer isOwnerParty; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 默认为0 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
private List<ExtractGroupMemberActionRecordResultDTO> members = new ArrayList(); |
||||
|
} |
||||
@ -0,0 +1,128 @@ |
|||||
|
/** |
||||
|
* 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.extract; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-机关项目响应时间 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class FactOriginProjectOrgPeriodDailyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String projectId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* grid agenct dept |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 最后一个节点是PID,若无则为空 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 流转到的日期 |
||||
|
*/ |
||||
|
private Date informedDate; |
||||
|
|
||||
|
/** |
||||
|
* 流转走或结案的日期 |
||||
|
*/ |
||||
|
private Date handledDate; |
||||
|
|
||||
|
/** |
||||
|
* 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) |
||||
|
*/ |
||||
|
private Integer totalPeriod; |
||||
|
|
||||
|
/** |
||||
|
* 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 |
||||
|
*/ |
||||
|
private Integer periodTillReplyFirstly; |
||||
|
|
||||
|
/** |
||||
|
* resloved 、 unresolved |
||||
|
*/ |
||||
|
private String isResolved; |
||||
|
|
||||
|
/** |
||||
|
* 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! |
||||
|
* */ |
||||
|
private String operation; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.extract.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* desc:抽取指标数据 参数dto |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ExtractIndexFormDTO implements Serializable { |
||||
|
|
||||
|
|
||||
|
private static final long serialVersionUID = 1248641210655148366L; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
private String monthId; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,148 @@ |
|||||
|
/** |
||||
|
* 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.extract.form; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 治理能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GovernAbilityGridMonthlyFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格所属机关Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 月维度Id:yyyyMM |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年Id:yyyy |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 网格总议题数 |
||||
|
*/ |
||||
|
private Integer issueTotal; |
||||
|
|
||||
|
/** |
||||
|
* 网格人均议题数目 |
||||
|
*/ |
||||
|
private Integer avgIssueCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格议题转项目率 |
||||
|
*/ |
||||
|
private BigDecimal issueToProjectRatio; |
||||
|
|
||||
|
/** |
||||
|
* 网格总项目数 |
||||
|
*/ |
||||
|
private Integer projectTotal; |
||||
|
|
||||
|
/** |
||||
|
* 网格自治项目数 统计期网格自身内办结的项目数目 |
||||
|
*/ |
||||
|
private Integer selfSolveProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格办结项目数 统计期内办结的项目数目 |
||||
|
*/ |
||||
|
private Integer resolveProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格吹哨部门准确率 |
||||
|
*/ |
||||
|
private BigDecimal transferRightRatio; |
||||
|
|
||||
|
/** |
||||
|
* 网格内解决的项目的满意度 |
||||
|
*/ |
||||
|
private BigDecimal satisfactionRatio; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除;1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
public GovernAbilityGridMonthlyFormDTO() { |
||||
|
this.issueTotal = NumConstant.ZERO; |
||||
|
this.avgIssueCount = NumConstant.ZERO; |
||||
|
this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); |
||||
|
this.projectTotal = NumConstant.ZERO; |
||||
|
this.selfSolveProjectCount = NumConstant.ZERO; |
||||
|
this.resolveProjectCount = NumConstant.ZERO; |
||||
|
this.transferRightRatio = new BigDecimal(NumConstant.ZERO); |
||||
|
this.satisfactionRatio = new BigDecimal(NumConstant.ZERO); |
||||
|
this.delFlag = NumConstant.ZERO_STR; |
||||
|
this.revision = NumConstant.ZERO; |
||||
|
this.createdBy = "APP_USER"; |
||||
|
this.updatedBy = "APP_USER"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.extract.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @ClassName GridHeartedFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-20 12:42 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridHeartedFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 9069263069122734316L; |
||||
|
|
||||
|
private String userId; |
||||
|
|
||||
|
private String gridId; |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.dto.extract.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 10:12 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridIssueCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1222149631076688225L; |
||||
|
|
||||
|
/** |
||||
|
* 网格总议题数目 |
||||
|
*/ |
||||
|
private Integer issueTotal; |
||||
|
|
||||
|
/** |
||||
|
* 网格人均议题数目 |
||||
|
*/ |
||||
|
private Integer avgIssueCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
} |
||||
@ -0,0 +1,178 @@ |
|||||
|
/** |
||||
|
* 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.extract.form; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyAbilityGridMonthlyFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 机关Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 月维度Id:yyyyMM |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年Idyyyy |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 网格群众用户数 |
||||
|
*/ |
||||
|
private Integer userCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格党员用户数 |
||||
|
*/ |
||||
|
private Integer partyCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格活跃群众用户数 |
||||
|
*/ |
||||
|
private Integer activeUserCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格活跃党员用户数 |
||||
|
*/ |
||||
|
private Integer activePartyCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格党员人均提出话题数 |
||||
|
*/ |
||||
|
private Integer partyAvgTopicCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格群众人均提出话题数 |
||||
|
*/ |
||||
|
private Integer userAvgTopicCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格党员人均提出的议题转项目数 |
||||
|
*/ |
||||
|
private Integer partyAvgShiftProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格群众人均提出的议题转项目数 |
||||
|
*/ |
||||
|
private Integer userAvgShiftProjectCount; |
||||
|
|
||||
|
/** |
||||
|
* 建群党员数(累计值) 去重 |
||||
|
*/ |
||||
|
private Integer createGroupPartyCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格发文数 |
||||
|
*/ |
||||
|
private Integer publishArticleCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格议题转项目率 |
||||
|
*/ |
||||
|
private BigDecimal issueToProjectRatio; |
||||
|
|
||||
|
/** |
||||
|
* 组织三会一课次数 |
||||
|
*/ |
||||
|
private Integer createThreeMeetsCount; |
||||
|
|
||||
|
/** |
||||
|
* 党员参加三会一课人次 |
||||
|
*/ |
||||
|
private Integer joinThreeMeetsCount; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除;1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
public PartyAbilityGridMonthlyFormDTO() { |
||||
|
this.userCount = NumConstant.ZERO; |
||||
|
this.partyCount = NumConstant.ZERO; |
||||
|
this.activeUserCount = NumConstant.ZERO; |
||||
|
this.activePartyCount = NumConstant.ZERO; |
||||
|
this.partyAvgTopicCount = NumConstant.ZERO; |
||||
|
this.userAvgTopicCount = NumConstant.ZERO; |
||||
|
this.partyAvgShiftProjectCount = NumConstant.ZERO; |
||||
|
this.userAvgShiftProjectCount = NumConstant.ZERO; |
||||
|
this.createGroupPartyCount = NumConstant.ZERO; |
||||
|
this.publishArticleCount = NumConstant.ZERO; |
||||
|
this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); |
||||
|
this.createThreeMeetsCount = NumConstant.ZERO; |
||||
|
this.joinThreeMeetsCount = NumConstant.ZERO; |
||||
|
this.delFlag = NumConstant.ZERO_STR; |
||||
|
this.revision = NumConstant.ZERO; |
||||
|
this.createdBy = "APP_USER"; |
||||
|
this.updatedBy = "APP_USER"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 5:22 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AutoNoMyResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 5812052000386418907L; |
||||
|
|
||||
|
/** |
||||
|
* 动作code |
||||
|
*/ |
||||
|
private String actionCode; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String projectId; |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 4:01 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CalSatisfactionResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -7514945819312915670L; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/19 1:55 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CreateTopicCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 500844515980125608L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 党员/群众 人均提出话题数 |
||||
|
*/ |
||||
|
private Integer createTopicCount; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 2:02 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridProjectClosedTotalResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 5144371528837124674L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格办结项目数 |
||||
|
*/ |
||||
|
private Integer resolveProjectCount; |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 1:22 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridProjectCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -1348707512443965601L; |
||||
|
|
||||
|
/** |
||||
|
* 网格总项目数 |
||||
|
*/ |
||||
|
private Integer projectTotal; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格议题转项目率 |
||||
|
*/ |
||||
|
private BigDecimal issueToProjectRatio; |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/19 10:59 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridUserCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -2912049598149499392L; |
||||
|
|
||||
|
/** |
||||
|
* 注册居民本月增量 |
||||
|
*/ |
||||
|
private Integer userCount; |
||||
|
|
||||
|
/** |
||||
|
* 注册党员本月增量 |
||||
|
*/ |
||||
|
private Integer partyCount; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 2:46 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class NotReturnProjectResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -2931817313224740122L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 未被退回的项目 |
||||
|
*/ |
||||
|
private Integer notReturnProject = NumConstant.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 网格吹哨部门准确率 |
||||
|
*/ |
||||
|
private BigDecimal transferRightRatio = new BigDecimal(NumConstant.ZERO); |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Description 各机关响应时间 |
||||
|
* @ClassName OrgResponseTimeResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-21 02:03 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgResponseTimeResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 6017440139236985959L; |
||||
|
|
||||
|
private String agencyId; |
||||
|
|
||||
|
private BigDecimal responseTime; |
||||
|
|
||||
|
private BigDecimal projectTotal; |
||||
|
|
||||
|
private BigDecimal distinctProjectTotal; |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/18 14:39 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class OrgStatisticsResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 9221060553279124719L; |
||||
|
private String customerId; |
||||
|
private String agencyId; |
||||
|
private String orgId; |
||||
|
private Integer count; |
||||
|
private Integer sum; |
||||
|
private String ratio; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/21 9:35 上午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyActiveResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4694666116463447613L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 动作操作用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/19 3:30 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PartyCreateGroupCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -4193777575465275095L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 建群党员数 |
||||
|
*/ |
||||
|
private Integer partyCreateGroupCount; |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 3:23 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectEvaluateResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 6042094904405338630L; |
||||
|
|
||||
|
/** |
||||
|
* 动作code |
||||
|
*/ |
||||
|
private String actionCode; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 满意度评价对应的分数 |
||||
|
*/ |
||||
|
private Integer score = NumConstant.ZERO; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String projectId; |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 参与过项目的agencyDTO |
||||
|
* @ClassName ProjectParticipatedAgencyResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-20 23:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectParticipatedAgencyResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 1071619125612033138L; |
||||
|
|
||||
|
private String projectId; |
||||
|
|
||||
|
private String agencyId; |
||||
|
|
||||
|
private String level; |
||||
|
|
||||
|
private int score; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/19 2:41 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PublishCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -955208044108055887L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 发文数量 |
||||
|
*/ |
||||
|
private Integer publishCount; |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.dto.extract.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/19 2:23 下午 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ShiftProjectCountResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -262809191405218048L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格 党员/群众 人均提出的议题转项目数 |
||||
|
*/ |
||||
|
private Integer shiftProjectCount; |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
package com.epmet.dto.group.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @ClassName ExtractGroupMemberActionRecordResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-18 21:18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ExtractGroupMemberActionRecordResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -74883228267461785L; |
||||
|
private String customerId; |
||||
|
|
||||
|
private String groupId; |
||||
|
|
||||
|
private String memberId; |
||||
|
|
||||
|
private String leaderFlag; |
||||
|
|
||||
|
private String dateId; |
||||
|
|
||||
|
private String weekId; |
||||
|
|
||||
|
private String monthId; |
||||
|
|
||||
|
private String quarterId; |
||||
|
|
||||
|
private String yearId; |
||||
|
|
||||
|
private Date joinDate; |
||||
|
|
||||
|
/** |
||||
|
* 目前只有join leader也是join |
||||
|
* */ |
||||
|
private String actionCode; |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.dto.project; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/20 21:08 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class FinishOrgDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -5684606755705833962L; |
||||
|
private String projectId; |
||||
|
private String orgIdPath; |
||||
|
private String pIdPath; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,95 @@ |
|||||
|
package com.epmet.dto.project.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description 从数据库中查询出的 项目 - 机关(网格、部门、机关)的响应时长 |
||||
|
* FIXME 注:查询的全都是已经结案的项目!!!!!!!!!!!!如果查询流转中的项目,需要修改逻辑(较为复杂) |
||||
|
* @ClassName ProjectOrgPeriodResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-16 15:28 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectOrgPeriodResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 6216112710806237600L; |
||||
|
|
||||
|
/** |
||||
|
* 节点Id |
||||
|
* */ |
||||
|
private String processId; |
||||
|
|
||||
|
/** |
||||
|
* 项目Id |
||||
|
* */ |
||||
|
private String projectId; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 对这个节点的处理,如果未处理则为null |
||||
|
* created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联,需要另取) |
||||
|
* */ |
||||
|
private String operation; |
||||
|
|
||||
|
/** |
||||
|
* 是这个节点的操作,相当于上一个人的操作,而不是对于这个节点的处理 |
||||
|
* created transfer close return response |
||||
|
* */ |
||||
|
private String lastAction; |
||||
|
|
||||
|
/** |
||||
|
* 节点所属的机关,即上个节点推到这个节点的负责部门 |
||||
|
* */ |
||||
|
private String departmentName; |
||||
|
|
||||
|
/** |
||||
|
* 当前节点所属的Agency,如果负责的是部门或者网格则是其所属的机关 |
||||
|
* */ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 如果是部门处理,则有值,否则null |
||||
|
* */ |
||||
|
private String departmentId; |
||||
|
|
||||
|
/** |
||||
|
* 如果是网格处理,则有值,否则null |
||||
|
* */ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 当前所属的机关的所有Pid集合以及当前的机关Id,所以此项不会未null,至少也是它的所属Agency |
||||
|
* */ |
||||
|
private String orgIdPath; |
||||
|
|
||||
|
/** |
||||
|
* 从节点流入到节点流出,且当前负责单位确实解决(包括退回)了的情况下,所耗费的时间(以分钟为单位) |
||||
|
* 如果未当前负责单位一直停留在unresolved状态,即使做出response、或者项目被其他单位结案,该项依旧是0,不参与办结的计时 |
||||
|
* 如果负责单位只是做出回应,但未处理(即没有让节点流走),需要查出其相应的第一次响应时间,另取 |
||||
|
* */ |
||||
|
private Integer totalPeriod; |
||||
|
|
||||
|
/** |
||||
|
* 节点流入时间 |
||||
|
* */ |
||||
|
private Date informedDate; |
||||
|
|
||||
|
/** |
||||
|
* 节点流出时间,如果未解决则未null |
||||
|
* */ |
||||
|
private Date handledDate; |
||||
|
|
||||
|
/** |
||||
|
* 第一次响应时间 |
||||
|
* */ |
||||
|
private Date periodTillReplyFirstly; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
private String staffId; |
||||
|
|
||||
|
private String isResolved; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
package com.epmet.dto.project.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询机关在项目节点上响应的结果 |
||||
|
* 查询的是存在“响应”的所有相关工作人员节点,如果同一个人对同一个项目已经做过一次处理(并未做出响应)而在第二次流转到自己时 |
||||
|
* 做出了响应,也会连带查询出其第一次未响应过的数据 |
||||
|
* @ClassName ProjectOrgRelationWhenResponseResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-16 17:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectOrgRelationWhenResponseResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 1962332392048752037L; |
||||
|
|
||||
|
/** |
||||
|
* 项目Id |
||||
|
* */ |
||||
|
private String projectId; |
||||
|
|
||||
|
/** |
||||
|
* 节点Id |
||||
|
* */ |
||||
|
private String processId; |
||||
|
|
||||
|
/** |
||||
|
* 节点动作的发起人 |
||||
|
* */ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 负责人所属的单位名称:xx机关-xx部门 、 xx机关-xx网格 、 xx机关 |
||||
|
* */ |
||||
|
private String departmentName; |
||||
|
|
||||
|
/** |
||||
|
* 动作分类 |
||||
|
* */ |
||||
|
private String operation; |
||||
|
|
||||
|
/** |
||||
|
* 节点创建时间,动作发起时间 |
||||
|
* */ |
||||
|
private Date createdTime; |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.stats.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @ClassName GridAttributesResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-20 12:50 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridAttributesResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 466974582608407121L; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格所属机关ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 机关的上级ID |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 所有上级Id |
||||
|
* */ |
||||
|
private String pids; |
||||
|
} |
||||
@ -0,0 +1,210 @@ |
|||||
|
package com.epmet.feign.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.StatsFormDTO; |
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
import com.epmet.dto.extract.form.ExtractIndexFormDTO; |
||||
|
import com.epmet.dto.group.form.GroupStatsFormDTO; |
||||
|
import com.epmet.dto.issue.form.IssueJobFromDTO; |
||||
|
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; |
||||
|
import com.epmet.feign.DataStatisticalOpenFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* desc: |
||||
|
* |
||||
|
* @return: |
||||
|
* @date: 2020/6/22 9:38 |
||||
|
* @author: jianjun liu |
||||
|
* email:liujianjun@git.elinkit.com.cn |
||||
|
*/ |
||||
|
@Component |
||||
|
public class FactExtractOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 |
||||
|
* |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result articleSummaryDailyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 |
||||
|
* |
||||
|
* @return: |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagUsedDailyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 |
||||
|
* |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagUsedMonthlyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 |
||||
|
* |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagUsedQuarterlyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【日】 统计阅读最多的标签 包含 机关 网格 |
||||
|
* |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagViewedDailyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【月】 统计阅读最多的标签 包含 机关 网格 |
||||
|
* |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagViewedMonthlyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result tagViewedQuarterlyStatsjob(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result groupGridDaily(GroupStatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result groupAgencyDaily(GroupStatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result groupAgencyMonthly(GroupStatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result agencyGridIssueStats() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats"); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result agencyGridIssueStatsOfDate(IssueJobFromDTO fromDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStatsOfDate"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 数据统计-项目-机关日月统计 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result agencyProjectStats(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 数据统计-项目-网格日月统计 |
||||
|
* @Author sun |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result gridProjectStats(StatsFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats", formDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result initAllDims() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllDims"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return |
||||
|
* @Description 执行用户统计 |
||||
|
* @author wangc |
||||
|
* @date 2020.06.29 09:26 |
||||
|
**/ |
||||
|
@Override |
||||
|
public Result execUserStatistical(String date) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical", date); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param |
||||
|
* @return |
||||
|
* @Description 执行话题统计 |
||||
|
* @author wangc |
||||
|
* @date 2020.06.29 09:27 |
||||
|
**/ |
||||
|
@Override |
||||
|
public Result execTopicStatistical(String date) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical", date); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo", customerIdAndDateIdFormDTO); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result processPenddingCalculate() { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result factOriginExtractAll(ExtractFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* desc: 【月】抽取统计数据到指标库 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @date: 2020/6/22 9:09 |
||||
|
* @author: jianjun liu |
||||
|
*/ |
||||
|
@Override |
||||
|
public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO); |
||||
|
} |
||||
|
} |
||||
@ -1,84 +0,0 @@ |
|||||
package com.epmet.controller; |
|
||||
|
|
||||
import com.epmet.commons.tools.utils.Result; |
|
||||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
||||
import com.epmet.dto.extract.form.ExtractFormDTO; |
|
||||
import com.epmet.dto.extract.form.ProjectFormDTO; |
|
||||
import com.epmet.service.evaluationindex.extract.IssueExtractService; |
|
||||
import com.epmet.service.evaluationindex.extract.ProjectExtractService; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; |
|
||||
import org.apache.commons.lang3.StringUtils; |
|
||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
import java.util.Date; |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 原始数据清洗 |
|
||||
* |
|
||||
* @author yinzuomei@elink-cn.com |
|
||||
* @date 2020/9/15 11:06 |
|
||||
*/ |
|
||||
@RestController |
|
||||
@RequestMapping("factorigin") |
|
||||
public class FactOriginController { |
|
||||
|
|
||||
@Autowired |
|
||||
private IssueExtractService issueExtractService; |
|
||||
@Autowired |
|
||||
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
|
||||
@Autowired |
|
||||
private ProjectExtractService projectExtractService; |
|
||||
|
|
||||
/** |
|
||||
* @Description 议题抽取(main) |
|
||||
* @param extractFormDTO |
|
||||
* @author zxc |
|
||||
* @date 2020/9/15 2:02 下午 |
|
||||
*/ |
|
||||
@PostMapping("issueextractmain") |
|
||||
public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO){ |
|
||||
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); |
|
||||
issueExtractService.issueExtractMain(extractFormDTO); |
|
||||
return new Result(); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* @Description 议题抽取(log) |
|
||||
* @param extractFormDTO |
|
||||
* @author zxc |
|
||||
* @date 2020/9/16 9:41 上午 |
|
||||
*/ |
|
||||
@PostMapping("issueextractlog") |
|
||||
public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO){ |
|
||||
ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); |
|
||||
issueExtractService.issueExtractLog(extractFormDTO); |
|
||||
return new Result(); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* @param customerId yyyyMMdd |
|
||||
* @param dateId yyyyMMdd |
|
||||
* @return com.epmet.commons.tools.utils.Result |
|
||||
* @author yinzuomei |
|
||||
* @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计) |
|
||||
* @Date 2020/9/15 13:39 |
|
||||
**/ |
|
||||
@PostMapping("topic") |
|
||||
public Result topicDataCleaning(String customerId,String dateId) { |
|
||||
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { |
|
||||
factOriginTopicMainDailyService.topicCleaning(customerId,dateId); |
|
||||
} |
|
||||
return new Result(); |
|
||||
} |
|
||||
|
|
||||
@PostMapping("project") |
|
||||
public Result projectData(@RequestBody ProjectFormDTO formDTO) { |
|
||||
projectExtractService.saveOriginProjectDaily(formDTO.getCustomerId(), formDTO.getDate()); |
|
||||
return new Result(); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.extract.form.ExtractIndexFormDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 原始数据清洗 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/9/15 11:06 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("indexorigin") |
||||
|
public class IndexOriginExtractController { |
||||
|
@Autowired |
||||
|
private IndexOriginExtractService indexOriginExtractService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* desc:抽取统计数据到指标库 |
||||
|
* |
||||
|
* @param extractFormDTO 默认统计上一个月 |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("extractall") |
||||
|
public Result extractAll(@RequestBody ExtractIndexFormDTO extractFormDTO) { |
||||
|
indexOriginExtractService.indexOriginExtractAll(extractFormDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,139 @@ |
|||||
|
/** |
||||
|
* 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.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; |
||||
|
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; |
||||
|
import com.epmet.dto.extract.form.GridHeartedFormDTO; |
||||
|
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-小组相关 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMainDailyEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询建群党员数 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 3:49 下午 |
||||
|
*/ |
||||
|
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 查询是否存在该客户下的数据 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.18 23:30 |
||||
|
**/ |
||||
|
int selectIfExist(@Param("customerId")String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 按照客户Id清除组数据 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 09:58 |
||||
|
**/ |
||||
|
void deleteBatchByCustomerId(@Param("customerId")String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 按照客户Id清除组员数据 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 09:58 |
||||
|
**/ |
||||
|
void deleteBatchMemberByCustomerId(@Param("customerId")String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 按照组Id清除组和组员数据 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 12:16 |
||||
|
**/ |
||||
|
void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List<String> list); |
||||
|
|
||||
|
/** |
||||
|
* @Description 更新群主的党员信息 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 12:44 |
||||
|
**/ |
||||
|
int updatePartyFlag(@Param("list") List<String> list,@Param("customerId")String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 更新群主的热心居民信息 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 12:44 |
||||
|
**/ |
||||
|
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list,@Param("customerId")String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 批量插入组主表 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 15:37 |
||||
|
**/ |
||||
|
int insertBatchMain(@Param("list") List<FactOriginGroupMainDailyDTO> list); |
||||
|
|
||||
|
/** |
||||
|
* @Description 批量插入组员表 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.20 15:37 |
||||
|
**/ |
||||
|
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list); |
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param groupOwnerId |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @author yinzuomei |
||||
|
* @description 查询当前用户建的所有群id |
||||
|
* @Date 2020/9/20 21:22 |
||||
|
**/ |
||||
|
List<String> selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId); |
||||
|
|
||||
|
/** |
||||
|
* @return java.util.List<java.lang.String> |
||||
|
* @param groupIdList |
||||
|
* @author yinzuomei |
||||
|
* @description 查询组成员数(去重) |
||||
|
* @Date 2020/9/20 21:29 |
||||
|
**/ |
||||
|
List<String> selectGroupMemberList(@Param("list") List<String> groupIdList); |
||||
|
} |
||||
@ -0,0 +1,99 @@ |
|||||
|
/** |
||||
|
* 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.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.extract.result.OrgResponseTimeResultDTO; |
||||
|
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-机关项目响应时间 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginProjectOrgPeriodDailyEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询是否存在数据,如果没有则视为第一次扫描该表,需要根据业务查询全部数据 |
||||
|
* @param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.17 13:43 |
||||
|
**/ |
||||
|
int selectIfExisted(@Param("customerId") String customerId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 在插入之前,先删除所有与这个项目相关的历时信息 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.17 14:43 |
||||
|
**/ |
||||
|
void deleteByProjectId(@Param("projectId") String projectId); |
||||
|
|
||||
|
/** |
||||
|
* 获取项目响应度 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 15:52 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @param level |
||||
|
* @param orgType |
||||
|
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO> |
||||
|
*/ |
||||
|
List<OrgStatisticsResultDTO> selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId, |
||||
|
@Param("level")String level, |
||||
|
@Param("orgType")String orgType); |
||||
|
|
||||
|
void deleteByProjectId(@Param("list") List<String> list); |
||||
|
|
||||
|
/** |
||||
|
* @Description 批量插入 |
||||
|
* @param list |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.18 17:11 |
||||
|
**/ |
||||
|
void insertBatch(@Param("list") List<FactOriginProjectOrgPeriodDailyEntity> list); |
||||
|
|
||||
|
/** |
||||
|
* @Description 查找网格、部门对项目的响应系数 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.21 02:13 |
||||
|
**/ |
||||
|
List<OrgResponseTimeResultDTO> selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); |
||||
|
|
||||
|
/** |
||||
|
* @Description 查找机关对项目的响应系数 |
||||
|
* @param customerId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.21 02:13 |
||||
|
**/ |
||||
|
List<OrgResponseTimeResultDTO> selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); |
||||
|
} |
||||
@ -0,0 +1,119 @@ |
|||||
|
/** |
||||
|
* 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.evaluationindex.extract; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-小组相关 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("fact_origin_group_main_daily") |
||||
|
public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) |
||||
|
Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” |
||||
|
*/ |
||||
|
private String groupState; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在机关Id |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在组织的父机关Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 小组所在组织所有父类Id集合 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的时期 |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的周期 |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的月份 |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的季度 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 建群申请审核通过的年 |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 群众人数 |
||||
|
*/ |
||||
|
private Integer resiMemberCount; |
||||
|
|
||||
|
/** |
||||
|
* 组内总人数 |
||||
|
*/ |
||||
|
private Integer memberTotal; |
||||
|
|
||||
|
/** |
||||
|
* 群主ID |
||||
|
*/ |
||||
|
private String groupOwnerId; |
||||
|
|
||||
|
/** |
||||
|
* 建组时群主是否热心居民,不更新 |
||||
|
*/ |
||||
|
private Integer isOwnerHearted; |
||||
|
|
||||
|
/** |
||||
|
* 建组时群主是否党员,不更新 |
||||
|
*/ |
||||
|
private Integer isOwnerParty; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
/** |
||||
|
* 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.evaluationindex.extract; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 业务数据抽取-机关项目响应时间 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-16 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("fact_origin_project_org_period_daily") |
||||
|
public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 项目ID |
||||
|
*/ |
||||
|
private String projectId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* grid agenct dept |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 最后一个节点是PID,若无则为空 |
||||
|
*/ |
||||
|
private String pids; |
||||
|
|
||||
|
/** |
||||
|
* 流转到的日期 |
||||
|
*/ |
||||
|
private Date informedDate; |
||||
|
|
||||
|
/** |
||||
|
* 流转走或结案的日期 |
||||
|
*/ |
||||
|
private Date handledDate; |
||||
|
|
||||
|
/** |
||||
|
* 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) |
||||
|
*/ |
||||
|
private Integer totalPeriod; |
||||
|
|
||||
|
/** |
||||
|
* 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 |
||||
|
*/ |
||||
|
private Date periodTillReplyFirstly; |
||||
|
|
||||
|
/** |
||||
|
* resloved 、 unresolved |
||||
|
*/ |
||||
|
private String isResolved; |
||||
|
|
||||
|
/** |
||||
|
* 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! |
||||
|
* */ |
||||
|
private String operation; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
/** |
||||
|
* 党员相关 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/9/17 14:05 |
||||
|
*/ |
||||
|
public interface CalCpcIndexService { |
||||
|
/** |
||||
|
* @return void |
||||
|
* @param customerId 客户id |
||||
|
* @param monthId yyyyMM |
||||
|
* @author yinzuomei |
||||
|
* @description 党员相关-党建能力 |
||||
|
* @Date 2020/9/17 14:08 |
||||
|
**/ |
||||
|
void calCpcPartyAbility(String customerId, String monthId); |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 9:52 上午 |
||||
|
*/ |
||||
|
public interface CalGridIndexService { |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标党建能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
Boolean calGridIndexPartyAbility(String customerId,String monthId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标治理能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
Boolean calGridIndexGovernAbility(String customerId,String monthId); |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标服务能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
Boolean calGridIndexServiceAbility(String customerId,String monthId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 治理能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
public interface FactIndexGovernAbilityGridMonthlyService{ |
||||
|
|
||||
|
/** |
||||
|
* @Description 批量插入治理能力 |
||||
|
* @param lists |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 4:28 下午 |
||||
|
*/ |
||||
|
void insertGovernAbilityRecord(@Param("lists") List<GovernAbilityGridMonthlyFormDTO> lists); |
||||
|
|
||||
|
/** |
||||
|
* @Description 删除治理能力旧纪录 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 4:31 下午 |
||||
|
*/ |
||||
|
void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
public interface FactIndexPartyAbilityGridMonthlyService{ |
||||
|
|
||||
|
/** |
||||
|
* @Description 网格党建能力插入 |
||||
|
* @param lists |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 10:32 上午 |
||||
|
*/ |
||||
|
void insertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> lists); |
||||
|
|
||||
|
/** |
||||
|
* @Description 删除旧的党建能力记录 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 10:45 上午 |
||||
|
*/ |
||||
|
void deleteOldPartyAbility(String customerId,String monthId); |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
/** |
||||
|
* 服务能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
public interface FactIndexServiceAbilityGridMonthlyService{ |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/15 14:00 |
||||
|
*/ |
||||
|
public interface FactOriginExtractService { |
||||
|
|
||||
|
/** |
||||
|
* desc:抽取所有业务数据到统计库 |
||||
|
* |
||||
|
* @param extractFormDTO |
||||
|
*/ |
||||
|
void extractAll(ExtractFormDTO extractFormDTO); |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
|
||||
|
/** |
||||
|
* @Desc 业务数据抽取 - 组相关 |
||||
|
* @Author wangc |
||||
|
* @DateTime 2020/9/14 5:07 下午 |
||||
|
*/ |
||||
|
public interface GroupExtractService { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询建群党员数 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 3:49 下午 |
||||
|
*/ |
||||
|
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId,String monthId); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 业务抽取 - 小组祥光 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.18 21:07 |
||||
|
**/ |
||||
|
void extractGroupData(ExtractFormDTO param); |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
|
||||
|
/** |
||||
|
* @Desc 业务数据抽取 - 项目节点历时 |
||||
|
* @Author wangc |
||||
|
* @DateTime 2020/9/14 5:07 下午 |
||||
|
*/ |
||||
|
public interface ProjectPeriodExtractService { |
||||
|
|
||||
|
/** |
||||
|
* @Description 抽取项目节点历时逻辑 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.17 14:05 |
||||
|
**/ |
||||
|
void extractProjectPeriodData(ExtractFormDTO param); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.dataToIndex; |
||||
|
|
||||
|
import com.epmet.dto.extract.form.ExtractIndexFormDTO; |
||||
|
|
||||
|
/** |
||||
|
* desc:将统计库对象数据抽取到指标库 服务接口 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/9/17 14:05 |
||||
|
*/ |
||||
|
public interface IndexOriginExtractService { |
||||
|
/** |
||||
|
* desc:从统计库对象抽取指标数据 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
*/ |
||||
|
void indexOriginExtractAll(ExtractIndexFormDTO formDTO); |
||||
|
} |
||||
@ -0,0 +1,105 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.dataToIndex.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.dto.extract.form.ExtractIndexFormDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.CalCpcIndexService; |
||||
|
import com.epmet.service.evaluationindex.extract.CalGridIndexService; |
||||
|
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; |
||||
|
import com.epmet.service.stats.DimCustomerService; |
||||
|
import com.epmet.util.DimIdGenerator; |
||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.concurrent.*; |
||||
|
|
||||
|
/** |
||||
|
* desc:指标原始数据抽取服务实现类 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class IndexOriginExtractServiceImpl implements IndexOriginExtractService { |
||||
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
||||
|
.setNameFormat("indexOriginExtract-pool-%d").build(); |
||||
|
ExecutorService threadPool = new ThreadPoolExecutor(2, 8, |
||||
|
10L, TimeUnit.MINUTES, |
||||
|
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); |
||||
|
|
||||
|
@Autowired |
||||
|
private CalCpcIndexService calCpcIndexService; |
||||
|
@Autowired |
||||
|
private CalGridIndexService calGridIndexService; |
||||
|
@Autowired |
||||
|
private DimCustomerService dimCustomerService; |
||||
|
|
||||
|
/** |
||||
|
* desc:从统计库对象抽取指标数据 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
*/ |
||||
|
@Override |
||||
|
public void indexOriginExtractAll(ExtractIndexFormDTO formDTO) { |
||||
|
String monthId = formDTO.getMonthId(); |
||||
|
String customerId = formDTO.getCustomerId(); |
||||
|
if (StringUtils.isBlank(monthId)) { |
||||
|
monthId = DimIdGenerator.getDateDimId(DateUtils.addDateMonths(new Date(), -1)); |
||||
|
} |
||||
|
List<String> customerIds = new ArrayList<>(); |
||||
|
if (StringUtils.isNotBlank(customerId)) { |
||||
|
customerIds.add(customerId); |
||||
|
} |
||||
|
int pageNo = NumConstant.ONE; |
||||
|
int pageSize = NumConstant.ONE_HUNDRED; |
||||
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); |
||||
|
if (CollectionUtils.isEmpty(customerIds)) { |
||||
|
log.error("indexOriginExtractAll 获取客户Id为空"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
String finalMonthId = monthId; |
||||
|
customerIds.forEach(cId -> { |
||||
|
ExtractIndexFormDTO param = new ExtractIndexFormDTO(); |
||||
|
param.setCustomerId(cId); |
||||
|
param.setMonthId(finalMonthId); |
||||
|
submitJob(param); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
private void submitJob(ExtractIndexFormDTO param) { |
||||
|
final String customerId = param.getCustomerId(); |
||||
|
final String monthId = param.getMonthId(); |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
calCpcIndexService.calCpcPartyAbility(customerId, monthId); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
calGridIndexService.calGridIndexGovernAbility(customerId, monthId); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
try { |
||||
|
calGridIndexService.calGridIndexPartyAbility(customerId, monthId); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
try { |
||||
|
calGridIndexService.calGridIndexServiceAbility(customerId, monthId); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,435 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.constant.IndexCalConstant; |
||||
|
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; |
||||
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; |
||||
|
import com.epmet.service.evaluationindex.extract.*; |
||||
|
import com.epmet.service.stats.DimCustomerPartymemberService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.collections4.ListUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.text.NumberFormat; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 党员相关 |
||||
|
* |
||||
|
* @author yinzuomei@elink-cn.com |
||||
|
* @date 2020/9/17 14:06 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class CalCpcIndexServiceImpl implements CalCpcIndexService { |
||||
|
@Autowired |
||||
|
private DimCustomerPartymemberService dimCustomerPartymemberService; |
||||
|
@Autowired |
||||
|
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; |
||||
|
@Autowired |
||||
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
||||
|
@Autowired |
||||
|
private FactOriginTopicLogDailyService factOriginTopicLogDailyService; |
||||
|
@Autowired |
||||
|
private IssueExtractService issueExtractService; |
||||
|
@Autowired |
||||
|
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; |
||||
|
@Autowired |
||||
|
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; |
||||
|
|
||||
|
/** |
||||
|
* @param customerId 客户id |
||||
|
* @param monthId yyyyMM |
||||
|
* @return void |
||||
|
* @author yinzuomei |
||||
|
* @description 党员相关-党建能力 |
||||
|
* @Date 2020/9/17 14:08 |
||||
|
**/ |
||||
|
@Override |
||||
|
public void calCpcPartyAbility(String customerId, String monthId) { |
||||
|
//1、构造初始值
|
||||
|
List<FactIndexPartyAblityCpcMonthlyEntity> indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); |
||||
|
if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { |
||||
|
log.info("dim_customer_partymember do not any records"); |
||||
|
return; |
||||
|
} |
||||
|
String quarterId= DateUtils.getQuarterId(monthId); |
||||
|
String yearId=DateUtils.getYearId(monthId); |
||||
|
//2、删除之前统计过的
|
||||
|
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
||||
|
|
||||
|
|
||||
|
//1、党员提出话题数
|
||||
|
Map<String, Integer> createTopicCountMap = calCreateTopicCount(customerId, monthId); |
||||
|
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
|
||||
|
Map<String, Integer> joinTopicCountMap = calJoinTopicCount(customerId, monthId); |
||||
|
//3、党员提出的话题转议题数
|
||||
|
Map<String, Integer> shiftIssueCountMap = calShiftIssueCount(customerId, monthId); |
||||
|
//4、党员提出的议题转项目数
|
||||
|
Map<String, Integer> shiftProjectCountMap = calShiftProjectCount(customerId, monthId); |
||||
|
//5、参加“三会一课”次数 默认0
|
||||
|
|
||||
|
//可以先查询出每个党员的 自建群
|
||||
|
Map<String, List<String>> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); |
||||
|
//6、党员自建群群众人数 (todo 和monthId无关??)
|
||||
|
Map<String, Integer> groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); |
||||
|
//7、党员自建群活跃群众人数
|
||||
|
Map<String, Integer> groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); |
||||
|
//8、党员自建群活跃度——话题数 (todo 校验sql正确性)
|
||||
|
Map<String, Integer> groupTopicCountMap = calGroupTopicCount(customerId, monthId); |
||||
|
//9、自建群活跃度——议题转项目率
|
||||
|
Map<String, BigDecimal> topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); |
||||
|
|
||||
|
//3、计算实际值,更新
|
||||
|
for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { |
||||
|
indexPartyAblityCpcEntity.setMonthId(monthId); |
||||
|
indexPartyAblityCpcEntity.setQuarterId(quarterId); |
||||
|
indexPartyAblityCpcEntity.setYearId(yearId); |
||||
|
//1、党员提出话题数
|
||||
|
if (createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和
|
||||
|
if (joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//3、党员提出的话题转议题数
|
||||
|
if (shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//4、党员提出的议题转项目数
|
||||
|
if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//5、参加“三会一课”次数 目前没有此业务,默认0
|
||||
|
//6、党员自建群群众人数
|
||||
|
if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//7、党员自建群活跃群众人数
|
||||
|
if (groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//8、党员自建群活跃度——话题数
|
||||
|
if (groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
//9、自建群活跃度——议题转项目率
|
||||
|
if (topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { |
||||
|
indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); |
||||
|
} |
||||
|
} |
||||
|
//4、分批插入批量插入
|
||||
|
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); |
||||
|
partition.forEach(list -> { |
||||
|
this.FactIndexPartyAblityCpcMonthlyEntity(list); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param partyMemberList |
||||
|
* @return java.util.Map<java.lang.String, java.util.List < java.lang.String>> |
||||
|
* @author yinzuomei |
||||
|
* @description 查询每个党员的自建群 |
||||
|
* @Date 2020/9/20 22:07 |
||||
|
**/ |
||||
|
private Map<String, List<String>> queryUserCreatedGroups(String customerId, List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList) { |
||||
|
Map<String, List<String>> map = new HashMap<>(); |
||||
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
||||
|
//查询当前党员建了多少个组
|
||||
|
List<String> groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId()); |
||||
|
if (CollectionUtils.isEmpty(groupIdList)) { |
||||
|
map.put(partyMember.getUserId(), new ArrayList<>()); |
||||
|
continue; |
||||
|
} else { |
||||
|
map.put(partyMember.getUserId(), groupIdList); |
||||
|
} |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.lang.Integer |
||||
|
* @author yinzuomei |
||||
|
* @description 1、查询出客户下所有党员对应的-党员提出话题数 |
||||
|
* @Date 2020/9/18 10:59 |
||||
|
**/ |
||||
|
private Map<String, Integer> calCreateTopicCount(String customerId, String monthId) { |
||||
|
List<Map<String, Integer>> mapList = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); |
||||
|
Map<String, Integer> resultMap = new HashMap<>(); |
||||
|
for (Map<String, Integer> map : mapList) { |
||||
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
||||
|
resultMap.put(m.getKey(), m.getValue()); |
||||
|
} |
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 2、查询客户下,这个月内,每个党员评论话题的次数 |
||||
|
* @Date 2020/9/18 13:33 |
||||
|
**/ |
||||
|
private Map<String, Integer> calJoinTopicCount(String customerId, String monthId) { |
||||
|
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); |
||||
|
Map<String, Integer> resultMap = new HashMap<>(); |
||||
|
for (Map<String, Integer> map : mapList) { |
||||
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
||||
|
resultMap.put(m.getKey(), m.getValue()); |
||||
|
} |
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 3、党员提出的话题转议题数 |
||||
|
* @Date 2020/9/18 13:53 |
||||
|
**/ |
||||
|
private Map<String, Integer> calShiftIssueCount(String customerId, String monthId) { |
||||
|
List<Map<String, Integer>> mapList = issueExtractService.selectShiftIssueCount(customerId, monthId); |
||||
|
Map<String, Integer> resultMap = new HashMap<>(); |
||||
|
for (Map<String, Integer> map : mapList) { |
||||
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
||||
|
resultMap.put(m.getKey(), m.getValue()); |
||||
|
} |
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 4、党员提出的议题转项目数 |
||||
|
* @Date 2020/9/18 14:10 |
||||
|
**/ |
||||
|
private Map<String, Integer> calShiftProjectCount(String customerId, String monthId) { |
||||
|
//查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_
|
||||
|
List<Map<String, Integer>> mapList = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); |
||||
|
Map<String, Integer> resultMap = new HashMap<>(); |
||||
|
for (Map<String, Integer> map : mapList) { |
||||
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
||||
|
resultMap.put(m.getKey(), m.getValue()); |
||||
|
} |
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 6、党员自建群群众人数 |
||||
|
* @Date 2020/9/18 15:38 |
||||
|
**/ |
||||
|
private Map<String, Integer> calgroupUserCount(String customerId, String monthId, |
||||
|
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, |
||||
|
Map<String, List<String>> userCreatedGroups) { |
||||
|
/*含义:评价周期内,党员自建群中群众成员数。 |
||||
|
数据来源:用户社群关系表。 |
||||
|
计算方法:对党员i的所有j个自建群,从用户社群关系表中统计属于每个自建群的群众用户总人数,并对j个群众用户总数进行不重复累加。 |
||||
|
对评价结果的影响:正向。*/ |
||||
|
Map<String, Integer> map = new HashMap<>(); |
||||
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
||||
|
//查询当前党员建了多少个组
|
||||
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
||||
|
if (CollectionUtils.isEmpty(groupIdList)) { |
||||
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//去重组里面的成员
|
||||
|
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); |
||||
|
if (CollectionUtils.isEmpty(memberIdList)) { |
||||
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
||||
|
continue; |
||||
|
} else { |
||||
|
map.put(partyMember.getUserId(), memberIdList.size()); |
||||
|
} |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @param partyMemberList |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 7、党员自建群活跃群众人数 |
||||
|
* @Date 2020/9/20 21:36 |
||||
|
**/ |
||||
|
private Map<String, Integer> calGroupActiveUserCount(String customerId, String monthId, |
||||
|
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, |
||||
|
Map<String, List<String>> userCreatedGroups) { |
||||
|
/*含义:评价周期内,党员自建群中活跃群众成员数。所谓活跃群成员,即评价周期内参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。 |
||||
|
数据来源:话题用户阅读表、话题评论用户表态表、话题评论表、事件点赞点踩表、事件评论点赞点踩表、事件评论表、用户信息表。 |
||||
|
计算方法: |
||||
|
a)判断群中的群众成员是否活跃 |
||||
|
for each 群众成员 i |
||||
|
统计i的话题阅读次数、话题评论次数、话题评论表态次数、事件点赞点踩次数、事件评论点赞点踩次数、事件评论总次数。 |
||||
|
If 总次数>阈值 |
||||
|
成员i为活跃群众成员 |
||||
|
b)不重复累加活跃群众成员数 |
||||
|
对评价结果的影响:正向。*/ |
||||
|
//结合目前产品,数据来源:话题评论、议题表决
|
||||
|
Map<String, Integer> map = new HashMap<>(); |
||||
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
||||
|
int groupActiveUserCount = 0; |
||||
|
//1、查询当前党员建了多少个组
|
||||
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
||||
|
if (CollectionUtils.isEmpty(groupIdList)) { |
||||
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//2、去重组里面的成员
|
||||
|
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); |
||||
|
if (CollectionUtils.isEmpty(memberIdList)) { |
||||
|
map.put(partyMember.getUserId(), NumConstant.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//3、判断每个成员是否 “活跃”
|
||||
|
for (String memberId : memberIdList) { |
||||
|
//1、判断成员在本月内是否评论过
|
||||
|
Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); |
||||
|
if (topicCommentCount > 0) { |
||||
|
groupActiveUserCount++; |
||||
|
continue; |
||||
|
} |
||||
|
//2、判断成员在本月内是否表决过(支持or反对)议题
|
||||
|
Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); |
||||
|
if (voteCount > 0) { |
||||
|
groupActiveUserCount++; |
||||
|
} |
||||
|
} |
||||
|
//赋值每个党员的 -- 党员自建群活跃群众人数
|
||||
|
map.put(partyMember.getUserId(), groupActiveUserCount); |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return java.util.Map<java.lang.String, java.lang.Integer> |
||||
|
* @author yinzuomei |
||||
|
* @description 8、党员自建群活跃度——话题数 |
||||
|
* @Date 2020/9/18 14:31 |
||||
|
**/ |
||||
|
private Map<String, Integer> calGroupTopicCount(String customerId, String monthId) { |
||||
|
/*含义:评价周期内,党员自建群中话题发布数。 |
||||
|
数据来源:话题表。 |
||||
|
计算方法:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 |
||||
|
对评价结果的影响:正向。*/ |
||||
|
List<Map<String, Integer>> mapList = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId); |
||||
|
Map<String, Integer> resultMap = new HashMap<>(); |
||||
|
for (Map<String, Integer> map : mapList) { |
||||
|
for (Map.Entry<String, Integer> m : map.entrySet()) { |
||||
|
resultMap.put(m.getKey(), m.getValue()); |
||||
|
} |
||||
|
} |
||||
|
return resultMap; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param userCreatedGroups 党员自建群 |
||||
|
* @return java.util.Map<java.lang.String, java.math.BigDecimal> |
||||
|
* @author yinzuomei |
||||
|
* @description 9、自建群活跃度——议题转项目率 |
||||
|
* @Date 2020/9/20 22:11 |
||||
|
**/ |
||||
|
private Map<String, BigDecimal> caltopicToIssueRatio(String customerId, |
||||
|
String monthId, |
||||
|
List<FactIndexPartyAblityCpcMonthlyEntity> partyMemberList, |
||||
|
Map<String, List<String>> userCreatedGroups) { |
||||
|
Map<String, BigDecimal> map = new HashMap<>(); |
||||
|
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { |
||||
|
//如果党员自建群为空,直接赋值0
|
||||
|
if (CollectionUtils.isEmpty(userCreatedGroups.get(partyMember.getUserId()))) { |
||||
|
map.put(partyMember.getUserId(), BigDecimal.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//自建群出来的话题
|
||||
|
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId()); |
||||
|
List<String> topicIdList = factOriginTopicLogDailyService.selectTopicIds(groupIdList); |
||||
|
if (CollectionUtils.isEmpty(topicIdList)) { |
||||
|
map.put(partyMember.getUserId(), BigDecimal.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//分子
|
||||
|
//本月内新增的项目(and 源于自建群中的话题)
|
||||
|
Integer projectTotal = factOriginProjectMainDailyService.selectCountByPartyUser(customerId, monthId, topicIdList); |
||||
|
if (null == projectTotal || projectTotal == NumConstant.ZERO) { |
||||
|
map.put(partyMember.getUserId(), BigDecimal.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
//分母
|
||||
|
//本评价周期+上一个评价周期内自建群中的议题数
|
||||
|
Integer issueTotal = issueExtractService.selectIssueTotalTwoMonth(topicIdList); |
||||
|
if (null == issueTotal || issueTotal == NumConstant.ZERO) { |
||||
|
map.put(partyMember.getUserId(), BigDecimal.ZERO); |
||||
|
continue; |
||||
|
} |
||||
|
NumberFormat numberFormat = NumberFormat.getInstance(); |
||||
|
numberFormat.setMaximumFractionDigits(6); |
||||
|
String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); |
||||
|
BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr); |
||||
|
map.put(partyMember.getUserId(), topicToIssueRatio); |
||||
|
} |
||||
|
return map; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @return void |
||||
|
* @author yinzuomei |
||||
|
* @description 删除这个客户这个月 党员相关-党建能力的数据 |
||||
|
* @Date 2020/9/18 10:20 |
||||
|
**/ |
||||
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
||||
|
public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { |
||||
|
int deleteNum; |
||||
|
do { |
||||
|
deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); |
||||
|
} while (deleteNum > NumConstant.ZERO); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param list |
||||
|
* @return void |
||||
|
* @author yinzuomei |
||||
|
* @description 批量插入党员相关党建能力表 |
||||
|
* @Date 2020/9/18 10:27 |
||||
|
**/ |
||||
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX) |
||||
|
private void FactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list) { |
||||
|
factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,425 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.constant.ExtractConstant; |
||||
|
import com.epmet.constant.ProjectEvaluateConstant; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; |
||||
|
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; |
||||
|
import com.epmet.dto.extract.form.GridIssueCountResultDTO; |
||||
|
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; |
||||
|
import com.epmet.dto.extract.result.*; |
||||
|
import com.epmet.service.evaluationindex.extract.*; |
||||
|
import com.epmet.service.stats.FactArticlePublishedGridDailyService; |
||||
|
import com.epmet.service.stats.user.FactRegUserGridMonthlyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.BeanUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.concurrent.atomic.AtomicReference; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Author zxc |
||||
|
* @DateTime 2020/9/18 9:53 上午 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class CalGridIndexServiceImpl implements CalGridIndexService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IssueExtractService issueExtractService; |
||||
|
@Autowired |
||||
|
private FactIndexGovernAbilityGridMonthlyService governAbilityGridMonthlyService; |
||||
|
@Autowired |
||||
|
private FactIndexPartyAbilityGridMonthlyService partyAbilityGridMonthlyService; |
||||
|
@Autowired |
||||
|
private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; |
||||
|
@Autowired |
||||
|
private FactOriginProjectMainDailyService projectMainService; |
||||
|
@Autowired |
||||
|
private FactOriginProjectLogDailyService projectLogService; |
||||
|
@Autowired |
||||
|
private FactRegUserGridMonthlyService userGridMonthlyService; |
||||
|
@Autowired |
||||
|
private FactOriginTopicMainDailyService topicMainService; |
||||
|
@Autowired |
||||
|
private FactArticlePublishedGridDailyService articlePublishedGridDailyService; |
||||
|
@Autowired |
||||
|
private GroupExtractService groupExtractService; |
||||
|
@Autowired |
||||
|
private FactOriginTopicLogDailyService topicLogService; |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标党建能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean calGridIndexPartyAbility(String customerId, String monthId) { |
||||
|
List<PartyAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfoToParty(customerId); |
||||
|
if (CollectionUtils.isEmpty(result)){ |
||||
|
throw new RenException("客户【"+customerId+"】未查出网格信息"); |
||||
|
} |
||||
|
// 网格群众用户数 , 网格党员用户数
|
||||
|
List<GridUserCountResultDTO> gridUserCountList = userGridMonthlyService.selectGridUserCount(customerId, monthId); |
||||
|
// 网格党员人均提出话题数
|
||||
|
List<CreateTopicCountResultDTO> partyCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ONE); |
||||
|
// 网格群众人均提出话题数
|
||||
|
List<CreateTopicCountResultDTO> massCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ZERO); |
||||
|
// 网格党员人均提出的议题转项目数
|
||||
|
List<ShiftProjectCountResultDTO> partyShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ONE); |
||||
|
// 网格群众人均提出的议题转项目数
|
||||
|
List<ShiftProjectCountResultDTO> massShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ZERO); |
||||
|
// 网格的发文数量
|
||||
|
List<PublishCountResultDTO> publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); |
||||
|
// 网格议题转项目率
|
||||
|
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); |
||||
|
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); |
||||
|
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); |
||||
|
// 建群党员数
|
||||
|
List<PartyCreateGroupCountResultDTO> partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId); |
||||
|
//结合目前产品,数据来源:话题评论、议题表决
|
||||
|
//网格活跃群众用户数
|
||||
|
Map<String,Integer> gridMassActiveMap = new HashMap<>(16); |
||||
|
List<PartyActiveResultDTO> massActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ZERO); |
||||
|
List<PartyActiveResultDTO> massActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ZERO); |
||||
|
massActiveList.addAll(massActiveIssueVote); |
||||
|
if (!CollectionUtils.isEmpty(massActiveList)) { |
||||
|
Map<String, List<PartyActiveResultDTO>> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); |
||||
|
collectMap.forEach((gridId, massActive) -> { |
||||
|
List<String> userIds = massActive.stream().map(mass -> mass.getUserId()).distinct().collect(Collectors.toList()); |
||||
|
gridMassActiveMap.put(gridId, userIds.size()); |
||||
|
}); |
||||
|
} |
||||
|
//网格活跃党员用户数
|
||||
|
Map<String,Integer> gridPartyActiveMap = new HashMap<>(16); |
||||
|
List<PartyActiveResultDTO> partyActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ONE); |
||||
|
List<PartyActiveResultDTO> partyActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ONE); |
||||
|
partyActiveList.addAll(partyActiveIssueVote); |
||||
|
if (!CollectionUtils.isEmpty(partyActiveList)){ |
||||
|
Map<String, List<PartyActiveResultDTO>> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); |
||||
|
collectMap.forEach((gridId, partyActive) -> { |
||||
|
List<String> userIds = partyActive.stream().map(party -> party.getUserId()).distinct().collect(Collectors.toList()); |
||||
|
gridPartyActiveMap.put(gridId, userIds.size()); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
String quarterId = DateUtils.getQuarterId(monthId); |
||||
|
String yearId = DateUtils.getYearId(monthId); |
||||
|
result.forEach(r -> { |
||||
|
r.setMonthId(monthId); |
||||
|
r.setQuarterId(quarterId); |
||||
|
r.setYearId(yearId); |
||||
|
// 1. 网格群众用户数 , 网格党员用户数
|
||||
|
if (!CollectionUtils.isEmpty(gridUserCountList)){ |
||||
|
gridUserCountList.forEach(count -> { |
||||
|
if (r.getGridId().equals(count.getGridId())){ |
||||
|
BeanUtils.copyProperties(count,r); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 2. 网格党员人均提出话题数
|
||||
|
if (!CollectionUtils.isEmpty(partyCreateTopicCountList)){ |
||||
|
partyCreateTopicCountList.forEach(party -> { |
||||
|
if (r.getGridId().equals(party.getGridId())){ |
||||
|
r.setPartyAvgTopicCount(party.getCreateTopicCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 3. 网格群众人均提出话题数
|
||||
|
if (!CollectionUtils.isEmpty(massCreateTopicCountList)){ |
||||
|
massCreateTopicCountList.forEach(mass -> { |
||||
|
if (r.getGridId().equals(mass.getGridId())){ |
||||
|
r.setUserAvgTopicCount(mass.getCreateTopicCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 4. 网格党员人均提出的议题转项目数
|
||||
|
if (!CollectionUtils.isEmpty(partyShiftProjectCountList)){ |
||||
|
partyShiftProjectCountList.forEach(party -> { |
||||
|
if (r.getGridId().equals(party.getGridId())){ |
||||
|
r.setPartyAvgShiftProjectCount(party.getShiftProjectCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 5. 网格群众人均提出的议题转项目数
|
||||
|
if (!CollectionUtils.isEmpty(massShiftProjectCountList)){ |
||||
|
massShiftProjectCountList.forEach(mass -> { |
||||
|
if (r.getGridId().equals(mass.getGridId())){ |
||||
|
r.setPartyAvgShiftProjectCount(mass.getShiftProjectCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 6. 网格的发文数量
|
||||
|
if (!CollectionUtils.isEmpty(publishCountList)){ |
||||
|
publishCountList.forEach(publish -> { |
||||
|
if (r.getGridId().equals(publish.getGridId())){ |
||||
|
r.setPublishArticleCount(publish.getPublishCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 7. 网格议题转项目率
|
||||
|
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){ |
||||
|
gridIssueShiftProjectRatio.forEach(ratio -> { |
||||
|
if (r.getGridId().equals(ratio.getGridId())){ |
||||
|
r.setIssueToProjectRatio(ratio.getIssueToProjectRatio()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 8. 建群党员数
|
||||
|
if (!CollectionUtils.isEmpty(partyCreateGroupCountList)){ |
||||
|
partyCreateGroupCountList.forEach(party -> { |
||||
|
if (r.getGridId().equals(party.getGridId())){ |
||||
|
r.setCreateGroupPartyCount(party.getPartyCreateGroupCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 9. 网格活跃群众用户数
|
||||
|
if (null != gridMassActiveMap){ |
||||
|
gridMassActiveMap.forEach((k,v) -> { |
||||
|
if (r.getGridId().equals(k)){ |
||||
|
r.setActiveUserCount(v); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 10. 网格活跃党员用户数
|
||||
|
if (null != gridPartyActiveMap){ |
||||
|
gridPartyActiveMap.forEach((k,v) -> { |
||||
|
if (r.getGridId().equals(k)){ |
||||
|
r.setActivePartyCount(v); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
delAndInsertPartyAbility(result,customerId,monthId); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标治理能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean calGridIndexGovernAbility(String customerId, String monthId) { |
||||
|
|
||||
|
List<GovernAbilityGridMonthlyFormDTO> result = governAbilityDao.selectAllGridInfo(customerId); |
||||
|
if (CollectionUtils.isEmpty(result)){ |
||||
|
throw new RenException("客户【"+customerId+"】未查出网格信息"); |
||||
|
} |
||||
|
//网格总议题数目,网格人均议题数目
|
||||
|
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); |
||||
|
//网格总项目数
|
||||
|
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); |
||||
|
//网格议题转项目率
|
||||
|
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); |
||||
|
//网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格
|
||||
|
List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); |
||||
|
Map<String,Integer> autoMap = new HashMap<>(16); |
||||
|
if (!CollectionUtils.isEmpty(projectAutoNoMyList)){ |
||||
|
Map<String, List<AutoNoMyResultDTO>> groupByGrid = projectAutoNoMyList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getGridId)); |
||||
|
groupByGrid.forEach((gridId,projectList) -> { |
||||
|
Map<String, List<AutoNoMyResultDTO>> groupByProject = projectList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getProjectId)); |
||||
|
AtomicReference<Boolean> autoSelf = new AtomicReference<>(true); |
||||
|
AtomicReference<Integer> count = new AtomicReference<>(NumConstant.ZERO); |
||||
|
groupByProject.forEach((projectId,projects) -> { |
||||
|
String disposeGrid = projects.get(NumConstant.ZERO).getGridId(); |
||||
|
projects.forEach(p -> { |
||||
|
if (!disposeGrid.equals(p.getGridId())){ |
||||
|
autoSelf.set(false); |
||||
|
} |
||||
|
}); |
||||
|
if (autoSelf.get()) { |
||||
|
count.getAndSet(count.get() + NumConstant.ONE); |
||||
|
} |
||||
|
}); |
||||
|
autoMap.put(gridId,count.get()); |
||||
|
}); |
||||
|
} |
||||
|
//网格办结项目数
|
||||
|
List<GridProjectClosedTotalResultDTO> gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); |
||||
|
//网格吹哨部门准确率 【没被退回的项目数/项目总数 】
|
||||
|
List<NotReturnProjectResultDTO> notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE); |
||||
|
if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){ |
||||
|
notReturnProjectList.forEach(not -> { |
||||
|
gridIssueShiftProjectRatio.forEach(total -> { |
||||
|
if (not.getGridId().equals(total.getGridId())){ |
||||
|
not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()))); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
//网格内解决的项目的满意度
|
||||
|
//项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数
|
||||
|
List<ProjectEvaluateResultDTO> projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId); |
||||
|
Map<String,BigDecimal> resultSatisfactionScore = new HashMap<>(16); |
||||
|
if (!CollectionUtils.isEmpty(projectEvaluateList)){ |
||||
|
Map<String, List<ProjectEvaluateResultDTO>> groupByGrid = projectEvaluateList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getGridId)); |
||||
|
groupByGrid.forEach((gridId,projectEvaluateInfoList) -> { |
||||
|
Map<String,Integer> scoreMap = new HashMap<>(16); |
||||
|
Map<String, List<ProjectEvaluateResultDTO>> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); |
||||
|
groupByProject.forEach((projectId,projectList) -> { |
||||
|
projectList.forEach(project -> { |
||||
|
switch (project.getActionCode()) { |
||||
|
case ExtractConstant.EVALUATE_BAD: |
||||
|
project.setScore(ProjectEvaluateConstant.BAD); |
||||
|
break; |
||||
|
case ExtractConstant.EVALUATE_GOOD: |
||||
|
project.setScore(ProjectEvaluateConstant.GOOD); |
||||
|
break; |
||||
|
case ExtractConstant.EVALUATE_PERFECT: |
||||
|
project.setScore(ProjectEvaluateConstant.PERFECT); |
||||
|
break; |
||||
|
default: |
||||
|
log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode()); |
||||
|
} |
||||
|
}); |
||||
|
Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); |
||||
|
scoreMap.put(projectId,projectAllScore/projectList.size()); |
||||
|
}); |
||||
|
AtomicReference<Integer> allScore = new AtomicReference<>(0); |
||||
|
scoreMap.forEach((k,v) -> { |
||||
|
allScore.set(++v); |
||||
|
}); |
||||
|
resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); |
||||
|
}); |
||||
|
} |
||||
|
String quarterId = DateUtils.getQuarterId(monthId); |
||||
|
String yearId = DateUtils.getYearId(monthId); |
||||
|
result.forEach(r -> { |
||||
|
r.setMonthId(monthId); |
||||
|
r.setQuarterId(quarterId); |
||||
|
r.setYearId(yearId); |
||||
|
// 1. 网格总议题数目,网格人均议题数目
|
||||
|
if (!CollectionUtils.isEmpty(gridIssueTotalList)) { |
||||
|
gridIssueTotalList.forEach(total -> { |
||||
|
if (r.getGridId().equals(total.getGridId())) { |
||||
|
BeanUtils.copyProperties(total, r); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 2. 网格总项目数,网格议题转项目率
|
||||
|
if (!CollectionUtils.isEmpty(gridIssueTotalList)){ |
||||
|
gridIssueShiftProjectRatio.forEach(projectTotal -> { |
||||
|
if (r.getGridId().equals(projectTotal.getGridId())){ |
||||
|
r.setProjectTotal(projectTotal.getProjectTotal()); |
||||
|
r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 3. 网格办结项目数
|
||||
|
if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){ |
||||
|
gridProjectClosedTotalList.forEach(closed -> { |
||||
|
if (r.getGridId().equals(closed.getGridId())){ |
||||
|
r.setResolveProjectCount(closed.getResolveProjectCount()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 4. 网格吹哨部门准确率
|
||||
|
if (!CollectionUtils.isEmpty(notReturnProjectList)) { |
||||
|
notReturnProjectList.forEach(not -> { |
||||
|
if (r.getGridId().equals(not.getGridId())) { |
||||
|
r.setTransferRightRatio(not.getTransferRightRatio()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
// 5. 网格内解决的项目的满意度
|
||||
|
resultSatisfactionScore.forEach((k, v) -> { |
||||
|
if (r.getGridId().equals(k)) { |
||||
|
r.setSatisfactionRatio(v); |
||||
|
} |
||||
|
}); |
||||
|
// 6. 网格自治项目数
|
||||
|
autoMap.forEach((k, v) -> { |
||||
|
if (r.getGridId().equals(k)) { |
||||
|
r.setSelfSolveProjectCount(v); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
delAndInsertGovernAbility(result,customerId,monthId); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 计算网格指标服务能力 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 9:56 上午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public Boolean calGridIndexServiceAbility(String customerId, String monthId) { |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 小数四舍五入【保留六位小数】 |
||||
|
* @param d |
||||
|
* @author zxc |
||||
|
* @date 2020/9/18 2:01 下午 |
||||
|
*/ |
||||
|
public BigDecimal getRound(BigDecimal d){ |
||||
|
return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @param gridIssueTotalList |
||||
|
* @param gridProjectTotalList |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 2:53 下午 |
||||
|
*/ |
||||
|
public List<GridProjectCountResultDTO> getGridIssueShiftProjectRatio(List<GridIssueCountResultDTO> gridIssueTotalList,List<GridProjectCountResultDTO> gridProjectTotalList){ |
||||
|
if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) { |
||||
|
gridProjectTotalList.forEach(project -> { |
||||
|
gridIssueTotalList.forEach(issue -> { |
||||
|
if (project.getGridId().equals(issue.getGridId())) { |
||||
|
project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()))); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
return gridProjectTotalList; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 删除并插入党建能力的记录 |
||||
|
* @param result |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 4:06 下午 |
||||
|
*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delAndInsertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> result,String customerId,String monthId){ |
||||
|
if (!CollectionUtils.isEmpty(result)){ |
||||
|
partyAbilityGridMonthlyService.deleteOldPartyAbility(customerId, monthId); |
||||
|
partyAbilityGridMonthlyService.insertPartyAbility(result); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 删除并插入治理能力的记录 |
||||
|
* @param result |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 4:06 下午 |
||||
|
*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delAndInsertGovernAbility(List<GovernAbilityGridMonthlyFormDTO> result,String customerId,String monthId){ |
||||
|
if (!CollectionUtils.isEmpty(result)){ |
||||
|
governAbilityGridMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); |
||||
|
governAbilityGridMonthlyService.insertGovernAbilityRecord(result); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; |
||||
|
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.FactIndexGovernAbilityGridMonthlyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 治理能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexGovernAbilityGridMonthlyServiceImpl implements FactIndexGovernAbilityGridMonthlyService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; |
||||
|
|
||||
|
@Override |
||||
|
public void insertGovernAbilityRecord(List<GovernAbilityGridMonthlyFormDTO> lists) { |
||||
|
governAbilityDao.insertGovernAbilityRecord(lists); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void deleteOldGovernAbilityRecord(String customerId, String monthId) { |
||||
|
governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; |
||||
|
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.FactIndexPartyAbilityGridMonthlyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 党建能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexPartyAbilityGridMonthlyServiceImpl implements FactIndexPartyAbilityGridMonthlyService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactIndexPartyAblityGridMonthlyDao partyAbilityGridDao; |
||||
|
|
||||
|
@Override |
||||
|
public void insertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> lists) { |
||||
|
partyAbilityGridDao.insertPartyAbility(lists); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void deleteOldPartyAbility(String customerId, String monthId) { |
||||
|
partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.service.evaluationindex.extract.FactIndexServiceAbilityGridMonthlyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 服务能力-网格相关事实表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-09-19 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexServiceAbilityGridMonthlyService { |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,107 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.*; |
||||
|
import com.epmet.service.stats.DimCustomerService; |
||||
|
import com.epmet.util.DimIdGenerator; |
||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.concurrent.*; |
||||
|
|
||||
|
/** |
||||
|
* desc:抽取业务数据 到 统计库 汇聚类 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class FactOriginExtractServiceImpl implements FactOriginExtractService { |
||||
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
||||
|
.setNameFormat("factOriginExtract-pool-%d").build(); |
||||
|
ExecutorService threadPool = new ThreadPoolExecutor(4, 8, |
||||
|
10L, TimeUnit.MINUTES, |
||||
|
new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); |
||||
|
|
||||
|
@Autowired |
||||
|
private IssueExtractService issueExtractService; |
||||
|
@Autowired |
||||
|
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; |
||||
|
@Autowired |
||||
|
private ProjectExtractService projectExtractService; |
||||
|
@Autowired |
||||
|
private DimCustomerService dimCustomerService; |
||||
|
@Autowired |
||||
|
private GroupExtractService groupExtractService; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public void extractAll(ExtractFormDTO extractFormDTO) { |
||||
|
String dateId = extractFormDTO.getDateId(); |
||||
|
String customerId = extractFormDTO.getCustomerId(); |
||||
|
if (StringUtils.isBlank(dateId)) { |
||||
|
dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)); |
||||
|
} |
||||
|
List<String> customerIds = new ArrayList<>(); |
||||
|
if (StringUtils.isNotBlank(customerId)) { |
||||
|
customerIds.add(customerId); |
||||
|
} |
||||
|
int pageNo = NumConstant.ONE; |
||||
|
int pageSize = NumConstant.ONE_HUNDRED; |
||||
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); |
||||
|
if (CollectionUtils.isEmpty(customerIds)) { |
||||
|
log.error("extractAll 获取客户Id为空"); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
String finalDateId = dateId; |
||||
|
customerIds.forEach(cId -> { |
||||
|
ExtractFormDTO param = new ExtractFormDTO(); |
||||
|
param.setCustomerId(cId); |
||||
|
param.setDateId(finalDateId); |
||||
|
submitJob(param); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void submitJob(ExtractFormDTO param) { |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
groupExtractService.extractGroupData(param); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
factOriginTopicMainDailyService.topicCleaning(param); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
issueExtractService.issueExtractMain(param); |
||||
|
issueExtractService.issueExtractLog(param); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【议题数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
threadPool.submit(() -> { |
||||
|
try { |
||||
|
projectExtractService.saveOriginProjectDaily(param); |
||||
|
projectExtractService.extractProjectPeriodData(param); |
||||
|
} catch (Exception e) { |
||||
|
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(param), e); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,145 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; |
||||
|
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; |
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
import com.epmet.dto.extract.form.GridHeartedFormDTO; |
||||
|
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; |
||||
|
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; |
||||
|
import com.epmet.dto.stats.result.GridAttributesResultDTO; |
||||
|
import com.epmet.service.evaluationindex.extract.GroupExtractService; |
||||
|
import com.epmet.service.group.GroupDataService; |
||||
|
import com.epmet.service.stats.DimGridService; |
||||
|
import com.epmet.service.user.UserService; |
||||
|
import com.epmet.util.DimIdGenerator; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Date; |
||||
|
import java.util.LinkedList; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.function.Function; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Description 业务数据抽取 - 组相关 |
||||
|
* @ClassName GroupExtractServiceImpl |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-16 14:47 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class GroupExtractServiceImpl implements GroupExtractService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactOriginGroupMainDailyDao groupMainDailyDao; |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询建群党员数 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @author zxc |
||||
|
* @date 2020/9/19 3:49 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId, String monthId) { |
||||
|
return groupMainDailyDao.selectPartyCreateGroupCount(customerId, monthId); |
||||
|
} |
||||
|
@Autowired |
||||
|
private GroupDataService groupDataService; |
||||
|
@Autowired |
||||
|
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; |
||||
|
@Autowired |
||||
|
private UserService userService; |
||||
|
@Autowired |
||||
|
private DimGridService dimGridService; |
||||
|
|
||||
|
/** |
||||
|
* @Description 业务抽取 - 小组祥光 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.18 21:07 |
||||
|
**/ |
||||
|
@Override |
||||
|
public void extractGroupData(ExtractFormDTO param) { |
||||
|
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId()); |
||||
|
|
||||
|
if(StringUtils.isBlank(param.getDateId())){ |
||||
|
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
||||
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
||||
|
param.setDateId(format.format(yesterday)); |
||||
|
} |
||||
|
//原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组
|
||||
|
//但是每个组每天都要更新一次组长的身份信息
|
||||
|
List<FactOriginGroupMainDailyDTO> originGroupData = groupDataService.extractGroupData( |
||||
|
count <= NumConstant.ZERO, |
||||
|
param.getCustomerId(), param.getDateId()); |
||||
|
|
||||
|
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>(); |
||||
|
if (!CollectionUtils.isEmpty(originGroupData)) { |
||||
|
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); |
||||
|
|
||||
|
if (!CollectionUtils.isEmpty(gridList)) { |
||||
|
Map<String, GridAttributesResultDTO> gridMap = |
||||
|
gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); |
||||
|
if (!CollectionUtils.isEmpty(originGroupData)) { |
||||
|
originGroupData.forEach(group -> { |
||||
|
if (!CollectionUtils.isEmpty(group.getMembers())) { |
||||
|
group.setMemberTotal(group.getMembers().size()); |
||||
|
group.getMembers().forEach(member -> { |
||||
|
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(member.getJoinDate()); |
||||
|
member.setDateId(dateInfo.getDateId()); |
||||
|
member.setWeekId(dateInfo.getWeekId()); |
||||
|
member.setMonthId(dateInfo.getMonthId()); |
||||
|
member.setQuarterId(dateInfo.getQuarterId()); |
||||
|
member.setYearId(dateInfo.getYearId()); |
||||
|
|
||||
|
memberList.add(member); |
||||
|
}); |
||||
|
} |
||||
|
GridAttributesResultDTO attr = gridMap.get(group.getGridId()); |
||||
|
if (null != attr) { |
||||
|
group.setAgencyId(attr.getAgencyId()); |
||||
|
group.setParentId(attr.getParentId()); |
||||
|
group.setPids(attr.getPids()); |
||||
|
} |
||||
|
if(null != group.getCreatedTime()){ |
||||
|
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime()); |
||||
|
group.setDateId(dateInfo.getDateId()); |
||||
|
group.setWeekId(dateInfo.getWeekId()); |
||||
|
group.setMonthId(dateInfo.getMonthId()); |
||||
|
group.setQuarterId(dateInfo.getQuarterId()); |
||||
|
group.setYearId(dateInfo.getYearId()); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
if (count <= NumConstant.ZERO) { |
||||
|
//isFirst
|
||||
|
factOriginGroupMainDailyDao.deleteBatchMemberByCustomerId(param.getCustomerId()); |
||||
|
factOriginGroupMainDailyDao.insertBatchMain(originGroupData); |
||||
|
factOriginGroupMainDailyDao.insertBatchMembers(memberList); |
||||
|
} else { |
||||
|
factOriginGroupMainDailyDao.deleteBatchByGroupId(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList())); |
||||
|
factOriginGroupMainDailyDao.insertBatchMembers(memberList); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
List<String> partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); |
||||
|
List<GridHeartedFormDTO> heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); |
||||
|
|
||||
|
factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId()); |
||||
|
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,104 @@ |
|||||
|
package com.epmet.service.evaluationindex.extract.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; |
||||
|
import com.epmet.dto.extract.form.ExtractFormDTO; |
||||
|
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; |
||||
|
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; |
||||
|
import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService; |
||||
|
import com.epmet.service.project.ProjectProcessService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.util.CollectionUtils; |
||||
|
|
||||
|
import java.text.SimpleDateFormat; |
||||
|
import java.util.Date; |
||||
|
import java.util.LinkedList; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @Description 业务数据抽取 - 项目节点历时 |
||||
|
* @ClassName ProjectPeriodExtractServiceImpl |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-09-17 13:52 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; |
||||
|
@Autowired |
||||
|
private ProjectProcessService projectProcessService; |
||||
|
|
||||
|
/** |
||||
|
* @Description 抽取项目节点历时逻辑 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.09.17 14:05 |
||||
|
**/ |
||||
|
@Override |
||||
|
public void extractProjectPeriodData(ExtractFormDTO param) { |
||||
|
int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); |
||||
|
Boolean isFirst = trace <= NumConstant.ZERO ? true : false; |
||||
|
if(StringUtils.isBlank(param.getDateId())){ |
||||
|
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); |
||||
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
||||
|
param.setDateId(format.format(yesterday)); |
||||
|
} |
||||
|
List<ProjectOrgPeriodResultDTO> extractData = |
||||
|
projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); |
||||
|
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>(); |
||||
|
extractData.forEach(original -> { |
||||
|
FactOriginProjectOrgPeriodDailyEntity dest |
||||
|
= ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); |
||||
|
if(StringUtils.isNotBlank(original.getDepartmentId())){ |
||||
|
dest.setOrgType("dept"); |
||||
|
dest.setPid(original.getOrgId()); |
||||
|
dest.setPids(original.getOrgIdPath()); |
||||
|
}else if(StringUtils.isNotBlank(original.getGridId())){ |
||||
|
dest.setOrgType("grid"); |
||||
|
dest.setPid(original.getOrgId()); |
||||
|
dest.setPids(original.getOrgIdPath()); |
||||
|
}else{ |
||||
|
dest.setOrgType("agency"); |
||||
|
dest.setPids(""); |
||||
|
String[] array = original.getOrgIdPath().split(":"); |
||||
|
if(null == array || array.length <= NumConstant.ZERO){ |
||||
|
dest.setPid(NumConstant.ZERO_STR); |
||||
|
} |
||||
|
if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){ |
||||
|
dest.setPid(NumConstant.ZERO_STR); |
||||
|
} |
||||
|
if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){ |
||||
|
dest.setPid(array[array.length - NumConstant.TWO]); |
||||
|
dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); |
||||
|
} |
||||
|
if(StringUtils.isNotBlank(dest.getPids())){ |
||||
|
while(dest.getPids().endsWith(":")){ |
||||
|
dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE)); |
||||
|
} |
||||
|
while(dest.getPids().startsWith(":")){ |
||||
|
dest.setPids(dest.getPids().replaceFirst(":","")); |
||||
|
} |
||||
|
} |
||||
|
dest.setPids(dest.getPids().replaceAll(" ","")); |
||||
|
} |
||||
|
|
||||
|
formattingData.add(dest); |
||||
|
}); |
||||
|
if(!CollectionUtils.isEmpty(formattingData)) { |
||||
|
List<String> projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); |
||||
|
if (!CollectionUtils.isEmpty(projectIds)) { |
||||
|
factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds); |
||||
|
factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/20 20:29 |
||||
|
*/ |
||||
|
public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService<FactIndexGovrnAblityOrgMonthlyEntity> { |
||||
|
/** |
||||
|
* 根据客户清空数据 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/20 20:33 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @param type |
||||
|
* @return void |
||||
|
*/ |
||||
|
void deleteByCustomer(String customerId, String monthId, String type); |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/20 23:00 |
||||
|
*/ |
||||
|
public interface FactIndexPartyAblityOrgMonthlyService extends BaseService<FactIndexPartyAblityOrgMonthlyEntity> { |
||||
|
/** |
||||
|
* 根据客户清空数据 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/20 20:33 |
||||
|
* @param customerId |
||||
|
* @param monthId |
||||
|
* @param type |
||||
|
* @return void |
||||
|
*/ |
||||
|
void deleteByCustomer(String customerId, String monthId, String type); |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
/** |
||||
|
* 社区相关统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 10:33 |
||||
|
*/ |
||||
|
public interface IndexCollCommunityService { |
||||
|
/** |
||||
|
* 社区能力统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 13:52 |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return void |
||||
|
*/ |
||||
|
void saveCommunityAbility(String customerId, String dateId); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
/** |
||||
|
* 区直部门相关统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 10:43 |
||||
|
*/ |
||||
|
public interface IndexCollDistrictDepartmentService { |
||||
|
} |
||||
@ -0,0 +1,10 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
/** |
||||
|
* 全区相关统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 10:44 |
||||
|
*/ |
||||
|
public interface IndexCollDistrictService { |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll; |
||||
|
|
||||
|
/** |
||||
|
* 街道相关统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 10:35 |
||||
|
*/ |
||||
|
public interface IndexCollStreetService { |
||||
|
/** |
||||
|
* 街道治理能力统计 |
||||
|
* |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/18 13:52 |
||||
|
* @param customerId |
||||
|
* @param dateId |
||||
|
* @return void |
||||
|
*/ |
||||
|
void saveStreetAbility(String customerId, String dateId); |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; |
||||
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; |
||||
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/20 20:29 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityOrgMonthlyDao, FactIndexGovrnAblityOrgMonthlyEntity> implements FactIndexGovrnAblityOrgMonthlyService { |
||||
|
@Override |
||||
|
public void deleteByCustomer(String customerId, String monthId, String type) { |
||||
|
baseDao.deleteByCustomer(customerId, monthId, type); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.service.evaluationindex.indexcoll.impl; |
||||
|
|
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; |
||||
|
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; |
||||
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/9/20 23:01 |
||||
|
*/ |
||||
|
@Service |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexPartyAblityOrgMonthlyDao, FactIndexPartyAblityOrgMonthlyEntity> implements FactIndexPartyAblityOrgMonthlyService { |
||||
|
@Override |
||||
|
public void deleteByCustomer(String customerId, String monthId, String type) { |
||||
|
baseDao.deleteByCustomer(customerId, monthId, type); |
||||
|
} |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue