Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_temp

dev_shibei_match
yinzuomei 5 years ago
parent
commit
9105b59000
  1. 2
      epmet-gateway/src/main/resources/bootstrap.yml
  2. 43
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java
  3. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java
  4. 17
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java
  5. 29
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml
  6. 23
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml
  7. 14
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java
  8. 67
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java
  9. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java
  10. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java
  11. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java
  12. 110
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java
  13. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java
  14. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java
  15. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java
  16. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java
  17. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java
  18. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java
  19. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java
  20. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml
  21. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml
  22. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

2
epmet-gateway/src/main/resources/bootstrap.yml

@ -441,7 +441,7 @@ epmet:
# url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单
urlWhiteList:
- /data/report/test/test
- /data/report/screen/**
swaggerUrls:
jwt:

43
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPublicPartiTotalDataDao.java

@ -0,0 +1,43 @@
/**
* 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.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.screen.dto.result.PublicPartiRankResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-24
*/
@Mapper
public interface ScreenPublicPartiTotalDataDao{
/**
* @Description 查询公众参与各类总数
* @param agencyId
* @return
* @author wangc
* @date 2020.08.20 16:00
**/
List<PublicPartiRankResultDTO> selectPublicPartiTotal(@Param("agencyId") String agencyId);
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java

@ -18,7 +18,6 @@
package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.PartymemberPercentResultDTO;
import com.epmet.screen.dto.result.PublicPartiRankResultDTO;
import com.epmet.screen.dto.result.TopProfileResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -60,12 +59,4 @@ public interface ScreenUserTotalDataDao {
**/
int selectAvgIssue(@Param("agencyId")String agencyId);
/**
* @Description 查询用户数据
* @param agencyId
* @return
* @author wangc
* @date 2020.08.20 16:00
**/
List<PublicPartiRankResultDTO> selectUserTotalData(@Param("agencyId") String agencyId);
}

17
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java

@ -44,6 +44,9 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
private ScreenUserTotalDataDao screenUserTotalDataDao;
@Autowired
private ScreenGovernRankDataDao screenGovernRankDataDao;
@Autowired
private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao;
/**
* @Description 1热心市民积分排行
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544
@ -122,11 +125,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true)
@Override
public List<PublicPartiRankResultDTO> publicPartiRank(AgencyAndNumFormDTO param) {
if(null == param.getTopNum()) param.setTopNum(NumConstant.TWO);
if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX);
if(null == param.getTopNum()){
param.setTopNum(NumConstant.TWO);
}
if(NumConstant.ZERO == param.getTopNum()){
param.setTopNum(NumConstant.MAX);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<PublicPartiRankResultDTO> result = screenUserTotalDataDao.selectUserTotalData(param.getAgencyId());
if(null == result) return new ArrayList<>();
List<PublicPartiRankResultDTO> result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId());
if(null == result) {
return new ArrayList<>();
}
return result;
}

29
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml

@ -0,0 +1,29 @@
<?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.screen.ScreenPublicPartiTotalDataDao">
<!-- 查询公众参与各类总数 -->
<select id="selectPublicPartiTotal" resultType="com.epmet.screen.dto.result.PublicPartiRankResultDTO">
SELECT
ORG_NAME AS NAME,
REG_USER_TOTAL AS regNum,
JOIN_USER_TOTAL AS joinNum,
TOPIC_TOTAL AS topicNum,
ISSUE_TOTAL AS issueNum,
PROJECT_TOTAL AS projectNum
FROM
screen_public_parti_total_data
WHERE
DEL_FLAG = '0'
AND PARENT_ID = #{agencyId}
ORDER BY
(REG_USER_TOTAL + JOIN_USER_TOTAL + TOPIC_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL) DESC,
REG_USER_TOTAL desc,
JOIN_USER_TOTAL desc,
TOPIC_TOTAL desc,
ISSUE_TOTAL desc,
PROJECT_TOTAL desc
</select>
</mapper>

23
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -46,27 +46,4 @@
</select>
<!-- 查询用户数据 -->
<select id="selectUserTotalData" resultType="com.epmet.screen.dto.result.PublicPartiRankResultDTO">
SELECT
ORG_NAME AS NAME,
REG_USER_TOTAL AS regNum,
JOIN_USER_TOTAL AS joinNum,
TOPIC_TOTAL AS topicNum,
ISSUE_TOTAL AS issueNum,
PROJECT_TOTAL AS projectNum
FROM
screen_user_total_data
WHERE
DEL_FLAG = '0'
AND ORG_TYPE = 'agency'
AND PARENT_ID = #{agencyId}
ORDER BY
(REG_USER_TOTAL + JOIN_USER_TOTAL + TOPIC_TOTAL + ISSUE_TOTAL + PROJECT_TOTAL) DESC,
REG_USER_TOTAL desc,
JOIN_USER_TOTAL desc,
TOPIC_TOTAL desc,
ISSUE_TOTAL desc,
PROJECT_TOTAL desc
</select>
</mapper>

14
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java

@ -82,17 +82,17 @@ public class GridPartyMemberDataFormDTO implements Serializable {
private BigDecimal topicToIssueRatio;
/**
* 提出的议题转项目数
* 上级组织Id
*/
private Integer issueToProjectCount;
private String parentId;
/**
* 用户id
*/
private String userId;
* 党员自建群活跃群众人数(08-24)
*/
private Integer groupActiveUserCount;
/**
* 上级组织Id
* 用户id
*/
private String parentId;
private String userId;
}

67
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataFormDTO.java

@ -0,0 +1,67 @@
package com.epmet.dto.screencoll.form;
import lombok.Data;
import java.io.Serializable;
/**
* 18公众参与各类总数 入参
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* @Auther: zhangyong
* @Date: 2020-08-18 09:59
*/
@Data
public class PublicPartiTotalDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 组织类别 agency组织网格grid
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id如果是网格传入网格所属的组织id
*/
private String parentId;
/**
* 组织名称(可以是网格名称也可以是组织名称)
*/
private String orgName;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 注册人数
*/
private Integer regUserTotal;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 参与人数
*/
private Integer joinUserTotal;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
}

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java

@ -68,14 +68,4 @@ public class UserTotalDataFormDTO implements Serializable {
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* 注册人数08-21新增
*/
private Integer regUserTotal;
/**
* 参与人数08-21新增
*/
private Integer joinUserTotal;
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java

@ -283,4 +283,21 @@ public class ScreenCollController {
screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId());
return new Result();
}
/**
* 18公众参与各类总数
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
*
* @param formDTO
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:44 2020-08-25
**/
// @ExternalAppRequestAuth
// @PostMapping("publicpartitotaldata")
// public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List<PublicPartiTotalDataFormDTO> formDTO) {
// screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId());
// return new Result();
// }
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPublicPartiTotalDataDao.java

@ -0,0 +1,34 @@
/**
* 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.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.screen.ScreenPublicPartiTotalDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-24
*/
@Mapper
public interface ScreenPublicPartiTotalDataDao extends BaseDao<ScreenPublicPartiTotalDataEntity> {
}

110
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java

@ -27,10 +27,10 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* 党建能力-党员相关的事实表
* 党建能力-党员相关的事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-20
* @since v1.0.0 2020-08-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@ -39,89 +39,89 @@ public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
/**
* 客户Id
*/
private String customerId;
/**
* 机关Id
*/
/**
* 机关Id
*/
private String agencyId;
/**
* 上级组织Id
*/
/**
* 上级组织Id
*/
private String parentId;
/**
* 网格Id
*/
/**
* 网格Id
*/
private String gridId;
/**
* 用户Id:
*/
/**
* 用户Id:
*/
private String userId;
/**
* 月维度Id: yyyMM
*/
/**
* 月维度Id: yyyMM
*/
private String monthId;
/**
* 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
*/
/**
* 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4
*/
private String quarterId;
/**
* 年Id : yyyy
*/
/**
* 年Id : yyyy
*/
private String yearId;
/**
* 党员提出的话题数
*/
/**
* 党员提出的话题数
*/
private Integer createTopicCount;
/**
* 党员参与话题数支持反对评论浏览
*/
/**
* 党员参与话题数支持反对评论浏览
*/
private Integer joinTopicCount;
/**
* 话题转议题数
*/
/**
* 党员提出的话题转议题数
*/
private Integer shiftIssueCount;
/**
* 议题转项目数
*/
/**
* 党员提出的议题转项目数
*/
private Integer shiftProjectCount;
/**
* 参加三会一课次数
*/
/**
* 参加三会一课次数
*/
private Integer joinThreeMeetsCount;
/**
* 自建群群众人数
*/
/**
* 党员自建群群众人数
*/
private Integer groupUserCount;
/**
* 自建群活跃度-话题数
*/
/**
* 党员自建群活跃群众人数(08-24)
*/
private Integer groupActiveUserCount;
/**
* 党员自建群活跃度话题数
*/
private Integer groupTopicCount;
/**
* 议题转项目率
*/
/**
* 自建群活跃度议题转项目率
*/
private BigDecimal topicToIssueRatio;
/**
* 提出的议题转项目数
*/
private Integer issueToProjectCount;
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPublicPartiTotalDataEntity.java

@ -0,0 +1,96 @@
/**
* 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.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-24
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("screen_public_parti_total_data")
public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织类别 agency组织网格grid部门department
*/
private String orgType;
/**
* 组织Id 可以为网格机关id
*/
private String orgId;
/**
* 上级组织Id如果是网格传入网格所属组织id
*/
private String parentId;
/**
* 组织名称也可能是网格名称
*/
private String orgName;
/**
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 议题总数
*/
private Integer issueTotal;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 注册人数
*/
private Integer regUserTotal;
/**
* 参与人数
*/
private Integer joinUserTotal;
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java

@ -26,7 +26,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* 中央区-各类(用户|党员|党群|话题|议题|项目)总数
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-21
@ -98,14 +98,4 @@ public class ScreenUserTotalDataEntity extends BaseEpmetEntity {
*/
private Integer projectTotal;
/**
* 注册人数08-21新增
*/
private Integer regUserTotal;
/**
* 参与人数08-21新增
*/
private Integer joinUserTotal;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java

@ -218,4 +218,17 @@ public interface ScreenCollService {
* @Date 10:52 2020-08-18
**/
void insertPioneerData(List<PioneerDataFormDTO> formDTO, String customerId);
/**
* 18公众参与各类总数
* 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
* 1) 根据CUSTOMER_IDORG_ID进行查询如果有数据则先进行物理删除
* 2) 在新增
* @param formDTO
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:44 2020-08-25
**/
// void insertPublicPartiTotalData(List<PublicPartiTotalDataFormDTO> formDTO, String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java

@ -445,4 +445,19 @@ public class ScreenCollServiceImpl implements ScreenCollService {
screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId);
}
}
// @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true)
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void insertPublicPartiTotalData(List<PublicPartiTotalDataFormDTO> formDTO, String customerId) {
// if (null != formDTO && formDTO.size() > NumConstant.ZERO){
// String[] orgIds = new String[formDTO.size()];
// for (int i = NumConstant.ZERO; i < formDTO.size(); i++){
// orgIds[i] = formDTO.get(i).getOrgId();
// }
//// screenPioneerDataDao.deletePioneerData(customerId, orgIds);
//
//// screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId);
// }
// }
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java

@ -17,7 +17,7 @@ public class DoubleScoreCalculator extends ScoreCalculator {
* @param correlation 相关性
*/
public DoubleScoreCalculator(Double[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) {
this.sourceArrary = sourceArray;
this.sourceArrary = sourceArray.clone();
this.minScore = minScore;
this.maxScore = maxScore;
this.correlation = correlation;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java

@ -17,7 +17,7 @@ public class IntegerScoreCalculator extends ScoreCalculator {
* @param correlation 相关性
*/
public IntegerScoreCalculator(Integer[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) {
this.sourceArrary = sourceArray;
this.sourceArrary = sourceArray.clone();
this.minScore = minScore;
this.maxScore = maxScore;
this.correlation = correlation;

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java

@ -6,6 +6,7 @@ import java.util.Arrays;
/**
* 所有数据类型计算器的父类实现算法骨架数据类型转换方法则由子类实现
* 如果需要保持传入的数组元素顺序不变请在实现类的构造方法中将传入数组进行克隆
* @param <T> 数据类型泛型
*/
public abstract class ScoreCalculator<T> {
@ -38,7 +39,7 @@ public abstract class ScoreCalculator<T> {
}
/**
* 归一算法
* 单值归一算法
* @return
*/
public BigDecimal normalize(T sourceValue) {
@ -66,6 +67,49 @@ public abstract class ScoreCalculator<T> {
}
}
/**
* 单值归一算法带权重
* @param sourceValue
* @param weight
* @return
*/
public BigDecimal normalize(T sourceValue, BigDecimal weight) {
return normalize(sourceValue).multiply(weight);
}
/**
* 批量归一算法
* @param sourceValues
* @return
*/
public BigDecimal[] normalize(T[] sourceValues) {
BigDecimal[] scores = new BigDecimal[sourceValues.length];
for (int i=0;i<sourceValues.length;i++) {
BigDecimal score = normalize(sourceValues[i]);
scores[i] = score;
}
return scores;
}
/**
* 批量归一算法带权重
* @param sourceValues
* @param weight
* @return
*/
public BigDecimal[] normalize(T[] sourceValues, BigDecimal weight) {
BigDecimal[] scores = new BigDecimal[sourceValues.length];
for (int i=0;i<sourceValues.length;i++) {
BigDecimal score = normalize(sourceValues[i]);
scores[i] = score.multiply(weight);
}
return scores;
}
/**
* 校验数组
* @param sourceArray

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml

@ -9,7 +9,6 @@
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
@ -21,13 +20,14 @@
<result property="groupUserCount" column="GROUP_USER_COUNT"/>
<result property="groupTopicCount" column="GROUP_TOPIC_COUNT"/>
<result property="topicToIssueRatio" column="TOPIC_TO_ISSUE_RATIO"/>
<result property="issueToProjectCount" column="ISSUE_TO_PROJECT_COUNT"/>
<result property="groupActiveUserCount" column="GROUP_ACTIVE_USER_COUNT"/>
<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"/>
<result property="userId" column="USER_ID"/>
</resultMap>
<delete id="deleteFactIndexPartyAblityCpcMonthly">
@ -44,7 +44,6 @@
AGENCY_ID,
PARENT_ID,
GRID_ID,
USER_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
@ -56,13 +55,14 @@
GROUP_USER_COUNT,
GROUP_TOPIC_COUNT,
TOPIC_TO_ISSUE_RATIO,
ISSUE_TO_PROJECT_COUNT,
GROUP_ACTIVE_USER_COUNT,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
USER_ID
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -71,7 +71,6 @@
#{item.agencyId},
#{item.parentId},
#{item.gridId},
#{item.userId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
@ -83,13 +82,14 @@
#{item.groupUserCount},
#{item.groupTopicCount},
#{item.topicToIssueRatio},
#{item.issueToProjectCount},
#{item.groupActiveUserCount},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.userId}
)
</foreach>
</insert>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml

@ -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.dao.ScreenPublicPartiTotalDataDao">
<resultMap type="com.epmet.entity.screen.ScreenPublicPartiTotalDataEntity" id="screenPublicPartiTotalDataMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="orgId" column="ORG_ID"/>
<result property="parentId" column="PARENT_ID"/>
<result property="orgName" column="ORG_NAME"/>
<result property="dataEndTime" column="DATA_END_TIME"/>
<result property="topicTotal" column="TOPIC_TOTAL"/>
<result property="issueTotal" column="ISSUE_TOTAL"/>
<result property="projectTotal" column="PROJECT_TOTAL"/>
<result property="regUserTotal" column="REG_USER_TOTAL"/>
<result property="joinUserTotal" column="JOIN_USER_TOTAL"/>
<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>

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -28,8 +28,6 @@
TOPIC_TOTAL,
ISSUE_TOTAL,
PROJECT_TOTAL,
REG_USER_TOTAL,
JOIN_USER_TOTAL,
DEL_FLAG,
REVISION,
CREATED_BY,
@ -52,8 +50,6 @@
#{item.topicTotal},
#{item.issueTotal},
#{item.projectTotal},
#{item.regUserTotal},
#{item.joinUserTotal},
0,
0,
'APP_USER',

Loading…
Cancel
Save