admin
2024-10-14 b9b263043cbb2e028017b9a5626c664b54513749
fanli/src/main/java/com/yeshi/fanli/util/CMQManager.java
@@ -93,88 +93,6 @@
        return cmqManager;
    }
    /**
     * 发送订单消息
     *
     * @param orderId
     */
    public void addTaoBaoOrderMsg(String orderId) {
        if (!StringUtil.isNullOrEmpty(orderId)) {
            tdmqUtil.sendMsg(QUEUENAME_ORDER, orderId);
        }
    }
    /**
     * 消费淘宝订单消息
     *
     * @param count
     */
    public List<String> consumeTaoBaoOrderMsg(int count) {
        List<String> resultList = new ArrayList<>();
        List<Message> list = tdmqUtil.recieveMsg(count, QUEUENAME_ORDER);
        if (list != null)
            for (Message msg : list) {
                String result = msg.msgBody;
                resultList.add(result);
                // 删除消息
                tdmqUtil.deleteMsg(QUEUENAME_ORDER, msg.receiptHandle);
            }
        return resultList;
    }
    /**
     * 删除淘宝订单消息
     *
     * @param receiptHandle
     */
    public void deleteTaoBaoOrderMsg(String receiptHandle) {
        tdmqUtil.deleteMsg(QUEUENAME_ORDER, receiptHandle);
    }
    /**
     * 发送订单消息(刚刚产生的订单)
     *
     * @param orderId
     */
    public void addTaoBaoNewOrderMsg(String orderId) {
        if (!StringUtil.isNullOrEmpty(orderId)) {
            tdmqUtil.sendMsg(QUEUENAME_NEW_ORDER, orderId);
        }
    }
    /**
     * 消费淘宝订单消息(刚刚产生的订单)
     *
     * @param count
     */
    public List<String> consumeTaoBaoNewOrderMsg(int count) {
        List<String> resultList = new ArrayList<>();
        List<Message> list = tdmqUtil.recieveMsg(count, QUEUENAME_NEW_ORDER);
        if (list != null)
            for (Message msg : list) {
                String result = msg.msgBody;
                resultList.add(result);
                // 删除消息
                tdmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, msg.receiptHandle);
            }
        return resultList;
    }
    /**
     * 删除淘宝订单消息(刚刚产生的订单)
     *
     * @param receiptHandle
     */
    public void deleteTaoBaoNewOrderMsg(String receiptHandle) {
        tdmqUtil.deleteMsg(QUEUENAME_NEW_ORDER, receiptHandle);
    }
    /**
     * 添加提现结果消息