Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
张松 2025-01-06 21:20:55 +08:00
commit 59dd29f226
5 changed files with 20 additions and 9 deletions

View File

@ -668,8 +668,13 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
List<Orders> orders = baseMapper.selectOrdersByOrdersNo(ordersNo, status, userId, courseId,
flag, time, userName, ordersType, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), sysUserId, qdCode, sysUserName);
Set<Long> courseIds = orders.stream().map(Orders::getCourseId).collect(Collectors.toSet());
List<Course> courses = courseDao.selectBatchIds(courseIds);
Map<Long, String> map = courses.stream().collect(Collectors.toMap(Course::getCourseId, Course::getTitle));
orders.parallelStream().forEach(s -> {
s.setTitle(map.get(s.getCourseId()));
});
PageInfo<Orders> pageInfo = new PageInfo<>(orders);
return Result.success().put("data", PageUtils.page(pageInfo));
}

View File

@ -43,7 +43,7 @@ public interface PayDetailsDao extends BaseMapper<PayDetails> {
int selectPayCount(Long userId);
Double instantselectSumPay(@Param("date") String date, @Param("userId") Long userId);
Double instantselectSumPay(@Param("startTime") String startTime,@Param("endTime") String endTime, @Param("userId") Long userId);
Double statisticsIncomeMoney(@Param("time") String time, @Param("flag") Integer flag, @Param("ordersType") Integer ordersType);

View File

@ -1,5 +1,6 @@
package com.sqx.modules.pay.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
@ -80,7 +81,9 @@ public class PayDetailsServiceImpl extends ServiceImpl<PayDetailsDao, PayDetails
@Override
public Double instantselectSumPay(String date, Long userId) {
return payDetailsDao.instantselectSumPay(date, userId);
return payDetailsDao.instantselectSumPay(
DateUtil.beginOfMonth(DateUtil.parse(date)).toString(),
DateUtil.endOfMonth(DateUtil.parse(date)).toString(), userId);
}
@Override

View File

@ -94,9 +94,8 @@
</insert>
<select id="selectOrdersByOrdersNo" resultType="com.sqx.modules.orders.entity.Orders">
select o.*,u.user_name as userName,c.title as title,s.username as sysUserName,s.qd_code as qdCode from orders o
select o.*,u.user_name as userName,s.username as sysUserName,s.qd_code as qdCode from orders o
left join tb_user u on o.user_id=u.user_id
left join course c on c.course_id=o.course_id
left join sys_user s on s.user_id=o.sys_user_id
where 1=1
<if test="userName!=null and userName!=''">

View File

@ -141,9 +141,13 @@
order by d.pay_time desc
</select>
<select id="instantselectSumPay" resultType="Double">
select sum(money) from pay_details where 1=1
and date_format(create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
and state=1 and user_id=#{userId}
select sum(money)
from pay_details
where 1 = 1
and create_time &gt; #{startTime}
and create_time &lt; #{endTime}
and state = 1
and user_id = #{userId}
</select>