123
This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
package com.ruoyi.test.business;
|
package com.ruoyi.test.business;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.ruoyi.cai.notice.data.ImVideoAttachR;
|
||||||
|
import com.ruoyi.cai.notice.data.child.ImVideoAttachData;
|
||||||
import com.ruoyi.cai.ws.cache.RoomDataCache;
|
import com.ruoyi.cai.ws.cache.RoomDataCache;
|
||||||
import com.ruoyi.cai.ws.job.JobResp;
|
import com.ruoyi.cai.ws.job.JobResp;
|
||||||
import com.ruoyi.cai.ws.job.RoomCheckJobService;
|
import com.ruoyi.cai.ws.job.RoomCheckJobService;
|
||||||
import com.ruoyi.cai.ws.service.RoomService;
|
import com.ruoyi.cai.ws.service.RoomService;
|
||||||
|
import com.ruoyi.yunxin.Yunxin;
|
||||||
|
import com.ruoyi.yunxin.resp.YxCommonR;
|
||||||
|
import com.ruoyi.yunxin.resp.YxDataR;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -35,4 +40,21 @@ public class RoomTest {
|
|||||||
boolean b = roomDataCache.setStatusAgree(roomId);
|
boolean b = roomDataCache.setStatusAgree(roomId);
|
||||||
log.error("结果 b:{}",b);
|
log.error("结果 b:{}",b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Yunxin yunxin;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCallBack(){
|
||||||
|
Long roomId = 1L;
|
||||||
|
Long callId = 1L;
|
||||||
|
Long receiverId = 1L;
|
||||||
|
ImVideoAttachData data = new ImVideoAttachData();
|
||||||
|
data.setRoomid(roomId);
|
||||||
|
ImVideoAttachR<ImVideoAttachData> res = ImVideoAttachR.ok(data);
|
||||||
|
YxDataR<YxCommonR> r = yunxin.sendAttachMsg(callId, receiverId, res);
|
||||||
|
if(r == null || !r.isSuccess()){
|
||||||
|
log.error("云信发送失败【sendCallAsync】r={}", JSON.toJSONString(r));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.ruoyi.common.annotation.ExcelEnumFormat;
|
|||||||
import com.ruoyi.common.convert.ExcelEnumConvert;
|
import com.ruoyi.common.convert.ExcelEnumConvert;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
|
import org.springframework.format.annotation.NumberFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -53,6 +54,7 @@ public class AccountCash implements Serializable {
|
|||||||
* 提现金额
|
* 提现金额
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "提现金额")
|
@ExcelProperty(value = "提现金额")
|
||||||
|
@NumberFormat(pattern = "0.##")
|
||||||
@ContentFontStyle(color = Font.COLOR_RED)
|
@ContentFontStyle(color = Font.COLOR_RED)
|
||||||
private BigDecimal cashMoney;
|
private BigDecimal cashMoney;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.ruoyi.common.convert.ExcelEnumConvert;
|
|||||||
import com.ruoyi.common.enums.SensitiveStrategy;
|
import com.ruoyi.common.enums.SensitiveStrategy;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class AccountCashAdminVo extends AccountCash {
|
public class AccountCashAdminVo extends AccountCash {
|
||||||
@@ -41,4 +43,5 @@ public class AccountCashAdminVo extends AccountCash {
|
|||||||
@ExcelProperty(value = "主播",converter = ExcelEnumConvert.class)
|
@ExcelProperty(value = "主播",converter = ExcelEnumConvert.class)
|
||||||
@ExcelEnumFormat(enumClass = IsAnchorEnum.class,codeField = "code",textField = "message")
|
@ExcelEnumFormat(enumClass = IsAnchorEnum.class,codeField = "code",textField = "message")
|
||||||
private Integer isAnchor;
|
private Integer isAnchor;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,11 +119,11 @@ public class UserGreetServiceImpl extends ServiceImpl<UserGreetMapper,UserGreet>
|
|||||||
if(val != null && Long.parseLong(val) > max){
|
if(val != null && Long.parseLong(val) > max){
|
||||||
throw new ServiceException("您今天打招呼的次数已经用完了");
|
throw new ServiceException("您今天打招呼的次数已经用完了");
|
||||||
}
|
}
|
||||||
String sendGreetCount = String.format(RedisHttpConstant.USER_GREET_SEND_TIME_REDIS,userId);
|
String userGreetSendTime = String.format(RedisHttpConstant.USER_GREET_SEND_TIME_REDIS,userId); // 最近一次的发送时间
|
||||||
String lastTime = stringRedisTemplate.opsForValue().get(sendGreetCount);
|
String lastTime = stringRedisTemplate.opsForValue().get(userGreetSendTime);
|
||||||
if(StringUtils.isNotBlank(lastTime)){
|
if(StringUtils.isNotBlank(lastTime)){
|
||||||
Integer inter = systemConfigManager.getSystemConfigOfInt(SystemConfigEnum.GREET_INTERVAL_MIN);
|
int inter = systemConfigManager.getSystemConfigOfInt(SystemConfigEnum.GREET_INTERVAL_MIN) * 60;
|
||||||
long jiange = Long.parseLong(lastTime) - DateUtil.currentSeconds();
|
long jiange = DateUtil.currentSeconds() - Long.parseLong(lastTime); // 距离上次发送的间隔
|
||||||
long diff = inter - jiange;
|
long diff = inter - jiange;
|
||||||
if(diff > 0){
|
if(diff > 0){
|
||||||
if(diff > 60){
|
if(diff > 60){
|
||||||
@@ -141,7 +141,7 @@ public class UserGreetServiceImpl extends ServiceImpl<UserGreetMapper,UserGreet>
|
|||||||
if(!r.isSuccess()){
|
if(!r.isSuccess()){
|
||||||
throw new ServiceException("发送失败");
|
throw new ServiceException("发送失败");
|
||||||
}
|
}
|
||||||
stringRedisTemplate.opsForValue().set(sendGreetCount,DateUtil.currentSeconds()+"",1,TimeUnit.DAYS);
|
stringRedisTemplate.opsForValue().set(userGreetSendTime,DateUtil.currentSeconds()+"",1,TimeUnit.DAYS);
|
||||||
stringRedisTemplate.opsForValue().increment(numKey);
|
stringRedisTemplate.opsForValue().increment(numKey);
|
||||||
stringRedisTemplate.expire(numKey,1,TimeUnit.DAYS);
|
stringRedisTemplate.expire(numKey,1,TimeUnit.DAYS);
|
||||||
}finally {
|
}finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user