| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | |
| | | 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()); |