|
|
@@ -2,6 +2,7 @@ package com.fs.gtPush.service.impl;
|
|
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
@@ -14,6 +15,9 @@ import com.fs.gtPush.domain.UniPushLog;
|
|
|
import com.fs.gtPush.service.UniPushLogService;
|
|
|
import com.fs.gtPush.service.uniPush2Service;
|
|
|
import com.fs.im.service.OpenIMService;
|
|
|
+import com.fs.system.domain.SysConfig;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
+import com.qiniu.util.Json;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import com.fs.gtPush.utils.PushUtils;
|
|
|
import com.fs.his.domain.FsUser;
|
|
|
@@ -35,12 +39,26 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
|
|
|
@Autowired
|
|
|
private UniPushLogService logService;
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService iSysConfigService;
|
|
|
|
|
|
@Override
|
|
|
public PushResult pushMessage(PushReqBean push) {
|
|
|
+ SysConfig config = iSysConfigService.selectConfigByConfigKey("his.config");
|
|
|
+ if (config == null || StringUtils.isBlank(config.getConfigValue())) {
|
|
|
+ throw new RuntimeException("his.config 配置不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ JSONObject json = JSON.parseObject(config.getConfigValue());
|
|
|
+ String url = json.getString("appPushUrl");
|
|
|
+ if (StringUtils.isBlank(url)) {
|
|
|
+ throw new RuntimeException("his.config 中未配置 appPushUrl");
|
|
|
+ }
|
|
|
+
|
|
|
String result = HttpUtil.post(url, push.toString());
|
|
|
PushResult pushResult = JSONUtil.toBean(result, PushResult.class);
|
|
|
return pushResult;
|
|
|
+
|
|
|
}
|
|
|
@Override
|
|
|
public void pushSopAppLinkMsgByExternalIM(String cropId, String linkTile, String linkDescribe,String linkImageUrl, String link, Long companyUserId,Long fsUserId) throws JsonProcessingException {
|