forked from luyan/epmet-cloud-lingshan
30 changed files with 801 additions and 193 deletions
@ -0,0 +1,30 @@ |
|||
package com.epmet.dto.extract.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc: 网格级别小组内的组成员数 |
|||
* |
|||
* @author LiuJanJun |
|||
* @date 2020/9/27 2:27 下午 |
|||
*/ |
|||
@Data |
|||
public class GridGroupUserCountResultDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = -4729061928990808187L; |
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
private String gridId; |
|||
|
|||
private Integer memberCount; |
|||
/** |
|||
* 网格的pids |
|||
*/ |
|||
private String pids; |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package com.epmet.dto.extract.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* desc: 议题投票统计结果DTO |
|||
* |
|||
* @author LiuJanJun |
|||
* @date 2020/9/27 11:22 上午 |
|||
*/ |
|||
@Data |
|||
public class IssueVoteStatisticalResultDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = 2631108929053690349L; |
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
private String issueId; |
|||
|
|||
/** |
|||
* 统计日期 yyyy-MM-dd |
|||
*/ |
|||
private Date statisticalDate; |
|||
|
|||
/** |
|||
* 到该日的总赞成数 |
|||
*/ |
|||
private Integer supportCount; |
|||
|
|||
/** |
|||
* 到该日的总反对数 |
|||
*/ |
|||
private Integer oppositionCount; |
|||
|
|||
/** |
|||
* 到该日的总票数 |
|||
*/ |
|||
private Integer totalCount; |
|||
|
|||
/** |
|||
* 该日增量 |
|||
*/ |
|||
private Integer todayIncrement; |
|||
|
|||
/** |
|||
* 该日赞成增量 |
|||
*/ |
|||
private Integer supportIncrement; |
|||
|
|||
/** |
|||
* 该日反对增量 |
|||
*/ |
|||
private Integer oppositionIncrement; |
|||
|
|||
/** |
|||
* 到该日的应表决数 |
|||
*/ |
|||
private Integer votableCount; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.epmet.dto.extract.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* desc: 议题投票人数 |
|||
* |
|||
* @author LiuJanJun |
|||
* @date 2020/9/27 2:27 下午 |
|||
*/ |
|||
@Data |
|||
public class IssueVoteUserCountResultDTO implements Serializable { |
|||
|
|||
|
|||
private static final long serialVersionUID = -4729061928990808187L; |
|||
private String gridId; |
|||
private String issueId; |
|||
private Integer voteCount; |
|||
private Integer issueCount; |
|||
/** |
|||
* 网格的pids |
|||
*/ |
|||
private String pids; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.epmet.service.evaluationindex.extract.toscreen; |
|||
|
|||
/** |
|||
* screen_public_parti_total_data |
|||
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计 |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/27 11:09 |
|||
*/ |
|||
public interface PublicPartiTotalDataExtractService { |
|||
|
|||
/** |
|||
* 按天统计 |
|||
* |
|||
* @param customerId 客户id |
|||
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd |
|||
* @return |
|||
*/ |
|||
void extractPublicPartiTotalData(String customerId,String dateId); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package com.epmet.service.evaluationindex.extract.toscreen.impl; |
|||
|
|||
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; |
|||
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; |
|||
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartiTotalDataExtractService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; |
|||
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* screen_public_parti_total_data |
|||
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 按天统计 |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/27 11:09 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalDataExtractService { |
|||
@Autowired |
|||
private ScreenUserTotalDataService screenUserTotalDataService; |
|||
@Autowired |
|||
private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; |
|||
@Autowired |
|||
private FactOriginIssueLogDailyService factOriginIssueLogDailyService; |
|||
|
|||
/** |
|||
* 按天统计 |
|||
* |
|||
* @param customerId 客户id |
|||
* @param dateId yyyyMMdd 这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public void extractPublicPartiTotalData(String customerId, String dateId) { |
|||
List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId); |
|||
if (CollectionUtils.isEmpty(userTotalDataEntityList)) { |
|||
log.warn("screen_user_total_data dosen't have any record "); |
|||
return; |
|||
} |
|||
List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>(); |
|||
for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) { |
|||
ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity(); |
|||
entity.setCustomerId(customerId); |
|||
entity.setOrgType(totalData.getOrgType()); |
|||
entity.setOrgId(totalData.getOrgId()); |
|||
entity.setParentId(totalData.getParentId()); |
|||
entity.setOrgName(totalData.getOrgName()); |
|||
entity.setDataEndTime(dateId); |
|||
entity.setTopicTotal(totalData.getTopicTotal()); |
|||
entity.setIssueTotal(totalData.getIssueTotal()); |
|||
entity.setProjectTotal(totalData.getProjectTotal()); |
|||
entity.setRegUserTotal(totalData.getUserTotal()); |
|||
//参与人数参与人数: 议题的表决行为的用户数去重的累计值
|
|||
int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId()); |
|||
entity.setJoinUserTotal(joinUserTotal); |
|||
list.add(entity); |
|||
} |
|||
//先删除,后插入
|
|||
screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue