|
|
@ -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 |
|
|
|