mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
新增管理端消费趋势接口
This commit is contained in:
+7
-1
@@ -49,6 +49,12 @@ public class OrganAmountController {
|
|||||||
@GetMapping("/statistics/consumptionTrend")
|
@GetMapping("/statistics/consumptionTrend")
|
||||||
@Operation(summary = "获取组织消费趋势")
|
@Operation(summary = "获取组织消费趋势")
|
||||||
public CommonResult<Map<String, Object>> getOrganConsumptionTrend(@Valid OrganFundsStatisticsReqVO reqVO) {
|
public CommonResult<Map<String, Object>> getOrganConsumptionTrend(@Valid OrganFundsStatisticsReqVO reqVO) {
|
||||||
return success(organAmountService.getOrganConsumptionTrend(reqVO));
|
return success(organAmountService.getConsumptionTrend(reqVO, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/manage/statistics/consumptionTrend")
|
||||||
|
@Operation(summary = "获取管理端消费趋势")
|
||||||
|
public CommonResult<Map<String, Object>> getManageConsumptionTrend(@Valid OrganFundsStatisticsReqVO reqVO) {
|
||||||
|
return success(organAmountService.getConsumptionTrend(reqVO, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,5 @@
|
|||||||
package com.cf.imes.module.system.service.funds.organamount;
|
package com.cf.imes.module.system.service.funds.organamount;
|
||||||
|
|
||||||
|
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.AllOrganAmountRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.AllOrganAmountRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountRespVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganFundsStatisticsReqVO;
|
import com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganFundsStatisticsReqVO;
|
||||||
@@ -64,9 +63,11 @@ public interface OrganAmountService {
|
|||||||
AllOrganAmountRespVO getOrganAmountAll();
|
AllOrganAmountRespVO getOrganAmountAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取组织消费趋势
|
* 获取消费趋势
|
||||||
*
|
*
|
||||||
|
* @param reqVO
|
||||||
|
* @param queryOrg 是否查询单个组织下
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Object> getOrganConsumptionTrend(OrganFundsStatisticsReqVO reqVO);
|
Map<String, Object> getConsumptionTrend(OrganFundsStatisticsReqVO reqVO, boolean queryOrg);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -222,7 +222,7 @@ public class OrganAmountServiceImpl implements OrganAmountService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getOrganConsumptionTrend(OrganFundsStatisticsReqVO reqVO) {
|
public Map<String, Object> getConsumptionTrend(OrganFundsStatisticsReqVO reqVO, boolean queryOrg) {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
// 所有的日期集合
|
// 所有的日期集合
|
||||||
List<String> dateList = getDateList(reqVO);
|
List<String> dateList = getDateList(reqVO);
|
||||||
@@ -232,7 +232,7 @@ public class OrganAmountServiceImpl implements OrganAmountService {
|
|||||||
Map<String, Object> orgAmountSeriesItem = new HashMap<>();
|
Map<String, Object> orgAmountSeriesItem = new HashMap<>();
|
||||||
|
|
||||||
// 查询组织收支趋势统计
|
// 查询组织收支趋势统计
|
||||||
Map<String, List<OrganAmountGroupByCreateTimeRespVO>> organIncomeExpenseGroupByCreateTimeRespMap = organAmountMapper.selectOrganIncomeExpenseTrendGroupByCreateTime(reqVO, organId).stream()
|
Map<String, List<OrganAmountGroupByCreateTimeRespVO>> organIncomeExpenseGroupByCreateTimeRespMap = organAmountMapper.selectOrganIncomeExpenseTrendGroupByCreateTime(reqVO, queryOrg ? organId : null).stream()
|
||||||
.sorted(Comparator.naturalOrder())
|
.sorted(Comparator.naturalOrder())
|
||||||
.collect(Collectors.groupingBy(OrganAmountGroupByCreateTimeRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(OrganAmountGroupByCreateTimeRespVO::getDate, LinkedHashMap::new, Collectors.toList()));
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -22,8 +22,11 @@
|
|||||||
select sum(cash_amount_change) as amount
|
select sum(cash_amount_change) as amount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from income_expense_details
|
from income_expense_details
|
||||||
where organ_id = #{organId}
|
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
||||||
and create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
<if test="organId != null">
|
||||||
|
and organ_id = #{organId}
|
||||||
|
</if>
|
||||||
GROUP BY date
|
GROUP BY date
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user