mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
同一日数据统计自动扩展为当天的0点~23点59分59秒:1、账户总额趋势;2、管理端分析页账户数量/组织数量/账户资金;
This commit is contained in:
+3
@@ -7,6 +7,7 @@ import lombok.Data;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用统计 ReqVO
|
* 通用统计 ReqVO
|
||||||
@@ -19,6 +20,8 @@ public class CommonStatisticsReqVO {
|
|||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate[] createTime;
|
private LocalDate[] createTime;
|
||||||
|
|
||||||
|
private LocalDateTime[] createTimeForQry = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计维度单位
|
* 统计维度单位
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -118,7 +118,7 @@ public class StatisticsChangeUtils {
|
|||||||
Integer unit = reqVO.getUnit();
|
Integer unit = reqVO.getUnit();
|
||||||
// 计算时间跨度
|
// 计算时间跨度
|
||||||
getTimeSpan(reqVO);
|
getTimeSpan(reqVO);
|
||||||
// 计算后的开始和结束时间
|
// 计算后的开始和结束时间
|
||||||
LocalDate startDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
|
LocalDate startDate = ObjectUtil.clone(reqVO.getCreateTime()[0]);
|
||||||
LocalDate endDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
|
LocalDate endDate = ObjectUtil.clone(reqVO.getCreateTime()[1]);
|
||||||
|
|
||||||
|
|||||||
+2
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.service.funds.organamount;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.ManageAmountOverviewRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.ManageAmountOverviewRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO;
|
||||||
@@ -106,6 +107,7 @@ public class OrganAmountServiceImpl implements OrganAmountService {
|
|||||||
List<Map<String, Object>> series = new ArrayList<>();
|
List<Map<String, Object>> series = new ArrayList<>();
|
||||||
Map<String, Object> orgAmountSeriesItem = new HashMap<>();
|
Map<String, Object> orgAmountSeriesItem = new HashMap<>();
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 查询组织收支趋势统计
|
// 查询组织收支趋势统计
|
||||||
Map<String, List<OrganAmountGroupByCreateTimeRespVO>> organIncomeExpenseGroupByCreateTimeRespMap = incomeExpenseDetailsMapper.selectOrganIncomeExpenseTrendGroupByCreateTime(reqVO, queryOrg ? organId : null).stream()
|
Map<String, List<OrganAmountGroupByCreateTimeRespVO>> organIncomeExpenseGroupByCreateTimeRespMap = incomeExpenseDetailsMapper.selectOrganIncomeExpenseTrendGroupByCreateTime(reqVO, queryOrg ? organId : null).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
|
|||||||
+2
@@ -1,5 +1,6 @@
|
|||||||
package com.cf.imes.module.system.service.funds.statistics;
|
package com.cf.imes.module.system.service.funds.statistics;
|
||||||
|
|
||||||
|
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||||
import com.cf.imes.framework.common.util.i18n.core.util.I18nUtils;
|
import com.cf.imes.framework.common.util.i18n.core.util.I18nUtils;
|
||||||
import com.cf.imes.module.system.controller.admin.statistics.vo.OrgStatusGroupStatisticsReqVO;
|
import com.cf.imes.module.system.controller.admin.statistics.vo.OrgStatusGroupStatisticsReqVO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO;
|
import com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO;
|
||||||
@@ -42,6 +43,7 @@ public class FundsStatisticsServiceImpl implements FundsStatisticsService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 销售额Map
|
// 销售额Map
|
||||||
LinkedHashMap<String, List<FundsTradeTypeGroupStatisticsDO>> purchaseMap = incomeExpenseDetailsMapper.selectTotalSalesTrendGroupByCreateTime(reqVO).stream()
|
LinkedHashMap<String, List<FundsTradeTypeGroupStatisticsDO>> purchaseMap = incomeExpenseDetailsMapper.selectTotalSalesTrendGroupByCreateTime(reqVO).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
|
|||||||
+1
@@ -753,6 +753,7 @@ public class OrganServiceImpl implements OrganService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 组织有效数量
|
// 组织有效数量
|
||||||
Map<String, List<OrgStatisticsIsLapseRespDTO>> orderNotLapseRespMap = organMapper.selectOrgCountAddByOrderDate(reqVO).stream()
|
Map<String, List<OrgStatisticsIsLapseRespDTO>> orderNotLapseRespMap = organMapper.selectOrgCountAddByOrderDate(reqVO).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
|
|||||||
+2
@@ -12,6 +12,7 @@ import com.cf.imes.framework.common.enums.UserTypeEnum;
|
|||||||
import com.cf.imes.framework.common.exception.ServiceException;
|
import com.cf.imes.framework.common.exception.ServiceException;
|
||||||
import com.cf.imes.framework.common.pojo.PageResult;
|
import com.cf.imes.framework.common.pojo.PageResult;
|
||||||
import com.cf.imes.framework.common.util.collection.CollectionUtils;
|
import com.cf.imes.framework.common.util.collection.CollectionUtils;
|
||||||
|
import com.cf.imes.framework.common.util.date.LocalDateTimeUtils;
|
||||||
import com.cf.imes.framework.common.util.i18n.core.util.I18nUtils;
|
import com.cf.imes.framework.common.util.i18n.core.util.I18nUtils;
|
||||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||||
import com.cf.imes.framework.common.util.monitor.TracerUtils;
|
import com.cf.imes.framework.common.util.monitor.TracerUtils;
|
||||||
@@ -876,6 +877,7 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
|
|
||||||
|
reqVO.setCreateTimeForQry(LocalDateTimeUtils.generateTimeSection(reqVO.getCreateTime()));
|
||||||
// 新增数量Map
|
// 新增数量Map
|
||||||
LinkedHashMap<String, List<UserStatusGroupStatisticsDO>> userAddMap = userMapper.selectUserStatusGroupStatistics(reqVO, false).stream()
|
LinkedHashMap<String, List<UserStatusGroupStatisticsDO>> userAddMap = userMapper.selectUserStatusGroupStatistics(reqVO, false).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@
|
|||||||
select COALESCE(sum(amount) ,0) as amount
|
select COALESCE(sum(amount) ,0) as amount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from income_expense_details
|
from income_expense_details
|
||||||
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
<if test="organId != null">
|
<if test="organId != null">
|
||||||
and organ_id = #{organId}
|
and organ_id = #{organId}
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
select COALESCE(sum(amount) ,0) as amount
|
select COALESCE(sum(amount) ,0) as amount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from income_expense_details
|
from income_expense_details
|
||||||
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and deleted = false
|
and deleted = false
|
||||||
GROUP BY date
|
GROUP BY date
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@
|
|||||||
select count(o.id) as orgCount
|
select count(o.id) as orgCount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from system_organization o
|
from system_organization o
|
||||||
where o.update_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where o.update_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and o.deleted = 1
|
and o.deleted = 1
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
select count(o.id) as orgCount
|
select count(o.id) as orgCount
|
||||||
<include refid="dateCreate"/>
|
<include refid="dateCreate"/>
|
||||||
from system_organization o
|
from system_organization o
|
||||||
where o.create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where o.create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
and o.deleted = 0
|
and o.deleted = 0
|
||||||
group by date;
|
group by date;
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
+2
-2
@@ -97,10 +97,10 @@
|
|||||||
from system_users o
|
from system_users o
|
||||||
where
|
where
|
||||||
<if test="deleted">
|
<if test="deleted">
|
||||||
o.update_time between #{req.createTime[0]} and #{req.createTime[1]}
|
o.update_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="!deleted">
|
<if test="!deleted">
|
||||||
o.create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
o.create_time between #{req.createTimeForQry[0]} and #{req.createTimeForQry[1]}
|
||||||
</if>
|
</if>
|
||||||
and o.deleted = #{deleted}
|
and o.deleted = #{deleted}
|
||||||
group by date;
|
group by date;
|
||||||
|
|||||||
Reference in New Issue
Block a user