| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.rabbitmq.client.Channel; |
| | | import com.xcong.excoin.configurations.RabbitMqConfig; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.ChangeBondDto; |
| | | import com.xcong.excoin.modules.documentary.service.FollowOrderOperationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.Message; |
| | |
| | | followOrderOperationService.addFollowerOrder(Long.parseLong(content)); |
| | | } |
| | | |
| | | // @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND) |
| | | @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND) |
| | | public void changeFollowOrderBond(Message message, Channel channel) { |
| | | String content = new String(message.getBody()); |
| | | log.info("==收到跟单保证金调整消息 : {}", content); |
| | | Map map = JSONObject.parseObject(content, Map.class); |
| | | Integer id = (Integer) map.get("id"); |
| | | BigDecimal bond = (BigDecimal) map.get("bond"); |
| | | Integer type = (Integer) map.get("type"); |
| | | followOrderOperationService.changeFollowOrdersBond(id.longValue(), bond, type); |
| | | ChangeBondDto changeBondDto = JSONObject.parseObject(content, ChangeBondDto.class); |
| | | followOrderOperationService.changeFollowOrdersBond(changeBondDto.getId(), changeBondDto.getAmount(), changeBondDto.getType()); |
| | | } |
| | | } |