Browse Source

Merge branch 'dev_third_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_third_data

master
wxz 4 years ago
parent
commit
b1f0323537
  1. 12
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  2. 27
      epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java
  3. 12
      epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java
  4. 46
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java
  6. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java
  7. 27
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java
  8. 60
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  9. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java
  10. 37
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  11. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  12. 32
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  13. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  14. 40
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  15. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  16. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  17. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  18. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  19. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java
  20. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  21. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  22. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  23. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  24. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java
  25. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  26. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  27. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  28. 242
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  29. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  30. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  31. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  32. 90
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql
  33. 133
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql
  34. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml
  35. 32
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  36. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  37. 31
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  38. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  39. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java
  40. 1
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql

12
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -104,4 +104,16 @@ public class ThirdLoginController {
return new Result().ok("");
}
/**
* @param formDTO
* @author sun
* @description 单客户-工作端微信小程序登录-发送验证码
**/
@PostMapping(value = "sendsmscode")
public Result sendSmsCode(@RequestBody ThirdSendSmsCodeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,ThirdSendSmsCodeFormDTO.AddUserShowGroup.class);
thirdLoginService.sendSmsCode(formDTO);
return new Result();
}
}

27
epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 单客户-工作端微信小程序登录-发送验证码
* @Author sun
*/
@Data
public class ThirdSendSmsCodeFormDTO implements Serializable {
private static final long serialVersionUID = -1852541457359282018L;
/**
* 小程序appId
*/
@NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class})
private String appId;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class})
private String mobile;
public interface AddUserShowGroup extends CustomerClientShowGroup {}
}

12
epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java

@ -1,9 +1,6 @@
package com.epmet.service;
import com.epmet.dto.form.GetResiWxPhoneFormDTO;
import com.epmet.dto.form.LoginFormDTO;
import com.epmet.dto.form.ThirdStaffOrgsFormDTO;
import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffOrgsResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
@ -62,4 +59,11 @@ public interface ThirdLoginService {
* @description 单客户-获取微信用户手机号
**/
String getResiWxPhone(GetResiWxPhoneFormDTO formDTO);
/**
* @param formDTO
* @author sun
* @description 单客户-工作端微信小程序登录-发送验证码
**/
void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO);
}

46
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -14,10 +14,13 @@ import com.epmet.commons.tools.security.dto.GovTokenDto;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.password.PasswordUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.AuthHttpUrlConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.jwt.JwtTokenProperties;
@ -56,6 +59,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @param formDTO
@ -589,4 +594,45 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
return phone;
}
/**
* @param formDTO
* @author sun
* @description 单客户-工作端微信小程序登录-发送验证码
**/
@Override
public void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO) {
String str = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]";
//1.校验手机号是否符合规范
if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) {
logger.warn(String.format(str, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg()));
throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode());
}
//2.根据手机号校验用户是否存在
//2-1.根据appId查询对应客户Id
PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId());
//2-2.根据手机号查询到用户信息
ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO();
dto.setCustomerId(customer.getId());
dto.setMobile(formDTO.getMobile());
Result<List<CustomerStaffDTO>> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto);
if (!customerStaffResult.success()) {
logger.warn(String.format(str, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg()));
throw new RenException(customerStaffResult.getCode());
}
//3.发送短信验证码
SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(formDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM);
Result<SendVerificationCodeResultDTO> smsCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if (!smsCodeResult.success()) {
logger.warn(String.format(str, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg()));
throw new RenException(smsCodeResult.getCode());
}
//4.保存短信验证码(删除现有短信验证码 将新的短信验证码存入Redis)
SendSmsCodeFormDTO sendSmsCodeFormDTO = new SendSmsCodeFormDTO();
sendSmsCodeFormDTO.setMobile(formDTO.getMobile());
captchaRedis.saveSmsCode(sendSmsCodeFormDTO, smsCodeResult.getData().getCode());
logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile()));
}
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java

@ -28,4 +28,6 @@ public interface DataSourceConstant {
String OPER_CRM="opercrm";
String DATA_STATISTICAL="datastatistical";
String EVALUATION_INDEX = "evaluationIndex";
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java

@ -0,0 +1,33 @@
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 GovrnRatioFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
/**
* 组织Id
*/
@NotBlank(message = "组织或网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class)
private String orgId;
/**
* 组织:agency 网格:grid
*/
@NotBlank(message = "网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class)
private String orgType;
/**
* 日维度Id[日期不传值默认查前一天的格式20210101]
*/
private String dateId;
public interface AgencyGrid extends CustomerClientShowGroup {}
}

27
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dataaggre.dto.datastats.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 治理实况-组织/网格下响应解决满意自治率-接口返参
* @Auth sun
*/
@Data
public class GovrnRatioResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
//组织或网格Id
private String orgId;
//组织:agency 网格:grid
private String orgType;
//响应率
private String responseRatio = "0%";
//解决率
private String resolvedRatio = "0%";
//自治率
private String governRatio = "0%";
//满意率
private String satisfactionRatio = "0%";
}

60
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -158,11 +158,18 @@
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<datasource.druid.stats.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
</datasource.druid.stats.url>
<datasource.druid.stats.username>epmet_data_statistical_user</datasource.druid.stats.username>
<datasource.druid.stats.password>EpmEt-db-UsEr</datasource.druid.stats.password>
<!-- epmet_evaluation_index -->
<datasource.druid.evaluationIndex.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex.url>
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
@ -246,11 +253,18 @@
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<datasource.druid.stats.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
</datasource.druid.stats.url>
<datasource.druid.stats.username>epmet_data_statistical_user</datasource.druid.stats.username>
<datasource.druid.stats.password>EpmEt-db-UsEr</datasource.druid.stats.password>
<!-- epmet_evaluation_index -->
<datasource.druid.evaluationIndex.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex.url>
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
@ -334,11 +348,18 @@
<datasource.druid.opercrm.password>elink@833066</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<datasource.druid.stats.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>elink@833066</datasource.druid.opercrm.password>
</datasource.druid.stats.url>
<datasource.druid.stats.username>epmet</datasource.druid.stats.username>
<datasource.druid.stats.password>elink@833066</datasource.druid.stats.password>
<!-- epmet_evaluation_index -->
<datasource.druid.evaluationIndex.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex.url>
<datasource.druid.evaluationIndex.username>epmet</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>elink@833066</datasource.druid.evaluationIndex.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
@ -422,11 +443,18 @@
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<datasource.druid.stats.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
</datasource.druid.stats.url>
<datasource.druid.stats.username>epmet_data_statistical_user</datasource.druid.stats.username>
<datasource.druid.stats.password>EpmEt-db-UsEr</datasource.druid.stats.password>
<!-- epmet_evaluation_index -->
<datasource.druid.evaluationIndex.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex.url>
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java

@ -1,5 +1,6 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.datastats.form.*;
@ -200,4 +201,18 @@ public class DataStatsController {
return new Result<List<GridGovrnResultDTO>>().ok(dataStatsService.subGridGovrnList(formDTO));
}
/**
* @Param formDTO
* @Description 治理实况-组织/网格下响应解决满意自治率
* @author sun
*/
@PostMapping("governratio")
public Result<GovrnRatioResultDTO> governRatio(@RequestBody GovrnRatioFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GovrnRatioFormDTO.AgencyGrid.class);
if (!"agency".equals(formDTO.getOrgType()) && !"grid".equals(formDTO.getOrgType())) {
throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType()));
}
return new Result<GovrnRatioResultDTO>().ok(dataStatsService.governRatio(formDTO));
}
}

37
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java

@ -0,0 +1,37 @@
/**
* 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.evaluationindex;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Author sun
* @Description 指标统计服务
*/
@Mapper
public interface EvaluationIndexDao {
/**
* @Param formDTO
* @Description 按类型日期查询治理指数下响应解决满意自治四个统计率
* @author sun
*/
GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -152,4 +152,11 @@ public interface DataStatsService {
* @author sun
*/
List<GridGovrnResultDTO> subGridGovrnList(GridGovrnFormDTO formDTO);
/**
* @Param formDTO
* @Description 治理实况-组织/网格下响应解决满意自治率
* @author sun
*/
GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO);
}

32
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
import com.epmet.dataaggre.entity.datastats.DimGridEntity;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -39,6 +40,8 @@ import java.util.stream.Collectors;
public class DataStatsServiceImpl implements DataStatsService {
@Autowired
private DataStatsDao dataStatsDao;
@Autowired
private EvaluationIndexService indexService;
/**
@ -1243,4 +1246,33 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultList;
}
/**
* @Param formDTO
* @Description 治理实况-组织/网格下响应解决满意自治率
* @author sun
*/
@Override
public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) {
GovrnRatioResultDTO resultDTO = new GovrnRatioResultDTO();
resultDTO.setOrgId(formDTO.getOrgId());
resultDTO.setOrgType(formDTO.getOrgType());
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
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.按类型、日期查询治理指数下响应解决满意自治四个统计率
GovrnRatioResultDTO dto = indexService.governRatio(formDTO);
if (null != dto) {
resultDTO.setResponseRatio(dto.getResponseRatio());
resultDTO.setResolvedRatio(dto.getResolvedRatio());
resultDTO.setGovernRatio(dto.getGovernRatio());
resultDTO.setSatisfactionRatio(dto.getSatisfactionRatio());
}
return resultDTO;
}
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java

@ -0,0 +1,18 @@
package com.epmet.dataaggre.service.evaluationindex;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
/**
* @Author sun
* @Description 指标统计服务
*/
public interface EvaluationIndexService {
/**
* @Param formDTO
* @Description 治理实况-组织/网格下响应解决满意自治率
* @author sun
*/
GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO);
}

40
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -0,0 +1,40 @@
package com.epmet.dataaggre.service.evaluationindex.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao;
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO;
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
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.text.SimpleDateFormat;
import java.util.Date;
/**
* @Author sun
* @Description 指标统计服务
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Slf4j
public class EvaluationIndexServiceImpl implements EvaluationIndexService {
@Autowired
private EvaluationIndexDao evaluationIndexDao;
/**
* @Param formDTO
* @Description 按类型日期查询治理指数下响应解决满意自治四个统计率
* @author sun
*/
@Override
public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) {
return evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId());
}
}

11
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml

@ -131,9 +131,14 @@ dynamic:
password: @datasource.druid.opercrm.password@
datastatistical:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.opercrm.url@
username: @datasource.druid.opercrm.username@
password: @datasource.druid.opercrm.password@
url: @datasource.druid.stats.url@
username: @datasource.druid.stats.username@
password: @datasource.druid.stats.password@
evaluationIndex:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.evaluationIndex.url@
username: @datasource.druid.evaluationIndex.username@
password: @datasource.druid.evaluationIndex.password@
feign:
hystrix:
enabled: true

23
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -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.dataaggre.dao.evaluationindex.EvaluationIndexDao">
<select id="getAgnecyOrGridGoverRatio" resultType="com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO">
SELECT
org_id AS orgId,
org_type AS orgType,
CONCAT(ROUND(response_ratio, 1), '%') AS responseRatio,
CONCAT(ROUND(resolved_ratio, 1) , '%')AS resolvedRatio,
CONCAT(ROUND(govern_ratio, 1), '%') AS governRatio,
CONCAT(ROUND(satisfaction_ratio, 1), '%') AS satisfactionRatio
FROM
screen_govern_rank_data_daily
WHERE
del_flag = '0'
AND org_id = #{orgId}
AND org_type = #{orgType}
AND date_id = #{dateId}
</select>
</mapper>

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -71,4 +71,14 @@ public interface ProjectConstant {
String ISSUE = "issue";
/**
* 项目来源于议题
*/
String PROJECT_ORIGIN_ISSUE="issue";
/**
* 项目来源于 工作端立项
*/
String PROJECT_ORIGIN_AGENCY="agency";
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -37,6 +37,7 @@ import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.StatsPartyMemberVanguardService;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
@ -116,6 +117,8 @@ public class DemoController {
private StatsPartyMemberVanguardService statsPartyMemberVanguardService;
@Autowired
private FactGroupActDailyService factGroupActDailyService;
@Autowired
private FactGridGovernDailyService factGridGovernDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -899,4 +902,10 @@ public class DemoController {
factGroupActDailyService.extractAgencyGroupActDaily(customerId,dateId);
return new Result();
}
@PostMapping("extractgridgoverndaily")
public Result extractFactGridGovernDaily(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){
factGridGovernDailyService.extractFactGridGovernDaily(customerId,dateId);
return new Result();
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 网格的治理指数按天统计
@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface FactGridGovernDailyDao extends BaseDao<FactGridGovernDailyEntity> {
int deleteBatchByCustomerIdAndDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("limit") int limit);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -225,4 +226,20 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectPartyMemberIssueStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 3当前网格内议题关闭已解决数
* 4当前网格内议题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @param resolveType unresolved,resolved
* @return
*/
List<GovernGridTotalCommonDTO> selectGroupByGridId(@Param("customerId")String customerId,
@Param("gridIds")List<String> gridIds,
@Param("issueStatus")String issueStatus,
@Param("resolveType")String resolveType);
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -28,6 +28,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -445,4 +446,23 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectPartyMemberClosedProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO
*/
List<GovernGridTotalCommonDTO> selectGroupByGrid(@Param("customerId")String customerId,
@Param("gridIds")List<String> gridIds,
@Param("projectStatus")String projectStatus,
@Param("origin")String origin,
@Param("isResolved")String isResolved);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -159,4 +160,21 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectPartyMemberTopicStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 1当前网格内话题关闭已解决数
* 2当前网格内话题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param topicStatus 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* @param closedStatus unresolved,resolved
* @return
*/
List<GovernGridTotalCommonDTO> selectTopicGroupByGridId(@Param("customerId")String customerId,
@Param("gridIds")List<String> gridIds,
@Param("topicStatus")String topicStatus,
@Param("closedStatus")String closedStatus,
@Param("shiftIssue")String shiftIssue);
}

54
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java

@ -19,6 +19,8 @@ package com.epmet.entity.evaluationindex.extract;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -127,9 +129,55 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/
/**
* 11来源于议题的项目未出网格结案并且已解决的项目数
*/
private Integer fromIssueResolvedInGridCount;
/**
* 12来源于议题的项目未出网格结案并且无需解决的项目数
*/
private Integer fromIssueUnResolvedInGridCount;
/**
* 13来源于项目立项的项目未出网格结案并且已解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyResolvedInGridCount;
/**
* 14来源于项目立项的项目未出网格结案并且无需解决的项目数因现在网格不能立项所以此列默认为0
*/
private Integer fromAgencyUnResolvedInGridCount;
/**
* 15未出当前网格的结案项目数=11+12+13+14
*/
private Integer gridSelfGovernProjectTotal;
public FactGridGovernDailyEntity() {
this.customerId = StrConstant.EPMETY_STR;
this.dateId = StrConstant.EPMETY_STR;
this.gridId = StrConstant.EPMETY_STR;
this.pid = StrConstant.EPMETY_STR;
this.pids = StrConstant.EPMETY_STR;
this.problemResolvedCount = NumConstant.ZERO;
this.groupSelfGovernRatio=BigDecimal.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
this.topicResolvedCount=NumConstant.ZERO;
this.topicUnResolvedCount=NumConstant.ZERO;
this.issueResolvedCount=NumConstant.ZERO;
this.issueUnResolvedCount=NumConstant.ZERO;
this.issueProjectResolvedCount=NumConstant.ZERO;
this.issueProjectUnResolvedCount=NumConstant.ZERO;
this.approvalProjectResolvedCount=NumConstant.ZERO;
this.approvalProjectUnResolvedCount=NumConstant.ZERO;
this.inGroupTopicResolvedCount=NumConstant.ZERO;
this.inGroupTopicUnResolvedCount=NumConstant.ZERO;
this.fromIssueResolvedInGridCount=NumConstant.ZERO;
this.fromIssueUnResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyResolvedInGridCount=NumConstant.ZERO;
this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
}
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.entity.evaluationindex.extract;
import lombok.Data;
import java.io.Serializable;
/**
* 网格的治理指数按天统计 计算过程中通用dto
*
* @author yinzuomei@elink-cn.com
* @date 2021/5/25 13:43
*/
@Data
public class GovernGridTotalCommonDTO implements Serializable {
private String customerId;
private String gridId;
private Integer total;
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import java.util.List;
import java.util.Map;
@ -122,4 +123,17 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @return java.util.Map<java.lang.String,com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
Map<String, OrgStatisticsResultDTO> getPartyMemberIssueStatic(String customerId, String dateId, String type);
/**
* 3当前网格内议题关闭已解决数
* 4当前网格内议题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @param resolveType unresolved,resolved
* @return
*/
List<GovernGridTotalCommonDTO> queryGridIssueValue(String customerId, List<String> gridIds, String issueStatus, String resolveType);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -29,6 +29,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import java.util.List;
@ -421,4 +422,18 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
*/
Map<String, OrgStatisticsResultDTO> getPartyMemberClosedProjectStatic(String customerId, String dateId, String type);
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return
*/
List<GovernGridTotalCommonDTO> queryGridProjectValue(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java

@ -23,6 +23,7 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import java.util.List;
import java.util.Map;
@ -123,4 +124,18 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @return java.util.Map<java.lang.String,com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
Map<String, OrgStatisticsResultDTO> getPartyMemberTopicStatic(String customerId, String dateId, String type);
/**
* 1当前网格内话题关闭已解决数
* 2当前网格内话题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param topicStatus 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* @param closedStatus unresolved,resolved
* @param shiftIssue 是否转为议题0:false1:true
* @return
*/
List<GovernGridTotalCommonDTO> queryGridTopicValue(String customerId, List<String> gridIds, String topicStatus, String closedStatus, String shiftIssue);
}

242
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java

@ -18,19 +18,30 @@
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DimObjectStatusConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.org.CustomerAgencyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
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.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 网格的治理指数按天统计
@ -42,9 +53,11 @@ import java.util.List;
@Service
public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGovernDailyDao, FactGridGovernDailyEntity> implements FactGridGovernDailyService {
@Autowired
private GroupDataService groupDataService;
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private CustomerAgencyService customerAgencyService;
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private CustomerGridService customerGridService;
@ -62,13 +75,230 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
*/
@Override
public void extractFactGridGovernDaily(String customerId, String dateId) {
log.info("extractFactGridGovernDaily start customerId="+customerId+";dateId="+dateId);
//客户id, dateId不能为空
if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){
return;
}
// 2、当前客户下所有的网格
List<GridInfoDTO> gridInfoDTOList=customerGridService.queryGridInfoList(customerId);
//todo
// List<FactGridGovernDailyEntity>
if(CollectionUtils.isEmpty(gridInfoDTOList)){
log.info("当前客户customerId=("+customerId+")下没有网格,无需计算");
return;
}
List<FactGridGovernDailyEntity> insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList);
// log.info(JSON.toJSONString(insertEntityList,true));
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
Map<String, Integer> topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,null);
Map<String, Integer> topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,null);
Map<String, Integer> issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED);
Map<String, Integer> issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> issueProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED);
Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR);
Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR);
for(FactGridGovernDailyEntity insertEntity:insertEntityList){
//1、当前网格内,话题关闭已解决数
if(topicResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setTopicResolvedCount(topicResolvedMap.get(insertEntity.getGridId()));
}
//2、当前网格内,话题关闭无需解决数
if(topicUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setTopicUnResolvedCount(topicUnResolvedMap.get(insertEntity.getGridId()));
}
//3、当前网格内,议题关闭已解决数
if(issueResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueResolvedCount(issueResolvedMap.get(insertEntity.getGridId()));
}
//4、当前网格内,议题关闭无需解决数
if(issueUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueUnResolvedCount(issueUnResolvedMap.get(insertEntity.getGridId()));
}
// 5、当前网格内:来源于议题的项目:结案已解决数
if(issueProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueProjectResolvedCount(issueProjectResolvedMap.get(insertEntity.getGridId()));
}
// 6、当前网格内:来源于议题的项目:结案无需解决数
if(issueProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setIssueProjectUnResolvedCount(issueProjectUnResolvedMap.get(insertEntity.getGridId()));
}
//7、当前网格内:项目立项,结案已解决数;默认为0,
if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectResolvedCount(approvalProjectResolvedMap.get(insertEntity.getGridId()));
}
// 8、当前网格内:项目立项,结案无需解决数;默认为0,
if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectUnResolvedCount(approvalProjectUnResolvedMap.get(insertEntity.getGridId()));
}
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setInGroupTopicResolvedCount(inGroupTopicResolvedMap.get(insertEntity.getGridId()));
}
// 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数
if(inGroupTopicUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setInGroupTopicUnResolvedCount(inGroupTopicUnResolvedMap.get(insertEntity.getGridId()));
}
// todo
// 11、来源于议题的项目,未出网格结案并且已解决的项目数
insertEntity.setFromIssueResolvedInGridCount(0);
// 12、来源于议题的项目,未出网格结案并且无需解决的项目数
insertEntity.setFromIssueUnResolvedInGridCount(0);
// 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyResolvedInGridCount(0);
// 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0
insertEntity.setFromAgencyUnResolvedInGridCount(0);
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
//界面展示:1、问题解决总数=1+2+3+4+5+6+7+8
insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount()
+insertEntity.getIssueResolvedCount()+insertEntity.getIssueUnResolvedCount()
+insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount()
+insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount());
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
//界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount();
if (NumConstant.ZERO == groupSelfGovernRatioFz || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
insertEntity.setGroupSelfGovernRatio(BigDecimal.ZERO);
}else{
String groupSelfGovernRatioStr = numberFormat.format((float) groupSelfGovernRatioFz / insertEntity.getProblemResolvedCount());
insertEntity.setGroupSelfGovernRatio(new BigDecimal(groupSelfGovernRatioStr));
}
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
//界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){
insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO);
}else{
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount());
insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr));
}
}
// 先删除,后新增
// 3、批量删除
int deleteNum;
do {
deleteNum = baseDao.deleteBatchByCustomerIdAndDateId(customerId, dateId, NumConstant.TWO_HUNDRED);
} while (deleteNum > NumConstant.ZERO);
// 4、插入数据
this.insertBatch(insertEntityList);
log.info("extractFactGridGovernDaily completed");
}
/**
* 构造要插入的数据每个网格一天一条数据初始赋值0
*
* @param customerId
* @param dateId
* @param gridInfoDTOList
* @return com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity
*/
private List<FactGridGovernDailyEntity> constructFactGridGovernDailyEntityList(String customerId, String dateId, List<GridInfoDTO> gridInfoDTOList) {
List<FactGridGovernDailyEntity> insertEntityList = new ArrayList<>();
for (GridInfoDTO gridInfoDTO : gridInfoDTOList) {
FactGridGovernDailyEntity entity = new FactGridGovernDailyEntity();
entity.setCustomerId(customerId);
entity.setDateId(dateId);
entity.setGridId(gridInfoDTO.getGridId());
entity.setPid(gridInfoDTO.getPid());
entity.setPids(gridInfoDTO.getPids());
insertEntityList.add(entity);
}
return insertEntityList;
}
/**
* 1当前网格内话题关闭已解决数
* 2当前网格内话题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param topicStatus 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* @param closedStatus unresolved,resolved
* @param shiftIssue 是否转为议题0:false1:true
* @return
*/
private Map<String, Integer> getTopicMap(String customerId, List<String> gridIds, String topicStatus, String closedStatus,String shiftIssue) {
Map<String, Integer> resultMap = new HashMap<>();
List<GovernGridTotalCommonDTO> list = factOriginTopicMainDailyService.queryGridTopicValue(customerId, gridIds, topicStatus, closedStatus,shiftIssue);
for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) {
resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal());
}
return resultMap;
}
/**
* 3当前网格内议题关闭已解决数
* 4当前网格内议题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @param resolveType unresolved,resolved
* @return
*/
private Map<String, Integer> getIssueMap(String customerId, List<String> gridIds, String issueStatus, String resolveType) {
Map<String, Integer> resultMap = new HashMap<>();
List<GovernGridTotalCommonDTO> list = factOriginIssueMainDailyService.queryGridIssueValue(customerId, gridIds, issueStatus, resolveType);
for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) {
resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal());
}
return resultMap;
}
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return
*/
private Map<String, Integer> getGridProjectMap(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved) {
Map<String, Integer> resultMap = new HashMap<>();
List<GovernGridTotalCommonDTO> list = factOriginProjectMainDailyService.queryGridProjectValue(customerId, gridIds, projectStatus, origin, isResolved);
for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) {
resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal());
}
return resultMap;
}
/**
* 15未出当前网格的结案项目数=11+12+13+14
*
* @param customerId
* @param gridId
*/
private Integer calGridSelfGovernProjectTotal(String customerId, String gridId) {
// todo
return 0;
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -169,4 +170,20 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity()));
}
}
/**
* 3当前网格内议题关闭已解决数
* 4当前网格内议题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param issueStatus 议题状态 voting 已转项目shift_project 已关闭closed_resloved
* @param resolveType unresolved,resolved
* @return
*/
@Override
public List<GovernGridTotalCommonDTO> queryGridIssueValue(String customerId, List<String> gridIds, String issueStatus, String resolveType) {
return baseDao.selectGroupByGridId(customerId,gridIds,issueStatus,resolveType);
}
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -39,6 +39,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
@ -639,5 +640,23 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
}
/**
* 5当前网格内来源于议题的项目结案已解决数
* 6当前网格内来源于议题的项目结案无需解决数
* 7当前网格内项目立项结案已解决数默认为0
* 8当前网格内项目立项结案无需解决数默认为0
*
* @param customerId
* @param gridIds
* @param projectStatus 状态:待处理 pending结案closed
* @param origin 项目来源 来源议题issue 组织agency
* @param isResolved unresolved,resolved
* @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO
*/
@Override
public List<GovernGridTotalCommonDTO> queryGridProjectValue(String customerId, List<String> gridIds, String projectStatus, String origin, String isResolved) {
return baseDao.selectGroupByGrid(customerId,gridIds,projectStatus,origin,isResolved);
}
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -37,6 +37,7 @@ import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.topic.TopicService;
@ -359,4 +360,21 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
}
}
/**
* 1当前网格内话题关闭已解决数
* 2当前网格内话题关闭无需解决数
* 这两个值可以通过此方法获得
*
* @param customerId
* @param gridIds
* @param topicStatus 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* @param closedStatus unresolved,resolved
* @param shiftIssue 是否转为议题0:false1:true
* @return
*/
@Override
public List<GovernGridTotalCommonDTO> queryGridTopicValue(String customerId, List<String> gridIds, String topicStatus, String closedStatus, String shiftIssue) {
return baseDao.selectTopicGroupByGridId(customerId,gridIds,topicStatus,closedStatus,shiftIssue);
}
}

90
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql

@ -1,49 +1,47 @@
-- epmet_data_statistical 库执行以下脚本
-- CREATE TABLE `fact_group_act_daily` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据',
-- `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据',
-- `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析';
CREATE TABLE `fact_group_act_daily` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd',
`ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
`ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
`PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
`PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
`PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
`LEVEL` int(11) NOT NULL COMMENT '分类等级',
`ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据',
`PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据',
`AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析';
-- CREATE TABLE `fact_group_act_monthly` (
-- `ID` varchar(64) NOT NULL COMMENT '主键',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
-- `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM',
-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
-- `LEVEL` int(11) NOT NULL COMMENT '分类等级',
-- `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数',
-- `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数',
-- `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数',
-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析';
CREATE TABLE `fact_group_act_monthly` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM',
`ORG_ID` varchar(64) NOT NULL COMMENT '网格id',
`ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency',
`PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织',
`PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.',
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码',
`PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码',
`LEVEL` int(11) NOT NULL COMMENT '分类等级',
`ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数',
`PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数',
`AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' 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`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析';

133
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql

@ -0,0 +1,133 @@
-- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计
-- /*
-- Navicat Premium Data Transfer
--
-- Source Server : 192.168.1.130
-- Source Server Type : MySQL
-- Source Server Version : 50728
-- Source Host : 192.168.1.130:3306
-- Source Schema : epmet_data_statistical
--
-- Target Server Type : MySQL
-- Target Server Version : 50728
-- File Encoding : 65001
--
-- Date: 25/05/2021 09:31:39
-- */
--
-- SET NAMES utf8mb4;
-- SET FOREIGN_KEY_CHECKS = 0;
--
-- -- ----------------------------
-- -- Table structure for fact_agency_govern_daily
-- -- ----------------------------
-- DROP TABLE IF EXISTS `fact_agency_govern_daily`;
-- CREATE TABLE `fact_agency_govern_daily` (
-- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录',
-- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id',
-- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
-- `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id',
-- `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)',
-- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id',
-- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id',
-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8',
-- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数',
-- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `COMMUNITY_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `STREET_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `DISTRICT_DEPT_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '1、当前组织内,话题关闭已解决数',
-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '2、当前组织内,话题关闭无需解决数',
-- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '3、当前组织内,议题关闭已解决数',
-- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '4、当前组织内,议题关闭无需解决数',
-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '5、当前组织内:来源于议题的项目:结案已解决数',
-- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数',
-- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,',
-- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,',
-- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数',
-- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数',
-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '11、未出当前网格的,结案项目数',
-- `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由社区结案的项目总数',
-- `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由街道结案的项目总数',
-- `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数',
-- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁',
-- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
-- `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人',
-- `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间',
-- PRIMARY KEY (`ID`) USING BTREE
-- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织的治理指数,按天统计' ROW_FORMAT = Dynamic;
--
-- -- ----------------------------
-- -- Table structure for fact_grid_govern_daily
-- -- ----------------------------
-- DROP TABLE IF EXISTS `fact_grid_govern_daily`;
-- CREATE TABLE `fact_grid_govern_daily` (
-- `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录',
-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ',
-- `GRID_ID` varchar(64) NOT NULL COMMENT '网格id',
-- `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id',
-- `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id',
-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8',
-- `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数',
-- `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数',
-- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数',
-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数',
-- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数',
-- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数',
-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数',
-- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数',
-- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,',
-- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,',
-- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数',
-- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数',
-- `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数',
-- `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数',
-- `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0',
-- `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0',
-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14',
-- `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
-- `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致',
-- `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
-- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
-- PRIMARY KEY (`ID`) USING BTREE
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计';
--
-- SET FOREIGN_KEY_CHECKS = 1;
# 小组成员添加是否是党员
ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily`
ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`;
# 项目主表添加结案项目是否满意
ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily`
ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`;
# 添加治理能力按日统计表
CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` (
`ID` varchar(64) NOT NULL COMMENT 'ID 主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id',
`YEAR_ID` varchar(32) NOT NULL COMMENT '年Id',
`MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id',
`DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd',
`ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid',
`ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id',
`PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id',
`ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称',
`RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率',
`RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率',
`GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率',
`SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按日统计)';

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml

@ -2,6 +2,15 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao">
<!-- 批量删除 -->
<delete id="deleteBatchByCustomerIdAndDateId" parameterType="map">
DELETE
FROM
fact_grid_govern_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID = #{dateId}
LIMIT #{limit}
</delete>
</mapper>

32
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -311,4 +311,36 @@
AND DATE_ID &lt;= #{dateId}
GROUP BY GRID_ID
</select>
<!-- 3、当前网格内,议题关闭已解决数 4、当前网格内,议题关闭无需解决数 -->
<select id="selectGroupByGridId" parameterType="map" resultType="com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO">
SELECT
m.CUSTOMER_ID AS customerId,
m.GRID_ID AS gridId,
count( 1 ) AS total
FROM
fact_origin_issue_main_daily m
WHERE
m.DEL_FLAG = '0'
AND m.GRID_ID IS NOT NULL
<if test='null != customerId and "" != customerId'>
AND m.CUSTOMER_ID = #{customerId}
</if>
<if test='null != issueStatus and "" != issueStatus'>
AND m.ISSUE_STATUS LIKE concat(#{issueStatus},'%')
</if>
<if test='null != resolveType and "" != resolveType'>
AND m.RESOLVE_TYPE = #{resolveType}
</if>
<if test="gridIds != null and gridIds.size() > 0">
AND m.GRID_ID in
<foreach item="gridId" collection="gridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
</if>
GROUP BY
m.CUSTOMER_ID,
m.GRID_ID
</select>
</mapper>

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -914,4 +914,37 @@
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<!-- 5、当前网格内:来源于议题的项目:结案已解决数、6、当前网格内:来源于议题的项目:结案无需解决数、7、当前网格内:项目立项,结案已解决数;默认为0、8、当前网格内:项目立项,结案无需解决数;默认为0、 -->
<select id="selectGroupByGrid" parameterType="map" resultType="com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO">
SELECT
m.CUSTOMER_ID AS customerId,
m.GRID_ID AS gridId,
count( 1 ) AS total
FROM
fact_origin_project_main_daily m
WHERE
m.DEL_FLAG = '0'
<if test='null != customerId and "" != customerId'>
AND m.CUSTOMER_ID = #{customerId}
</if>
<if test='null != origin and "" != origin'>
AND m.ORIGIN = #{origin}
</if>
<if test='null != projectStatus and "" != projectStatus'>
AND m.PROJECT_STATUS = #{projectStatus}
</if>
<if test='null != isResolved and "" != isResolved'>
AND m.IS_RESOLVED = #{isResolved}
</if>
<if test="gridIds != null and gridIds.size() > 0">
AND m.GRID_ID in
<foreach item="gridId" collection="gridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
</if>
GROUP BY
m.CUSTOMER_ID,
m.GRID_ID
</select>
</mapper>

31
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -197,4 +197,35 @@
AND DATE_ID &lt;= #{dateId}
GROUP BY GRID_ID
</select>
<select id="selectTopicGroupByGridId" parameterType="map" resultType="com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO">
SELECT
m.CUSTOMER_ID as customerId,
m.GRID_ID AS gridId,
count( 1 ) AS total
FROM
fact_origin_topic_main_daily m
WHERE
m.DEL_FLAG = '0'
<if test='null != customerId and "" != customerId'>
AND m.CUSTOMER_ID = #{customerId}
</if>
<if test='null != topicStatus and "" != topicStatus'>
AND m.TOPIC_STATUS = #{topicStatus}
</if>
<if test='null != closedStatus and "" != closedStatus'>
AND m.CLOSED_STATUS = #{closedStatus}
</if>
<if test="gridIds != null and gridIds.size() > 0">
AND m.GRID_ID in
<foreach item="gridId" collection="gridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
</if>
<if test='null != shiftIssue and "" != shiftIssue'>
and m.SHIFT_ISSUE=#{shiftIssue}
</if>
GROUP BY
m.CUSTOMER_ID,m.GRID_ID
</select>
</mapper>

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -181,6 +181,7 @@ public interface ProjectConstant {
String THREE_MONTH = "threeMonth";
String SIX_MONTH = "sixMonth";
String TWELVE_MONTH = "twelveMonth";
String YESTERDAY = "yesterday";
/**
* 排序

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java

@ -215,8 +215,7 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
* @date 2021/5/18 2:28 下午
*/
public Integer getDateId(String dateType){
String beforeNDay = DateUtils.getBeforeNDay(NumConstant.ONE);
Integer result = Integer.valueOf(beforeNDay);
Integer result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE));
switch (dateType) {
case ProjectConstant.THREE_MONTH:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.NINETY));
@ -227,6 +226,9 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl<Pr
case ProjectConstant.TWELVE_MONTH:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE));
break;
case ProjectConstant.YESTERDAY:
result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE));
break;
default:
}
return result;

1
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql

@ -0,0 +1 @@
INSERT INTO `customer_project_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1007', 'default', 'satisfaction', '项目满意指标', '75', '评分小于当前分的为不满意', '0', 1, '1', '2020-10-26 10:57:41', '1', '2020-10-26 10:57:45');
Loading…
Cancel
Save