课程报表汇总后台天医币去掉测试号

This commit is contained in:
wuchunlei
2025-11-13 17:22:10 +08:00
parent c3e4dd90df
commit 5a6261c206
7 changed files with 18 additions and 22 deletions

View File

@@ -14,4 +14,6 @@ public interface UserCourseBuyDao extends MPJBaseMapper<UserCourseBuyEntity> {
List<Map<String,Object>> getUserCourseBuyInfo(@Param("date") String date);
List<Map<String,Object>> getUserCourseBuyInfoTotal(@Param("date") String date);
List<Map<String,Object>> getIncome(@Param("date") String date);
}

View File

@@ -3,11 +3,5 @@ package com.peanut.modules.common.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.UserCourseBuyLog;
import java.util.List;
import java.util.Map;
public interface UserCourseBuyLogService extends IService<UserCourseBuyLog> {
List<Map<String,Object>> getIncome(String date);
}

View File

@@ -1,26 +1,13 @@
package com.peanut.modules.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.modules.common.dao.UserCourseBuyLogDao;
import com.peanut.modules.common.entity.UserCourseBuyLog;
import com.peanut.modules.common.service.UserCourseBuyLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Slf4j
@Service("commonUserCourseBuyLogService")
public class UserCourseBuyLogServiceImpl extends ServiceImpl<UserCourseBuyLogDao, UserCourseBuyLog> implements UserCourseBuyLogService {
@Override
public List<Map<String,Object>> getIncome(String date) {
return this.baseMapper.selectMaps(new MPJLambdaWrapper<UserCourseBuyLog>()
.select(UserCourseBuyLog::getPayType)
.selectSum(UserCourseBuyLog::getFee)
.apply("DATE_FORMAT(pay_time,'%Y-%m') = '"+date+"'")
.groupBy(UserCourseBuyLog::getPayType));
}
}

View File

@@ -38,8 +38,6 @@ public class StatisticsController {
@Autowired
private UserCourseBuyService userCourseBuyService;
@Autowired
private UserCourseBuyLogService userCourseBuyLogService;
@Autowired
private TrainingClassService trainingClassService;
@Autowired
private TrainingToUserService trainingToUserService;
@@ -260,7 +258,7 @@ public class StatisticsController {
@RequestMapping("/getUserCourseBuyInfoTotal")
public R getUserCourseBuyInfoTotal(@RequestBody Map<String, Object> params) {
List<Map<String,Object>> tanxiaoTotal = userCourseBuyService.getUserCourseBuyInfoTotal(params.get("date").toString());
List<Map<String,Object>> income = userCourseBuyLogService.getIncome(params.get("date").toString().substring(0,7));
List<Map<String,Object>> income = userCourseBuyService.getIncome(params.get("date").toString());
return R.ok().put("tanxiaoTotal", tanxiaoTotal).put("income", income);
}

View File

@@ -22,6 +22,8 @@ public interface UserCourseBuyService extends IService<UserCourseBuyEntity> {
Map<String, ArrayList<AddCoursesFrag>> addCourses(AddCourses addCourses);
List<Map<String,Object>> getIncome(String date);
List<Map<String,Object>> getUserCourseBuyInfoTotal(String date);
List<Map<String,Object>> getUserCourseBuyInfo(String date);

View File

@@ -180,6 +180,11 @@ public class UserCourseBuyServiceImpl extends ServiceImpl<UserCourseBuyDao, User
return frag;
}
@Override
public List<Map<String, Object>> getIncome(String date) {
return this.baseMapper.getIncome(date);
}
@Override
public List<Map<String, Object>> getUserCourseBuyInfoTotal(String date) {
return this.baseMapper.getUserCourseBuyInfoTotal(date);

View File

@@ -37,6 +37,14 @@
) t) s) q) w
</select>
<select id="getIncome" resultType="map">
select pay_type,SUM(fee) fee
from user_course_buy_log
where DATE_FORMAT(pay_time,'%Y-%m') = SUBSTR(#{date},1,7)
and user_id not in (select id from user where tel in ('18812616272','13110039505','18526084267','12222222222','13333333333','14444444444','15555555555','16666666666','17777777777','18888888888','1774455','15533','165965','164964','54321','111','13662001490','15505153873','18834844847','17602219785','19999999999','12299','166933','16855','17602634511','16161616161','17171717171','112112112','21212121211','222222','666666','123123','789789','96','25252525','3434343434','123789','124789','789789','163963','5656','19966','1664455','15151515151','256366','986986','18834844846','18834844849','15611027864','18047689535','18834844848','456456456'))
GROUP BY pay_type
</select>
<select id="getUserCourseBuyInfoTotal" resultType="map">
select ROUND(SUM(fee),2) fee,ROUND(SUM(alreadyTanxiao),2) alreadyTanxiao,ROUND(SUM(currentTanxiao),2) currentTanxiao,ROUND(SUM(surplusTanxiao),2) surplusTanxiao
from (