Browse Source

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

master
zhangyongzhangyong 5 years ago
parent
commit
782c93499e
  1. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  2. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  3. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/KcVolunteerHeartRankFormDTO.java
  4. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java
  5. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyEntity.java
  6. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyDao.xml

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -66,10 +66,10 @@
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT SELECT
org_name AS `NAME`, org_name AS `NAME`,
index_total AS totalIndex, ROUND(index_total, 2) AS totalIndex,
govern_ablity AS governAbility, ROUND(govern_ablity, 2) AS governAbility,
party_dev_ablity AS partyDevAbility, ROUND(party_dev_ablity, 2) AS partyDevAbility,
service_ablity AS serviceAbility, ROUND(service_ablity, 2) AS serviceAbility,
ORG_ID orgId ORG_ID orgId
FROM FROM
screen_index_data_monthly screen_index_data_monthly

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -24,10 +24,10 @@
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT SELECT
org_name AS `NAME`, org_name AS `NAME`,
index_total AS totalIndex, ROUND(index_total, 2) AS totalIndex,
govern_ablity AS governAbility, ROUND(govern_ablity, 2) AS governAbility,
party_dev_ablity AS partyDevAbility, ROUND(party_dev_ablity, 2) AS partyDevAbility,
service_ablity AS serviceAbility, ROUND(service_ablity, 2) AS serviceAbility,
ORG_ID orgId ORG_ID orgId
FROM FROM
screen_index_data_yearly screen_index_data_yearly

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

@ -49,4 +49,14 @@ public class KcVolunteerHeartRankFormDTO implements Serializable {
* 爱心时长 单位分钟 * 爱心时长 单位分钟
*/ */
private Integer heartTime; private Integer heartTime;
/**
* 积分09-11新增
*/
private Integer points;
/**
* 志愿者id 09-11新增
*/
private String volunteerId;
} }

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

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PreDestroy;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -57,6 +58,15 @@ public class IndexCalculateController {
private Map<String, Future> futureMap = new HashMap<>(); private Map<String, Future> futureMap = new HashMap<>();
@PreDestroy
public void clearDataCalFlag() {
// 实例销毁之前,将正在本实例中执行计算的客户列表的计算状态清空
futureMap.forEach((customerId, future) -> {
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
});
}
/** /**
* 按照客户计算所有指标(按照月份) * 按照客户计算所有指标(按照月份)
* *
@ -69,6 +79,7 @@ public class IndexCalculateController {
@PostMapping("all") @PostMapping("all")
public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { public Result<Boolean> indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) {
String customerId = externalAppRequestParam.getCustomerId(); String customerId = externalAppRequestParam.getCustomerId();
//String customerId = "epmettest";
Boolean executing = (Boolean) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId)); Boolean executing = (Boolean) redisUtils.get(RedisKeys.getCustomerStatsCalFlag(customerId));
if (executing == null || !executing) { if (executing == null || !executing) {
synchronized (statsCalLock) { synchronized (statsCalLock) {
@ -84,7 +95,7 @@ public class IndexCalculateController {
if (aBoolean) { if (aBoolean) {
log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); log.error("客户Id:{},全部指标计算完成,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000);
} }
redisUtils.set(RedisKeys.getCustomerStatsCalFlag(customerId), false); redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
futureMap.remove(customerId); futureMap.remove(customerId);
}); });
futureMap.put(customerId, future); futureMap.put(customerId, future);
@ -104,6 +115,7 @@ public class IndexCalculateController {
* @param form * @param form
* @return * @return
*/ */
@ExternalAppRequestAuth
@PostMapping("stopcalculate") @PostMapping("stopcalculate")
public Result stopcalculate(@RequestBody CalculateCommonFormDTO form) { public Result stopcalculate(@RequestBody CalculateCommonFormDTO form) {
ValidatorUtils.validateEntity(form); ValidatorUtils.validateEntity(form);
@ -112,6 +124,9 @@ public class IndexCalculateController {
Future future = this.futureMap.get(customerId); Future future = this.futureMap.get(customerId);
if (future != null && !future.isCancelled()) { if (future != null && !future.isCancelled()) {
future.cancel(true); future.cancel(true);
redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(customerId));
futureMap.remove(customerId);
HttpClientManager.getInstance().sendAlarmMsg(String.format("数据统计服务-中止计算成功,customerId:%s", customerId));
} }
return new Result(); return new Result();
} }

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenKcVolunteerHeatRankGridDailyEntity.java

@ -83,4 +83,13 @@ public class ScreenKcVolunteerHeatRankGridDailyEntity extends BaseEpmetEntity {
*/ */
private Integer heartTime; private Integer heartTime;
/**
* 积分09-11新增
*/
private Integer points;
/**
* 志愿者id 09-11新增
*/
private String volunteerId;
} }

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

@ -14,6 +14,8 @@
<result property="userId" column="USER_ID"/> <result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/> <result property="userName" column="USER_NAME"/>
<result property="heartTime" column="HEART_TIME"/> <result property="heartTime" column="HEART_TIME"/>
<result property="points" column="POINTS"/>
<result property="volunteerId" column="VOLUNTEER_ID"/>
<result property="delFlag" column="DEL_FLAG"/> <result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/> <result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/> <result property="createdBy" column="CREATED_BY"/>
@ -42,6 +44,8 @@
USER_ID, USER_ID,
USER_NAME, USER_NAME,
HEART_TIME, HEART_TIME,
POINTS,
VOLUNTEER_ID,
DEL_FLAG, DEL_FLAG,
REVISION, REVISION,
@ -62,6 +66,8 @@
#{item.userId}, #{item.userId},
#{item.userName}, #{item.userName},
#{item.heartTime}, #{item.heartTime},
#{item.points},
#{item.volunteerId},
0, 0,
0, 0,
'APP_USER', 'APP_USER',

Loading…
Cancel
Save