|
@@ -5,13 +5,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import me.zhengjie.base.BaseResponse;
|
|
|
import me.zhengjie.modules.dm.messageSendLog.domain.DmMessageSendLog;
|
|
|
+import me.zhengjie.modules.dm.messageSendLog.domain.SendMsgParam;
|
|
|
import me.zhengjie.modules.dm.messageSendLog.service.DmMessageSendLogService;
|
|
|
import me.zhengjie.utils.StringUtils;
|
|
|
|
|
|
@Slf4j
|
|
|
public class SendMessageUtils {
|
|
|
|
|
|
- private static String erpapiUrl = "http://10.20.2.231:10088";
|
|
|
+ private static String erpapiUrl = "https://portal.caih.com";
|
|
|
|
|
|
/**
|
|
|
* 发送
|
|
@@ -28,8 +29,6 @@ public class SendMessageUtils {
|
|
|
bodyJSON.put("messageTo",dmMessageSendLog.getUsernames());
|
|
|
log.info("bodyJSON:"+bodyJSON.toJSONString());
|
|
|
String res = HttpRequest.get(erpapiUrl+url)
|
|
|
- .header("serviceId", "USky")
|
|
|
- .header("serviceUserId",dmMessageSendLog.getSendUserId())
|
|
|
.body(bodyJSON.toJSONString()).execute().body();
|
|
|
JSONObject json = JSONObject.parseObject(res);
|
|
|
log.info("json:"+json);
|
|
@@ -41,4 +40,18 @@ public class SendMessageUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 发送
|
|
|
+ */
|
|
|
+ public static Boolean sendMsg(SendMsgParam sendMsgParam){
|
|
|
+ String url = "/api-third-party/otherSystem/sendMsg?authKey=purchasing_platform&phone="+sendMsgParam.getPhone()+"&context="+sendMsgParam.getContext();
|
|
|
+ String res = HttpRequest.get(erpapiUrl+url).execute().body();
|
|
|
+ log.info("res:"+res);
|
|
|
+ if(StringUtils.equals("success",res)){
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|