Browse Source

孔村-首页-平台各类总数

dev_shibei_match
sunyuchao 5 years ago
parent
commit
80c0e6c2d2
  1. 71
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SummaryResultDTO.java
  2. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java
  3. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java
  4. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java
  5. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java
  6. 24
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml

71
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SummaryResultDTO.java

@ -0,0 +1,71 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 首页-平台各类总数
* @Author sun
*/
@Data
public class SummaryResultDTO implements Serializable {
private static final long serialVersionUID = 3860268744336541373L;
/**
* 数据更新至yyyyMMdd
*/
private String dateId = "";
/**
* 网格总数
*/
private Integer gridCount = 0;
/**
* 已开通网格数
*/
private Integer openedGridCount = 0;
/**
* 议题总数
*/
private Integer issueCount = 0;
/**
* 项目总数
*/
private Integer projectCount = 0;
/**
* 用户总数
*/
private Integer userCount = 0;
/**
* 党员用户
*/
private Integer partyUserCount = 0;
/**
* 社群总数
*/
private Integer groupCount = 0;
/**
* 话题总数
*/
private Integer topicCount = 0;
/**
* 新闻总数
*/
private Integer newsCount = 0;
/**
* 阅读数量
*/
private Integer readCount = 0;
/**
* 公益活动总数
*/
private Integer actCount = 0;
/**
* 志愿者总数
*/
private Integer volunteerCount = 0;
}

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/KcScreenController.java

@ -1,7 +1,12 @@
package com.epmet.datareport.controller.screen; package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.evaluationindex.screen.dto.result.SummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
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;
@ -19,12 +24,15 @@ public class KcScreenController {
private KcScreenService kcScreenService; private KcScreenService kcScreenService;
// @ExternalAppRequestAuth /**
// @PostMapping("homepage/summary") * @param externalAppRequestParam
// public Result<YearAverageIndexResultDTO> yearAverageIndex(){ * @Description 首页-平台各类总数
//// ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); * @author sun
//// return new Result<YearAverageIndexResultDTO>().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); */
// } @ExternalAppRequestAuth
@PostMapping("homepage/summary")
public Result<SummaryResultDTO> summary(ExternalAppRequestParam externalAppRequestParam){
return new Result<SummaryResultDTO>().ok(kcScreenService.summary(externalAppRequestParam));
}
// @RequestBody
} }

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenkc/ScreenKcPlatformSummaryDailyDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screenkc; package com.epmet.datareport.dao.evaluationindex.screenkc;
import com.epmet.evaluationindex.screen.dto.result.SummaryResultDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
/** /**
@ -28,4 +29,10 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ScreenKcPlatformSummaryDailyDao { public interface ScreenKcPlatformSummaryDailyDao {
/**
* @param customerId
* @Description 首页-平台各类总数
* @author sun
*/
SummaryResultDTO selectSummaryDaily(String customerId);
} }

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/KcScreenService.java

@ -1,5 +1,8 @@
package com.epmet.datareport.service.evaluationindex.screen; package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.evaluationindex.screen.dto.result.SummaryResultDTO;
/** /**
* 孔村大屏api * 孔村大屏api
* *
@ -8,5 +11,11 @@ package com.epmet.datareport.service.evaluationindex.screen;
*/ */
public interface KcScreenService { public interface KcScreenService {
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
SummaryResultDTO summary(ExternalAppRequestParam externalAppRequestParam);
} }

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/KcScreenServiceImpl.java

@ -1,9 +1,12 @@
package com.epmet.datareport.service.evaluationindex.screen.impl; package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.extappauth.bean.ExternalAppRequestParam;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao;
import com.epmet.datareport.service.evaluationindex.screen.KcScreenService; import com.epmet.datareport.service.evaluationindex.screen.KcScreenService;
import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.DateUtils;
import com.epmet.evaluationindex.screen.dto.result.SummaryResultDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -19,6 +22,17 @@ public class KcScreenServiceImpl implements KcScreenService {
@Autowired @Autowired
private DateUtils dateUtils; private DateUtils dateUtils;
@Autowired
private ScreenKcPlatformSummaryDailyDao screenKcPlatformSummaryDailyDao;
/**
* @param externalAppRequestParam
* @Description 首页-平台各类总数
* @author sun
*/
@Override
public SummaryResultDTO summary(ExternalAppRequestParam externalAppRequestParam) {
return screenKcPlatformSummaryDailyDao.selectSummaryDaily(externalAppRequestParam.getCustomerId());
}
} }

24
epmet-module/data-report/data-report-server/src/main/resources/mapper/screenkc/ScreenKcPlatformSummaryDailyDao.xml

@ -3,5 +3,29 @@
<mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao"> <mapper namespace="com.epmet.datareport.dao.evaluationindex.screenkc.ScreenKcPlatformSummaryDailyDao">
<select id="selectSummaryDaily" resultType="com.epmet.evaluationindex.screen.dto.result.SummaryResultDTO">
SELECT
date_id AS "dateId",
grid_count AS "gridCount",
opened_grid_count AS "openedGridCount",
issue_count AS "issueCount",
project_count AS "projectCount",
user_count AS "userCount",
party_user_count AS "partyUserCount",
group_count AS "groupCount",
topic_count AS "topicCount",
news_count AS "newsCount",
read_count AS "readCount",
act_count AS "actCount",
volunteer_count AS "volunteerCount"
FROM
screen_kc_platform_summary_daily
WHERE
del_flag = '0'
AND customer_id = #{customerId}
ORDER BY
date_id DESC
LIMIT 1
</select>
</mapper> </mapper>

Loading…
Cancel
Save