doum
19 小时以前 4936ba718f4ec2d069a9c28d07215573ed8548aa
server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java
@@ -9,6 +9,7 @@
import com.doumee.dao.business.dao.SmsEmailMapper;
import com.doumee.dao.business.model.Bookings;
import com.doumee.dao.business.model.SmsEmail;
import com.doumee.dao.system.model.SystemDictData;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -27,6 +28,12 @@
@Component
public class WxPlatNotice {
    public String  getAccessToken(String appid,String secret) {
        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret;
        String response = HttpsUtil.get(url,false);
        JSONObject json = JSONObject.parseObject(response);
        return json.getString("access_token");
    }
    public void  testSendNotice(List<String> openIds,String token){
        if(CollectionUtils.isNotEmpty(openIds)){
            String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
@@ -120,8 +127,6 @@
    }
    public void createBeginWxNotice(SystemDictDataBiz systemDictDataBiz, SmsEmailMapper smsEmailMapper, Bookings bookings, String openId){
        Map<String,Object> map = new HashMap<>();
        //整体参数map
        Map<String, Object> paramMap = new HashMap<String, Object>();
        //消息主题显示相关map
@@ -195,7 +200,6 @@
        paramMap.put("template_id", "vdIPfwvDCrXOHgQnB6sdE1lGEsJm1oUURfLx6SoLdk0");
        paramMap.put("touser", openId);
        paramMap.put("data", dataMap);
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setPhone(openId);
        smsEmail.setRemark("等待发送");