xuhy
2024-09-10 55c3b10c726509ed4b048c46d724d842c39d220d
ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/rocket/listener/BillingModeVerifyMessageListener.java
@@ -34,12 +34,6 @@
    @Autowired
    private BillingModeVerifyService billingModeVerifyService;
    @Autowired
    private IotMessageProduce iotMessageProduce;
    @Autowired
    private MessageUtil messageUtil;
    @Autowired
    private AccountingStrategyDetailClient accountingStrategyDetailClient;
    @Override
    protected void handleMessage(BillingModeVerifyMessage message) throws Exception {
@@ -50,28 +44,6 @@
        BeanUtils.copyProperties(message,billingModeVerify);
        billingModeVerifyService.create(billingModeVerify);
        // 业务处理
        BillingModeVerifyReply billingModeVerifyReply = new BillingModeVerifyReply();
        if(message.getBilling_model_code().equals("0")){
            // 首次
            billingModeVerifyReply.setCharging_pile_code(billingModeVerify.getCharging_pile_code());
            billingModeVerifyReply.setBilling_model_code("0");
            billingModeVerifyReply.setBilling_model_result(1);
        }else {
            // 查询桩使用的模版
            CheckChargingStrategyDTO dto = new CheckChargingStrategyDTO();
            dto.setCode(message.getBilling_model_code());
            dto.setStrategyDetailId(Integer.valueOf(message.getBilling_model_code()));
            Boolean check = accountingStrategyDetailClient.checkChargingStrategy(dto).getData();
            // 校验计费模版是否准确
            billingModeVerifyReply.setCharging_pile_code(billingModeVerify.getCharging_pile_code());
            billingModeVerifyReply.setBilling_model_code(message.getBilling_model_code());
            if(check){
                billingModeVerifyReply.setBilling_model_result(0);
            }else {
                billingModeVerifyReply.setBilling_model_result(1);
            }
        }
        iotMessageProduce.sendMessage(billingModeVerifyReply.getCharging_pile_code(), ServiceIdMenu.BILLING_MODE_VERIFY_REPLY.getKey(),messageUtil.billingModeVerifyReply(billingModeVerifyReply));
    }
    @Override