Browse Source

Merge remote-tracking branch 'remotes/origin/dev_data_stats' into dev

master
jianjun 5 years ago
parent
commit
e127b23070
  1. 36
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml
  5. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java

@ -46,6 +46,8 @@ public class PublicityServiceImpl implements PublicityService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* @param tokenDto
* @Description 宣传能力工作端当前机关累计发文和当前发文
@ -66,16 +68,16 @@ public class PublicityServiceImpl implements PublicityService {
@Override
public List<FactTagViewedAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN);
Date dateFact = DateUtils.addDateDays( new Date(),-1);
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
if (StringUtils.equals("month", type)) {//当月
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7);
return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact);
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize);
} else if (StringUtils.equals("year", type)) {//当年
@ -94,16 +96,16 @@ public class PublicityServiceImpl implements PublicityService {
@Override
public List<FactTagUsedAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN);
Date dateFact = DateUtils.addDateDays( new Date(),-1);
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
if (StringUtils.equals("month", type)) {//当月
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7);
return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact);
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize);
} else if (StringUtils.equals("year", type)) {//当年
@ -122,8 +124,8 @@ public class PublicityServiceImpl implements PublicityService {
@Override
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
Date dateFact = DateUtils.addDateDays( new Date(),-1);
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
@ -131,7 +133,7 @@ public class PublicityServiceImpl implements PublicityService {
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact);
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年
@ -150,8 +152,8 @@ public class PublicityServiceImpl implements PublicityService {
@Override
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
Date dateFact = DateUtils.addDateDays( new Date(),-1);
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
@ -159,7 +161,7 @@ public class PublicityServiceImpl implements PublicityService {
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact);
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年
@ -178,8 +180,8 @@ public class PublicityServiceImpl implements PublicityService {
@Override
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD);
Date dateFact = DateUtils.addDateDays( new Date(),-1);
String strDate = DateUtils.format(dateFact, DateUtils.DATE_PATTERN_YYYYMMDD);
String yearId = strDate.substring(0, 4);
String monthId = strDate.substring(0, 6);
@ -187,7 +189,7 @@ public class PublicityServiceImpl implements PublicityService {
return publicityDao.getSubGridPublishedMonth(agencyId, monthId);
} else if (StringUtils.equals("quarter", type)) {//当季
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date);
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(dateFact);
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId);
} else if (StringUtils.equals("year", type)) {//当年

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

@ -154,7 +154,7 @@ public class StatsGroupServiceImpl implements StatsGroupService {
//机关下的所有网格(包括直属网格)
List<String> allGrid = this.getAllGrid(agencyId,customerId);
if (allGrid.size() != NumConstant.ZERO) {
// 1. 机关下有多少网格
// 1. 机关下有多少网格 (this.getAllGrid拿的是当前机关下所有网格,以下方法是根据“dateId”来拿的,两者过滤)
List<GridIdListByCustomerResultDTO> customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId);
AtomicReference<Integer> gridSize = new AtomicReference<>(NumConstant.ZERO);
if (customerGridIdList.size() != NumConstant.ZERO) {

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

@ -227,6 +227,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i);
if (agency.getId().equals(dto.getAgencyId())) {
monthly.setIssueIncr(dto.getIssueIncr());
monthly.setVotingIncr(dto.getVotingIncr());
monthly.setShiftProjectIncr(dto.getShiftProjectIncr());
monthly.setClosedIncr(dto.getClosedIncr());
monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr());
@ -430,6 +431,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i);
if (grid.getId().equals(dto.getGridId())) {
monthly.setIssueIncr(dto.getIssueIncr());
monthly.setVotingIncr(dto.getVotingIncr());
monthly.setShiftProjectIncr(dto.getShiftProjectIncr());
monthly.setClosedIncr(dto.getClosedIncr());
monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr());

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

@ -51,6 +51,7 @@
SELECT
da.ID AS "agencyId",
SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr",
SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr",
SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr",
SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr",
SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr",
@ -64,6 +65,7 @@
AND MONTH_ID = #{monthId}
WHERE
da.DEL_FLAG = '0'
AND da.AGENCY_DIM_TYPE= 'all'
AND da.CUSTOMER_ID = #{customerId}
GROUP BY
da.ID

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml

@ -57,6 +57,7 @@
dg.AGENCY_ID AS "agencyId",
dg.ID AS "gridId",
SUM(IFNULL(ISSUE_INCR, 0)) AS "issueIncr",
SUM(IFNULL(VOTING_INCR, 0)) AS "votingIncr",
SUM(IFNULL(SHIFT_PROJECT_INCR, 0)) AS "shiftProjectIncr",
SUM(IFNULL(CLOSED_INCR, 0)) AS "closedIncr",
SUM(IFNULL(CLOSED_RESOLVED_INCR, 0)) AS "closedResolvedIncr",

Loading…
Cancel
Save