Browse Source

修改虚拟次数

feature/0725lihuilin
jihaipeng 4 weeks ago
parent
commit
25c50f7ea9
  1. BIN
      lottery-system/.idea/.cache/.Apifox_Helper/.toolWindow.db
  2. 5
      lottery-system/lottery-service/src/main/java/com/lottery/admin/service/Impl/FundingServiceImpl.java
  3. 16
      lottery-system/lottery-service/src/main/java/com/lottery/api/service/Impl/ApiFundingServiceImpl.java

BIN
lottery-system/.idea/.cache/.Apifox_Helper/.toolWindow.db

5
lottery-system/lottery-service/src/main/java/com/lottery/admin/service/Impl/FundingServiceImpl.java

@ -301,9 +301,12 @@ public class FundingServiceImpl implements IFundingService {
} }
//查询当前总的助力数 //查询当前总的助力数
Integer total = fundingMapper.searchMarketTotal(activityId,stock); Integer total = fundingMapper.searchMarketTotal(activityId,stock);
if(total + addTotal >= 1500){
if(total + addTotal > 1500){
return Result.failure("所在市场助力值最大1500"); return Result.failure("所在市场助力值最大1500");
} }
if(total + addTotal < 0){
return Result.failure("所设置市场助力值不能小于0");
}
fundingMapper.setVirtual(activityId, stock, addTotal); fundingMapper.setVirtual(activityId, stock, addTotal);
return Result.success("设置虚拟次数成功"); return Result.success("设置虚拟次数成功");

16
lottery-system/lottery-service/src/main/java/com/lottery/api/service/Impl/ApiFundingServiceImpl.java

@ -181,6 +181,22 @@ public class ApiFundingServiceImpl implements ApiIFundingService {
if(rootNode.path("code").asInt() == 401){ if(rootNode.path("code").asInt() == 401){
return Result.failure("登录凭证错误"); return Result.failure("登录凭证错误");
} }
//市场二的总的助力次数
Integer markerTwoTotal = fundingMapper.searchMarketTotal(fundingRecordDto.getActivityId(), fundingRecordDto.getMarketSign());
if (markerTwoTotal == null) {
markerTwoTotal = 0; // 默认值
}
//市场二的虚拟次数
Integer markerTwoVirtual = fundingMapper.searchVirtual(fundingRecordDto.getActivityId(), fundingRecordDto.getMarketSign());
if (markerTwoVirtual == null) {
markerTwoVirtual = 0; // 默认值
}
Integer Show = markerTwoTotal + markerTwoVirtual;
if((Show+1)>1500){
return Result.failure(200,"美股实时数据助力成功!");
}
// 提取 username // 提取 username
String username = rootNode.path("data").path("username").asText(); String username = rootNode.path("data").path("username").asText();
String jwcode = rootNode.path("data").path("jwcode").asText(); String jwcode = rootNode.path("data").path("jwcode").asText();

Loading…
Cancel
Save