Browse Source

bug修复

master
luogw 3 weeks ago
parent
commit
9920f2cfbe
  1. 5
      src/main/java/com/project/interaction/domain/dto/ProduceDTO.java
  2. 3
      src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java
  3. 4
      src/main/resources/application-test.yml

5
src/main/java/com/project/interaction/domain/dto/ProduceDTO.java

@ -11,11 +11,8 @@ public class ProduceDTO {
int needSingleCount; int needSingleCount;
int needMultipleCount; int needMultipleCount;
int needJudgmentCount; int needJudgmentCount;
int generateCount = 0;
public boolean isCompleted() { public boolean isCompleted() {
int totalNeed = needSingleCount + needJudgmentCount + needMultipleCount; return needSingleCount <= 0 && needJudgmentCount <= 0 && needMultipleCount <= 0;
// 已生成数量等于总需要数量,或总需要数量≤0时,视为完成
return generateCount >= totalNeed || totalNeed <= 0;
} }
} }

3
src/main/java/com/project/interaction/domain/service/impl/SaveClusterDomainServiceImpl.java

@ -220,9 +220,6 @@ public class SaveClusterDomainServiceImpl implements SaveClusterDomainService {
// 更新剩余数量 // 更新剩余数量
int remainCount = needCount - generateNum; int remainCount = needCount - generateNum;
setNeedCount.accept(Math.max(0, remainCount)); // 确保剩余数量≥0 setNeedCount.accept(Math.max(0, remainCount)); // 确保剩余数量≥0
// 更新已生成总数量
dto.setGenerateCount(dto.getGenerateCount() + generateNum);
} }
private ProduceDTO buildDTO(Long sourceId , QuestionSourceTypeEnum sourceType, int needJudgmentCount,int needSingleCount, int needMultipleCount) { private ProduceDTO buildDTO(Long sourceId , QuestionSourceTypeEnum sourceType, int needJudgmentCount,int needSingleCount, int needMultipleCount) {

4
src/main/resources/application-test.yml

@ -59,7 +59,7 @@ mybatis-plus:
type-aliases-package: com.proposal.**.domain.entity type-aliases-package: com.proposal.**.domain.entity
milvus: milvus:
host: 172.16.204.50 host: 127.0.0.1
port: 19530 port: 19530
analysis: analysis:
host: https://107pm707566hq.vicp.fun host: https://107pm707566hq.vicp.fun
@ -83,7 +83,7 @@ jwt:
question: question:
generation: generation:
# 限流速率:每秒允许的API请求数 # 限流速率:每秒允许的API请求数
rate-limit: 1 rate-limit: 4
downgrade: false downgrade: false
# 队列配置 # 队列配置
queue: queue:

Loading…
Cancel
Save