This commit is contained in:
dute7liang
2024-01-14 03:38:50 +08:00
parent 7a6f9eecd3
commit d5deaacfe8
32 changed files with 323 additions and 135 deletions

View File

@@ -282,7 +282,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
Long callPrice = roomData.getCallPrice();
Long callTime = roomService.getCallTime(room);
// 本次支付金额
long totalAmount = callPrice * (callTime / 60); // 本次需要支付的金额
long totalAmount = callPrice * ((callTime / 60) + 1); // 本次需要支付的金额
Long payCoin = roomData.getPayCoin(); // 已经支付的余额
Long payIncome = roomData.getPayIncome(); // 已经支付的收益
// 补差价
@@ -357,9 +357,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
consumeLogService.save(consumeLog);
userCallService.update(Wrappers.lambdaUpdate(UserCall.class)
.eq(UserCall::getId, userCall.getId())
.set(UserCall::getTraceId,tractId)
.set(UserCall::getBeginTime, DateUtil.date(roomData.getBeginTime()).toLocalDateTime())
.set(UserCall::getEndTime,DateUtil.date(roomData.getHangUpTime()).toLocalDateTime())
.set(UserCall::getCallTime,roomData.getHangUpTime() - roomData.getBeginTime())
.set(UserCall::getEndTime,DateUtil.date(roomData.getHangupTime()).toLocalDateTime())
.set(UserCall::getCallTime,roomData.getHangupTime() - roomData.getBeginTime())
.set(UserCall::getCallAmount,amountReal)
.set(UserCall::getCallIncome, anchorAmount)
.set(UserCall::getStatus, RoomStatusEnums.STATUS_HANGUP.getCode()));
@@ -367,6 +368,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
resp.setConsumeLog(consumeLog);
resp.setPayIncome(payIncome);
resp.setPayCoin(payCoin);
resp.setAnchorIncome(anchorAmount);
return resp;
}

View File

@@ -47,7 +47,9 @@ public class UserCallServiceImpl extends ServiceImpl<UserCallMapper, UserCall> i
}
UserCall userCall = new UserCall();
userCall.setFromUid(fromUid);
userCall.setFromUsercode(fromUser.getUsercode());
userCall.setToUid(toUser.getId());
userCall.setToUsercode(toUser.getUsercode());
userCall.setCallPrice(anchor.getPrice());
userCall.setReceiverVideoDivide(anchor.getVideoRate());
boolean save = this.save(userCall);

View File

@@ -13,6 +13,7 @@ import com.ruoyi.cai.dto.app.vo.user.UserListVo;
import com.ruoyi.cai.dto.app.vo.user.OnlineStatusVo;
import com.ruoyi.cai.mapper.UserMapper;
import com.ruoyi.cai.service.*;
import com.ruoyi.cai.ws.service.RoomService;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.helper.LoginHelper;
@@ -61,6 +62,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
private UserForbidService userForbidService;
@Autowired
private AnchorApplyService anchorApplyService;
@Autowired
private RoomService roomService;
@Override
public User getByUsername(String username) {
@@ -114,7 +117,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
// 在线状态
OnlineStatusVo onlineStatusVo;
if(user.getIsAnchor() == 1 && anchor != null){
onlineStatusVo = userOnlineService.onlineStatus(userId,anchor.getOpenVideoStatus(),anchor.getVideoStatus(), user.getIsAnchor());
boolean runningVideo = roomService.checkRunningVideo(userId, anchor.getUserId());
onlineStatusVo = userOnlineService.onlineStatus(userId,anchor.getOpenVideoStatus(),
runningVideo?1:anchor.getVideoStatus(), user.getIsAnchor());
}else{
onlineStatusVo = userOnlineService.onlineStatus(userId,0,0, user.getIsAnchor());
}