| | |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity; |
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import com.xcong.excoin.utils.CacheSettingUtils; |
| | | import com.xcong.excoin.utils.CoinTypeConvert; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Resource |
| | | private OrderProducer producer; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | // 暂默认逐仓 |
| | | entrustOrderEntity.setPositionType(ContractEntrustOrderEntity.POSITION_TYPE_ADD); |
| | | |
| | | // int i = contractEntrustOrderDao.insert(entrustOrderEntity); |
| | | int i = contractEntrustOrderDao.insert(entrustOrderEntity); |
| | | |
| | | walletContract.setFrozenBalance(walletContract.getFrozenBalance().add(entrustTotalAmount)); |
| | | walletContract.setAvailableBalance(walletContract.getAvailableBalance().subtract(entrustTotalAmount)); |
| | | // memberWalletContractDao.updateById(walletContract); |
| | | if (1 > 0) { |
| | | memberWalletContractDao.updateById(walletContract); |
| | | if (i > 0) { |
| | | return Result.ok("委托成功"); |
| | | } else { |
| | | return Result.fail("委托失败"); |