|
@@ -1,5 +1,6 @@
|
|
|
package com.game.business.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -7,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -14,11 +16,13 @@ import com.game.business.domain.AppUser;
|
|
|
import com.game.business.domain.CfgCommon;
|
|
|
import com.game.business.dto.AppUserTeamTranserDto;
|
|
|
import com.game.business.dto.AppUserTeamTranserRecordDto;
|
|
|
+import com.game.business.dto.FinTranDto;
|
|
|
import com.game.business.dto.FinTranRecordDTO;
|
|
|
import com.game.business.service.IAppGameBettingService;
|
|
|
import com.game.business.service.IAppUserService;
|
|
|
import com.game.business.service.ICfgCommonService;
|
|
|
import com.game.business.util.Md5Utils;
|
|
|
+import com.game.business.vo.FinTranVo;
|
|
|
import com.game.common.annotation.DataSource;
|
|
|
import com.game.common.constant.AppSceneType;
|
|
|
import com.game.common.constant.finance.FinTranAddedInfo;
|
|
@@ -142,7 +146,7 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
|
|
|
LambdaQueryWrapper<FinTranRecord> queryWrapper = new LambdaQueryWrapper<FinTranRecord>();
|
|
|
queryWrapper.between(FinTranRecord::getCreateTime,beginTime,endTime);
|
|
|
if(StringUtils.isNotBlank(userId)){
|
|
|
- queryWrapper.eq(FinTranRecord::getFromUid,userId);
|
|
|
+ queryWrapper.eq(FinTranRecord::getUid,userId);
|
|
|
}
|
|
|
return finTranRecordMapper.selectList(queryWrapper);
|
|
|
}
|
|
@@ -301,4 +305,36 @@ public class FinTranRecordServiceImpl extends ServiceImpl<FinTranRecordMapper, F
|
|
|
|
|
|
return jsonObject;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @DataSource(DataSourceType.SLAVE)
|
|
|
+ public List<FinTranVo> selectTranList(FinTranDto finTranDto) {
|
|
|
+ if(null == finTranDto.getUserId()){
|
|
|
+ finTranDto.setUserId(SecurityUtils.getUserId());
|
|
|
+ }
|
|
|
+ String weekBegin = null;
|
|
|
+ String weekend = null;
|
|
|
+ Date curDate = DateUtil.date();
|
|
|
+ if(1 == finTranDto.getType().intValue()){
|
|
|
+ curDate = DateUtil.offsetDay(curDate,-15); //上一周期
|
|
|
+ }
|
|
|
+ int curDay = Integer.parseInt(DateUtil.format(curDate,"dd"));
|
|
|
+ if(curDay <= 15){
|
|
|
+ weekBegin = DateUtil.format(DateUtil.beginOfMonth(curDate),"yyyy-MM-dd").concat(" 00:00:00");
|
|
|
+ weekend = DateUtil.format(curDate,"yyyy-MM-".concat("15").concat(" 23:59:59"));
|
|
|
+ }else{
|
|
|
+ weekBegin = DateUtil.format(curDate,"yyyy-MM-".concat("15").concat(" 00:00:00"));
|
|
|
+ weekend = DateUtil.format(DateUtil.endOfMonth(curDate),"yyyy-MM-dd").concat(" 23:59:59");
|
|
|
+ }
|
|
|
+ finTranDto.setBeginTime(weekBegin);
|
|
|
+ finTranDto.setEndTime(weekend);
|
|
|
+ if(0 == finTranDto.getTranType().intValue()){
|
|
|
+ //直播收益
|
|
|
+ finTranDto.setTranType1(FinTranType1.U_Income_Coin.getType());
|
|
|
+ finTranDto.setTranType3(FinTranType3.CONSUM_LIVE_ROOM_REWARD.getType());
|
|
|
+ }else{
|
|
|
+ finTranDto.setTranType3(FinTranType3.CHARGE_IN_INVITE.getType());
|
|
|
+ }
|
|
|
+ return finTranRecordMapper.selectTranList(finTranDto);
|
|
|
+ }
|
|
|
}
|