| | |
| | | package com.doumee.core.utils.qiyeweixin; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.utils.HttpsUtil; |
| | | import com.doumee.core.utils.qiyeweixin.model.request.QywxSendMsgRequest; |
| | | import com.doumee.core.utils.qiyeweixin.model.response.*; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.HashMap; |
| | |
| | | |
| | | private static QywxUtil qyUtil; |
| | | |
| | | @Value("${qiwei.serviceurl}") |
| | | // @Value("${qiwei.serviceurl}") |
| | | private String qiweiUrl; |
| | | |
| | | @PostConstruct |
| | | // @PostConstruct |
| | | private void init() { |
| | | qyUtil = this; |
| | | // QywxUtil.qiweiUrl = serviceurl; |
| | |
| | | try{ |
| | | String[] interfaceUrl = QywxConstant.SEND_MSG; |
| | | String url = interfaceUrl[0].replace("${accesstoken}",token); |
| | | QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1],JSONObject.toJSONString(param) |
| | | QywxSendMsgResponse response = sendHttpRequestSingle(url,interfaceUrl[1], JSONObject.toJSONString(param) |
| | | ,new TypeReference<QywxSendMsgResponse>(){}); |
| | | log.error("推送消息结果{}",JSONObject.toJSONString(response)); |
| | | if(response.getErrcode()!=null && response.getErrcode() ==0){ |