This commit is contained in:
kuang.yife 2024-03-25 14:08:29 +08:00
parent 17c91becbe
commit 00f4e17324
6 changed files with 23 additions and 23 deletions

View File

@ -40,7 +40,7 @@ public class PlayletRevenueRecordAppController extends BaseController {
public Result<PageInfo<PlayletRevenueRecord>> recordList(@RequestBody PlayletRevenueRecord playletRevenueRecord, public Result<PageInfo<PlayletRevenueRecord>> recordList(@RequestBody PlayletRevenueRecord playletRevenueRecord,
@RequestParam(value = "pageNum") Integer pageNum, @RequestParam(value = "pageNum") Integer pageNum,
@RequestParam(value = "pageSize") Integer pageSize) { @RequestParam(value = "pageSize") Integer pageSize) {
return Result.success(service.getItemPage(playletRevenueRecord, pageSize, pageNum)); return Result.success(service.getItemPage(playletRevenueRecord, pageNum, pageSize));
} }
@ResponseBody @ResponseBody

View File

@ -71,8 +71,8 @@ public class PlayletRevenueRecordAppServiceImpl implements PlayletRevenueRecordA
vo.setTotalMoney(revenueRecordListByTotal.stream().mapToLong(PlayletRevenueRecord::getPracticalEarnings).sum()); vo.setTotalMoney(revenueRecordListByTotal.stream().mapToLong(PlayletRevenueRecord::getPracticalEarnings).sum());
} }
// 开始时间结束时间缺省值 // 开始时间结束时间缺省值
Long startTime = System.currentTimeMillis(); Date startTime = null;
Long endTime = System.currentTimeMillis(); Date endTime = record.getStartTime();
// 今日 // 今日
startTime = timeGain(null); startTime = timeGain(null);
timeSupplement(record, startTime, endTime); timeSupplement(record, startTime, endTime);
@ -139,13 +139,13 @@ public class PlayletRevenueRecordAppServiceImpl implements PlayletRevenueRecordA
} }
// 时间更新 // 时间更新
private void timeSupplement(PlayletRevenueRecord record, Long startTime, Long endTime) { private void timeSupplement(PlayletRevenueRecord record, Date startTime, Date endTime) {
record.setStartTime(startTime); record.setStartTime(startTime);
record.setEndTime(endTime); record.setEndTime(endTime);
} }
// 获取时间 // 获取时间
private Long timeGain(Integer day) { private Date timeGain(Integer day) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.MINUTE, 0);
@ -154,6 +154,6 @@ public class PlayletRevenueRecordAppServiceImpl implements PlayletRevenueRecordA
if (ObjectUtils.isNotNull(day)) { if (ObjectUtils.isNotNull(day)) {
calendar.set(Calendar.DATE, day); calendar.set(Calendar.DATE, day);
} }
return calendar.getTimeInMillis(); return calendar.getTime();
} }
} }

View File

@ -99,6 +99,8 @@ mybatis:
mybatis-plus: mybatis-plus:
mapper-locations: classpath*:mapper/**/*Mapper.xml mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.playlet.**.domain type-aliases-package: com.playlet.**.domain
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# PageHelper分页插件 # PageHelper分页插件
pagehelper: pagehelper:

View File

@ -11,6 +11,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import com.playlet.common.annotation.Excel; import com.playlet.common.annotation.Excel;
import java.util.Date;
/** /**
* @Date: 2024-03-17 * @Date: 2024-03-17
* @Author: 但星霖 * @Author: 但星霖
@ -114,7 +116,7 @@ public class PlayletRevenueRecord extends BaseEntity {
*/ */
@Excel(name = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。)") @Excel(name = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。)")
@ApiModelProperty(value = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。) 时间戳") @ApiModelProperty(value = "推送收益时间(此处为外部平台推入 建议使用时间戳后续数据转换。) 时间戳")
private Long pushTime; private Date pushTime;
/** 剧场类型 */ /** 剧场类型 */
@Excel(name = "剧场类型") @Excel(name = "剧场类型")
@ -123,9 +125,9 @@ public class PlayletRevenueRecord extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
private Long startTime; private Date startTime;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "结束时间") @ApiModelProperty(value = "结束时间")
private Long endTime; private Date endTime;
} }

View File

@ -1,9 +1,6 @@
package com.playlet.system.service.impl; package com.playlet.system.service.impl;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -134,8 +131,8 @@ public class PlayletRevenueRecordServiceImpl extends ServiceImpl<PlayletRevenueR
vo.setTotalMoney(revenueRecordListByTotal.stream().mapToLong(PlayletRevenueRecord::getPracticalEarnings).sum()); vo.setTotalMoney(revenueRecordListByTotal.stream().mapToLong(PlayletRevenueRecord::getPracticalEarnings).sum());
} }
// 开始时间结束时间缺省值 // 开始时间结束时间缺省值
Long startTime = System.currentTimeMillis(); Date endTime = record.getStartTime();
Long endTime = System.currentTimeMillis(); Date startTime = null;
// 今日 // 今日
startTime = timeGain(null); startTime = timeGain(null);
timeSupplement(record, startTime, endTime); timeSupplement(record, startTime, endTime);
@ -205,13 +202,13 @@ public class PlayletRevenueRecordServiceImpl extends ServiceImpl<PlayletRevenueR
} }
// 时间更新 // 时间更新
private void timeSupplement(PlayletRevenueRecord record, Long startTime, Long endTime) { private void timeSupplement(PlayletRevenueRecord record, Date startTime, Date endTime) {
record.setStartTime(startTime); record.setStartTime(startTime);
record.setEndTime(endTime); record.setEndTime(endTime);
} }
// 获取时间 // 获取时间
private Long timeGain(Integer day) { private Date timeGain(Integer day) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.MINUTE, 0);
@ -220,6 +217,6 @@ public class PlayletRevenueRecordServiceImpl extends ServiceImpl<PlayletRevenueR
if (ObjectUtils.isNotNull(day)) { if (ObjectUtils.isNotNull(day)) {
calendar.set(Calendar.DATE, day); calendar.set(Calendar.DATE, day);
} }
return calendar.getTimeInMillis(); return calendar.getTime();
} }
} }

View File

@ -43,12 +43,11 @@
<if test="estimateEarnings != null "> and estimate_earnings = #{estimateEarnings}</if> <if test="estimateEarnings != null "> and estimate_earnings = #{estimateEarnings}</if>
<if test="practicalEarnings != null "> and practical_earnings = #{practicalEarnings}</if> <if test="practicalEarnings != null "> and practical_earnings = #{practicalEarnings}</if>
<if test="taskId != null ">and task_id = #{taskId}</if> <if test="taskId != null ">and task_id = #{taskId}</if>
<!-- <if test="pushTime != null "> and push_time = #{pushTime}</if> --> <if test="startTime != null">
<if test="startTime != null and startTime != 0" > and date_format(push_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
and push_time <![CDATA[ >= ]]> #{startTime}
</if> </if>
<if test="endTime != null and endTime != 0" > <if test="endTime != null">
and push_time <![CDATA[ <= ]]> #{endTime} and date_format(push_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if> </if>
<if test="itemType != null "> and item_type = #{itemType}</if> <if test="itemType != null "> and item_type = #{itemType}</if>
</where> </where>