|
@@ -1,5 +1,6 @@
|
|
|
package com.book.server.service.impl;
|
|
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.util.Date;
|
|
|
|
|
|
import com.book.dao.VO.SunVO;
|
|
@@ -760,13 +761,18 @@ public class SunDataServiceImpl implements SunDataService {
|
|
|
public Map getIncomeByDay(int page, int size) {
|
|
|
HashMap<String, Object> resMap = new HashMap<>();
|
|
|
SunStaticIncomeExample example = SunStaticIncomeExample.newAndCreateCriteria().example();
|
|
|
- //总共多少条
|
|
|
+ // 总共多少条
|
|
|
long l = sunStaticIncomeMapper.countByExample(example);
|
|
|
resMap.put("total", l);
|
|
|
// 排序查询指定页
|
|
|
example.orderBy(SunStaticIncome.Column.staticDate.desc());
|
|
|
example.page(page, size);
|
|
|
List<SunStaticIncome> sunStaticIncomes = sunStaticIncomeMapper.selectByExample(example);
|
|
|
+ //保留小数点
|
|
|
+ //for (SunStaticIncome sunStaticIncome : sunStaticIncomes) {
|
|
|
+ // DecimalFormat df = new DecimalFormat("#.00");//此为保留2位小数
|
|
|
+ // sunStaticIncome.setAllRecharge(df.format(sunStaticIncome.getAllRecharge()));
|
|
|
+ //}
|
|
|
|
|
|
//查询另一张表对应的前 60 天的数据
|
|
|
List<String> collect = sunStaticIncomes.stream().map(SunStaticIncome::getStaticDate).collect(Collectors.toList());
|
|
@@ -828,6 +834,11 @@ public class SunDataServiceImpl implements SunDataService {
|
|
|
return i > 0;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<SunChannel> getAllChannel() {
|
|
|
+ return sunChannelMapper.selectByExample(SunChannelExample.newAndCreateCriteria().example());
|
|
|
+ }
|
|
|
+
|
|
|
private SunStaticUserDay getSunUserByDate(String startDate, String endDate) {
|
|
|
int i = sun2Mapper.selectCountUserByDay(startDate, endDate);
|
|
|
if (i <= 0) {
|