jiangping
2025-04-23 eff9f8dce083c7ef911cb8419c03baf3af176c68
server/src/main/java/com/doumee/core/utils/qiyeweixin/QywxUtil.java
@@ -25,17 +25,16 @@
    private static JSONObject json = new JSONObject();
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
    private static QywxUtil qyUtil;
    @Value("${qiwei.serviceurl}")
    private static String qiweiUrl;
    private    String qiweiUrl;
    @PostConstruct
    private void init() {
        qyUtil = this;
        systemDictDataBiz = qyUtil.systemDictDataBiz;
//        QywxUtil.qiweiUrl =  serviceurl;
    }
@@ -89,6 +88,7 @@
            String url = interfaceUrl[0].replace("${accesstoken}",token);
            QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1],JSONObject.toJSONString(param)
                    ,new TypeReference<QywxSendMsgResponse>(){});
            log.error("推送消息结果{}",JSONObject.toJSONString(response));
            if(response.getErrcode()!=null && response.getErrcode() ==0){
                return response;
            }
@@ -156,12 +156,12 @@
     * @param <T>
     */
    public static   <T> QywxBaseResponse<T> sendHttpRequest(String url, String name, String param, TypeReference<QywxBaseResponse<T>> typeReference){
        log.info("【"+name+"】================开始===="+ JSONObject.toJSONString(param));
        log.info("【"+name+"】================开始===="+url+"\nparam==========================:"+ JSONObject.toJSONString(param));
        if ( StringUtils.isNotBlank(url)) {
            String res = null;
            try {
                Map<String,String> headers = new HashMap<>();
                res = HttpsUtil.postJson(qiweiUrl+url,param);
                res = HttpsUtil.postJson(qyUtil.qiweiUrl+url,param);
                QywxBaseResponse result = JSONObject.parseObject(res, typeReference.getType());
                logResult(result,name);
                return  result;
@@ -178,7 +178,7 @@
            String res = null;
            try {
                Map<String,String> headers = new HashMap<>();
                res = HttpsUtil.postJson(qiweiUrl+url,param);
                res = HttpsUtil.postJson(qyUtil.qiweiUrl+url,param);
                T result = JSONObject.parseObject(res, typeReference.getType());
//                logResult(result,name);
                return  result;