|
@@ -1,6 +1,8 @@
|
|
|
-package com.inspur.customer.object.inform;
|
|
|
|
|
|
|
+package com.inspur.customer.service.inform.object;
|
|
|
|
|
|
|
|
|
|
+import com.inspur.inform.object.message.MessageSendResponse;
|
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import java.util.BitSet;
|
|
import java.util.BitSet;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
@@ -10,18 +12,15 @@ import java.util.concurrent.CompletableFuture;
|
|
|
* @date 2022-07-01 19:01
|
|
* @date 2022-07-01 19:01
|
|
|
**/
|
|
**/
|
|
|
@Data
|
|
@Data
|
|
|
|
|
+@Slf4j
|
|
|
public class InformResult {
|
|
public class InformResult {
|
|
|
|
|
|
|
|
private BitSet resultFlag = new BitSet(4);
|
|
private BitSet resultFlag = new BitSet(4);
|
|
|
|
|
|
|
|
- private CompletableFuture<Integer> emailResult;
|
|
|
|
|
- private CompletableFuture<Integer> noteResult;
|
|
|
|
|
- private CompletableFuture<Integer> weChatResult;
|
|
|
|
|
- private CompletableFuture<Integer> weChatAppletResult;
|
|
|
|
|
-
|
|
|
|
|
- public void setEmailResult(CompletableFuture<Integer> emailResult) {
|
|
|
|
|
- this.emailResult = emailResult;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ private CompletableFuture<MessageSendResponse> emailResult;
|
|
|
|
|
+ private CompletableFuture<MessageSendResponse> noteResult;
|
|
|
|
|
+ private CompletableFuture<MessageSendResponse> weChatResult;
|
|
|
|
|
+ private CompletableFuture<MessageSendResponse> weChatAppletResult;
|
|
|
|
|
|
|
|
public void updateResultFlag(Integer index) {
|
|
public void updateResultFlag(Integer index) {
|
|
|
resultFlag.set(index);
|
|
resultFlag.set(index);
|
|
@@ -29,15 +28,19 @@ public class InformResult {
|
|
|
|
|
|
|
|
public void updateResultFlag() {
|
|
public void updateResultFlag() {
|
|
|
if (noteResult != null) {
|
|
if (noteResult != null) {
|
|
|
|
|
+ log.info("update note flag");
|
|
|
getFlagFromFuture(noteResult, 0);
|
|
getFlagFromFuture(noteResult, 0);
|
|
|
}
|
|
}
|
|
|
if (emailResult != null) {
|
|
if (emailResult != null) {
|
|
|
|
|
+ log.info("update email flag");
|
|
|
getFlagFromFuture(emailResult, 1);
|
|
getFlagFromFuture(emailResult, 1);
|
|
|
}
|
|
}
|
|
|
if (weChatResult != null) {
|
|
if (weChatResult != null) {
|
|
|
|
|
+ log.info("update weChat flag");
|
|
|
getFlagFromFuture(weChatResult, 2);
|
|
getFlagFromFuture(weChatResult, 2);
|
|
|
}
|
|
}
|
|
|
if (weChatAppletResult != null) {
|
|
if (weChatAppletResult != null) {
|
|
|
|
|
+ log.info("update applet flag");
|
|
|
getFlagFromFuture(weChatAppletResult, 3);
|
|
getFlagFromFuture(weChatAppletResult, 3);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -49,7 +52,7 @@ public class InformResult {
|
|
|
return (int) resultFlag.toByteArray()[0];
|
|
return (int) resultFlag.toByteArray()[0];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void getFlagFromFuture(CompletableFuture<Integer> future, Integer index) {
|
|
|
|
|
|
|
+ private void getFlagFromFuture(CompletableFuture<MessageSendResponse> future, Integer index) {
|
|
|
future.whenComplete((result, error) -> {
|
|
future.whenComplete((result, error) -> {
|
|
|
if (error == null) {
|
|
if (error == null) {
|
|
|
resultFlag.set(index);
|
|
resultFlag.set(index);
|