Browse Source

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

master
yinzuomei 5 years ago
parent
commit
96794a182d
  1. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java
  2. 48
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java
  3. 36
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java
  4. 12
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java
  5. 23
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java
  6. 60
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java
  7. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java
  8. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java
  9. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java
  10. 7
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java
  11. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java
  12. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java
  13. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java
  14. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java
  15. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java
  16. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java
  17. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java
  18. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java
  19. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java
  20. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java
  21. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  22. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java
  23. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java
  24. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java
  25. 37
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.5__screen_org_add_source_col.sql
  26. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql
  27. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql
  28. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml
  29. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
  30. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  31. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
  32. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml
  33. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml
  34. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  35. 17
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml
  36. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml
  37. 6
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 指标计算通用入参DTO
@ -29,6 +30,17 @@ public class CalculateCommonFormDTO implements Serializable {
@NotBlank(message = "客户id不能为空", groups = { CancelCalculateGroup.class })
private String customerId;
/**
* 当前客户所属的地区编码 add 01.14
*/
private String customerAreaCode;
/**
* 当前客户下的需要汇聚的子客户列表 add 01.14
* 暂不使用
*/
private List<String> subCustomerIds;
public CalculateCommonFormDTO() {
super();
}

48
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java

@ -69,4 +69,52 @@ public class DeptGovrnAbilityFormDTO implements Serializable {
* 办结项目满意度
*/
private BigDecimal satisfactionRatio;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
}

36
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java

@ -79,4 +79,40 @@ public class GridGovrnAbilityFormDTO implements Serializable {
* 网格自治项目数 统计期网格自身内办结的项目数目
*/
private Integer selfSolveProjectCount;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal transferRightRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal transferRightRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal issueToProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal issueToProjectRatioFm;
}

12
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java

@ -104,4 +104,16 @@ public class GridPartyAbilityFormDTO implements Serializable {
* 党员参加三会一课人次
*/
private Integer joinThreeMeetsCount;
/**
* V2升级字段issueToProjectRatio的分子评价周期内转为项目的数量
* 2020-01-07 新增
*/
private Integer shiftedProjectTotal;
/**
* V2升级字段issueToProjectRatio的分母评价周期内网格内居民提出的议题数目
* 2020-01-07 新增
*/
private Integer issueTotal;
}

23
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java

@ -55,4 +55,27 @@ public class GridServiceAbilityFormDTO implements Serializable {
*/
private BigDecimal partyVolunteerRatio;
/**
* V2升级字段partyVolunteerRatio的分子网格党员志愿者数
* 2020-01-07
*/
private Integer partyVolunteerTotal;
/**
* V2升级字段partyVolunteerRatio的分母志愿者总数
* 2020-01-07
*/
private Integer volunteerTotal;
/**
* V2升级字段volunteerRatio的分子居民且注册志愿者的总人数
* 2020-01-07
*/
private Integer volunteerUserTotal;
/**
* V2升级字段volunteerRatio的分母网格内注册居民数
* 2020-01-07
*/
private Integer regUserTotal;
}

60
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java

@ -80,4 +80,64 @@ public class OrgGovrnAbilityFormDTO implements Serializable {
* 街道办结项目的处理效率, data_type=street时有值
*/
private BigDecimal handleProjectRatio;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal overdueProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal overdueProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFm;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.org.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/1/14 上午11:05
*/
@Data
public class CustomerAreaCodeResultDTO implements Serializable {
private static final long serialVersionUID = -4722604654441455214L;
/**
* 客户ID
*/
private String customerId;
/**
* 行政区域编码
*/
private String areaCode;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java

@ -48,4 +48,10 @@ public class CustomerDeptFormDTO implements Serializable {
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* V2升级必传参数当前网格所属行政地区编码去除末尾0
* 2020-01-07
*/
private String areaCode;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java

@ -53,4 +53,10 @@ public class CustomerGridFormDTO implements Serializable {
* 所有上级ID用英文逗号分开(8.26新增)
*/
private String allParentIds;
/**
* V2升级必传参数当前网格所属行政地区编码去除末尾0
* 2020-01-07
*/
private String areaCode;
}

7
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto.stats;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -73,4 +74,8 @@ public class DimCustomerDTO implements Serializable {
*/
private Date updatedTime;
/**
* 客户所属行政地区编码取值来自客户根组织的area_code01.14 add
*/
private String areaCode;
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java

@ -2,6 +2,7 @@ package com.epmet.dao.org;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.org.result.CustomerAreaCodeResultDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -22,4 +23,12 @@ public interface StatsCustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<AgencySubTreeDto> selectSubAgencyByPid(@Param("pid")String pid);
List<CustomerAgencyEntity> listAgenciesByUpdatedTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
/**
* @Description 查询客户所属区域编码
* @Param customerIds
* @author zxc
* @date 2021/1/14 上午11:07
*/
List<CustomerAreaCodeResultDTO> selectCustomerAreaCodeById(@Param("customerIds") List<String> customerIds);
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java

@ -17,6 +17,7 @@
package com.epmet.entity.crm;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -88,4 +89,6 @@ public class CustomerEntity extends BaseEpmetEntity {
*/
private String logo;
@TableField(exist = false)
private String areaCode;
}

49
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java

@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 治理能力-部门相关数据
* 治理能力-部门相关数据
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-20
@ -97,4 +97,51 @@ public class FactIndexGovrnAblityDeptMonthlyEntity extends BaseEpmetEntity {
*/
private BigDecimal satisfactionRatio;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
}

37
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java

@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 治理能力-网格相关事实表
* 治理能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-20
@ -107,4 +107,39 @@ public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity {
*/
private BigDecimal satisfactionRatio;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal transferRightRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal transferRightRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal issueToProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal issueToProjectRatioFm;
}

60
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java

@ -106,4 +106,64 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity {
* 街道办结项目的处理效率, data_type=street时有值
*/
private BigDecimal handleProjectRatio;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal respProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal closedProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal satisfactionRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal overdueProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal overdueProjectRatioFm;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFz;
/**
* V2升级新增字段, 详见说明文档
* 2020-01-07
*/
private BigDecimal handleProjectRatioFm;
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java

@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 党建能力-网格相关事实表
* 党建能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-20
@ -132,4 +132,16 @@ public class FactIndexPartyAblityGridMonthlyEntity extends BaseEpmetEntity {
*/
private Integer joinThreeMeetsCount;
/**
* V2升级字段issueToProjectRatio的分子评价周期内转为项目的数量
* 2020-01-07 新增
*/
private Integer shiftedProjectTotal;
/**
* V2升级字段issueToProjectRatio的分母评价周期内网格内居民提出的议题数目
* 2020-01-07 新增
*/
private Integer issueTotal;
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java

@ -82,4 +82,27 @@ public class FactIndexServiceAblityGridMonthlyEntity extends BaseEpmetEntity {
*/
private BigDecimal partyVolunteerRatio;
/**
* V2升级字段partyVolunteerRatio的分子网格党员志愿者数
* 2020-01-07
*/
private Integer partyVolunteerTotal;
/**
* V2升级字段partyVolunteerRatio的分母志愿者总数
* 2020-01-07
*/
private Integer volunteerTotal;
/**
* V2升级字段volunteerRatio的分子居民且注册志愿者的总人数
* 2020-01-07
*/
private Integer volunteerUserTotal;
/**
* V2升级字段volunteerRatio的分母网格内注册居民数
* 2020-01-07
*/
private Integer regUserTotal;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java

@ -77,4 +77,9 @@ public class ScreenCustomerDeptEntity extends BaseEpmetEntity {
private String sourceType;
/**
* V2升级必传参数当前网格所属行政地区编码去除末尾0
* 2020-01-07
*/
private String areaCode;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java

@ -81,4 +81,10 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity {
private String allParentIds;
private String sourceType;
/**
* V2升级必传参数当前网格所属行政地区编码去除末尾0
* 2020-01-07
*/
private String areaCode;
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java

@ -43,4 +43,9 @@ public class DimCustomerEntity extends BaseEpmetEntity {
*/
private String customerName;
/**
* 客户所属行政地区编码取值来自客户根组织的area_code01.14 add
*/
private String areaCode;
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -1,6 +1,7 @@
package com.epmet.service.impl;
import com.epmet.constant.RobotConstant;
import com.epmet.dto.org.result.CustomerAreaCodeResultDTO;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
@ -199,6 +200,14 @@ public class StatsDimServiceImpl implements StatsDimService {
List<CustomerEntity> customers = customerService.listValidCustomersByCreateTime(lastInitTime, initTime);
// 添加 areaCode
if (!CollectionUtils.isEmpty(customers)){
List<String> customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList());
List<CustomerAreaCodeResultDTO> areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds);
if (!CollectionUtils.isEmpty(areaCodes)){
customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode())));
}
}
return customers;
}
@ -212,6 +221,14 @@ public class StatsDimServiceImpl implements StatsDimService {
if (lastCreatedDim != null) {
// 说明不是首次初始化
List<CustomerEntity> customers = customerService.listValidCustomersByUpdatedTime(lastCreatedDim.getUpdatedTime(), initTime);
// 添加 areaCode
if (!CollectionUtils.isEmpty(customers)){
List<String> customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList());
List<CustomerAreaCodeResultDTO> areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds);
if (!CollectionUtils.isEmpty(areaCodes)){
customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode())));
}
}
return customers;
}
return new ArrayList<>();

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java

@ -1,5 +1,6 @@
package com.epmet.service.org;
import com.epmet.dto.org.result.CustomerAreaCodeResultDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import java.util.Date;
@ -9,4 +10,12 @@ public interface CustomerAgencyService {
List<CustomerAgencyEntity> listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime);
List<CustomerAgencyEntity> listAgenciesByUpdatedTime(Date updatedTime, Date now);
/**
* @Description 查询客户所属区域编码
* @Param customerIds
* @author zxc
* @date 2021/1/14 上午11:07
*/
List<CustomerAreaCodeResultDTO> selectCustomerAreaCodeById(List<String> customerIds);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java

@ -3,11 +3,14 @@ package com.epmet.service.org.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.org.StatsCustomerAgencyDao;
import com.epmet.dto.org.result.CustomerAreaCodeResultDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.service.org.CustomerAgencyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -27,4 +30,19 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService {
public List<CustomerAgencyEntity> listAgenciesByUpdatedTime(Date startTime, Date endTime) {
return customerAgencyDao.listAgenciesByUpdatedTime(startTime, endTime);
}
/**
* @Description 查询客户所属区域编码
* @Param customerIds
* @author zxc
* @date 2021/1/14 上午11:07
*/
@Override
public List<CustomerAreaCodeResultDTO> selectCustomerAreaCodeById(List<String> customerIds) {
if (!CollectionUtils.isEmpty(customerIds)){
List<CustomerAreaCodeResultDTO> resultDTOS = customerAgencyDao.selectCustomerAreaCodeById(customerIds);
return resultDTOS;
}
return new ArrayList<>();
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java

@ -128,6 +128,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
for (CustomerEntity customer : newCustomers) {
DimCustomerEntity dim = new DimCustomerEntity();
dim.setCustomerName(customer.getCustomerName());
dim.setAreaCode(customer.getAreaCode());
dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT);
dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT);
dim.setId(customer.getId());
@ -143,6 +144,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
existsCustomerDim.setCustomerName(updatedCustomer.getCustomerName());
existsCustomerDim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT);
existsCustomerDim.setUpdatedTime(initTime);
existsCustomerDim.setAreaCode(updatedCustomer.getAreaCode());
baseDao.updateById(existsCustomerDim);
}
}

37
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.5__screen_org_add_source_col.sql

@ -0,0 +1,37 @@
# alter table fact_index_party_ablity_grid_monthly add column SHIFTED_PROJECT_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量';
# alter table fact_index_party_ablity_grid_monthly add column ISSUE_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目';
# alter table fact_index_service_ablity_grid_monthly add column PARTY_VOLUNTEER_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数';
# alter table fact_index_service_ablity_grid_monthly add column VOLUNTEER_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:partyVolunteerRatio的分母:志愿者总数';
# alter table fact_index_service_ablity_grid_monthly add column VOLUNTEER_USER_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数';
# alter table fact_index_service_ablity_grid_monthly add column REG_USER_TOTAL int(11) DEFAULT NULL COMMENT 'V2升级字段:volunteerRatio的分母:网格内注册居民数';
# alter table fact_index_govrn_ablity_grid_monthly add column TRANSFER_RIGHT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_grid_monthly add column TRANSFER_RIGHT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_grid_monthly add column SATISFACTION_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_grid_monthly add column SATISFACTION_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_grid_monthly add column ISSUE_TO_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_grid_monthly add column ISSUE_TO_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column RESP_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column RESP_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column HANDLE_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column HANDLE_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column CLOSED_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column CLOSED_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column SATISFACTION_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_dept_monthly add column SATISFACTION_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column RESP_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column RESP_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column CLOSED_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column CLOSED_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column SATISFACTION_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column SATISFACTION_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column OVERDUE_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column OVERDUE_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column HANDLE_PROJECT_RATIO_FZ decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table fact_index_govrn_ablity_org_monthly add column HANDLE_PROJECT_RATIO_FM decimal(10,6) DEFAULT NULL COMMENT 'V2升级新增字段, 详见说明文档';
# alter table screen_customer_grid add column AREA_CODE varchar(30) DEFAULT NULL COMMENT 'V2升级必传参数:当前网格所属行政地区编码,去除末尾0';
# alter table screen_customer_dept add column AREA_CODE varchar(30) DEFAULT NULL COMMENT 'V2升级必传参数:当前网格所属行政地区编码,去除末尾0';

18
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__indexcal_addCustomerAreaCodeAndCustomerRelationTb.sql

@ -0,0 +1,18 @@
-- epmet_data_statistical 库sql脚本:
alter table dim_customer add COLUMN AREA_CODE varchar(12) default '' comment '客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add)'after CUSTOMER_NAME;
CREATE TABLE `customer_relation` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`PARENT_CUSTOMER_ID` varchar(64) NOT NULL COMMENT '父级客户id;如果是顶级客户,此列=0',
`CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '当前客户类型取值: external:外部客户,internal:内部客户',
`PARENT_CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '父级客户类型取值: external:外部客户,internal:内部客户',
`STATUS` varchar(10) NOT NULL DEFAULT 'open' COMMENT 'open,closed是否启用',
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识0未删除1已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户关系表(01.14 add)';

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql

@ -0,0 +1,4 @@
-- epmet_evaluation_index
alter table screen_customer_grid add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与';
alter table screen_customer_dept add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与';
alter table screen_customer_agency add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与';

20
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml

@ -52,7 +52,15 @@
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
RESP_PROJECT_RATIO_FZ,
RESP_PROJECT_RATIO_FM,
HANDLE_PROJECT_RATIO_FZ,
HANDLE_PROJECT_RATIO_FM,
CLOSED_PROJECT_RATIO_FZ,
CLOSED_PROJECT_RATIO_FM,
SATISFACTION_RATIO_FZ,
SATISFACTION_RATIO_FM
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -74,7 +82,15 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.respProjectRatioFz},
#{item.respProjectRatioFm},
#{item.handleProjectRatioFz},
#{item.handleProjectRatioFm},
#{item.closedProjectRatioFz},
#{item.closedProjectRatioFm},
#{item.satisfactionRatioFz},
#{item.satisfactionRatioFm}
)
</foreach>
</insert>

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

@ -56,7 +56,13 @@
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
TRANSFER_RIGHT_RATIO_FZ,
TRANSFER_RIGHT_RATIO_FM,
SATISFACTION_RATIO_FZ,
SATISFACTION_RATIO_FM,
ISSUE_TO_PROJECT_RATIO_FZ,
ISSUE_TO_PROJECT_RATIO_FM
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -80,7 +86,13 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.transferRightRatioFz},
#{item.transferRightRatioFm},
#{item.satisfactionRatioFz},
#{item.satisfactionRatioFm},
#{item.issueToProjectRatioFz},
#{item.issueToProjectRatioFm}
)
</foreach>
</insert>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -63,7 +63,17 @@
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
RESP_PROJECT_RATIO_FZ,
RESP_PROJECT_RATIO_FM,
CLOSED_PROJECT_RATIO_FZ,
CLOSED_PROJECT_RATIO_FM,
SATISFACTION_RATIO_FZ,
SATISFACTION_RATIO_FM,
OVERDUE_PROJECT_RATIO_FZ,
OVERDUE_PROJECT_RATIO_FM,
HANDLE_PROJECT_RATIO_FZ,
HANDLE_PROJECT_RATIO_FM
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -87,7 +97,17 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.respProjectRatioFz},
#{item.respProjectRatioFm},
#{item.closedProjectRatioFz},
#{item.closedProjectRatioFm},
#{item.satisfactionRatioFz},
#{item.satisfactionRatioFm},
#{item.overdueProjectRatioFz},
#{item.overdueProjectRatioFm},
#{item.handleProjectRatioFz},
#{item.handleProjectRatioFm}
)
</foreach>
</insert>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml

@ -66,7 +66,9 @@
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
SHIFTED_PROJECT_TOTAL,
ISSUE_TOTAL
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -95,7 +97,9 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.shiftedProjectTotal},
#{item.issueTotal}
)
</foreach>
</insert>

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml

@ -46,7 +46,11 @@
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
UPDATED_TIME,
PARTY_VOLUNTEER_TOTAL,
VOLUNTEER_TOTAL,
VOLUNTEER_USER_TOTAL,
REG_USER_TOTAL
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -65,7 +69,11 @@
'APP_USER',
now(),
'APP_USER',
now()
now(),
#{item.partyVolunteerTotal},
#{item.volunteerTotal},
#{item.volunteerUserTotal},
#{item.regUserTotal}
)
</foreach>
</insert>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml

@ -26,7 +26,8 @@
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
DATA_END_TIME
DATA_END_TIME,
AREA_CODE
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -44,7 +45,8 @@
now(),
'APP_USER',
now(),
#{item.dataEndTime}
#{item.dataEndTime},
#{item.areaCode}
)
</foreach>
</insert>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -27,7 +27,8 @@
UPDATED_BY,
UPDATED_TIME,
DATA_END_TIME,
ALL_PARENT_IDS
ALL_PARENT_IDS,
AREA_CODE
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -46,7 +47,8 @@
'APP_USER',
now(),
#{item.dataEndTime},
#{item.allParentIds}
#{item.allParentIds},
#{item.areaCode}
)
</foreach>
</insert>

17
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml

@ -100,4 +100,21 @@
and UPDATED_TIME <![CDATA[<=]]> #{endTime}
</select>
<!-- 查询客户所属区域编码 -->
<select id="selectCustomerAreaCodeById" resultType="com.epmet.dto.org.result.CustomerAreaCodeResultDTO">
SELECT
CUSTOMER_ID,
AREA_CODE
FROM
customer_agency
WHERE
DEL_FLAG = '0'
AND PID = '0'
AND (
<foreach collection="customerIds" item="customerId" separator=" OR ">
CUSTOMER_ID = #{customerId}
</foreach>
)
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml

@ -15,6 +15,7 @@
<select id="getLatestCreatedDimEntity" resultType="com.epmet.entity.stats.DimCustomerEntity">
SELECT id,
customer_name,
area_code,
del_flag,
revision,
created_by,
@ -30,6 +31,7 @@
select
id,
customer_name,
area_code,
del_flag,
revision,
created_by,

6
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt

@ -4,4 +4,8 @@
文档地址:
1. 大屏指标项文档说明:https://www.kdocs.cn/view/l/svtSfaUyzNYZ?f=130
2. 大屏或手机端:https://www.kdocs.cn/view/l/suilmk0Ziss1?f=130
2. 大屏或手机端:https://www.kdocs.cn/view/l/suilmk0Ziss1?f=130
01.14问题记录:
1、孔村、锦水这两个项目的组织树level与产品定义不匹配。举例:孔村镇应属于街道级street客户,实际定义的是district
2、孔村镇的行政区域与实际业务建立的组织有些匹配不上,比如:孔村社区。

Loading…
Cancel
Save