| | |
| | | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.xcong.excoin.modules.otc.vo.EntrustListVo; |
| | | import com.xcong.excoin.modules.otc.vo.EntrustOrderDetailVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import netscape.javascript.JSObject; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class OtcEntrustOrderServiceImpl extends ServiceImpl<OtcEntrustOrderDao, OtcEntrustOrder> implements OtcEntrustOrderService { |
| | |
| | | throw new GlobalException("最大限额应小于总金额"); |
| | | } |
| | | |
| | | log.info("----->>>{}", JSONObject.toJSONString(addDto)); |
| | | if (OtcEntrustOrder.ORDER_TYPE_S.equals(addDto.getType())) { |
| | | MemberWalletCoinEntity coinWallet = memberWalletCoinDao.selectWalletCoinBymIdAndCode(member.getId(), "USDT"); |
| | | // BigDecimal multiply = addDto.getUnitPrice().multiply(coinWallet.getAvailableBalance()); |
| | |
| | | throw new GlobalException("可用金额不足"); |
| | | } |
| | | |
| | | memberWalletCoinDao.updateFrozenBalance(member.getId(), coinWallet.getId(), addDto.getAmount()); |
| | | int i =memberWalletCoinDao.updateFrozenBalance(member.getId(), coinWallet.getId(), addDto.getAmount()); |
| | | log.info("=========>{}", i); |
| | | } |
| | | |
| | | if (!MemberEntity.IS_TRADER_Y.equals(member.getIsTrader())) { |