1
zj
2024-08-14 b6477d60938ba624e0f45bda4656443b90c39a18
src/main/java/project/contract/internal/ContractOrderServiceImpl.java
@@ -7,7 +7,6 @@
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import kernel.util.Arith;
import kernel.util.DateUtils;
@@ -15,6 +14,7 @@
import kernel.web.ApplicationUtil;
import kernel.web.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import project.Constants;
import project.contract.ContractApplyOrder;
import project.contract.ContractApplyOrderService;
@@ -129,8 +129,19 @@
      double profit = this.settle(order, volume);
      update(order);
//      if (profit > 0) {
      Wallet wallet = this.walletService.saveWalletByPartyId(order.getPartyId());
      double amount_before = wallet.getMoney();
      Object money = redisHandler.get("PARTY_ID_MONEY_" + order.getPartyId().toString());
      if(ObjectUtils.isEmpty(money)){
         wallet.setMoney(wallet.getMoney());
      }else{
         wallet.setMoney(Double.parseDouble(money.toString()));
      }
      if (Arith.add(wallet.getMoney(), profit) < 0) {
         profit = Arith.sub(0, wallet.getMoney());
      }
//      wallet.setMoney(Arith.add(wallet.getMoney(), profit));/
      if (Arith.add(wallet.getMoney(), profit) < 0) {
@@ -202,7 +213,12 @@
      Wallet wallet = this.walletService.saveWalletByPartyId(order.getPartyId());
      double amount_before = wallet.getMoney();
      Object money = redisHandler.get("PARTY_ID_MONEY_" + order.getPartyId().toString());
      if(ObjectUtils.isEmpty(money)){
         wallet.setMoney(wallet.getMoney());
      }else{
         wallet.setMoney(Double.parseDouble(money.toString()));
      }
      if (Arith.add(wallet.getMoney(), profit) < 0) {
         profit = Arith.sub(0, wallet.getMoney());