Browse Source
# Conflicts: # epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java # epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java # epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xmldev_shibei_match
124 changed files with 6942 additions and 76 deletions
@ -0,0 +1,29 @@ |
|||
package com.epmet.dataaggre.dto.datastats.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 基础数据-组织各种数据汇总-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class AgenctBasicDataFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3381286960911634231L; |
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) |
|||
private String agencyId; |
|||
/** |
|||
* 日维度Id |
|||
*/ |
|||
private String dateId; |
|||
public interface Agency extends CustomerClientShowGroup{} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.dataaggre.dto.datastats.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 基础数据-组织直属下级数据汇总-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3381286960911634231L; |
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@NotBlank(message = "组织ID不能为空",groups = SubAgencyFormDTO.Agency.class) |
|||
private String agencyId; |
|||
/** |
|||
* 日维度Id |
|||
*/ |
|||
private String dateId; |
|||
public interface Agency extends CustomerClientShowGroup{} |
|||
|
|||
@Data |
|||
public static class Topic implements Serializable { |
|||
//组织Id
|
|||
private String agencyId; |
|||
//话题数量
|
|||
private Integer topicCount; |
|||
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing
|
|||
private String topicStatus; |
|||
//话题已转议题数量
|
|||
private Integer shiftedIssueTotal; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.dataaggre.dto.datastats.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 基础数据-组织直属网格数据汇总-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3381286960911634231L; |
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@NotBlank(message = "组织ID不能为空",groups = SubGridFormDTO.Agency.class) |
|||
private String agencyId; |
|||
/** |
|||
* 日维度Id |
|||
*/ |
|||
private String dateId; |
|||
public interface Agency extends CustomerClientShowGroup{} |
|||
|
|||
@Data |
|||
public static class Topic implements Serializable { |
|||
//网格Id
|
|||
private String gridId; |
|||
//话题数量
|
|||
private Integer topicCount; |
|||
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing
|
|||
private String topicStatus; |
|||
//话题已转议题数量
|
|||
private Integer shiftedIssueTotal; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-组织各种数据汇总-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class AgencyBasicDataResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
//用户总数
|
|||
private Integer userTotal = 0; |
|||
//党员总数
|
|||
private Integer partyMemberTotal = 0; |
|||
//党员总数占比
|
|||
private BigDecimal partyMemberRatio = bi; |
|||
//居民总数
|
|||
private Integer resiTotal = 0; |
|||
//居民总数占比
|
|||
private BigDecimal resiRatio = bi; |
|||
//党群小组总数
|
|||
private Integer groupTotal = 0; |
|||
//楼院小组总数
|
|||
private Integer ordinaryTotal = 0; |
|||
//楼院小组总数占比
|
|||
private BigDecimal ordinaryRatio = bi; |
|||
//支部小组总数
|
|||
private Integer branchTotal = 0; |
|||
//支部小组总数占比
|
|||
private BigDecimal branchRatio = bi; |
|||
//话题总数
|
|||
private Integer topicTotal = 0; |
|||
//热议中总数
|
|||
private Integer discussingTotal = 0; |
|||
//热议中总数占比
|
|||
private BigDecimal discussingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedTopicTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedTopicRatio = bi; |
|||
//转议题总数
|
|||
private Integer shiftIssueTotal = 0; |
|||
//转议题总数占比
|
|||
private BigDecimal shiftIssueRatio = bi; |
|||
//议题总数
|
|||
private Integer issueTotal = 0; |
|||
//表决中总数
|
|||
private Integer votingTotal = 0; |
|||
//表决中总数占比
|
|||
private BigDecimal votingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedIssueTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedIssueRatio = bi; |
|||
//已转项目总数
|
|||
private Integer shiftProjectTotal = 0; |
|||
//已转项目总数占比
|
|||
private BigDecimal shiftProjectRatio = bi; |
|||
//项目总数
|
|||
private Integer projectTotal = 0; |
|||
//处理中总数
|
|||
private Integer pendingTotal = 0; |
|||
//处理中总数占比
|
|||
private BigDecimal pendingRatio = bi; |
|||
//已结案总数
|
|||
private Integer closedProjectTotal = 0; |
|||
//已结案总数占比
|
|||
private BigDecimal closedProjectRatio = bi; |
|||
|
|||
|
|||
@Data |
|||
public static class Topic implements Serializable { |
|||
//话题数量
|
|||
private Integer topicCount; |
|||
//话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing
|
|||
private String topicStatus; |
|||
//话题已转议题数量
|
|||
private Integer shiftedIssueTotal; |
|||
//数据更新至 时间
|
|||
private String deadline; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织的直属下级组织群组数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyGroupResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//组织Id
|
|||
private String agencyId; |
|||
//组织名称
|
|||
private String agencyName; |
|||
//党群小组总数
|
|||
private Integer groupTotal = 0; |
|||
//楼院小组总数
|
|||
private Integer ordinaryTotal = 0; |
|||
//楼院小组总数占比
|
|||
private BigDecimal ordinaryRatio = bi; |
|||
//支部小组总数
|
|||
private Integer branchTotal = 0; |
|||
//支部小组总数占比
|
|||
private BigDecimal branchRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织的直属下级组织议题数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyIssueResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//组织Id
|
|||
private String agencyId; |
|||
//组织名称
|
|||
private String agencyName; |
|||
//议题总数
|
|||
private Integer issueTotal = 0; |
|||
//表决中总数
|
|||
private Integer votingTotal = 0; |
|||
//表决中总数占比
|
|||
private BigDecimal votingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedIssueTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedIssueRatio = bi; |
|||
//已转项目总数
|
|||
private Integer shiftProjectTotal = 0; |
|||
//已转项目总数占比
|
|||
private BigDecimal shiftProjectRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织的直属下级组织项目数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyProjectResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//组织Id
|
|||
private String agencyId; |
|||
//组织名称
|
|||
private String agencyName; |
|||
//项目总数
|
|||
private Integer projectTotal = 0; |
|||
//处理中总数
|
|||
private Integer pendingTotal = 0; |
|||
//处理中总数占比
|
|||
private BigDecimal pendingRatio = bi; |
|||
//已结案总数
|
|||
private Integer closedProjectTotal = 0; |
|||
//已结案总数占比
|
|||
private BigDecimal closedProjectRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织的直属下级组织话题数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyTopicResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//组织Id
|
|||
private String agencyId; |
|||
//组织名称
|
|||
private String agencyName; |
|||
//话题总数
|
|||
private Integer topicTotal = 0; |
|||
//热议中总数
|
|||
private Integer discussingTotal = 0; |
|||
//热议中总数占比
|
|||
private BigDecimal discussingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedTopicTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedTopicRatio = bi; |
|||
//转议题总数
|
|||
private Integer shiftIssueTotal = 0; |
|||
//转议题总数占比
|
|||
private BigDecimal shiftIssueRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织的直属下级组织用户数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubAgencyUserResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//组织Id
|
|||
private String agencyId; |
|||
//组织名称
|
|||
private String agencyName; |
|||
//用户总数
|
|||
private Integer userTotal = 0; |
|||
//党员总数
|
|||
private Integer partyMemberTotal = 0; |
|||
//党员总数占比
|
|||
private BigDecimal partyMemberRatio = bi; |
|||
//居民总数
|
|||
private Integer resiTotal = 0; |
|||
//居民总数占比
|
|||
private BigDecimal resiRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织下直属网格列表群组数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridGroupResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//网格Id
|
|||
private String gridId; |
|||
//网格名称
|
|||
private String gridName; |
|||
//党群小组总数
|
|||
private Integer groupTotal = 0; |
|||
//楼院小组总数
|
|||
private Integer ordinaryTotal = 0; |
|||
//楼院小组总数占比
|
|||
private BigDecimal ordinaryRatio = bi; |
|||
//支部小组总数
|
|||
private Integer branchTotal = 0; |
|||
//支部小组总数占比
|
|||
private BigDecimal branchRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织下直属网格列表议题数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridIssueResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//网格Id
|
|||
private String gridId; |
|||
//网格名称
|
|||
private String gridName; |
|||
//议题总数
|
|||
private Integer issueTotal = 0; |
|||
//表决中总数
|
|||
private Integer votingTotal = 0; |
|||
//表决中总数占比
|
|||
private BigDecimal votingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedIssueTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedIssueRatio = bi; |
|||
//已转项目总数
|
|||
private Integer shiftProjectTotal = 0; |
|||
//已转项目总数占比
|
|||
private BigDecimal shiftProjectRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织下直属网格列表项目数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridProjectResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//网格Id
|
|||
private String gridId; |
|||
//网格名称
|
|||
private String gridName; |
|||
//项目总数
|
|||
private Integer projectTotal = 0; |
|||
//处理中总数
|
|||
private Integer pendingTotal = 0; |
|||
//处理中总数占比
|
|||
private BigDecimal pendingRatio = bi; |
|||
//已结案总数
|
|||
private Integer closedProjectTotal = 0; |
|||
//已结案总数占比
|
|||
private BigDecimal closedProjectRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织下直属网格列表话题数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridTopicResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//网格Id
|
|||
private String gridId; |
|||
//网格名称
|
|||
private String gridName; |
|||
//话题总数
|
|||
private Integer topicTotal = 0; |
|||
//热议中总数
|
|||
private Integer discussingTotal = 0; |
|||
//热议中总数占比
|
|||
private BigDecimal discussingRatio = bi; |
|||
//已处理总数
|
|||
private Integer closedTopicTotal = 0; |
|||
//已处理总数占比
|
|||
private BigDecimal closedTopicRatio = bi; |
|||
//转议题总数
|
|||
private Integer shiftIssueTotal = 0; |
|||
//转议题总数占比
|
|||
private BigDecimal shiftIssueRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Description 基础数据-查询当前组织下直属网格列表用户数据-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class SubGridUserResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 466974582608407121L; |
|||
@JsonIgnore |
|||
BigDecimal bi = new BigDecimal(0); |
|||
//网格Id
|
|||
private String gridId; |
|||
//网格名称
|
|||
private String gridName; |
|||
//用户总数
|
|||
private Integer userTotal = 0; |
|||
//党员总数
|
|||
private Integer partyMemberTotal = 0; |
|||
//党员总数占比
|
|||
private BigDecimal partyMemberRatio = bi; |
|||
//居民总数
|
|||
private Integer resiTotal = 0; |
|||
//居民总数占比
|
|||
private BigDecimal resiRatio = bi; |
|||
|
|||
} |
|||
@ -0,0 +1,150 @@ |
|||
package com.epmet.dataaggre.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.*; |
|||
import com.epmet.dataaggre.service.datastats.DataStatsService; |
|||
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; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据统计服务 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("datastats") |
|||
public class DataStatsController { |
|||
|
|||
@Autowired |
|||
private DataStatsService dataStatsService; |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 组织下五项基础数据汇总 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("agencybasicdata") |
|||
public Result<AgencyBasicDataResultDTO> agencyBasicData(@RequestBody AgenctBasicDataFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); |
|||
return new Result<AgencyBasicDataResultDTO>().ok(dataStatsService.agencyBasicData(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织用户数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subagencyuser") |
|||
public Result<List<SubAgencyUserResultDTO>> subAgencyUser(@RequestBody SubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); |
|||
return new Result<List<SubAgencyUserResultDTO>>().ok(dataStatsService.subAgencyUser(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表用户数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subgriduser") |
|||
public Result<List<SubGridUserResultDTO>> subGridUser(@RequestBody SubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); |
|||
return new Result<List<SubGridUserResultDTO>>().ok(dataStatsService.subGridUser(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织群组数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subagencygroup") |
|||
public Result<List<SubAgencyGroupResultDTO>> subAgencyGroup(@RequestBody SubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); |
|||
return new Result<List<SubAgencyGroupResultDTO>>().ok(dataStatsService.subAgencyGroup(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表群组数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subgridgroup") |
|||
public Result<List<SubGridGroupResultDTO>> subGridGroup(@RequestBody SubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); |
|||
return new Result<List<SubGridGroupResultDTO>>().ok(dataStatsService.subGridGroup(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织话题数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subagencytopic") |
|||
public Result<List<SubAgencyTopicResultDTO>> subAgencyTopic(@RequestBody SubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); |
|||
return new Result<List<SubAgencyTopicResultDTO>>().ok(dataStatsService.subAgencyTopic(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表话题数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subgridtopic") |
|||
public Result<List<SubGridTopicResultDTO>> subGridTopic(@RequestBody SubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); |
|||
return new Result<List<SubGridTopicResultDTO>>().ok(dataStatsService.subGridTopic(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织议题数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subagencyissue") |
|||
public Result<List<SubAgencyIssueResultDTO>> subAgencyIssue(@RequestBody SubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); |
|||
return new Result<List<SubAgencyIssueResultDTO>>().ok(dataStatsService.subAgencyIssue(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表议题数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subgridissue") |
|||
public Result<List<SubGridIssueResultDTO>> subGridIssue(@RequestBody SubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); |
|||
return new Result<List<SubGridIssueResultDTO>>().ok(dataStatsService.subGridIssue(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织项目数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subagencyproject") |
|||
public Result<List<SubAgencyProjectResultDTO>> subAgencyProject(@RequestBody SubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); |
|||
return new Result<List<SubAgencyProjectResultDTO>>().ok(dataStatsService.subAgencyProject(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表项目数据 |
|||
* @author sun |
|||
*/ |
|||
@PostMapping("subgridproject") |
|||
public Result<List<SubGridProjectResultDTO>> subGridProject(@RequestBody SubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); |
|||
return new Result<List<SubGridProjectResultDTO>>().ok(dataStatsService.subGridProject(formDTO)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
/** |
|||
* 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.dataaggre.dao.datastats; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.*; |
|||
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; |
|||
import com.epmet.dataaggre.entity.datastats.DimGridEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据统计服务 |
|||
*/ |
|||
@Mapper |
|||
public interface DataStatsDao { |
|||
|
|||
/** |
|||
* @Description 查询组织下注册用户最新日统计数据 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下最新群组日统计数据 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下最新状态话题-机关日统计数据表 |
|||
* @author sun |
|||
*/ |
|||
List<AgencyBasicDataResultDTO.Topic> getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下最新转议题话题-机关日统计数据表 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下最新议题日统计数据 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下最新项目日统计数据 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询当前组织的直属下级组织信息 |
|||
* @author sun |
|||
*/ |
|||
List<DimAgencyEntity> getSubAgencyList(@Param("pid") String pid); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织注册用户日统计数据,默认按用户总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyUserResultDTO> getSubAgencyUser(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询组织下网格列表 |
|||
* @author sun |
|||
*/ |
|||
List<DimGridEntity> getSubGridList(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级注册用户日统计数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridUserResultDTO> getSubGridUser(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织小组日统计数据,默认按群组总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyGroupResultDTO> getSubAgencyGroup(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级小组日统计数据,默认按群组总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridGroupResultDTO> getSubGridGroup(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织状态话题-日统计数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyFormDTO.Topic> getSubAgencyTopic(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织转议题话题-日统计数据表 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyFormDTO.Topic> getSubAgencyTopicShiftIssue(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级状态话题-日统计数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridFormDTO.Topic> getSubGridTopic(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级转议题话题-日统计数据表 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridFormDTO.Topic> getSubGridTopicShiftIssue(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织议题日统计数据,默认按议题总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyIssueResultDTO> getSubAgencyIssue(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级议题日统计数据,默认按议题总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridIssueResultDTO> getSubGridIssue(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询直属下级组织项目日统计数据,默认按项目总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyProjectResultDTO> getSubAgencyProject(@Param("agencyIds") List<String> agencyIds, @Param("dateId") String dateId); |
|||
|
|||
/** |
|||
* @Description 查询网格层级项目日统计数据,默认按项目总数降序 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridProjectResultDTO> getSubGridProject(@Param("gridIds") List<String> gridIds, @Param("dateId") String dateId); |
|||
|
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
/** |
|||
* 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.dataaggre.entity.datastats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
|
|||
/** |
|||
* 机关维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("dim_agency") |
|||
public class DimAgencyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 上级组织机构ID,根组织为0 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 所有上级组织机构ID(以英文:隔开) |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 |
|||
*/ |
|||
private String agencyDimType; |
|||
|
|||
/** |
|||
* 所有上级名称,以-连接 |
|||
*/ |
|||
private String allParentName; |
|||
|
|||
/** |
|||
* 机关级别(社区级:community, |
|||
* 乡(镇、街道)级:street, |
|||
* 区县级: district, |
|||
* 市级: city |
|||
* 省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
/** |
|||
* 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.dataaggre.entity.datastats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
|
|||
/** |
|||
* 客户维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("dim_customer") |
|||
public class DimCustomerEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户名称 |
|||
*/ |
|||
private String customerName; |
|||
|
|||
/** |
|||
* 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
/** |
|||
* 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.dataaggre.entity.datastats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
|
|||
/** |
|||
* 客户网格维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("dim_grid") |
|||
public class DimGridEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 所属组织机构ID(customer_agency.id) |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 所属地区码(所属组织地区码) |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
package com.epmet.dataaggre.service.datastats; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据统计服务 |
|||
*/ |
|||
public interface DataStatsService { |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 组织下五项基础数据汇总 |
|||
* @author sun |
|||
*/ |
|||
AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织用户数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyUserResultDTO> subAgencyUser(SubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表用户数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridUserResultDTO> subGridUser(SubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织群组数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyGroupResultDTO> subAgencyGroup(SubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表群组数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridGroupResultDTO> subGridGroup(SubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织话题数据 |
|||
* @author sun |
|||
* @return |
|||
*/ |
|||
List<SubAgencyTopicResultDTO> subAgencyTopic(SubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表话题数据 |
|||
* @author sun |
|||
* @return |
|||
*/ |
|||
List<SubGridTopicResultDTO> subGridTopic(SubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织议题数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyIssueResultDTO> subAgencyIssue(SubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表议题数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridIssueResultDTO> subGridIssue(SubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织项目数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubAgencyProjectResultDTO> subAgencyProject(SubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表项目数据 |
|||
* @author sun |
|||
*/ |
|||
List<SubGridProjectResultDTO> subGridProject(SubGridFormDTO formDTO); |
|||
} |
|||
@ -0,0 +1,632 @@ |
|||
package com.epmet.dataaggre.service.datastats.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.dataaggre.constant.DataSourceConstant; |
|||
import com.epmet.dataaggre.dao.datastats.DataStatsDao; |
|||
import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.*; |
|||
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; |
|||
import com.epmet.dataaggre.entity.datastats.DimGridEntity; |
|||
import com.epmet.dataaggre.service.datastats.DataStatsService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.text.NumberFormat; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.*; |
|||
import java.util.concurrent.atomic.AtomicInteger; |
|||
import java.util.concurrent.atomic.AtomicReference; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据统计服务 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.DATA_STATISTICAL) |
|||
@Slf4j |
|||
public class DataStatsServiceImpl implements DataStatsService { |
|||
@Autowired |
|||
private DataStatsDao dataStatsDao; |
|||
|
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 组织下五项基础数据汇总 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { |
|||
AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); |
|||
resultDTO.setAgencyId(formDTO.getAgencyId()); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】
|
|||
AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
if (null != user) { |
|||
resultDTO.setUserTotal(user.getUserTotal()); |
|||
resultDTO.setResiTotal(user.getResiTotal()); |
|||
resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal()))); |
|||
resultDTO.setPartyMemberTotal(user.getPartyMemberTotal()); |
|||
resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal()))); |
|||
} |
|||
|
|||
//2.查询组织下最新群组日统计数据
|
|||
AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
if (null != group) { |
|||
resultDTO.setGroupTotal(group.getGroupTotal()); |
|||
resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); |
|||
resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); |
|||
resultDTO.setBranchTotal(group.getBranchTotal()); |
|||
resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal()))); |
|||
} |
|||
|
|||
//3.查询组织下最新话题日统计数据
|
|||
//状态话题-机关日统计数据表最新日期三种状态数据
|
|||
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
|
|||
List<AgencyBasicDataResultDTO.Topic> topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
//转议题话题-机关日统计数据表
|
|||
AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
AtomicReference<Integer> closedTotal = new AtomicReference<>(0); |
|||
AtomicReference<Integer> hiddenTotal = new AtomicReference<>(0); |
|||
if (topic.size()>NumConstant.ZERO) { |
|||
resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); |
|||
topic.forEach(t -> { |
|||
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|||
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|||
}); |
|||
} |
|||
if (null != topicSHiftIssue) { |
|||
resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); |
|||
resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); |
|||
} |
|||
resultDTO.setDiscussingTotal(resultDTO.getTopicTotal()-closedTotal.get()-hiddenTotal.get()-resultDTO.getShiftIssueTotal()); |
|||
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); |
|||
resultDTO.setClosedTopicTotal(closedTotal.get()); |
|||
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); |
|||
|
|||
//4.查询组织下最新议题日统计数据
|
|||
AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
if (null != issue) { |
|||
resultDTO.setIssueTotal(issue.getIssueTotal()); |
|||
resultDTO.setVotingTotal(issue.getVotingTotal()); |
|||
resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); |
|||
resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal()); |
|||
resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); |
|||
resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal()); |
|||
resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); |
|||
} |
|||
|
|||
//5.查询组织下最新项目日统计数据
|
|||
AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId()); |
|||
if (null != project) { |
|||
resultDTO.setProjectTotal(project.getProjectTotal()); |
|||
resultDTO.setPendingTotal(project.getPendingTotal()); |
|||
resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); |
|||
resultDTO.setClosedProjectTotal(project.getClosedProjectTotal()); |
|||
resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); |
|||
} |
|||
|
|||
return resultDTO; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织用户数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubAgencyUserResultDTO> subAgencyUser(SubAgencyFormDTO formDTO) { |
|||
List<SubAgencyUserResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询当前组织的直属下级组织信息【机关维度】
|
|||
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|||
if(subAgencyList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询直属下级组织注册用户日统计数据,默认按用户总数降序
|
|||
resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); |
|||
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); |
|||
subAgencyList.forEach(sub->{ |
|||
if(re.getAgencyId().equals(sub.getId())){ |
|||
re.setAgencyName(sub.getAgencyName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表用户数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubGridUserResultDTO> subGridUser(SubGridFormDTO formDTO) { |
|||
List<SubGridUserResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织直属网格列表【网格维度】
|
|||
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|||
if(gridList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询网格层级注册用户日统计数据,默认按用户总数降序
|
|||
resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); |
|||
re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); |
|||
gridList.forEach(sub->{ |
|||
if(re.getGridId().equals(sub.getId())){ |
|||
re.setGridName(sub.getGridName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织群组数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubAgencyGroupResultDTO> subAgencyGroup(SubAgencyFormDTO formDTO) { |
|||
List<SubAgencyGroupResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询当前组织的直属下级组织信息【机关维度】
|
|||
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|||
if(subAgencyList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询直属下级组织小组日统计数据,默认按群组总数降序
|
|||
resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); |
|||
re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); |
|||
subAgencyList.forEach(sub->{ |
|||
if(re.getAgencyId().equals(sub.getId())){ |
|||
re.setAgencyName(sub.getAgencyName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表群组数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubGridGroupResultDTO> subGridGroup(SubGridFormDTO formDTO) { |
|||
List<SubGridGroupResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织直属网格列表【网格维度】
|
|||
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|||
if(gridList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询网格层级小组日统计数据,默认按群组总数降序
|
|||
resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); |
|||
re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); |
|||
gridList.forEach(sub->{ |
|||
if(re.getGridId().equals(sub.getId())){ |
|||
re.setGridName(sub.getGridName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织话题数据 |
|||
* @author sun |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<SubAgencyTopicResultDTO> subAgencyTopic(SubAgencyFormDTO formDTO) { |
|||
List<SubAgencyTopicResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询当前组织的直属下级组织信息【机关维度】
|
|||
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|||
if(subAgencyList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询直属下级组织状态话题-日统计数据
|
|||
//机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
|
|||
List<SubAgencyFormDTO.Topic> topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); |
|||
//查询直属下级组织转议题话题-日统计数据表
|
|||
List<SubAgencyFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); |
|||
agencyIds.forEach(agencyId->{ |
|||
SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); |
|||
AtomicInteger topicTotal = new AtomicInteger(0); |
|||
AtomicInteger closedTotal = new AtomicInteger(0); |
|||
AtomicInteger hiddenTotal = new AtomicInteger(0); |
|||
AtomicInteger shiftIssueTotal = new AtomicInteger(0); |
|||
AtomicReference<String> agencyName = new AtomicReference<>(""); |
|||
topic.forEach(t->{ |
|||
if(t.getAgencyId().equals(agencyId)){ |
|||
topicTotal.addAndGet(t.getTopicCount()); |
|||
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|||
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|||
} |
|||
}); |
|||
topicShiftIssue.forEach(t->{ |
|||
if(t.getAgencyId().equals(agencyId)){ |
|||
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); |
|||
} |
|||
}); |
|||
subAgencyList.forEach(sub->{ |
|||
if(agencyId.equals(sub.getId())){ |
|||
agencyName.set(sub.getAgencyName()); |
|||
} |
|||
}); |
|||
|
|||
resultDTO.setAgencyId(agencyId); |
|||
resultDTO.setAgencyName(agencyName.get()); |
|||
resultDTO.setTopicTotal(topicTotal.get()); |
|||
resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); |
|||
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); |
|||
resultDTO.setClosedTopicTotal(closedTotal.get()); |
|||
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); |
|||
resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); |
|||
resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); |
|||
|
|||
resultList.add(resultDTO); |
|||
}); |
|||
|
|||
//3.默认按话题总数降序
|
|||
Collections.sort(resultList, new Comparator<SubAgencyTopicResultDTO>() { |
|||
@Override |
|||
public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { |
|||
//升序
|
|||
//return o1.getTopicTotal().compareTo(o2.getTopicTotal());
|
|||
//降序
|
|||
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|||
} |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表话题数据 |
|||
* @author sun |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<SubGridTopicResultDTO> subGridTopic(SubGridFormDTO formDTO) { |
|||
List<SubGridTopicResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织直属网格列表【网格维度】
|
|||
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|||
if(gridList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询网格层级话题数据
|
|||
//查询网格层级状态话题-日统计数据 机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数
|
|||
List<SubGridFormDTO.Topic> topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); |
|||
//查询网格层级转议题话题-日统计数据表
|
|||
List<SubGridFormDTO.Topic> topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); |
|||
gridIds.forEach(gridId->{ |
|||
SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); |
|||
AtomicInteger topicTotal = new AtomicInteger(0); |
|||
AtomicInteger closedTotal = new AtomicInteger(0); |
|||
AtomicInteger hiddenTotal = new AtomicInteger(0); |
|||
AtomicInteger shiftIssueTotal = new AtomicInteger(0); |
|||
AtomicReference<String> gridName = new AtomicReference<>(""); |
|||
topic.forEach(t->{ |
|||
if(t.getGridId().equals(gridId)){ |
|||
topicTotal.addAndGet(t.getTopicCount()); |
|||
if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } |
|||
if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } |
|||
} |
|||
}); |
|||
topicShiftIssue.forEach(t->{ |
|||
if(t.getGridId().equals(gridId)){ |
|||
shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); |
|||
} |
|||
}); |
|||
gridList.forEach(sub->{ |
|||
if(gridId.equals(sub.getId())){ |
|||
gridName.set(sub.getGridName()); |
|||
} |
|||
}); |
|||
|
|||
resultDTO.setGridId(gridId); |
|||
resultDTO.setGridName(gridName.get()); |
|||
resultDTO.setTopicTotal(topicTotal.get()); |
|||
resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); |
|||
resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); |
|||
resultDTO.setClosedTopicTotal(closedTotal.get()); |
|||
resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); |
|||
resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); |
|||
resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); |
|||
|
|||
resultList.add(resultDTO); |
|||
}); |
|||
|
|||
//3.默认按话题总数降序
|
|||
Collections.sort(resultList, new Comparator<SubGridTopicResultDTO>() { |
|||
@Override |
|||
public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { |
|||
//升序
|
|||
//return o1.getTopicTotal().compareTo(o2.getTopicTotal());
|
|||
//降序
|
|||
return o2.getTopicTotal().compareTo(o1.getTopicTotal()); |
|||
} |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织议题数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubAgencyIssueResultDTO> subAgencyIssue(SubAgencyFormDTO formDTO) { |
|||
List<SubAgencyIssueResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询当前组织的直属下级组织信息【机关维度】
|
|||
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|||
if(subAgencyList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询直属下级组织议题日统计数据,默认按议题总数降序
|
|||
resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); |
|||
re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); |
|||
re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); |
|||
subAgencyList.forEach(sub->{ |
|||
if(re.getAgencyId().equals(sub.getId())){ |
|||
re.setAgencyName(sub.getAgencyName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表议题数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubGridIssueResultDTO> subGridIssue(SubGridFormDTO formDTO) { |
|||
List<SubGridIssueResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织直属网格列表【网格维度】
|
|||
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|||
if(gridList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询网格层级议题日统计数据,默认按议题总数降序
|
|||
resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); |
|||
re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); |
|||
re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); |
|||
gridList.forEach(sub->{ |
|||
if(re.getGridId().equals(sub.getId())){ |
|||
re.setGridName(sub.getGridName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织的直属下级组织项目数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubAgencyProjectResultDTO> subAgencyProject(SubAgencyFormDTO formDTO) { |
|||
List<SubAgencyProjectResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询当前组织的直属下级组织信息【机关维度】
|
|||
List<DimAgencyEntity> subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); |
|||
if(subAgencyList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询直属下级组织项目日统计数据,默认按项目总数降序
|
|||
resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); |
|||
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); |
|||
subAgencyList.forEach(sub->{ |
|||
if(re.getAgencyId().equals(sub.getId())){ |
|||
re.setAgencyName(sub.getAgencyName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Param formDTO |
|||
* @Description 查询当前组织下直属网格列表项目数据 |
|||
* @author sun |
|||
*/ |
|||
@Override |
|||
public List<SubGridProjectResultDTO> subGridProject(SubGridFormDTO formDTO) { |
|||
List<SubGridProjectResultDTO> resultList = new ArrayList<>(); |
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.FOUR); |
|||
|
|||
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
|
|||
if (StringUtils.isBlank(formDTO.getDateId())) { |
|||
Date yesterday = DateUtils.addDateDays(new Date(), -1); |
|||
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
formDTO.setDateId(format.format(yesterday)); |
|||
} |
|||
|
|||
//1.查询组织直属网格列表【网格维度】
|
|||
List<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); |
|||
if(gridList.size()<NumConstant.ONE){ |
|||
return resultList; |
|||
} |
|||
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); |
|||
|
|||
//2.查询网格层级项目日统计数据,默认按项目总数降序
|
|||
resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); |
|||
|
|||
//3.封装数据并返回
|
|||
resultList.forEach(re->{ |
|||
re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); |
|||
re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); |
|||
gridList.forEach(sub->{ |
|||
if(re.getGridId().equals(sub.getId())){ |
|||
re.setGridName(sub.getGridName()); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,317 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dataaggre.dao.datastats.DataStatsDao"> |
|||
|
|||
<select id="getAgnecyRegUser" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO"> |
|||
SELECT |
|||
reg_total AS userTotal, |
|||
partymember_total AS partyMemberTotal, |
|||
(reg_total - partymember_total) AS resiTotal |
|||
FROM |
|||
fact_reg_user_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getAgnecyGroup" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO"> |
|||
SELECT |
|||
group_total AS groupTotal, |
|||
ordinary_total AS ordinaryTotal, |
|||
branch_total AS branchTotal |
|||
FROM |
|||
fact_group_total_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getAgencyTopic" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic"> |
|||
SELECT |
|||
topic_count AS topicCount, |
|||
topic_status_id AS topicStatus |
|||
FROM |
|||
fact_topic_status_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND topic_status_id in('discussing','closed','hidden')<!-- 讨论中(热议中!=讨论中)、已处理、已屏蔽 --> |
|||
AND agency_id = #{agencyId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 3 |
|||
</select> |
|||
|
|||
<select id="getAgencyTopicShiftIssue" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO$Topic"> |
|||
SELECT |
|||
issue_total AS shiftedIssueTotal, |
|||
DATE_FORMAT(date_id, '%Y-%m-%d') AS deadline |
|||
FROM |
|||
fact_topic_issue_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getAgencyIssue" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO"> |
|||
SELECT |
|||
issue_total AS issueTotal, |
|||
voting_total AS votingTotal, |
|||
closed_total AS closedIssueTotal, |
|||
shift_project_total AS shiftProjectTotal |
|||
FROM |
|||
fact_issue_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getAgencyProject" resultType="com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO"> |
|||
SELECT |
|||
IFNULL(project_total, 0) AS "projectTotal", |
|||
IFNULL(pending_total, 0) AS "pendingTotal", |
|||
IFNULL(closed_total, 0) AS "closedProjectTotal" |
|||
FROM |
|||
fact_agency_project_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = '8631fa4b22e88fdc259b3f51b5de2be2' |
|||
AND date_id = #{dateId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
<select id="getSubAgencyList" resultType="com.epmet.dataaggre.entity.datastats.DimAgencyEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
dim_agency |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_dim_type = 'all' |
|||
AND pid = #{pid} |
|||
</select> |
|||
|
|||
<select id="getSubAgencyUser" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
reg_total AS userTotal, |
|||
partymember_total AS partyMemberTotal, |
|||
(reg_total - partymember_total) AS resiTotal |
|||
FROM |
|||
fact_reg_user_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
ORDER BY |
|||
reg_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubGridList" resultType="com.epmet.dataaggre.entity.datastats.DimGridEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
dim_grid |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
</select> |
|||
|
|||
<select id="getSubGridUser" resultType="com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
reg_total AS userTotal, |
|||
partymember_total AS partyMemberTotal, |
|||
(reg_total - partymember_total) AS resiTotal |
|||
FROM |
|||
fact_reg_user_grid_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
ORDER BY |
|||
reg_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubAgencyGroup" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyGroupResultDTO"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
group_total AS groupTotal, |
|||
ordinary_total AS ordinaryTotal, |
|||
branch_total AS branchTotal |
|||
FROM |
|||
fact_group_total_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
ORDER BY |
|||
group_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubGridGroup" resultType="com.epmet.dataaggre.dto.datastats.result.SubGridGroupResultDTO"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
group_total AS groupTotal, |
|||
ordinary_total AS ordinaryTotal, |
|||
branch_total AS branchTotal |
|||
FROM |
|||
fact_group_total_grid_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
ORDER BY |
|||
group_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubAgencyTopic" resultType="com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO$Topic"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
topic_count AS topicCount, |
|||
topic_status_id AS topicStatus |
|||
FROM |
|||
fact_topic_status_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND topic_status_id in('discussing','closed','hidden')<!-- 讨论中(热议中!=讨论中)、已处理、已屏蔽 --> |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
</select> |
|||
|
|||
<select id="getSubAgencyTopicShiftIssue" resultType="com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO$Topic"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
issue_total AS shiftedIssueTotal |
|||
FROM |
|||
fact_topic_issue_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
</select> |
|||
|
|||
<select id="getSubGridTopic" resultType="com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO$Topic"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
topic_count AS topicCount, |
|||
topic_status_id AS topicStatus |
|||
FROM |
|||
fact_topic_status_grid_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND topic_status_id in('discussing','closed','hidden')<!-- 讨论中(热议中!=讨论中)、已处理、已屏蔽 --> |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
</select> |
|||
|
|||
<select id="getSubGridTopicShiftIssue" resultType="com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO$Topic"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
issue_total AS shiftedIssueTotal |
|||
FROM |
|||
fact_topic_issue_grid_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
</select> |
|||
|
|||
<select id="getSubAgencyIssue" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyIssueResultDTO"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
issue_total AS issueTotal, |
|||
voting_total AS votingTotal, |
|||
closed_total AS closedIssueTotal, |
|||
shift_project_total AS shiftProjectTotal |
|||
FROM |
|||
fact_issue_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
ORDER BY |
|||
issue_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubGridIssue" resultType="com.epmet.dataaggre.dto.datastats.result.SubGridIssueResultDTO"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
issue_total AS issueTotal, |
|||
voting_total AS votingTotal, |
|||
closed_total AS closedIssueTotal, |
|||
shift_project_total AS shiftProjectTotal |
|||
FROM |
|||
fact_issue_grid_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
ORDER BY |
|||
issue_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubAgencyProject" resultType="com.epmet.dataaggre.dto.datastats.result.SubAgencyProjectResultDTO"> |
|||
SELECT |
|||
agency_id AS agencyId, |
|||
IFNULL(project_total, 0) AS "projectTotal", |
|||
IFNULL(pending_total, 0) AS "pendingTotal", |
|||
IFNULL(closed_total, 0) AS "closedProjectTotal" |
|||
FROM |
|||
fact_agency_project_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index=""> |
|||
agency_id = #{agencyId} |
|||
</foreach> |
|||
ORDER BY |
|||
project_total DESC |
|||
</select> |
|||
|
|||
<select id="getSubGridProject" resultType="com.epmet.dataaggre.dto.datastats.result.SubGridProjectResultDTO"> |
|||
SELECT |
|||
grid_id AS gridId, |
|||
IFNULL(project_total, 0) AS "projectTotal", |
|||
IFNULL(pending_total, 0) AS "pendingTotal", |
|||
IFNULL(closed_total, 0) AS "closedProjectTotal" |
|||
FROM |
|||
fact_grid_project_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND date_id = #{dateId} |
|||
<foreach item="gridId" collection="gridIds" open="AND (" separator="or" close=")" index=""> |
|||
grid_id = #{gridId} |
|||
</foreach> |
|||
ORDER BY |
|||
project_total DESC |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,122 @@ |
|||
/** |
|||
* 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.evaluationindex.index.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 指标说明文案 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class IndexExplainDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 含义 |
|||
*/ |
|||
private String meaning; |
|||
|
|||
/** |
|||
* 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) |
|||
*/ |
|||
private String orgLevel; |
|||
|
|||
/** |
|||
* 父ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 是否需要查询;1有;0:无; |
|||
*/ |
|||
private Integer isSearch; |
|||
|
|||
/** |
|||
* 数据类型:none;本级:self;下级:sub |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 |
|||
*/ |
|||
private Integer goDown; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
/** |
|||
* 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.evaluationindex.index.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 指标说明文案 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class IndexExplainTreeDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 含义 |
|||
*/ |
|||
private String meaning; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) |
|||
*/ |
|||
private String orgLevel; |
|||
|
|||
/** |
|||
* 父ID |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 是否需要查询;1有;0:无; |
|||
*/ |
|||
private Integer isSearch; |
|||
|
|||
/** |
|||
* 数据类型:none;本级:self;下级:sub |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 |
|||
*/ |
|||
private Integer goDown; |
|||
|
|||
/** |
|||
* 子节点 |
|||
*/ |
|||
List<IndexExplainTreeDTO> children; |
|||
|
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
/** |
|||
* 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.evaluationindex.index.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 指标说明文案查询参数 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class IndexExplainFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) |
|||
*/ |
|||
private String orgLevel; |
|||
|
|||
/** |
|||
* 组织id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.evaluationindex.index.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 指标分数 返回结果 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IndexScoreFormDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = 6225580299239889980L; |
|||
|
|||
private String customerId; |
|||
/** |
|||
* 组织或网格Id |
|||
*/ |
|||
private String orgId; |
|||
/** |
|||
* 组织或网格类型 |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* 月份Id(格式:202009) |
|||
*/ |
|||
private String monthId; |
|||
/** |
|||
* 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) |
|||
*/ |
|||
private String indexCode; |
|||
/** |
|||
* 所有有权重的指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.epmet.evaluationindex.index.result; |
|||
|
|||
import com.epmet.evaluationindex.index.dto.IndexExplainDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* desc:得分明细说明结果类 |
|||
* |
|||
* @author: LiuJanJun |
|||
* @date: 2021/5/12 4:19 下午 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
public class IndexExplainChildResult extends IndexExplainDTO { |
|||
|
|||
private static final long serialVersionUID = -3997821113617472317L; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
package com.epmet.evaluationindex.index.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* desc:得分明细说明结果类 |
|||
* |
|||
* @author: LiuJanJun |
|||
* @date: 2021/5/12 4:19 下午 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
public class IndexExplainResult { |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 含义 |
|||
*/ |
|||
private String meaning; |
|||
|
|||
/** |
|||
* 子节点 list |
|||
*/ |
|||
private List<IndexExplainResult> children = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 子节点data list |
|||
*/ |
|||
private List<IndexScoreDetailResult> tableDataList = new ArrayList<>(); |
|||
/** |
|||
* 子节点标题 list |
|||
*/ |
|||
private List<String> tableTileList = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 阈值说明列表 |
|||
*/ |
|||
private List<String> thresholdList = new ArrayList<>(); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,92 @@ |
|||
/** |
|||
* 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.evaluationindex.index.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 客户指标详情 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
|
|||
public class IndexGroupDetailResult implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* index_group.id |
|||
*/ |
|||
private String indexGroupId; |
|||
|
|||
/** |
|||
* 指标id |
|||
*/ |
|||
private String indexId; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
private String indexName; |
|||
|
|||
/** |
|||
* 所有有权重的指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allIndexCodePath; |
|||
|
|||
/** |
|||
* 权重(同一组权重总和=1) |
|||
*/ |
|||
private BigDecimal weight; |
|||
|
|||
/** |
|||
* 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 |
|||
*/ |
|||
private BigDecimal threshold; |
|||
|
|||
/** |
|||
* 是否启用:启用:enable 禁用:disabled |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 正相关:positive;负相关:negative |
|||
*/ |
|||
private String correlation; |
|||
|
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
package com.epmet.evaluationindex.index.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc:得分明细说明结果类 |
|||
* |
|||
* @author: LiuJanJun |
|||
* @date: 2021/5/12 4:19 下午 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
public class IndexScoreDetailResult implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3997821113617472317L; |
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
/** |
|||
* 指标名称 |
|||
*/ |
|||
private String indexName; |
|||
|
|||
/** |
|||
* 原始值(如果是平均分的话 则为 参与平均的个数) |
|||
*/ |
|||
private String originValue; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private String score; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private String weight; |
|||
|
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private String quantity; |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
package com.epmet.evaluationindex.index.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 指标分数 返回结果 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class IndexScoreResult implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = -8458272574625683349L; |
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
/** |
|||
* 指标对应值(数值或百分比)原始值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 指标对应的权重 |
|||
*/ |
|||
private BigDecimal weight; |
|||
|
|||
/** |
|||
* 原始值 |
|||
*/ |
|||
private String originValue; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private String quantity; |
|||
|
|||
} |
|||
@ -0,0 +1,74 @@ |
|||
package com.epmet.datareport.constant; |
|||
|
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author sun |
|||
* @dscription 数据 |
|||
*/ |
|||
public class IndexConstant { |
|||
|
|||
/** |
|||
* 评价指标类型-百分比 |
|||
*/ |
|||
public static final List<String> ScoreLastHeader = Arrays.asList("指标值", "得分", "权重"); |
|||
public static final List<String> QuantityLastHeader = Arrays.asList("数量", "平均值", "权重"); |
|||
|
|||
private static final String DJZS_CN = "党建指数"; |
|||
private static final String FWZS_CN = "服务指数"; |
|||
private static final String ZLZS_CN = "治理指数"; |
|||
private static final String ZB_CN = "指标"; |
|||
private static final String BEN_JI = "本级"; |
|||
private static final String XIA_JI = "下级"; |
|||
|
|||
|
|||
/** |
|||
* desc: 根据indexCode 获取表格表头 |
|||
* |
|||
* @param allIndexCode |
|||
* @return java.util.List<java.lang.String> |
|||
* @author LiuJanJun |
|||
* @date 2021/5/13 11:06 上午 |
|||
*/ |
|||
public static List<String> getStandardSelfHeaders(String allIndexCode) { |
|||
List<String> result = new ArrayList<>(8); |
|||
if (StringUtils.isBlank(allIndexCode)) { |
|||
return null; |
|||
} |
|||
|
|||
if (allIndexCode.contains(FactConstant.DJNL)) { |
|||
result.add(BEN_JI + DJZS_CN + ZB_CN); |
|||
} else if (allIndexCode.contains(FactConstant.FWNL)) { |
|||
result.add(BEN_JI + FWZS_CN + ZB_CN); |
|||
} else if (allIndexCode.contains(FactConstant.ZLNL)) { |
|||
result.add(BEN_JI + ZLZS_CN + ZB_CN); |
|||
} |
|||
result.addAll(ScoreLastHeader); |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* desc: 根据indexCode 获取表格表头 |
|||
* |
|||
* @param allIndexCode |
|||
* @return java.util.List<java.lang.String> |
|||
* @author LiuJanJun |
|||
* @date 2021/5/13 11:06 上午 |
|||
*/ |
|||
public static List<String> getStandardSubHeaders(String allIndexCode) { |
|||
List<String> result = new ArrayList<>(8); |
|||
if (allIndexCode.contains(FactConstant.DJNL)) { |
|||
result.add(XIA_JI + DJZS_CN + ZB_CN); |
|||
} else if (allIndexCode.contains(FactConstant.FWNL)) { |
|||
result.add(XIA_JI + FWZS_CN + ZB_CN); |
|||
} else if (allIndexCode.contains(FactConstant.ZLNL)) { |
|||
result.add(XIA_JI + ZLZS_CN + ZB_CN); |
|||
} |
|||
result.addAll(QuantityLastHeader); |
|||
return result; |
|||
} |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
/** |
|||
* 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.datareport.controller.index; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; |
|||
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; |
|||
import com.epmet.evaluationindex.index.result.IndexExplainResult; |
|||
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; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 指标说明文案 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("indexexplain") |
|||
public class IndexExplainController { |
|||
|
|||
@Autowired |
|||
private IndexExplainService indexExplainService; |
|||
|
|||
|
|||
/** |
|||
* desc: 获取得分说明明细 |
|||
* |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.group.dto.result.GroupSummaryInfoResultDTO> |
|||
* @author LiuJanJun |
|||
* @date 2021/5/12 4:12 下午 |
|||
*/ |
|||
@PostMapping("detail") |
|||
public Result<List<IndexExplainResult>> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ |
|||
Result<List<IndexExplainResult>> ok = new Result<List<IndexExplainResult>>().ok(indexExplainService.getScoreDetail(formDTO)); |
|||
return ok; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
/** |
|||
* 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.datareport.dao.evaluationindex.index; |
|||
|
|||
import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; |
|||
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 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface IndexExplainDao { |
|||
|
|||
List<IndexExplainTreeDTO> getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.datareport.dao.evaluationindex.index; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.evaluationindex.IndexGroupEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 客户指标分组 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface IndexGroupDao extends BaseDao<IndexGroupEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
/** |
|||
* 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.datareport.dao.evaluationindex.index; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.evaluationindex.IndexGroupDetailEntity; |
|||
import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户指标详情 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface IndexGroupDetailDao extends BaseDao<IndexGroupDetailEntity> { |
|||
|
|||
/** |
|||
* desc: 根据客户Id获取客户所有指标数据 |
|||
* |
|||
* @param customerId |
|||
* @return java.util.List<com.epmet.evaluationindex.index.result.IndexGroupDetailResult> |
|||
* @author LiuJanJun |
|||
* @date 2021/5/13 2:41 下午 |
|||
*/ |
|||
List<IndexGroupDetailResult> getAllIndexByCId(String customerId); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.datareport.dao.fact; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.evaluationindex.FactIndexCpcScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-14 |
|||
*/ |
|||
@Mapper |
|||
public interface FactIndexCpcScoreDao extends BaseDao<FactIndexCpcScoreEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
/** |
|||
* 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.datareport.dao.fact; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.datareport.entity.evaluationindex.FactIndexCpcSubScoreEntity; |
|||
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; |
|||
import com.epmet.evaluationindex.index.result.IndexScoreResult; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-14 |
|||
*/ |
|||
@Mapper |
|||
public interface FactIndexCpcSubScoreDao extends BaseDao<FactIndexCpcSubScoreEntity> { |
|||
|
|||
List<IndexScoreResult> selecCpcAvgScore(IndexScoreFormDTO ablityListFormDTO); |
|||
} |
|||
@ -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.datareport.entity.evaluationindex; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_index_cpc_score") |
|||
public class FactIndexCpcScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格所属的机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 1:总分;0不是 默认0 |
|||
*/ |
|||
private String isTotal; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 参与议事分值:canyuyishi; |
|||
党务活动分值:dangwuhuodong; |
|||
联系群众分值:lianxiqunzhong; |
|||
党建能力分值:dangjiannengli |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 权重(同一组权重总和=1) |
|||
*/ |
|||
private BigDecimal weight; |
|||
|
|||
} |
|||
@ -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.datareport.entity.evaluationindex; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-14 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_index_cpc_sub_score") |
|||
public class FactIndexCpcSubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格所属的机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 计算指标时的原始值 字符串类型 |
|||
*/ |
|||
private String originValue; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 参与议事分值:canyuyishi; |
|||
党务活动分值:dangwuhuodong; |
|||
联系群众分值:lianxiqunzhong; |
|||
党建能力分值:dangjiannengli |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 权重(同一组权重总和=1) |
|||
*/ |
|||
private BigDecimal weight; |
|||
|
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
/** |
|||
* 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.datareport.entity.evaluationindex; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 客户指标详情 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("index_group_detail") |
|||
public class IndexGroupDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* index_group.id |
|||
*/ |
|||
private String indexGroupId; |
|||
|
|||
/** |
|||
* 指标id |
|||
*/ |
|||
private String indexId; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有有权重的指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allIndexCodePath; |
|||
|
|||
/** |
|||
* 权重(同一组权重总和=1) |
|||
*/ |
|||
private BigDecimal weight; |
|||
|
|||
/** |
|||
* 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 |
|||
*/ |
|||
private BigDecimal threshold; |
|||
|
|||
/** |
|||
* 是否启用:启用:enable 禁用:disabled |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 正相关:positive;负相关:negative |
|||
*/ |
|||
private String correlation; |
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
/** |
|||
* 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.datareport.entity.evaluationindex; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 客户指标分组 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("index_group") |
|||
public class IndexGroupEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 指标id |
|||
*/ |
|||
private String indexId; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 是否启用:启用:enable 禁用:disabled |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 当前指标关联的上一级指标分组,如果没有上一级,则为0 |
|||
*/ |
|||
private String parentIndexGroupId; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allIndexCodePath; |
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.datareport.service.evaluationindex.index; |
|||
|
|||
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; |
|||
import com.epmet.evaluationindex.index.result.IndexExplainResult; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 指标说明文案 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
public interface IndexExplainService { |
|||
|
|||
/** |
|||
* desc: 获取指标得分说明 |
|||
* |
|||
* @param formDTO |
|||
* @return java.util.List<com.epmet.evaluationindex.index.result.IndexExplainResult> |
|||
* @author LiuJanJun |
|||
* @date 2021/5/12 4:38 下午 |
|||
*/ |
|||
List<IndexExplainResult> getScoreDetail(IndexExplainFormDTO formDTO); |
|||
} |
|||
@ -0,0 +1,191 @@ |
|||
/** |
|||
* 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.datareport.service.evaluationindex.index.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.datareport.constant.IndexConstant; |
|||
import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; |
|||
import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; |
|||
import com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao; |
|||
import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; |
|||
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; |
|||
import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; |
|||
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; |
|||
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; |
|||
import com.epmet.evaluationindex.index.result.IndexExplainResult; |
|||
import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; |
|||
import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; |
|||
import com.epmet.evaluationindex.index.result.IndexScoreResult; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 指标说明文案 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class IndexExplainServiceImpl implements IndexExplainService { |
|||
|
|||
@Autowired |
|||
private IndexExplainDao indexExplainDao; |
|||
@Autowired |
|||
private IndexGroupDetailDao indexGroupDetailDao; |
|||
@Autowired |
|||
private FactIndexGridSubScoreDao gridSubScoreDao; |
|||
@Autowired |
|||
private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; |
|||
|
|||
|
|||
@Override |
|||
public List<IndexExplainResult> getScoreDetail(IndexExplainFormDTO formDTO) { |
|||
List<IndexExplainResult> results = new ArrayList<>(); |
|||
List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); |
|||
if (CollectionUtils.isEmpty(explainDTOList)) { |
|||
return null; |
|||
} |
|||
List<IndexGroupDetailResult> groupDetailEntities = indexGroupDetailDao.getAllIndexByCId(formDTO.getCustomerId()); |
|||
if (CollectionUtils.isEmpty(groupDetailEntities)) { |
|||
return null; |
|||
} |
|||
Map<String, List<IndexGroupDetailResult>> detailEntityMap = groupDetailEntities.stream().collect(Collectors.groupingBy(IndexGroupDetailResult::getAllParentIndexCode)); |
|||
|
|||
|
|||
for (IndexExplainTreeDTO explainDTO : explainDTOList) { |
|||
//根节点
|
|||
IndexExplainResult result = new IndexExplainResult(); |
|||
results.add(result); |
|||
result.setTitle(explainDTO.getTitle()); |
|||
result.setMeaning(explainDTO.getMeaning()); |
|||
//设置表格数据
|
|||
setTableData(formDTO, detailEntityMap, explainDTO, result); |
|||
//子节点
|
|||
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); |
|||
} |
|||
|
|||
return results; |
|||
} |
|||
|
|||
private void setTableData(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { |
|||
Integer goDown = explainDTO.getGoDown(); |
|||
if (NumConstant.ONE == explainDTO.getIsSearch()) { |
|||
List<String> tableHeaders = getTableHeaders(explainDTO); |
|||
result.setTableTileList(tableHeaders); |
|||
switch (explainDTO.getOrgLevel()) { |
|||
case "grid": |
|||
String type = explainDTO.getType(); |
|||
String allIndexCodePath = null; |
|||
List<IndexScoreDetailResult> tableList = null; |
|||
if ("zishen".equals(type)) { |
|||
allIndexCodePath = "wanggexiangguan:dangjiannengli"; |
|||
tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); |
|||
result.setTableDataList(tableList); |
|||
} else if ("xiaji".equals(type)) { |
|||
allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; |
|||
tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); |
|||
result.setTableDataList(tableList); |
|||
} |
|||
//set Target value
|
|||
IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); |
|||
ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); |
|||
ablityListFormDTO.setOrgId(formDTO.getOrgId()); |
|||
ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); |
|||
ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); |
|||
//下钻到党员
|
|||
List<IndexScoreResult> scoreList = null; |
|||
if (goDown == 1) { |
|||
scoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); |
|||
} else { |
|||
//不下钻
|
|||
scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); |
|||
} |
|||
for (IndexScoreResult score : scoreList) { |
|||
for (IndexScoreDetailResult tb : tableList) { |
|||
if (tb.getIndexCode().equals(score.getIndexCode())) { |
|||
tb.setOriginValue(score.getOriginValue()); |
|||
tb.setScore(String.valueOf(score.getScore())); |
|||
tb.setQuantity(score.getQuantity()); |
|||
tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); |
|||
} |
|||
} |
|||
} |
|||
break; |
|||
default: |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
private List<IndexScoreDetailResult> setDefaultTableData(Map<String, List<IndexGroupDetailResult>> detailEntityMap, String type, String allIndexCodePath) { |
|||
List<IndexGroupDetailResult> indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); |
|||
List<IndexScoreDetailResult> tableList = new ArrayList<>(); |
|||
indexGroupDetailEntities.forEach(index -> { |
|||
IndexScoreDetailResult table = new IndexScoreDetailResult(); |
|||
table.setIndexCode(index.getIndexCode()); |
|||
table.setIndexName(index.getIndexName()); |
|||
table.setOriginValue(NumConstant.ZERO_STR); |
|||
table.setScore(NumConstant.ZERO_STR); |
|||
table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); |
|||
tableList.add(table); |
|||
}); |
|||
return tableList; |
|||
} |
|||
|
|||
private void setChildren(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List<IndexExplainTreeDTO> children) { |
|||
List<IndexExplainResult> childrenList = new ArrayList<>(); |
|||
children.forEach(child -> { |
|||
IndexExplainResult ch = new IndexExplainResult(); |
|||
ch.setTitle(child.getTitle()); |
|||
ch.setMeaning(child.getMeaning()); |
|||
if (CollectionUtils.isNotEmpty(child.getChildren())) { |
|||
setChildren(formDTO, detailEntityMap, ch, child, child.getChildren()); |
|||
} |
|||
setTableData(formDTO, detailEntityMap, child, ch); |
|||
childrenList.add(ch); |
|||
}); |
|||
result.setChildren(childrenList); |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
|
|||
} |
|||
|
|||
private List<String> getTableHeaders(IndexExplainTreeDTO explain) { |
|||
String type = explain.getType(); |
|||
List<String> headers = new ArrayList<>(); |
|||
if ("zishen".equals(type)) { |
|||
headers = IndexConstant.getStandardSelfHeaders(explain.getIndexCode()); |
|||
|
|||
} else if ("xiaji".equals(type)) { |
|||
headers = IndexConstant.getStandardSubHeaders(explain.getIndexCode()); |
|||
} |
|||
return headers; |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCpcScoreDao"> |
|||
|
|||
<!--<resultMap type="com.epmet.entity.FactIndexCpcScoreEntity" id="factIndexCpcScoreMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="isTotal" column="IS_TOTAL"/> |
|||
<result property="score" column="SCORE"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/> |
|||
<result property="weight" column="WEIGHT"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap>--> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao"> |
|||
|
|||
<!--<resultMap type="com.epmet.entity.FactIndexCpcSubScoreEntity" id="factIndexCpcSubScoreMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="originValue" column="ORIGIN_VALUE"/> |
|||
<result property="score" column="SCORE"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/> |
|||
<result property="weight" column="WEIGHT"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap>--> |
|||
|
|||
|
|||
|
|||
<select id="selecCpcAvgScore" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult"> |
|||
SELECT |
|||
id, customer_id, agency_id, grid_id, year_id, month_id, user_id, |
|||
COUNT(*) quantity, |
|||
ROUND(AVG(score),2) score, |
|||
index_code, all_parent_index_code, weight |
|||
FROM fact_index_cpc_sub_score |
|||
WHERE ALL_PARENT_INDEX_CODE = #{allParentIndexCode} |
|||
AND CUSTOMER_ID = #{customerId} |
|||
and GRID_ID = #{orgId} |
|||
and MONTH_ID = #{monthId} |
|||
GROUP BY INDEX_CODE; |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,41 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao"> |
|||
|
|||
<resultMap id="explainTreeResultMap" type="com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="title" column="TITLE"/> |
|||
<result property="meaning" column="MEANING"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
<result property="orgLevel" column="ORG_LEVEL"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="sort" column="SORT"/> |
|||
<result property="isSearch" column="IS_SEARCH"/> |
|||
<result property="type" column="TYPE"/> |
|||
<result property="goDown" column="GO_DOWN"/> |
|||
<collection property="children" ofType="com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO" column="ID" select="getIndexExplainTreeByPid"> |
|||
|
|||
</collection> |
|||
</resultMap> |
|||
<select id="getIndexExplainTreeByOrgType" resultMap="explainTreeResultMap"> |
|||
SELECT |
|||
ID, CUSTOMER_ID, TITLE, MEANING, INDEX_CODE, ORG_LEVEL, PID, SORT, IS_SEARCH, TYPE, GO_DOWN |
|||
FROM index_explain |
|||
WHERE |
|||
ORG_LEVEL = #{orgLevel} |
|||
and DEL_FLAG = '0' |
|||
AND PID = '0' |
|||
ORDER BY SORT |
|||
</select> |
|||
<select id="getIndexExplainTreeByPid" resultMap="explainTreeResultMap"> |
|||
SELECT |
|||
ID, CUSTOMER_ID, TITLE, MEANING, INDEX_CODE, ORG_LEVEL, PID, SORT, IS_SEARCH, TYPE, GO_DOWN |
|||
FROM index_explain |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND PID = #{pid} |
|||
ORDER BY SORT |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.datareport.dao.evaluationindex.index.IndexGroupDao"> |
|||
|
|||
<!--<resultMap type="com.epmet.entity.IndexGroupEntity" id="indexGroupMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="indexId" column="INDEX_ID"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="parentIndexGroupId" column="PARENT_INDEX_GROUP_ID"/> |
|||
<result property="allIndexCodePath" column="ALL_INDEX_CODE_PATH"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap>--> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,36 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao"> |
|||
|
|||
<!--<resultMap type="com.epmet.entity.IndexGroupDetailEntity" id="indexGroupDetailMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="indexGroupId" column="INDEX_GROUP_ID"/> |
|||
<result property="indexId" column="INDEX_ID"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/> |
|||
<result property="allIndexCodePath" column="ALL_INDEX_CODE_PATH"/> |
|||
<result property="weight" column="WEIGHT"/> |
|||
<result property="threshold" column="THRESHOLD"/> |
|||
<result property="status" column="STATUS"/> |
|||
<result property="correlation" column="CORRELATION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap>--> |
|||
|
|||
|
|||
<select id="getAllIndexByCId" resultType="com.epmet.evaluationindex.index.result.IndexGroupDetailResult"> |
|||
SELECT |
|||
d.ID, d.CUSTOMER_ID, d.INDEX_GROUP_ID, d.INDEX_ID, d.INDEX_CODE, d.ALL_PARENT_INDEX_CODE, |
|||
d.ALL_INDEX_CODE_PATH, d.WEIGHT, d.THRESHOLD, d.STATUS, d.CORRELATION, |
|||
id.INDEX_NAME |
|||
FROM index_group_detail d LEFT JOIN index_dict id ON d.index_code = id.index_code |
|||
WHERE |
|||
d.DEL_FLAG = 0 AND id.DEL_FLAG = 0 AND d.CUSTOMER_ID = #{customerId} |
|||
</select> |
|||
</mapper> |
|||
@ -0,0 +1,146 @@ |
|||
/** |
|||
* 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 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class FactOriginGroupMemberDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 组Id |
|||
*/ |
|||
private String groupId; |
|||
|
|||
/** |
|||
* 小组所在的网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 小组所在的社区id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 小组所在的街道id |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 所有上级组织ID,英文:隔开 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 成员Id(userId) |
|||
*/ |
|||
private String memberId; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* leader(群主) member(成员) |
|||
*/ |
|||
private String leaderFlag; |
|||
|
|||
/** |
|||
* 入群审核通过或自动加入群的日期 yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 入群周 2020W15 |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 入群月 202004 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 入群季 2020Q2 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 入群年 2020 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* join(入群),群主建群自己入群也是join |
|||
*/ |
|||
private String actionCode; |
|||
|
|||
/** |
|||
* 是否是党员 |
|||
*/ |
|||
private Integer isParty; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 删除标识 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
/** |
|||
* 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.group; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 活动类别字典 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-04-16 |
|||
*/ |
|||
@Data |
|||
public class ActCategoryDictDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 类别编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 活动类别名称;eg:支部建设、联建共建 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 等级1,2...... |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 排序 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 上级类别编码 |
|||
*/ |
|||
private String parentCode; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 网格相关:党员参加“三会一课”人次 用 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/5/13 10:50 |
|||
*/ |
|||
@Data |
|||
public class PartyJoinThreeMeetDTO implements Serializable { |
|||
private static final long serialVersionUID = 3027535602832948917L; |
|||
private String gridId; |
|||
private String userId; |
|||
private Integer joinThreeMeetsCount; |
|||
|
|||
} |
|||
@ -0,0 +1,187 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.stats; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class FactAgencyOriginProjectDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 日维度Id 【dim_date.id】 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周维度Id 【dim_week.id】 |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月维度Id 【dim_month.id】 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季度ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年维度Id 【dim_year.id】 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 项目来源 来源:议题issue 组织agency |
|||
*/ |
|||
private String origin; |
|||
|
|||
/** |
|||
* 截止当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
/** |
|||
* 删除标识 【0.未删除 1.已删除】 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,172 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto.stats; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
public class FactAgencyOriginProjectMonthlyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 月维度Id 【dim_month.id】 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季维度Id 【dim_quarter.id】 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年维度Id 【dim_year.id】 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 截止当月项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当月项目总数 【当前组织及下级前一月新增项目数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
/** |
|||
* 删除标识 【0.未删除 1.已删除】 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.extract.FactGroupActDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Mapper |
|||
public interface FactGroupActDailyDao extends BaseDao<FactGroupActDailyEntity> { |
|||
|
|||
int deleteBatch(@Param("customerId") String customerId, |
|||
@Param("dateId") String dateId, |
|||
@Param("limit") Integer limit, |
|||
@Param("orgType")String orgType); |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Mapper |
|||
public interface FactGroupActMonthlyDao extends BaseDao<FactGroupActMonthlyEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface FactOriginGroupMemberDailyDao extends BaseDao<FactOriginGroupMemberDailyEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface FactAgencyOriginProjectDailyDao extends BaseDao<FactAgencyOriginProjectDailyEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao.stats; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Mapper |
|||
public interface FactAgencyOriginProjectMonthlyDao extends BaseDao<FactAgencyOriginProjectMonthlyEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
/** |
|||
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_group_act_daily") |
|||
public class FactGroupActDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据更新至日期Id:yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 网格:grid;组织:agency |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* 1)orgType=grid: pid=网格所属组织id; |
|||
2)orgType=agency: pid=当前组织的上级组织 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 1)orgType=grid: pids=网格所有上级组织,包括pid; |
|||
2)orgType=agency: pids=当前组织的所有上级组织,包括pid. |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 活动分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 上级分类编码 |
|||
*/ |
|||
private String parentCode; |
|||
|
|||
/** |
|||
* 分类等级 |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 截止到dateId: 组织次数;包含dateId这一天的数据 |
|||
*/ |
|||
private Integer organizeTotal; |
|||
|
|||
/** |
|||
* 截止到dateId: 参加人数;包含dateId这一天的数据 |
|||
*/ |
|||
private Integer participateUserTotal; |
|||
|
|||
/** |
|||
* 截止到dateId: 平均参加人数;包含dateId这一天的数据 |
|||
*/ |
|||
private Integer avgParticipateUserTotal; |
|||
|
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
/** |
|||
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_group_act_monthly") |
|||
public class FactGroupActMonthlyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 数据维度:yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 网格:grid;组织:agency |
|||
*/ |
|||
private String orgType; |
|||
|
|||
/** |
|||
* 1)orgType=grid: pid=网格所属组织id; |
|||
2)orgType=agency: pid=当前组织的上级组织 |
|||
*/ |
|||
private String pid; |
|||
|
|||
/** |
|||
* 1)orgType=grid: pids=网格所有上级组织,包括pid; |
|||
2)orgType=agency: pids=当前组织的所有上级组织,包括pid. |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 活动分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 上级分类编码 |
|||
*/ |
|||
private String parentCode; |
|||
|
|||
/** |
|||
* 分类等级 |
|||
*/ |
|||
private Integer level; |
|||
|
|||
/** |
|||
* 本月内:活动组织次数 |
|||
*/ |
|||
private Integer organizeIncr; |
|||
|
|||
/** |
|||
* 本月内:活动签到人数参加人数 |
|||
*/ |
|||
private Integer participateUserIncr; |
|||
|
|||
/** |
|||
* 本月内:平均参加人数 |
|||
*/ |
|||
private Integer avgParticipateUserIncr; |
|||
|
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
/** |
|||
* 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 2021-05-12 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_origin_group_member_daily") |
|||
public class FactOriginGroupMemberDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组Id |
|||
*/ |
|||
private String groupId; |
|||
|
|||
/** |
|||
* 小组所在的网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 小组所在的社区id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 小组所在的街道id |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 所有上级组织ID,英文:隔开 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 成员Id(userId) |
|||
*/ |
|||
private String memberId; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* leader(群主) member(成员) |
|||
*/ |
|||
private String leaderFlag; |
|||
|
|||
/** |
|||
* 入群审核通过或自动加入群的日期 yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 入群周 2020W15 |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 入群月 202004 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 入群季 2020Q2 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 入群年 2020 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* join(入群),群主建群自己入群也是join |
|||
*/ |
|||
private String actionCode; |
|||
|
|||
/** |
|||
* 是否是党员 |
|||
*/ |
|||
private Integer isParty; |
|||
|
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_agency_origin_project_daily") |
|||
public class FactAgencyOriginProjectDailyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 日维度Id 【dim_date.id】 |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 周维度Id 【dim_week.id】 |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 月维度Id 【dim_month.id】 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季度ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年维度Id 【dim_year.id】 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 项目来源 来源:议题issue 组织agency |
|||
*/ |
|||
private String origin; |
|||
|
|||
/** |
|||
* 截止当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
} |
|||
@ -0,0 +1,142 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity.stats; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("fact_agency_origin_project_monthly") |
|||
public class FactAgencyOriginProjectMonthlyEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 月维度Id 【dim_month.id】 |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 季维度Id 【dim_quarter.id】 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年维度Id 【dim_year.id】 |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 截止当月项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当月项目总数 【当前组织及下级前一月新增项目数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; |
|||
|
|||
/** |
|||
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
public interface FactGroupActDailyService extends BaseService<FactGroupActDailyEntity> { |
|||
|
|||
/** |
|||
* 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return |
|||
*/ |
|||
void extractGridGroupActDaily(String customerId, String dateId); |
|||
|
|||
/** |
|||
* 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return |
|||
*/ |
|||
void extractAgencyGroupActDaily(String customerId, String dateId); |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
|||
|
|||
/** |
|||
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
public interface FactGroupActMonthlyService extends BaseService<FactGroupActMonthlyEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,95 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
public interface FactOriginGroupMemberDailyService extends BaseService<FactOriginGroupMemberDailyEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<FactOriginGroupMemberDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
PageData<FactOriginGroupMemberDailyDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<FactOriginGroupMemberDailyDTO> |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
List<FactOriginGroupMemberDailyDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return FactOriginGroupMemberDailyDTO |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
FactOriginGroupMemberDailyDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
void save(FactOriginGroupMemberDailyDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
void update(FactOriginGroupMemberDailyDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-05-12 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -0,0 +1,165 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.extract.FactGroupActDailyDao; |
|||
import com.epmet.dto.group.ActCategoryDictDTO; |
|||
import com.epmet.dto.org.GridInfoDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; |
|||
import com.epmet.entity.org.CustomerAgencyEntity; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; |
|||
import com.epmet.service.group.GroupDataService; |
|||
import com.epmet.service.org.CustomerAgencyService; |
|||
import com.epmet.service.org.CustomerGridService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@Slf4j |
|||
@DataSource(DataSourceConstant.STATS) |
|||
@Service |
|||
public class FactGroupActDailyServiceImpl extends BaseServiceImpl<FactGroupActDailyDao, FactGroupActDailyEntity> implements FactGroupActDailyService { |
|||
|
|||
@Autowired |
|||
private GroupDataService groupDataService; |
|||
@Autowired |
|||
private CustomerAgencyService customerAgencyService; |
|||
@Autowired |
|||
private CustomerGridService customerGridService; |
|||
|
|||
/** |
|||
* 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public void extractGridGroupActDaily(String customerId, String dateId) { |
|||
if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ |
|||
return; |
|||
} |
|||
// 1、查询出当前客户的组织分类;如果没有直接返回
|
|||
List<ActCategoryDictDTO> actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); |
|||
if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { |
|||
return; |
|||
} |
|||
|
|||
// 2、当前客户下所有的网格
|
|||
List<GridInfoDTO> gridInfoDTOList=customerGridService.queryGridInfoList(customerId); |
|||
// 2、遍历每个分类,查询组织次数、参与人数、平均参与人数
|
|||
List<FactGroupActDailyEntity> insertList = new ArrayList<>(); |
|||
for(GridInfoDTO gridInfoDTO:gridInfoDTOList){ |
|||
|
|||
for (ActCategoryDictDTO actCategoryDictDTO : actCategoryDictDTOList) { |
|||
List<FactGroupActDailyEntity> list = groupDataService.selectCountGridGroupActDaily(customerId, dateId, actCategoryDictDTO.getCategoryCode(),gridInfoDTO.getGridId()); |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
list.forEach(dto->{ |
|||
dto.setCategoryCode(actCategoryDictDTO.getCategoryCode()); |
|||
dto.setParentCode(actCategoryDictDTO.getParentCode()); |
|||
dto.setLevel(actCategoryDictDTO.getLevel()); |
|||
dto.setOrgType("grid"); |
|||
dto.setDateId(dateId); |
|||
}); |
|||
insertList.addAll(list); |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 3、批量删除
|
|||
int deleteNum; |
|||
do { |
|||
deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"grid"); |
|||
} while (deleteNum > NumConstant.ZERO); |
|||
|
|||
// 4、插入数据
|
|||
insertList.forEach(insertEntity -> { |
|||
baseDao.insert(insertEntity); |
|||
}); |
|||
log.info("extractGridGroupActDaily completed"); |
|||
} |
|||
|
|||
/** |
|||
* 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 |
|||
* |
|||
* @param customerId |
|||
* @param dateId |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public void extractAgencyGroupActDaily(String customerId, String dateId) { |
|||
// 1、查询出当前客户的组织分类;如果没有直接返回
|
|||
List<ActCategoryDictDTO> actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); |
|||
if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { |
|||
return; |
|||
} |
|||
// 2、当前客户下所有的组织
|
|||
List<CustomerAgencyEntity> agencyEntityList=customerAgencyService.queryAgencyListByCustomerId(customerId); |
|||
List<FactGroupActDailyEntity> insertList = new ArrayList<>(); |
|||
for(CustomerAgencyEntity agencyEntity:agencyEntityList){ |
|||
for(ActCategoryDictDTO categoryDict:actCategoryDictDTOList){ |
|||
List<FactGroupActDailyEntity> list = groupDataService.selectCountAgencyGroupActDaily(customerId, |
|||
agencyEntity.getId(), |
|||
dateId, |
|||
categoryDict.getCategoryCode()); |
|||
if (CollectionUtils.isNotEmpty(list)) { |
|||
list.forEach(dto->{ |
|||
dto.setCategoryCode(categoryDict.getCategoryCode()); |
|||
dto.setParentCode(categoryDict.getParentCode()); |
|||
dto.setLevel(categoryDict.getLevel()); |
|||
dto.setOrgId(agencyEntity.getId()); |
|||
dto.setOrgType("agency"); |
|||
dto.setPid(agencyEntity.getPid()); |
|||
dto.setPids(agencyEntity.getPids()); |
|||
dto.setDateId(dateId); |
|||
}); |
|||
insertList.addAll(list); |
|||
} |
|||
} |
|||
} |
|||
|
|||
// 3、批量删除
|
|||
int deleteNum; |
|||
do { |
|||
deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"agency"); |
|||
} while (deleteNum > NumConstant.ZERO); |
|||
|
|||
// 4、插入数据
|
|||
insertList.forEach(insertEntity->{ |
|||
baseDao.insert(insertEntity); |
|||
}); |
|||
log.info("extractAgencyGroupActDaily completed"); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata.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.extract.FactGroupActMonthlyDao; |
|||
import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactGroupActMonthlyService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-13 |
|||
*/ |
|||
@DataSource(DataSourceConstant.STATS) |
|||
@Slf4j |
|||
@Service |
|||
public class FactGroupActMonthlyServiceImpl extends BaseServiceImpl<FactGroupActMonthlyDao, FactGroupActMonthlyEntity> implements FactGroupActMonthlyService { |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,101 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.service.evaluationindex.extract.todata.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; |
|||
import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; |
|||
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-05-12 |
|||
*/ |
|||
@Service |
|||
public class FactOriginGroupMemberDailyServiceImpl extends BaseServiceImpl<FactOriginGroupMemberDailyDao, FactOriginGroupMemberDailyEntity> implements FactOriginGroupMemberDailyService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<FactOriginGroupMemberDailyDTO> page(Map<String, Object> params) { |
|||
IPage<FactOriginGroupMemberDailyEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, FactOriginGroupMemberDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<FactOriginGroupMemberDailyDTO> list(Map<String, Object> params) { |
|||
List<FactOriginGroupMemberDailyEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, FactOriginGroupMemberDailyDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<FactOriginGroupMemberDailyEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<FactOriginGroupMemberDailyEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public FactOriginGroupMemberDailyDTO get(String id) { |
|||
FactOriginGroupMemberDailyEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, FactOriginGroupMemberDailyDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(FactOriginGroupMemberDailyDTO dto) { |
|||
FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(FactOriginGroupMemberDailyDTO dto) { |
|||
FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue