|
@@ -109,7 +109,7 @@ public class WeComHistoryDataJob {
|
|
|
}
|
|
|
for (Corp corp : corps) {
|
|
|
for (; startTime < endTime; startTime += TimeConstant.DAY) {
|
|
|
- selectGroupMsgList(startTime, Math.min(startTime + TimeConstant.DAY, endTime), corp.getId());
|
|
|
+ selectGroupMsgList(startTime, Math.min(startTime + TimeConstant.DAY, endTime), corp.getId(), xxlJobParam.getStaffId());
|
|
|
}
|
|
|
}
|
|
|
for (Corp corp : corps) {
|
|
@@ -159,8 +159,8 @@ public class WeComHistoryDataJob {
|
|
|
LarkRobotUtil.sendMessage(stringBuilder.toString());
|
|
|
}
|
|
|
|
|
|
- private void selectGroupMsgList(Long startTime, Long endTime, Long corpId) {
|
|
|
- delHistoryMessageList(startTime, endTime);
|
|
|
+ private void selectGroupMsgList(Long startTime, Long endTime, Long corpId, Long staffId) {
|
|
|
+ delHistoryMessageList(startTime, endTime, corpId, staffId);
|
|
|
try {
|
|
|
String cursor = "";
|
|
|
do {
|
|
@@ -224,6 +224,12 @@ public class WeComHistoryDataJob {
|
|
|
LarkRobotUtil.sendMessage("企微推送报警:carrierId不存在请检查 " + carrierId);
|
|
|
continue;
|
|
|
}
|
|
|
+ //指定id以后 过滤其他id
|
|
|
+ if (staffId != null) {
|
|
|
+ if (!Objects.equals(staffList.get(0).getId(), staffId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
List<ExternalUser> externalUsers = selectGroupMsgSendResult(msgId, carrierId, corpId);
|
|
|
if (CollectionUtils.isEmpty(externalUsers)) {
|
|
|
continue;
|
|
@@ -333,11 +339,16 @@ public class WeComHistoryDataJob {
|
|
|
return httpPoolClient.post(url, param.toJSONString());
|
|
|
}
|
|
|
|
|
|
- private void delHistoryMessageList(Long startTime, Long endTime) {
|
|
|
+ private void delHistoryMessageList(Long startTime, Long endTime, Long corpId, Long staffId) {
|
|
|
HistoryMessage historyMessage = new HistoryMessage();
|
|
|
historyMessage.setIsDelete(1);
|
|
|
HistoryMessageExample example = new HistoryMessageExample();
|
|
|
- example.createCriteria().andSendTimeBetween(new Date(startTime * 1000), new Date(endTime * 1000));
|
|
|
+ HistoryMessageExample.Criteria criteria =
|
|
|
+ example.createCriteria().andSendTimeBetween(new Date(startTime * 1000), new Date(endTime * 1000))
|
|
|
+ .andCorpIdEqualTo(corpId);
|
|
|
+ if (staffId != null) {
|
|
|
+ criteria.andStaffIdEqualTo(staffId);
|
|
|
+ }
|
|
|
historyMessageMapper.updateByExampleSelective(historyMessage, example);
|
|
|
|
|
|
}
|