|
|
@@ -1,6 +1,7 @@
|
|
|
package com.kym.service.miniapp.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
@@ -86,7 +87,7 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public PageBean<StationStatVo> stationStat(StatQueryParam params) {
|
|
|
+ public JSONObject stationStat(StatQueryParam params) {
|
|
|
// 判断数据权限
|
|
|
params.setStationId(kymCache.getAdminUserStationId(StpUtil.getLoginIdAsLong()));
|
|
|
PageHelper.startPage(params.getPageNum(), params.getPageSize());
|
|
|
@@ -94,7 +95,9 @@ public class ChargeOrderServiceImpl extends ServiceImpl<ChargeOrderMapper, Charg
|
|
|
item.setElecMoneyPercent((new BigDecimal(item.getElecMoney())).divide(new BigDecimal(Math.max(1, item.getTotalMoney())), 2, RoundingMode.HALF_UP));
|
|
|
item.setServiceMoneyPercent(BigDecimal.ONE.subtract(item.getElecMoneyPercent()));
|
|
|
}).collect(Collectors.toList());
|
|
|
- return new PageBean<>(res);
|
|
|
+ return JSONObject.parseObject(JSONObject.toJSONString(new PageBean<>(res)))
|
|
|
+ .fluentPut("totalPower", res.stream().mapToDouble(StationStatVo::getTotalPower).sum())
|
|
|
+ .fluentPut("serviceMoney", res.stream().mapToInt(StationStatVo::getServiceMoney).sum());
|
|
|
}
|
|
|
|
|
|
/**
|