v1.1: 账单记录增加礼物总价值字段
This commit is contained in:
@@ -148,12 +148,12 @@ public class InsertRecordListener implements ApplicationListener<GiftMessageEven
|
||||
// 插入账单记录表(发送礼物用户)
|
||||
billRecordService.insertGiftSendBillRecord(giftMessage.getSendUid(), giftMessage.getRecvUid(),
|
||||
giftMessage.getRoomUid(), objId, outEnum, giftMessage.getGoldNum().doubleValue(),
|
||||
giftMessage.getGiftId(), giftMessage.getGiftNum());
|
||||
giftMessage.getGiftId(), giftMessage.getGiftNum(),giftMessage.getGoldNum());
|
||||
}
|
||||
// 插入账单记录表(接收礼物用户)
|
||||
String billId = billRecordService.insertGiftSendBillRecord(giftMessage.getRecvUid(), giftMessage.getSendUid(),
|
||||
giftMessage.getRoomUid(),objId, inEnum,giftMessage.getDiamondNum().doubleValue(),
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum());
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum(),giftMessage.getGoldNum());
|
||||
|
||||
if (giftMessage.getReciveAssociate() != null) {
|
||||
associateIncomeTransfer(giftMessage.getRecvUid(), giftMessage.getSendUid(), giftMessage.getDiamondNum(), BillObjTypeEnum.GIFT_ROOM_INCOME.getValue(), giftMessage.getReciveAssociate(), billId);
|
||||
@@ -162,7 +162,7 @@ public class InsertRecordListener implements ApplicationListener<GiftMessageEven
|
||||
if(giftMessage.getPerNum() != null && giftMessage.getPerNum().compareTo(0.0) > 0){
|
||||
String perNumbillId = billRecordService.insertGiftSendBillRecord(giftMessage.getPerNumUid(),giftMessage.getSendUid(),
|
||||
giftMessage.getRoomUid(),objId, BillObjTypeEnum.ROOM_PERCENTAGE_INCOME,giftMessage.getPerNum(),
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum());
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum(),giftMessage.getGoldNum());
|
||||
|
||||
if (giftMessage.getRoomAssociate() != null) {
|
||||
associateIncomeTransfer(giftMessage.getPerNumUid(), giftMessage.getSendUid(), giftMessage.getPerNum(), BillObjTypeEnum.ROOM_PERCENTAGE_INCOME.getValue(), giftMessage.getRoomAssociate(), perNumbillId);
|
||||
@@ -268,7 +268,7 @@ public class InsertRecordListener implements ApplicationListener<GiftMessageEven
|
||||
|
||||
log.info("个播房{}记录所属会长{}收益分成{},分成比例为{}", roomUid, hall.getOwnerUid(), diamondNum, rate);
|
||||
String billId = billRecordService.insertGiftSendBillRecord(hall.getOwnerUid(), giftMessage.getSendUid(),
|
||||
giftMessage.getRoomUid(), objId, BillObjTypeEnum.HALL_OWNER_SINGLE_ROOM_EARN, diamondNum, giftMessage.getGiftId(), giftMessage.getGiftNum());
|
||||
giftMessage.getRoomUid(), objId, BillObjTypeEnum.HALL_OWNER_SINGLE_ROOM_EARN, diamondNum, giftMessage.getGiftId(), giftMessage.getGiftNum(),goldNum);
|
||||
|
||||
ClanAccountAssociate clanAccountAssociate = clanAccountAssociateService.checkIsAssociateAccount(hall.getOwnerUid());
|
||||
if (ObjectUtil.isNull(clanAccountAssociate)) {
|
||||
|
@@ -48,7 +48,7 @@ public class WriteCpInviteBillListener {
|
||||
ClanAccountAssociate associate = billRecordDto.getClanAccountAssociate();
|
||||
|
||||
String billId = billRecordService.insertGiftSendBillRecord(billRecordDto.getUid(), billRecordDto.getTargetUid(),
|
||||
billRecordDto.getRoomUid(),billRecordDto.getObjId(), billRecordDto.getEventEnum(), billRecordDto.getAmount(), billRecordDto.getGiftId(),billRecordDto.getGiftNum());
|
||||
billRecordDto.getRoomUid(),billRecordDto.getObjId(), billRecordDto.getEventEnum(), billRecordDto.getAmount(), billRecordDto.getGiftId(),billRecordDto.getGiftNum(),billRecordDto.getAmount().longValue());
|
||||
|
||||
if (ObjectUtil.isNotNull(associate)) {
|
||||
log.info("同意CP邀请{}会长{}为关联号分成比例{}所得钻石{}流转到族长{}", billRecordDto.getObjId(), billRecordDto.getUid(), billRecordDto.getHallPerRate(), billRecordDto.getAmount(), associate.getClanElderUid());
|
||||
|
@@ -280,8 +280,8 @@ public class GiftService extends BaseService {
|
||||
userPurseService.addCrystal(targetUid, diamondNum.doubleValue(), BillObjTypeEnum.GIFT_PERSON_INCOME.getDesc());
|
||||
GiftSendRecord giftSendRecord = giftSendRecordService.insertGiftInfo(uid, targetUid, roomUid, room.getType(), type, giftId, giftNum, totalGoldPrice, diamondNum);
|
||||
String objId = giftSendRecord.getSendRecordId().toString();
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, totalGoldPrice.doubleValue(), giftId, giftNum);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_INCOME, diamondNum.doubleValue(), giftId, giftNum);
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, totalGoldPrice.doubleValue(), giftId, giftNum, totalGoldPrice);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_INCOME, diamondNum.doubleValue(), giftId, giftNum,totalGoldPrice);
|
||||
sendMessage(uid, giftId, targetUid, roomUid, room.getType(), diamondNum, giftPrice, Constant.ActiveMq.send_gift, type, giftNum);
|
||||
} else {
|
||||
logger.info("发送消息队列:" + uid + giftId + targetUid + diamondNum + totalGoldPrice + Constant.ActiveMq.send_gift + type + giftNum);
|
||||
@@ -413,8 +413,8 @@ public class GiftService extends BaseService {
|
||||
userPurseService.addCrystal(targetUid, diamondNum.doubleValue(), BillObjTypeEnum.GIFT_PERSON_INCOME.getDesc());
|
||||
GiftSendRecord giftSendRecord = giftSendRecordService.insertGiftInfo(uid, targetUid, roomUid, room.getType(), type, giftId, giftNum, totalGoldPrice, diamondNum);
|
||||
String objId = giftSendRecord.getSendRecordId().toString();
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, totalGoldPrice.doubleValue(), giftId, giftNum);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_PERSON_INCOME, diamondNum.doubleValue(), giftId, giftNum);
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, totalGoldPrice.doubleValue(), giftId, giftNum, totalGoldPrice);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_PERSON_INCOME, diamondNum.doubleValue(), giftId, giftNum, totalGoldPrice);
|
||||
sendMessage(uid, giftId, targetUid, roomUid, room.getType(), diamondNum, giftPrice, Constant.ActiveMq.send_gift, type, giftNum);
|
||||
} else {
|
||||
logger.info("发送消息队列:" + uid + giftId + targetUid + diamondNum + totalGoldPrice + Constant.ActiveMq.send_gift + type + giftNum);
|
||||
|
@@ -129,7 +129,7 @@ public class LuckyBagSendService extends BaseService {
|
||||
// 插入账单记录表(发送礼物用户)
|
||||
billRecordService.insertGiftSendBillRecord(it.getUid(), it.getReciveUid(), it.getRoomUid(),
|
||||
giftSendRecord.getSendRecordId().toString(), BillObjTypeEnum.GIFT_ROOM_PAY,
|
||||
luckyBagGift.getGoldPrice().doubleValue(), it.getGiftId(), it.getGiftNum());
|
||||
luckyBagGift.getGoldPrice().doubleValue(), it.getGiftId(), it.getGiftNum(),it.getTotalGoldNum());
|
||||
});
|
||||
// 批量插入福袋购买记录
|
||||
luckyBagRecordService.saveBatch(luckyBagRecordList);
|
||||
|
@@ -85,9 +85,9 @@ public class BillRecordService extends ServiceImpl<BillRecordMapper,BillRecord>
|
||||
* @param giftNum
|
||||
*/
|
||||
public String insertGiftSendBillRecord(Long uid, Long targetUid, Long roomUid, String objId, BillObjTypeEnum eventEnum,
|
||||
Double amount, Integer giftId, Integer giftNum) {
|
||||
Double amount, Integer giftId, Integer giftNum,Long giftTotalGoldNum) {
|
||||
Double rmbAmount = amount * eventEnum.getCurrency().getExchangeRate();
|
||||
return insertBillRecord(uid, targetUid, roomUid, objId, eventEnum, amount, rmbAmount, giftId, giftNum);
|
||||
return insertBillRecordV2(uid, targetUid, roomUid, objId, eventEnum, amount, rmbAmount, giftId, giftNum,null,giftTotalGoldNum);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,6 +157,34 @@ public class BillRecordService extends ServiceImpl<BillRecordMapper,BillRecord>
|
||||
return billRecord.getBillId();
|
||||
}
|
||||
|
||||
private String insertBillRecordV2(Long uid, Long targetUid, Long roomUid, String objId, BillObjTypeEnum eventEnum,
|
||||
Double amount, Double rmbAmount, Integer giftId, Integer giftNum, String remark, Long giftTotalGoldNum) {
|
||||
BillTypeEnum billType = eventEnum.getType();
|
||||
CurrencyEnum currency = eventEnum.getCurrency();
|
||||
BillRecord billRecord = new BillRecord();
|
||||
billRecord.setBillId(UUIDUitl.get());
|
||||
billRecord.setBillType(billType.getValue());
|
||||
billRecord.setUid(uid);
|
||||
billRecord.setTargetUid(targetUid);
|
||||
billRecord.setRoomUid(roomUid);
|
||||
billRecord.setObjId(objId);
|
||||
billRecord.setObjType(eventEnum.getValue());
|
||||
billRecord.setGiftId(giftId);
|
||||
billRecord.setGiftNum(giftNum);
|
||||
billRecord.setGiftTotalGoldNum(giftTotalGoldNum);
|
||||
billRecord.setCurrency(currency.getValue());
|
||||
billRecord.setAmount(BigDecimal.valueOf(amount));
|
||||
billRecord.setActualAmount(BigDecimal.valueOf(rmbAmount));
|
||||
billRecord.setCreateTime(new Date());
|
||||
if (StringUtils.isNotBlank(remark)) {
|
||||
billRecord.setRemark(remark);
|
||||
} else {
|
||||
billRecord.setRemark(eventEnum.getDesc());
|
||||
}
|
||||
billRecordMapper.insert(billRecord);
|
||||
return billRecord.getBillId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账单并根据时间分组
|
||||
*
|
||||
|
@@ -35,6 +35,8 @@ public class BillRecord{
|
||||
|
||||
private Integer giftNum;
|
||||
|
||||
private Long giftTotalGoldNum;
|
||||
|
||||
private Byte currency;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
<result column="obj_type" property="objType" jdbcType="TINYINT"/>
|
||||
<result column="gift_id" property="giftId" jdbcType="INTEGER"/>
|
||||
<result column="gift_num" property="giftNum" jdbcType="INTEGER"/>
|
||||
<result column="gift_total_gold_num" property="giftTotalGoldNum" jdbcType="BIGINT"/>
|
||||
<result column="diamond_num" property="diamondNum" jdbcType="DOUBLE"/>
|
||||
<result column="gold_num" property="goldNum" jdbcType="BIGINT"/>
|
||||
<result column="money" property="money" jdbcType="BIGINT"/>
|
||||
|
@@ -64,8 +64,8 @@ public class MyMessageListener {
|
||||
|
||||
GiftSendRecord giftSendRecord = giftSendRecordService.insertGiftInfo(uid, targetUid, roomUid, roomType, type, giftId, giftNum, totalGoldNum, diamondNum);
|
||||
String objId = giftSendRecord.getSendRecordId().toString();
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, goldNum.doubleValue(), giftNum, giftId);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_INCOME, diamondNum, giftNum, giftId);
|
||||
billRecordService.insertGiftSendBillRecord(uid, targetUid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_PAY, goldNum.doubleValue(), giftNum, giftId, totalGoldNum);
|
||||
billRecordService.insertGiftSendBillRecord(targetUid, uid, roomUid, objId, BillObjTypeEnum.GIFT_ROOM_INCOME, diamondNum, giftNum, giftId, totalGoldNum);
|
||||
}
|
||||
if (type == Constant.SendGiftType.room || type == Constant.SendGiftType.roomToperson) {
|
||||
statRoomCtrbSumService.addAndUpdateStatRoomCtrbSumList(roomUid, uid, totalGoldNum);
|
||||
|
@@ -95,7 +95,7 @@ public class ClanServiceTest extends CommonTest{
|
||||
// 插入账单记录表(接收礼物用户)
|
||||
String billId = billRecordService.insertGiftSendBillRecord(giftMessage.getRecvUid(), giftMessage.getSendUid(),
|
||||
giftMessage.getRoomUid(),objId, inEnum,giftMessage.getDiamondNum().doubleValue(),
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum());
|
||||
giftMessage.getGiftId(),giftMessage.getGiftNum(),giftMessage.getGoldNum());
|
||||
|
||||
if (clanAccountAssociate != null) {
|
||||
associateIncomeTransfer(giftMessage.getRecvUid(), giftMessage.getSendUid(), giftMessage.getPerNum(), inEnum.getValue(), giftMessage.getReciveAssociate(), billId);
|
||||
|
Reference in New Issue
Block a user