package cn.hanghui.outapi.platform.alipay.config;

import cn.hanghui.outapi.platform.alipay.constant.AlipayFaceAuthParam;
import cn.hanghui.outapi.platform.alipay.constant.AlipayOpenApiProperties;
import cn.hanghui.outapi.platform.alipay.entity.rest.request.AlipayAppAuthCancelledMqRequest;
import cn.hanghui.outapi.platform.alipay.entity.rest.request.AlipayUserCreateOpenMqRequest;
import cn.hanghui.outapi.platform.alipay.entity.rest.request.AlipayUserDeleteOpenMqRequest;
import cn.hanghui.outapi.platform.alipay.service.AlipayOpenApiService;
import cn.hanghui.outapi.platform.tenant.service.TenantService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.msg.AlipayMsgClient;
import com.alipay.api.msg.MsgHandler;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Data
@Configuration
@Slf4j
@Component
public class AlipayConfig {

    @Autowired
    private TenantService tenantService;

    @Autowired
    @Lazy
    private AlipayOpenApiService alipayOpenApiService;

    /**
     * 支付宝人脸服务客户端
     *
     * @param alipayFaceAuthParam AlipayFaceParam
     * @return AlipayClient
     */
    @Bean(name = "alipayFaceAuthClient")
    @Qualifier(value = "alipayFaceAuthClient")
    public AlipayClient alipayFaceAuthClient(AlipayFaceAuthParam alipayFaceAuthParam) {
        return new DefaultAlipayClient(alipayFaceAuthParam.getGateway(),
                alipayFaceAuthParam.getAppid(),
                alipayFaceAuthParam.getPrivateKey(),
                "json", "utf-8", alipayFaceAuthParam.getAlipayPublicKey(), "RSA2");
    }

    /**
     * 2188
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient")
    @Qualifier(value = "alipayOpenApiClient")
    public AlipayClient alipayOpenApiClient(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId(), alipayOpenApiProperties.getAlipayPrivateKey(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey(), alipayOpenApiProperties.getSignType());
    }

    @Bean(name = "alipayOpenApiClient5513")
    @Qualifier(value = "alipayOpenApiClient5513")
    public AlipayClient alipayOpenApiClient5513(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId5513(), alipayOpenApiProperties.getAlipayPrivateKey5513(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey5513(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 苏州园林
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient2189")
    @Qualifier(value = "alipayOpenApiClient2189")
    public AlipayClient alipayOpenApiClient2189(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId2189(), alipayOpenApiProperties.getAlipayPrivateKey2189(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey2189(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 易行智慧校园
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient5069")
    @Qualifier(value = "alipayOpenApiClient5069")
    public AlipayClient alipayOpenApiClient5069(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId5069(), alipayOpenApiProperties.getAlipayPrivateKey5069(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey5069(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 温测安
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient4661")
    @Qualifier(value = "alipayOpenApiClient4661")
    public AlipayClient alipayOpenApiClient4661(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId4661(), alipayOpenApiProperties.getAlipayPrivateKey4661(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey4661(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 无锡机场
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient3138")
    @Qualifier(value = "alipayOpenApiClient3138")
    public AlipayClient alipayOpenApiClient3138(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId3138(), alipayOpenApiProperties.getAlipayPrivateKey3138(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey3138(), alipayOpenApiProperties.getSignType());
    }

    /**
     * HHWindows_lssfzm支付宝
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient5736")
    @Qualifier(value = "alipayOpenApiClient5736")
    public AlipayClient alipayOpenApiClient5736(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId5736(), alipayOpenApiProperties.getAlipayPrivateKey5736(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey5736(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 易行临证通
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient2053")
    @Qualifier(value = "alipayOpenApiClient2053")
    public AlipayClient alipayOpenApiClient2053(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId2053(), alipayOpenApiProperties.getAlipayPrivateKey2053(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey2053(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 部队预约
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient9881")
    @Qualifier(value = "alipayOpenApiClient9881")
    public AlipayClient alipayOpenApiClient9881(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId9881(), alipayOpenApiProperties.getAlipayPrivateKey9881(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey9881(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 沈阳博物馆
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient1032")
    @Qualifier(value = "alipayOpenApiClient1032")
    public AlipayClient alipayOpenApiClient1032(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId1032(), alipayOpenApiProperties.getAlipayPrivateKey1032(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey1032(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 咸宁嘉鱼扫脸办
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient6873")
    @Qualifier(value = "alipayOpenApiClient6873")
    public AlipayClient alipayOpenApiClient6873(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId6873(), alipayOpenApiProperties.getAlipayPrivateKey6873(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey6873(), alipayOpenApiProperties.getSignType());
    }

    /**
     * 雕龙云
     *
     * @param alipayOpenApiProperties
     * @return
     */
    @Bean(name = "alipayOpenApiClient1942")
    @Qualifier(value = "alipayOpenApiClient1942")
    public AlipayClient alipayOpenApiClient1942(AlipayOpenApiProperties alipayOpenApiProperties) {
        return new DefaultAlipayClient(alipayOpenApiProperties.getALIPAY_SERVICE_URL(),
                alipayOpenApiProperties.getAppId1942(), alipayOpenApiProperties.getAlipayPrivateKey1942(),
                alipayOpenApiProperties.getFormat(), alipayOpenApiProperties.getCharset(),
                alipayOpenApiProperties.getAlipayPublicKey1942(), alipayOpenApiProperties.getSignType());
    }

//    /**
//     * 消息订阅 (航汇支付宝商户平台)
//     * ⚠️注意：非航汇支付宝商户平台部署时可注释掉
//     * 三方授权
//     *
//     * @param alipayOpenApiProperties
//     * @return
//     */
//    @Bean(name = "alipayMsgClient5513")
//    @Qualifier(value = "alipayMsgClient5513")
//    public AlipayMsgClient alipayMsgClient5513(AlipayOpenApiProperties alipayOpenApiProperties) {
//        AlipayMsgClient alipayMsgClient = AlipayMsgClient.getInstance(alipayOpenApiProperties.getAppId5513());
//        try {
//            alipayMsgClient.setConnector(alipayOpenApiProperties.getOPENCHANNEL_SERVICE_URL());
//            alipayMsgClient.setSecurityConfig(alipayOpenApiProperties.getSignType(), alipayOpenApiProperties.getAlipayPrivateKey5513(), alipayOpenApiProperties.getAlipayPublicKey5513());
//            alipayMsgClient.setCharset(alipayOpenApiProperties.getCharset());
//            alipayMsgClient.setMessageHandler(new MsgHandler() {
//                /**
//                 * 客户端接收到消息后回调此方法
//                 *  @param  msgApi 接收到的消息的消息api名
//                 *  @param  msgId 接收到的消息的消息id
//                 *  @param  bizContent 接收到的消息的内容，json格式
//                 */
//                @Override
//                public void onMessage(String msgApi, String msgId, String bizContent) {
//                    log.info("--->三方授权客户端接收到消息后回调此方法响应参数msgApi:{}, msgId:{}, bizContent:{}", msgApi, msgId, bizContent);
//                    switch (msgApi) {
//                        case "alipay.open.auth.appauth.cancelled":
//                            AlipayAppAuthCancelledMqRequest appAuthCancelledMqRequest = JSON.parseObject(bizContent, AlipayAppAuthCancelledMqRequest.class);
//                            //TODO 第三方应用授权取消
//                            log.info("--->三方授权第三方应用授权取消消息，接收到的消息内容参数:{}", JSONObject.toJSONString(appAuthCancelledMqRequest));
//                            tenantService.appAuthCancelled(appAuthCancelledMqRequest);
//                            break;
//                        default:
//                            break;
//                    }
//                }
//            });
//            alipayMsgClient.connect();
//        } catch (Exception e) {
//            log.error("--->三方授权消息订阅websocket连接异常", e);
//        }
//        return alipayMsgClient;
//    }
//
//    /**
//     * 消息订阅 (航汇支付宝商户平台)
//     * ⚠️注意：非航汇支付宝商户平台部署时可注释掉
//     *
//     * @param alipayOpenApiProperties
//     * @return
//     */
//    @Bean(name = "alipayMsgClient2188")
//    @Qualifier(value = "alipayMsgClient2188")
//    public AlipayMsgClient alipayMsgClient2188(AlipayOpenApiProperties alipayOpenApiProperties) {
//        AlipayMsgClient alipayMsgClient = AlipayMsgClient.getInstance(alipayOpenApiProperties.getAppId());
//        try {
//            alipayMsgClient.setConnector(alipayOpenApiProperties.getOPENCHANNEL_SERVICE_URL());
//            alipayMsgClient.setSecurityConfig(alipayOpenApiProperties.getSignType(), alipayOpenApiProperties.getAlipayPrivateKey(), alipayOpenApiProperties.getAlipayPublicKey());
//            alipayMsgClient.setCharset(alipayOpenApiProperties.getCharset());
//            alipayMsgClient.setMessageHandler(new MsgHandler() {
//                /**
//                 * 客户端接收到消息后回调此方法
//                 *  @param  msgApi 接收到的消息的消息api名
//                 *  @param  msgId 接收到的消息的消息id
//                 *  @param  bizContent 接收到的消息的内容，json格式
//                 */
//                @Override
//                public void onMessage(String msgApi, String msgId, String bizContent) {
//                    log.info("--->客户端接收到消息后回调此方法响应参数msgApi:{}, msgId:{}, bizContent:{}", msgApi, msgId, bizContent);
//                    switch (msgApi) {
//                        case "alipay.open.iotvsp.usercreate.notify":
//                            AlipayUserCreateOpenMqRequest createOpenMqRequest = JSON.parseObject(bizContent, AlipayUserCreateOpenMqRequest.class);
//                            //TODO 执行入库成功或失败处理
//                            log.info("--->执行入库成功或失败处理响应参数:{}", JSONObject.toJSONString(createOpenMqRequest));
//                            alipayOpenApiService.notifyCreateUserState(createOpenMqRequest);
//                            break;
//                        case "alipay.open.iotvsp.userdelete.notify":
//                            AlipayUserDeleteOpenMqRequest deleteOpenMqRequest = JSON.parseObject(bizContent, AlipayUserDeleteOpenMqRequest.class);
//                            //TODO 执行出库成功或失败处理
//                            log.info("--->执行出库成功或失败处理响应参数:{}", JSONObject.toJSONString(deleteOpenMqRequest));
//                            alipayOpenApiService.notifyDelUserState(deleteOpenMqRequest);
//                            break;
//                        default:
//                            break;
//                    }
//                }
//            });
//            alipayMsgClient.connect();
//        } catch (Exception e) {
//            log.error("--->消息订阅websocket连接异常", e);
//        }
//        return alipayMsgClient;
//    }
//
//    /**
//     * 消息订阅 苏州园林 (航汇支付宝商户平台)
//     * ⚠️注意：非航汇支付宝商户平台部署时可注释掉
//     *
//     * @param alipayOpenApiProperties
//     * @return
//     */
//    @Bean(name = "alipayMsgClient2189")
//    @Qualifier(value = "alipayMsgClient2189")
//    public AlipayMsgClient alipayMsgClient2189(AlipayOpenApiProperties alipayOpenApiProperties) {
//        AlipayMsgClient alipayMsgClient = AlipayMsgClient.getInstance(alipayOpenApiProperties.getAppId2189());
//        try {
//            alipayMsgClient.setConnector(alipayOpenApiProperties.getOPENCHANNEL_SERVICE_URL());
//            alipayMsgClient.setSecurityConfig(alipayOpenApiProperties.getSignType(), alipayOpenApiProperties.getAlipayPrivateKey2189(), alipayOpenApiProperties.getAlipayPublicKey2189());
//            alipayMsgClient.setCharset(alipayOpenApiProperties.getCharset());
//            alipayMsgClient.setMessageHandler(new MsgHandler() {
//                /**
//                 * 客户端接收到消息后回调此方法
//                 *  @param  msgApi 接收到的消息的消息api名
//                 *  @param  msgId 接收到的消息的消息id
//                 *  @param  bizContent 接收到的消息的内容，json格式
//                 */
//                @Override
//                public void onMessage(String msgApi, String msgId, String bizContent) {
//                    log.info("--->苏州园林客户端接收到消息后回调此方法响应参数msgApi:{}, msgId:{}, bizContent:{}", msgApi, msgId, bizContent);
//                    switch (msgApi) {
//                        case "alipay.open.iotvsp.usercreate.notify":
//                            AlipayUserCreateOpenMqRequest createOpenMqRequest = JSON.parseObject(bizContent, AlipayUserCreateOpenMqRequest.class);
//                            //TODO 执行入库成功或失败处理
//                            log.info("--->苏州园林执行入库成功或失败处理响应参数:{}", JSONObject.toJSONString(createOpenMqRequest));
//                            alipayOpenApiService.notifyCreateUserState(createOpenMqRequest);
//                            break;
//                        case "alipay.open.iotvsp.userdelete.notify":
//                            AlipayUserDeleteOpenMqRequest deleteOpenMqRequest = JSON.parseObject(bizContent, AlipayUserDeleteOpenMqRequest.class);
//                            //TODO 执行出库成功或失败处理
//                            log.info("--->苏州园林执行出库成功或失败处理响应参数:{}", JSONObject.toJSONString(deleteOpenMqRequest));
//                            alipayOpenApiService.notifyDelUserState(deleteOpenMqRequest);
//                            break;
//                        default:
//                            break;
//                    }
//                }
//            });
//            alipayMsgClient.connect();
//        } catch (Exception e) {
//            log.error("--->苏州园林消息订阅websocket连接异常", e);
//        }
//        return alipayMsgClient;
//    }
//
//    /**
//     * 消息订阅 (航汇支付宝商户平台)
//     * ⚠️注意：非航汇支付宝商户平台部署时可注释掉
//     * <p>
//     * 易行智慧校园
//     *
//     * @param alipayOpenApiProperties
//     * @return
//     */
//    @Bean(name = "alipayMsgClient5069")
//    @Qualifier(value = "alipayMsgClient5069")
//    public AlipayMsgClient alipayMsgClient5069(AlipayOpenApiProperties alipayOpenApiProperties) {
//        AlipayMsgClient alipayMsgClient = AlipayMsgClient.getInstance(alipayOpenApiProperties.getAppId5069());
//        try {
//            alipayMsgClient.setConnector(alipayOpenApiProperties.getOPENCHANNEL_SERVICE_URL());
//            alipayMsgClient.setSecurityConfig(alipayOpenApiProperties.getSignType(), alipayOpenApiProperties.getAlipayPrivateKey5069(), alipayOpenApiProperties.getAlipayPublicKey5069());
//            alipayMsgClient.setCharset(alipayOpenApiProperties.getCharset());
//            alipayMsgClient.setMessageHandler(new MsgHandler() {
//                /**
//                 * 客户端接收到消息后回调此方法
//                 *  @param  msgApi 接收到的消息的消息api名
//                 *  @param  msgId 接收到的消息的消息id
//                 *  @param  bizContent 接收到的消息的内容，json格式
//                 */
//                @Override
//                public void onMessage(String msgApi, String msgId, String bizContent) {
//                    log.info("--->易行智慧校园客户端接收到消息后回调此方法响应参数msgApi:{}, msgId:{}, bizContent:{}", msgApi, msgId, bizContent);
//                    switch (msgApi) {
//                        case "alipay.open.iotvsp.usercreate.notify":
//                            AlipayUserCreateOpenMqRequest createOpenMqRequest = JSON.parseObject(bizContent, AlipayUserCreateOpenMqRequest.class);
//                            //TODO 执行入库成功或失败处理
//                            log.info("--->易行智慧校园执行入库成功或失败处理响应参数:{}", JSONObject.toJSONString(createOpenMqRequest));
//                            alipayOpenApiService.notifyCreateUserState(createOpenMqRequest);
//                            break;
//                        case "alipay.open.iotvsp.userdelete.notify":
//                            AlipayUserDeleteOpenMqRequest deleteOpenMqRequest = JSON.parseObject(bizContent, AlipayUserDeleteOpenMqRequest.class);
//                            //TODO 执行出库成功或失败处理
//                            log.info("--->易行智慧校园执行出库成功或失败处理响应参数:{}", JSONObject.toJSONString(deleteOpenMqRequest));
//                            alipayOpenApiService.notifyDelUserState(deleteOpenMqRequest);
//                            break;
//                        default:
//                            break;
//                    }
//                }
//            });
//            alipayMsgClient.connect();
//        } catch (Exception e) {
//            log.error("--->易行智慧校园消息订阅websocket连接异常", e);
//        }
//        return alipayMsgClient;
//    }
//    /**
//     * 消息订阅 (航汇支付宝商户平台)
//     * ⚠️注意：非航汇支付宝商户平台部署时可注释掉
//     * <p>
//     * 部队预约
//     *
//     * @param alipayOpenApiProperties
//     * @return
//     */
//    @Bean(name = "alipayMsgClient9881")
//    @Qualifier(value = "alipayMsgClient9881")
//    public AlipayMsgClient alipayMsgClient9881(AlipayOpenApiProperties alipayOpenApiProperties) {
//        AlipayMsgClient alipayMsgClient = AlipayMsgClient.getInstance(alipayOpenApiProperties.getAppId9881());
//        try {
//            alipayMsgClient.setConnector(alipayOpenApiProperties.getOPENCHANNEL_SERVICE_URL());
//            alipayMsgClient.setSecurityConfig(alipayOpenApiProperties.getSignType(), alipayOpenApiProperties.getAlipayPrivateKey9881(), alipayOpenApiProperties.getAlipayPublicKey9881());
//            alipayMsgClient.setCharset(alipayOpenApiProperties.getCharset());
//            alipayMsgClient.setMessageHandler(new MsgHandler() {
//                /**
//                 * 客户端接收到消息后回调此方法
//                 *  @param  msgApi 接收到的消息的消息api名
//                 *  @param  msgId 接收到的消息的消息id
//                 *  @param  bizContent 接收到的消息的内容，json格式
//                 */
//                @Override
//                public void onMessage(String msgApi, String msgId, String bizContent) {
//                    log.info("--->部队预约客户端接收到消息后回调此方法响应参数msgApi:{}, msgId:{}, bizContent:{}", msgApi, msgId, bizContent);
//                    switch (msgApi) {
//                        case "alipay.open.iotvsp.usercreate.notify":
//                            AlipayUserCreateOpenMqRequest createOpenMqRequest = JSON.parseObject(bizContent, AlipayUserCreateOpenMqRequest.class);
//                            //TODO 执行入库成功或失败处理
//                            log.info("--->部队预约执行入库成功或失败处理响应参数:{}", JSONObject.toJSONString(createOpenMqRequest));
//                            alipayOpenApiService.notifyCreateUserState(createOpenMqRequest);
//                            break;
//                        case "alipay.open.iotvsp.userdelete.notify":
//                            AlipayUserDeleteOpenMqRequest deleteOpenMqRequest = JSON.parseObject(bizContent, AlipayUserDeleteOpenMqRequest.class);
//                            //TODO 执行出库成功或失败处理
//                            log.info("--->部队预约执行出库成功或失败处理响应参数:{}", JSONObject.toJSONString(deleteOpenMqRequest));
//                            alipayOpenApiService.notifyDelUserState(deleteOpenMqRequest);
//                            break;
//                        default:
//                            break;
//                    }
//                }
//            });
//            alipayMsgClient.connect();
//        } catch (Exception e) {
//            log.error("--->部队预约消息订阅websocket连接异常", e);
//        }
//        return alipayMsgClient;
//    }
}
