| | |
| | | import com.ruoyi.integration.mongodb.service.BmsDemandAndChargerExportationService; |
| | | import com.ruoyi.integration.rocket.model.BmsDemandAndChargerExportationMessage; |
| | | import com.ruoyi.integration.rocket.util.EnhanceMessageHandler; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.rocketmq.spring.annotation.MessageModel; |
| | | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @Slf4j |
| | | @Component |
| | |
| | | |
| | | @Autowired |
| | | private BmsDemandAndChargerExportationService bmsDemandAndChargerExportationService; |
| | | @Autowired |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @Override |
| | | protected void handleMessage(BmsDemandAndChargerExportationMessage message) throws Exception { |
| | | // 此时这里才是最终的业务处理,代码只需要处理资源类关闭异常,其他的可以交给父类重试 |
| | |
| | | BeanUtils.copyProperties(message,bmsDemandAndChargerExportation); |
| | | bmsDemandAndChargerExportationService.create(bmsDemandAndChargerExportation); |
| | | // 业务处理 |
| | | TChargingOrder chargingOrder = chargingOrderClient.getOrderByCode(message.getTransaction_serial_number()).getData(); |
| | | if(Objects.nonNull(chargingOrder)){ |
| | | chargingOrder.setNeedElec(message.getBms_current_requirements()); |
| | | chargingOrderClient.updateChargingOrder(chargingOrder); |
| | | } |
| | | } |
| | | |
| | | @Override |