Browse Source

大屏接口修改

dev_shibei_match
wangchao 5 years ago
parent
commit
6bc0ab51e1
  1. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java
  2. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java
  3. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java
  4. 50
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java
  5. 1
      epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml
  6. 9
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  7. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml
  8. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml
  9. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  10. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

9
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 治理能力查询结果dto
@ -22,20 +23,20 @@ public class GovernCapacityResultDTO implements Serializable {
/**
* 响应率
* */
private Integer responseRatio;
private BigDecimal responseRatio;
/**
* 解决率
* */
private Integer resolvedRatio;
private BigDecimal resolvedRatio;
/**
* 自治率
* */
private Integer governRatio;
private BigDecimal governRatio;
/**
* 满意率
* */
private Integer satisfactionRatio;
private BigDecimal satisfactionRatio;
}

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java

@ -3,7 +3,6 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao;
import com.epmet.datareport.service.screen.GrassrootsPartyDevService;
import com.epmet.screen.dto.form.BranchBuildRankFormDTO;
import com.epmet.screen.dto.form.BranchBuildTrendFormDTO;

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java

@ -144,10 +144,10 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
orderList.forEach(o -> {
GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO();
rank.setAgencyName(o.getAgencyName());
rank.setGovernRatio(convertPercentStr(new BigDecimal(o.getGovernRatio())));
rank.setResolvedRatio(convertPercentStr(new BigDecimal(o.getResolvedRatio())));
rank.setResponseRatio(convertPercentStr(new BigDecimal(o.getResponseRatio())));
rank.setSatisfactionRatio(convertPercentStr(new BigDecimal(o.getSatisfactionRatio())));
rank.setGovernRatio(convertPercentStr(o.getGovernRatio(),NumConstant.ONE));
rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE));
rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE));
rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE));
result.add(rank);
});
return result;

50
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java

@ -63,7 +63,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{
result.setPercentInPlatForm(convertPercentStr(new BigDecimal(result.getPartyMemberTotal()/result.getPlatFormTotal())));
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue()))));
}
return result;
}
@ -124,7 +124,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
List<Integer> numArray = new LinkedList<>();
BranchTrendSeriesDataResultDTO data = new BranchTrendSeriesDataResultDTO();
data.setName(issue);
if(null != issueYearlyDataList && issueYearlyDataList.isEmpty()){
if(null != issueYearlyDataList && !issueYearlyDataList.isEmpty()){
monthMap.keySet().forEach( monthId ->{
Optional<BranchIssueDataResultDTO> optional
= issueYearlyDataList.stream().filter(yearly -> StringUtils.equals(monthId,yearly.getMonthId())).findAny();
@ -139,6 +139,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
numArray.add(NumConstant.ZERO);
}
}
data.setData(numArray);
dataArray.add(data);
});
}
@ -237,51 +238,6 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
}
public static void main(String[] args) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); // 设置为当前时间
calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月
String currentMonth = format.format(calendar.getTime());
Integer monthCounter = Integer.parseInt(currentMonth);
Map<String,String> monthMap = new HashMap<>();
int i = NumConstant.ONE;
while(i <= NumConstant.TWELVE){
if(monthCounter.toString().endsWith("00")){
monthCounter -= NumConstant.EIGHTY_EIGHT;
}
String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO);
if(abscissa.startsWith("0")) {
abscissa = abscissa.replace("0","").concat("月");
}else{
abscissa = abscissa.concat("月");
}
monthMap.put(monthCounter.toString(),abscissa);
monthCounter-- ;
i++;
}
Map<String, String> result = Maps.newLinkedHashMap();
monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey())
.forEachOrdered((e -> result.put(e.getKey(),e.getValue())));
result.forEach((k,v) -> {
System.out.print(k);
System.out.print(" -> ");
System.out.print(v);
System.out.println();
});
List<String> xLine = result.values().stream().collect(Collectors.toList());
xLine.forEach(x -> {
System.out.println(x);
});
result.keySet().forEach(key -> System.out.println(key));
}
/**
* @Description 得到上个月的monthId
* @param

1
epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml

@ -144,6 +144,7 @@
<logger name="com.epmet.datareport.dao.topic" level="DEBUG"/>
<logger name="com.epmet.datareport.dao.user" level="DEBUG"/>
<logger name="com.epmet.datareport.dao.voice" level="DEBUG"/>
<logger name="com.epmet.datareport.dao.screen" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>

9
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml

@ -22,12 +22,13 @@
AND eve.DEL_FLAG = '0'
WHERE
diff.DEL_FLAG = '0'
AND diff.ORG_TYPE = 'agencyId'
AND diff.ORG_TYPE = 'agency'
AND diff.ORG_ID = #{agencyId}
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME DESC
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT DESC
ELSE diss.EVENT_RE_ORG DESC END
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT
ELSE diff.EVENT_RE_ORG END
DESC
</select>
</mapper>

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

@ -6,7 +6,7 @@
<!-- 根据agencyTd、type(数据类别 party:支部建设;union:联合建设)查出共有多少议题主题 -->
<select id="selectIssueGroup" resultType="java.lang.String">
SELECT DISTINCT
ISSUE_CATEGORY_NAME
MEET_CATEGORY_NAME
FROM
screen_party_branch_data
WHERE
@ -20,7 +20,7 @@
<select id="selectBranchDataByTypeAndTimeZone" resultType="com.epmet.screen.dto.result.BranchIssueDataResultDTO">
SELECT
MONTH_ID,
ISSUE_CATEGORY_NAME AS issue,
MEET_CATEGORY_NAME AS issue,
CASE #{type} WHEN 'organize' THEN ORGANIZE_COUNT
WHEN 'joinuser' THEN JOIN_USER_COUNT
WHEN 'averagejoinuser' THEN AVERAGE_JOIN_USER_COUNT
@ -35,7 +35,7 @@
AND MONTH_ID <![CDATA[ >= ]]> #{bottomMonthId}
ORDER BY
MONTH_ID DESC ,
ISSUE_CATEGORY_NAME
MEET_CATEGORY_NAME
</select>
<!-- 查找指定组织的下级组织的党建联建数据排序 -->
@ -50,7 +50,7 @@
<where>
DEL_FLAG = '0'
AND ORG_TYPE = 'agency'
AND ORG_ID = #{agencyId}
AND PARENT_ID = #{agencyId}
AND TYPE = #{category}
<!-- 指定月的排行 -->
<if test='null != monthId and "" != monthId'>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml

@ -6,7 +6,7 @@
<!-- 查询指定机关所属网格的用户积分排名 -->
<select id="selectUserPointOrder" resultType="com.epmet.screen.dto.result.UserPointResultDTO">
SELECT
user_name AS name,
concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name,
point_total AS point
FROM
screen_party_user_rank_data
@ -24,7 +24,7 @@
<select id="selectPartymemberPointOrder" resultType="com.epmet.screen.dto.result.PartyUserPointResultDTO">
SELECT
USER_ID,
concat( SURNAME, '*' ) AS NAME,
concat( surname, CASE char_length( NAME ) WHEN 1 THEN '*' WHEN 2 THEN '**' ELSE '***' END ) AS name,
POINT_TOTAL AS point
FROM
screen_party_user_rank_data

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml

@ -7,7 +7,7 @@
<select id="selectUserJoinData" resultType="com.epmet.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO">
SELECT
JOIN_TOTAL AS total,
AVG_JOIN_USER AS averageJoin,
AVG_JOIN AS averageJoin,
JOIN_TOTAL_UP_RATE AS monthIncr,
JOIN_TOTAL_UP_FLAG AS monthTrend,
AVG_ISSUE AS averageIssue,

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -67,6 +67,6 @@
JOIN_USER_TOTAL desc,
TOPIC_TOTAL desc,
ISSUE_TOTAL desc,
PROJECT_TOTAL desc,
PROJECT_TOTAL desc
</select>
</mapper>
Loading…
Cancel
Save