@Override
    public void dealSeckill(long seckillId, String userPhone, String note, String taskId) {
        try {
            InetAddress localHost = InetAddress.getLocalHost();
            SuccessKilledDTO successKilled = new SuccessKilledDTO();
            successKilled.setSeckillId(seckillId);
            successKilled.setUserPhone(userPhone);
            successKilled.setCreateTime(new Date());
            successKilled.setServerIp(localHost.getHostAddress() + ":" + localHost.getHostName());
            if (seckillService.reduceNumber(successKilled) < 1) {
                Seckill seckill = seckillMapper.selectById(seckillId);
                log.debug("#dealSeckill 当前库存：{}，秒杀活动id:{}，商品id:{}", seckill.getNumber(), seckill.getSeckillId(), seckill.getGoodsId());
                if (stateMachineService.checkState(seckillId, States.IN_PROGRESS)) {
                    stateMachineService.feedMachine(Events.ACTIVITY_CALCULATE, seckillId);
                    // 高并发时可能多次发送完成通知，使用锁控制
                    Boolean endFlag = redisService.setSeckillEndFlag(seckillId, taskId);
                    if (endFlag) {
                        streamBridge.send(DEFAULT_BINDING_NAME, MessageBuilder.withPayload(
                                        SeckillMockResponseDTO.builder().seckillId(seckillId).note(note).status(true).taskId(taskId).build())
                                .build());
                        log.info("#dealSeckill 商品已售罄，最新秒杀信息：{}", seckill);
                    }
                }
                if (seckill.getNumber() <= 0) {
                    log.debug("#dealSeckill 库存不足，无法继续秒杀！");
                }
            }
        } catch (UnknownHostException e) {
            log.error(e.getMessage(), e);
        }
    }
@Test
    void dealSeckill() {
        long seckillId = 1001L;
        Seckill seckill = new Seckill();
        seckill.setNumber(0);
        when(seckillMapper.selectById(seckillId)).thenReturn(seckill);
        seckillProcedureExecutor.dealSeckill(seckillId, "123", "test", "1");
        Seckill updateSeckill = new Seckill();
        updateSeckill.setSeckillId(seckillId);
//        updateSeckill.setStatus(SeckillStatusConstant.END);
        verify(seckillMapper, times(1)).selectById(seckillId);
    }