|
|
@@ -82,6 +82,8 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
@@ -249,7 +251,13 @@ public class Task {
|
|
|
}else{
|
|
|
count = fastGptPushTotal.getCount() * 150;
|
|
|
}
|
|
|
- fastGptPushTotal.setCount(count);
|
|
|
+ // 实际流量传输消耗是大于文件的,添加倍数计算流量消耗 配置 course.data.usage.multiple
|
|
|
+ BigDecimal multiple = new BigDecimal("1"); // 默认一倍
|
|
|
+ String config = sysConfigService.selectConfigByKey("course.data.usage.multiple");
|
|
|
+ if(com.fs.common.utils.StringUtils.isNotEmpty(config)){
|
|
|
+ multiple=new BigDecimal(config);
|
|
|
+ }
|
|
|
+ fastGptPushTotal.setCount(BigDecimal.valueOf(count).multiply(multiple).setScale(0, RoundingMode.UP).longValue());
|
|
|
// 计算金额,1元 = 10万token
|
|
|
double amount = count / 100000.0;
|
|
|
fastGptPushTotal.setAmount(Math.round(amount * 100.0) / 100.0);
|