MrShi
2026-01-13 3a154bdb0a5aaa2c0ac3eac95a6ba747068bd454
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;
@@ -149,12 +156,6 @@
        paramMap.put("touser", openId);
        paramMap.put("data", dataMap);
        smsEmailMapper.delete(new QueryWrapper<SmsEmail>().lambda()
                .eq(SmsEmail::getObjType,Constants.FIVE.toString())
                .eq(SmsEmail::getStatus,Constants.TWO)
                .eq(SmsEmail::getType,Constants.TWO)
                .eq(SmsEmail::getObjId,bookings.getId())
        );
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setPhone(openId);
@@ -200,7 +201,10 @@
        paramMap.put("touser", openId);
        paramMap.put("data", dataMap);
<<<<<<< HEAD
=======
>>>>>>> 5e91539195106afc3a03e7bd006786409ecd9b5d
        SmsEmail smsEmail = new SmsEmail();
        smsEmail.setPhone(openId);
        smsEmail.setRemark("等待发送");
@@ -214,10 +218,14 @@
        Integer endMin= Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.OVER_NOTICE_WX).getCode());
        smsEmail.setInfo(DateUtil.getFomartDate(DateUtil.getXMinuteAfterDate(bookings.getEndTime(),-endMin),"yyyy-MM-dd HH:mm:ss"));
        smsEmail.setContent(JSONObject.toJSONString(paramMap));
<<<<<<< HEAD
        smsEmailMapper.insert(smsEmail);
=======
        smsEmailMapper.insert(smsEmail);
>>>>>>> 5e91539195106afc3a03e7bd006786409ecd9b5d
    }