|
|
@@ -344,62 +344,42 @@ public class SendMsg {
|
|
|
// 推送 APP
|
|
|
boolean hasAppSend = false;
|
|
|
int successCount = 0;
|
|
|
+ int failCount = 0;
|
|
|
if (!setting.getSetting().isEmpty()) {
|
|
|
- if (!CloudHostUtils.hasCloudHostName("木易华康")) {
|
|
|
- new Thread(() -> {
|
|
|
- try {
|
|
|
- List<QwSopTempSetting.Content.Setting> settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId());
|
|
|
- }
|
|
|
-
|
|
|
- //app文本消息
|
|
|
- log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
- settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
-
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
|
|
|
- }
|
|
|
- //app语音消息
|
|
|
- log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
- settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId());
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("推送APP失败", e);
|
|
|
- }
|
|
|
- }).start();
|
|
|
- } else {
|
|
|
- List<QwSopCourseFinishTempSetting.Setting> settings = setting.getSetting().stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- hasAppSend = true;
|
|
|
- boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
- if (sendFlag) {
|
|
|
- successCount++;
|
|
|
- }
|
|
|
+ List<QwSopCourseFinishTempSetting.Setting> settings = setting.getSetting().stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
+ if (!settings.isEmpty()) {
|
|
|
+ hasAppSend = true;
|
|
|
+ boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
+ if (sendFlag) {
|
|
|
+ successCount++;
|
|
|
+ } else {
|
|
|
+ failCount++;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //app文本消息
|
|
|
- log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
- settings = setting.getSetting().stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- hasAppSend = true;
|
|
|
- boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
- if (sendFlag) {
|
|
|
- successCount++;
|
|
|
- }
|
|
|
+ //app文本消息
|
|
|
+ log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
+ settings = setting.getSetting().stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
+ if (!settings.isEmpty()) {
|
|
|
+ hasAppSend = true;
|
|
|
+ boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
+ if (sendFlag) {
|
|
|
+ successCount++;
|
|
|
+ } else {
|
|
|
+ failCount++;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- //app语音消息
|
|
|
- log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
- settings = setting.getSetting().stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
- if (!settings.isEmpty()) {
|
|
|
- hasAppSend = true;
|
|
|
- boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
- if (sendFlag) {
|
|
|
- successCount++;
|
|
|
- }
|
|
|
+ //app语音消息
|
|
|
+ log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
|
|
|
+ settings = setting.getSetting().stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
|
|
|
+ if (!settings.isEmpty()) {
|
|
|
+ hasAppSend = true;
|
|
|
+ boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
|
|
|
+ if (sendFlag) {
|
|
|
+ successCount++;
|
|
|
+ } else {
|
|
|
+ failCount++;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -426,10 +406,10 @@ public class SendMsg {
|
|
|
updateQwSop.setContentJson(JSON.toJSONString(setting));
|
|
|
|
|
|
if (hasAppSend) {
|
|
|
- if (successCount == 3) {
|
|
|
+ if (successCount > 0 && failCount == 0) {
|
|
|
updateQwSop.setAppSendRemark("APP全部发送成功");
|
|
|
updateQwSop.setAppSendStatus(1);
|
|
|
- } else if (successCount == 0) {
|
|
|
+ } else if (successCount == 0 && failCount > 0) {
|
|
|
updateQwSop.setAppSendRemark("APP全部发送失败");
|
|
|
updateQwSop.setAppSendStatus(2);
|
|
|
} else {
|