Просмотр исходного кода

[短信][修改][发送短信时带上modelId]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
531f42586c
1 измененных файлов: 12 добавлений и 2 удалений
  1. +12
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/MsgSendingSchedule.java

+ 12
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/MsgSendingSchedule.java Просмотреть файл

@@ -4,12 +4,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.iformall.domain.po.WxMsg;
import com.iformall.domain.po.WxMsgConfig;
import com.iformall.domain.po.WxMsgModel;
import com.iformall.enums.EnumMsgSendStatus;
import com.iformall.enums.EnumMsgStatus;
import com.iformall.enums.EnumVerifyCode;
import com.iformall.mapper.WxMsgConfigMapper;
import com.iformall.mapper.WxMsgMapper;
import com.iformall.service.PushLimitService;
import com.iformall.mapper.WxMsgModelMapper;
import com.iformall.utils.DateUtils;
import com.iformall.utils.WiwideUtil;
import org.slf4j.Logger;
@@ -34,6 +35,9 @@ public class MsgSendingSchedule {
@Autowired
private WxMsgConfigMapper wxMsgConfigMapper;

@Autowired
private WxMsgModelMapper wxMsgModelMapper;

/**
* 每小时第一分钟执行
*/
@@ -78,7 +82,13 @@ public class MsgSendingSchedule {
String signature = wxMsg.getSignature();
String msg = wxMsg.getMsg();
String notifyUrl = wxMsgConfig.getNotifyurl();
String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.NO.getCode().toString());
Integer modelId = null;
Long modelIdParam = wxMsg.getModelId();
if (modelIdParam != null) {
WxMsgModel wxMsgModel = wxMsgModelMapper.selectByPrimaryKey(modelIdParam);
modelId = wxMsgModel.getModelId();
}
String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.NO.getCode().toString(), modelId);
logger.info("短信返回结果:" + result);
JSONObject jsonObjectResult = JSONObject.parseObject(result);
String ret = jsonObjectResult.get("ret").toString();


Загрузка…
Отмена
Сохранить