|
|
@@ -11,6 +11,8 @@ import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
+import com.fs.config.im.IMSystemConfig;
|
|
|
+import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.gtPush.domain.PushReqBean;
|
|
|
import com.fs.gtPush.domain.PushResult;
|
|
|
import com.fs.gtPush.domain.UniPushLog;
|
|
|
@@ -53,6 +55,9 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
@Autowired
|
|
|
private CompanyUserMapper companyUserMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IMConfig imConfig;
|
|
|
+
|
|
|
@Override
|
|
|
public PushResult pushMessage(PushReqBean push) {
|
|
|
SysConfig config = iSysConfigService.selectConfigByConfigKey("his.config");
|
|
|
@@ -92,6 +97,10 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
if (param.getPayload() == null) {
|
|
|
param.setPayload(new HashMap<>());
|
|
|
}
|
|
|
+
|
|
|
+ if(imJsonString.length()>100){
|
|
|
+ imJsonString="";
|
|
|
+ }
|
|
|
param.getPayload().put("url", purl);
|
|
|
if (StringUtils.isNotBlank(imJsonString)) {
|
|
|
param.getPayload().put("extra", imJsonString);
|
|
|
@@ -110,9 +119,13 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
Map<String, Object> options = new HashMap<>();
|
|
|
Map<String, Object> android = new HashMap<>();
|
|
|
|
|
|
+
|
|
|
+ String json = iSysConfigService.selectConfigByKey("im.config");
|
|
|
+ IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
|
|
|
// 小米
|
|
|
Map<String, Object> xm = new HashMap<>();
|
|
|
- xm.put("/extra.channel_id", "133892");
|
|
|
+ xm.put("/extra.channel_id", config.getXm_channel_id());
|
|
|
+
|
|
|
xm.put("/extra.notify_foreground", true);
|
|
|
android.put("XM", xm);
|
|
|
|
|
|
@@ -246,6 +259,11 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ if(imJsonString.length()>100 ){
|
|
|
+ // 报文总共只能传 4096 长度
|
|
|
+ imJsonString="";
|
|
|
+ }
|
|
|
+
|
|
|
// payload
|
|
|
Map<String, Object> payload = new HashMap<>();
|
|
|
if (StringUtils.isNotBlank(purl)) {
|
|
|
@@ -266,9 +284,12 @@ public class uniPush2ServiceImpl implements uniPush2Service {
|
|
|
// options.android
|
|
|
Map<String, Object> android = new HashMap<>();
|
|
|
|
|
|
+ String json = iSysConfigService.selectConfigByKey("im.config");
|
|
|
+ IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
|
|
|
+
|
|
|
// 小米
|
|
|
Map<String, Object> xm = new HashMap<>();
|
|
|
- xm.put("/extra.channel_id", "133892");
|
|
|
+ xm.put("/extra.channel_id", config.getXm_channel_id());
|
|
|
android.put("XM", xm);
|
|
|
|
|
|
// OPPO
|