| | |
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.rabbit.pricequeue.OrderModel; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import com.xcong.excoin.utils.CacheSettingUtils; |
| | | import com.xcong.excoin.utils.CoinTypeConvert; |
| | | import com.xcong.excoin.utils.MessageSourceUtils; |
| | | import com.xcong.excoin.utils.RedisUtils; |
| | | import com.xcong.excoin.utils.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | if (submitEntrustDto.getEntrustType() == ContractEntrustOrderEntity.ENTRUST_TYPE_OPEN_MORE) { |
| | | OrderModel model = new OrderModel(entrustOrderEntity.getId(), RabbitPriceTypeEnum.ENTRUST_OPEN_MORE.getValue(), submitEntrustDto.getEntrustPrice().setScale(8, RoundingMode.HALF_UP).toPlainString(), submitEntrustDto.getSymbol()); |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | |
| | | LogRecordUtils.insertMemberAccountFlow(memberEntity.getId(), entrustTotalAmount, walletContract.getTotalBalance(), submitEntrustDto.getSymbol(), "买涨持仓", "买涨:" + submitEntrustDto.getSymbol()); |
| | | } else { |
| | | OrderModel model = new OrderModel(entrustOrderEntity.getId(), RabbitPriceTypeEnum.ENTRUST_OPEN_LESS.getValue(), submitEntrustDto.getEntrustPrice().setScale(8, RoundingMode.HALF_UP).toPlainString(), submitEntrustDto.getSymbol()); |
| | | producer.sendPriceOperate(JSONObject.toJSONString(model)); |
| | | |
| | | LogRecordUtils.insertMemberAccountFlow(memberEntity.getId(), entrustTotalAmount, walletContract.getTotalBalance(), submitEntrustDto.getSymbol(), "买跌持仓", "买跌:" + submitEntrustDto.getSymbol()); |
| | | } |
| | | |
| | | return Result.ok(MessageSourceUtils.getString("result_success_msg")); |
| | | } else { |
| | | return Result.fail(MessageSourceUtils.getString("result_fail_msg")); |
| | |
| | | int i = contractOrderDao.insert(orderEntity); |
| | | |
| | | contractEntrustOrderDao.deleteById(entrustOrderEntity.getId()); |
| | | |
| | | // 插入财务流水 |
| | | LogRecordUtils.insertMemberAccountFlow(memberEntity.getId(), total, walletContractEntity.getTotalBalance(), entrustOrderEntity.getSymbol(), "撤销委托单", "撤销委托单"); |
| | | if (i > 0) { |
| | | return Result.ok(MessageSourceUtils.getString("cancellation_success")); |
| | | } |