1.财务中心和数据中心收入明细不匹配修复

This commit is contained in:
张松
2025-01-06 19:27:18 +08:00
parent 73bd738c8b
commit 589fba42b9
4 changed files with 20 additions and 4 deletions

View File

@@ -273,9 +273,9 @@ public class CashController {
@ApiOperation("收入统计")
@GetMapping("/statisticsIncomeMoney")
public Result statisticsIncomeMoney(String time, Integer flag) {
Double sumMoney = ordersService.statisticsIncomeMoney(time, flag, null);
Double courseMoney = ordersService.statisticsIncomeMoney(time, flag, 1);
Double vipMoney = ordersService.statisticsIncomeMoney(time, flag, 2);
Double sumMoney = payDetailsService.statisticsIncomeMoney(time, flag, null);
Double courseMoney = payDetailsService.statisticsIncomeMoney(time, flag, 1);
Double vipMoney = payDetailsService.statisticsIncomeMoney(time, flag, 2);
Map<String, Object> map = new HashMap<>();
map.put("sumMoney", sumMoney == null ? 0.00 : sumMoney);
map.put("courseMoney", courseMoney == null ? 0.00 : courseMoney);

View File

@@ -20,4 +20,5 @@ public interface PayDetailsService {
Double instantselectSumPay(String date, Long userId);
Double statisticsIncomeMoney(String time, Integer flag, Integer ordersType);
}

View File

@@ -83,5 +83,8 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
return payDetailsDao.instantselectSumPay(date, userId);
}
@Override
public Double statisticsIncomeMoney(String time, Integer flag, Integer ordersType) {
return baseMapper.statisticsIncomeMoney(time, flag, ordersType);
}
}

View File

@@ -162,6 +162,18 @@
select count(*) from pay_details
where `state`=1 and user_id=#{userId}
</select>
<select id="statisticsIncomeMoney" resultType="java.lang.Double">
select sum(money) from pay_details where state=1
<if test="flag!=null and flag==1">
and date_format(create_time,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_time,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_time,'%Y')=date_format(#{time},'%Y')
</if>
</select>
</mapper>