日期问题

This commit is contained in:
wangw 2024-12-30 18:26:40 +08:00
parent d3241cf504
commit f154973d2d
3 changed files with 9 additions and 5 deletions

View File

@ -23,6 +23,7 @@ import com.sqx.modules.pay.service.PayDetailsService;
import com.sqx.modules.sys.entity.SysUserEntity;
import com.sqx.modules.sys.service.SysUserService;
import com.sqx.modules.utils.EasyPoi.ExcelUtils;
import com.sqx.modules.utils.TimeCompleteUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -270,7 +271,7 @@ public class UserController {
@ApiOperation("短剧分析")
public Result courseMessage(Long page, Long limit, String date, int type, Long sysUserId) {
Page<Map<String, Object>> iPage = new Page<>(page, limit);
IPage<Map<String, Object>> mapIPage = userService.queryCourseOrder(iPage, type, date, sysUserId);
IPage<Map<String, Object>> mapIPage = userService.queryCourseOrder(iPage, type, TimeCompleteUtils.completeStartTime(date), sysUserId);
return Result.success().put("data", new PageUtils(mapIPage));
}
@ -280,6 +281,7 @@ public class UserController {
@GetMapping("/userMessage")
@ApiOperation("用户分析")
public Result userMessage(String date, int type, Long sysUserId) {
date = TimeCompleteUtils.completeStartTime(date);
String qdCode = null;
if (sysUserId != null) {
qdCode = sysUserService.getById(sysUserId).getQdCode();

View File

@ -38,6 +38,7 @@ import com.sqx.modules.pay.controller.app.AliPayController;
import com.sqx.modules.pay.service.DyService;
import com.sqx.modules.pay.service.WxService;
import com.sqx.modules.utils.AliPayOrderUtil;
import com.sqx.modules.utils.TimeCompleteUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -657,8 +658,9 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
Integer flag, String time, String userName, Integer ordersType, String startTime, String endTime,
Long sysUserId, String qdCode, String sysUserName) {
Page<Orders> pages = new Page<>(page, limit);
return Result.success().put("data", new PageUtils(baseMapper.selectOrdersByOrdersNo(pages, ordersNo, status, userId, courseId,
flag, time, userName, ordersType, startTime, endTime, sysUserId, qdCode, sysUserName)));
flag, time, userName, ordersType, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), sysUserId, qdCode, sysUserName)));
}
@Override

View File

@ -127,13 +127,13 @@
and o.sys_user_id=#{sysUserId}
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(o.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
and o.create_time BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(o.create_time,'%Y-%m-%d') &gt;= #{startTime}
and o.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(o.create_time,'%Y-%m-%d') &lt;= #{endTime}
and o.create_time &lt;= #{endTime}
</if>
order by o.create_time desc
</select>