courseMessage报错修复
This commit is contained in:
@@ -22,4 +22,5 @@ public class CourseOrderResponse implements Serializable {
|
||||
* 售卖金币
|
||||
*/
|
||||
private Double coursemoney;
|
||||
private Long courseId;
|
||||
}
|
||||
|
||||
@@ -47,11 +47,14 @@ import com.sqx.modules.app.dto.AuthDTO;
|
||||
import com.sqx.modules.app.dto.AuthRespDTO;
|
||||
import com.sqx.modules.app.entity.*;
|
||||
import com.sqx.modules.app.mapper.TbUserBlacklistMapper;
|
||||
import com.sqx.modules.app.response.CourseOrderResponse;
|
||||
import com.sqx.modules.app.service.*;
|
||||
import com.sqx.modules.app.utils.JwtUtils;
|
||||
import com.sqx.modules.app.utils.UserConstantInterface;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.course.dao.CourseDao;
|
||||
import com.sqx.modules.course.entity.Course;
|
||||
import com.sqx.modules.discSpinning.service.DiscSpinningService;
|
||||
import com.sqx.modules.file.utils.Md5Utils;
|
||||
import com.sqx.modules.invite.service.InviteService;
|
||||
@@ -130,6 +133,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
|
||||
|
||||
private ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(true);
|
||||
@Autowired
|
||||
private CourseDao courseDao;
|
||||
|
||||
public UserServiceImpl(@Lazy AliService aliService, UserInfoService userInfoService, UserVipDao userVipDao, InviteAchievementService inviteAchievementService) {
|
||||
this.aliService = aliService;
|
||||
@@ -1423,8 +1428,21 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
||||
}
|
||||
|
||||
PageHelper.startPage(page.intValue(), limit.intValue());
|
||||
List<Map<String, Object>> list = baseMapper.queryCourseOrder(type, startTime, endTime, sysUserId);
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
List<CourseOrderResponse> courseList = courseDao.selectGroupCourseId(startTime, endTime);
|
||||
Set<Long> collect = courseList.stream().map(CourseOrderResponse::getCourseId).collect(Collectors.toSet());
|
||||
if (!collect.isEmpty()) {
|
||||
Map<Long, Course> courseMap = courseDao.selectList(new LambdaQueryWrapper<Course>().in(Course::getCourseId, collect).select(Course::getCourseId, Course::getTitle))
|
||||
.stream().collect(Collectors.toMap(Course::getCourseId, item -> item));
|
||||
courseList.forEach(item -> {
|
||||
Course course = courseMap.get(item.getCourseId());
|
||||
if (course != null) {
|
||||
item.setCoursename(course.getTitle());
|
||||
}
|
||||
});
|
||||
}
|
||||
PageInfo<CourseOrderResponse> pageInfo = new PageInfo<>(courseList);
|
||||
// List<Map<String, Object>> list = baseMapper.queryCourseOrder(type, startTime, endTime, sysUserId);
|
||||
// PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(list);
|
||||
|
||||
return PageUtils.page(pageInfo, true);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.sqx.modules.course.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sqx.modules.app.response.CourseOrderResponse;
|
||||
import com.sqx.modules.course.entity.Course;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -39,4 +40,6 @@ public interface CourseDao extends BaseMapper<Course> {
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectCourseTitle(@Param("title")String title);
|
||||
|
||||
List<CourseOrderResponse> selectGroupCourseId(@Param("start")String startTime, @Param("end") String endTime);
|
||||
}
|
||||
|
||||
@@ -236,5 +236,13 @@
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="selectGroupCourseId" resultType="com.sqx.modules.app.response.CourseOrderResponse">
|
||||
select sum(o.pay_money) as 'coursemoney' ,count(*) as 'coursenum', o.course_id as courseId
|
||||
from orders o
|
||||
where o.status=1 and o.orders_type=1
|
||||
and o.create_time between #{start} and #{end}
|
||||
group by o.course_id
|
||||
order by coursenum desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user