Commit 272fc736 by liushuangwu

Merge remote-tracking branch 'origin/master'

2 parents d11c237e 5aab6c70
...@@ -18,7 +18,11 @@ import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO; ...@@ -18,7 +18,11 @@ import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO;
import com.pipihelper.project.feishu.entity.Employee; import com.pipihelper.project.feishu.entity.Employee;
import com.pipihelper.project.feishu.entity.LastMaxPain; import com.pipihelper.project.feishu.entity.LastMaxPain;
import com.pipihelper.project.feishu.entity.Pain; import com.pipihelper.project.feishu.entity.Pain;
import com.pipihelper.project.feishu.service.*; import com.pipihelper.project.feishu.service.EmployeeService;
import com.pipihelper.project.feishu.service.FeiShuApiService;
import com.pipihelper.project.feishu.service.FeiShuEventService;
import com.pipihelper.project.feishu.service.LastMaxPainService;
import com.pipihelper.project.feishu.service.PainService;
import com.pipihelper.project.feishu.service.massage.MassageMsgCardSerivce; import com.pipihelper.project.feishu.service.massage.MassageMsgCardSerivce;
import com.pipihelper.project.feishu.service.massage.MassageService; import com.pipihelper.project.feishu.service.massage.MassageService;
import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter; import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter;
...@@ -34,7 +38,13 @@ import javax.annotation.Resource; ...@@ -34,7 +38,13 @@ import javax.annotation.Resource;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -168,8 +178,11 @@ public class FeiShuEventController { ...@@ -168,8 +178,11 @@ public class FeiShuEventController {
public synchronized JSONObject rob(FeiShuMsgCardEventDTO feiShuMsgCardEventDTO) { public synchronized JSONObject rob(FeiShuMsgCardEventDTO feiShuMsgCardEventDTO) {
String oldUserId = feiShuMsgCardEventDTO.getAction().getValue().getKey().split("\\.")[2]; String oldUserId = feiShuMsgCardEventDTO.getAction().getValue().getKey().split("\\.")[2];
String robUserId = feiShuMsgCardEventDTO.getOpen_id(); String robUserId = feiShuMsgCardEventDTO.getOpen_id();
JSONObject user = feiShuApiService.getUserInfo(robUserId);
Pain oldPain = painService.findByOpenId(oldUserId); Pain oldPain = painService.findByOpenId(oldUserId);
oldPain.setOpenId(robUserId); oldPain.setOpenId(robUserId);
oldPain.setName(user.getString("name"));
painService.update(oldPain); painService.update(oldPain);
FeiShuChatDTO feiShuChatDTO = new FeiShuChatDTO(); FeiShuChatDTO feiShuChatDTO = new FeiShuChatDTO();
feiShuChatDTO.setChatId((String) CacheUtil.get("chatId")); feiShuChatDTO.setChatId((String) CacheUtil.get("chatId"));
...@@ -182,7 +195,7 @@ public class FeiShuEventController { ...@@ -182,7 +195,7 @@ public class FeiShuEventController {
massageService.updateMassageMsgCardToPiPiChat((String) CacheUtil.get("chatId")); massageService.updateMassageMsgCardToPiPiChat((String) CacheUtil.get("chatId"));
String fileName1 = String.format("/templates/massage-msg-card-rob-end.json"); String fileName1 = String.format("/templates/massage-msg-card-rob-end.json");
return getInteractiveCardStr(fileName1, "已经被抢啦啦啦~"); return getInteractiveCardStr(fileName1, "已经被" + user.getString("name") + "抢啦,啦啦~");
} }
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!