Browse Source

feat:app发课状态优化

caoliqin 19 hours ago
parent
commit
653d3cff9e
1 changed files with 7 additions and 3 deletions
  1. 7 3
      fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

+ 7 - 3
fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

@@ -344,8 +344,9 @@ public class SendMsg {
             // 推送 APP
             boolean hasAppSend = false;
             int successCount = 0;
+            int actualCount = 0;
             if (!setting.getSetting().isEmpty()) {
-                if (!CloudHostUtils.hasCloudHostName("木易华康")) {
+                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());
@@ -373,6 +374,7 @@ public class SendMsg {
                 } else {
                     List<QwSopCourseFinishTempSetting.Setting> settings = setting.getSetting().stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
                     if (!settings.isEmpty()) {
+                        actualCount++;
                         hasAppSend = true;
                         boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
                         if (sendFlag) {
@@ -384,6 +386,7 @@ public class SendMsg {
                     log.info("开始发送app文本消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
                     settings = setting.getSetting().stream().filter(e -> "15".equals(e.getContentType())).collect(Collectors.toList());
                     if (!settings.isEmpty()) {
+                        actualCount++;
                         hasAppSend = true;
                         boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppTxtNormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
                         if (sendFlag) {
@@ -395,6 +398,7 @@ public class SendMsg {
                     log.info("开始发送app语音消息消息开始,消息{},用户{}", JSONObject.toJSONString(settings), user.getQwUserName());
                     settings = setting.getSetting().stream().filter(e -> "16".equals(e.getContentType())).collect(Collectors.toList());
                     if (!settings.isEmpty()) {
+                        actualCount++;
                         hasAppSend = true;
                         boolean sendFlag = asyncSopTestService.asyncSendMsgBySopAppMP3NormalIM(settings, qwUser.getCompanyUserId(), qwSopLogs.getFsUserId(), qwSopLogs.getId());
                         if (sendFlag) {
@@ -424,9 +428,9 @@ public class SendMsg {
                 updateQwSop.setRealSendTime(sdf.format(new Date()));
             }
             updateQwSop.setContentJson(JSON.toJSONString(setting));
-
+            log.info("实际需要发送的数量:{}", actualCount);
             if (hasAppSend) {
-                if (successCount == 3) {
+                if (successCount == actualCount) {
                     updateQwSop.setAppSendRemark("APP全部发送成功");
                     updateQwSop.setAppSendStatus(1);
                 } else if (successCount == 0) {