|
@@ -71,7 +71,7 @@ public class WeComMessageDataJob1 {
|
|
List<PushMessage> goodHistoryPushList = new ArrayList<>();
|
|
List<PushMessage> goodHistoryPushList = new ArrayList<>();
|
|
|
|
|
|
//保底视频列表
|
|
//保底视频列表
|
|
- Map<String, List<Long>> guaranteedVideoMap = new HashMap<>();
|
|
|
|
|
|
+ Map<Long, List<Long>> guaranteedVideoMap = new HashMap<>();
|
|
Map<String, String> pageMap = new HashMap<>();
|
|
Map<String, String> pageMap = new HashMap<>();
|
|
|
|
|
|
//初始化操作
|
|
//初始化操作
|
|
@@ -97,21 +97,20 @@ public class WeComMessageDataJob1 {
|
|
//保底视频获取
|
|
//保底视频获取
|
|
|
|
|
|
String key = String.format(GUARANTEED_MINI_PROGRAM_KEY, DateUtil.getThatDayDateString());
|
|
String key = String.format(GUARANTEED_MINI_PROGRAM_KEY, DateUtil.getThatDayDateString());
|
|
- String value = (String) redisTemplate.opsForValue().get(key);
|
|
|
|
- GuaranteedParam guaranteedParam = JSONObject.parseObject(value, GuaranteedParam.class);
|
|
|
|
|
|
+ GuaranteedParam guaranteedParam = (GuaranteedParam) redisTemplate.opsForValue().get(key);
|
|
if (guaranteedParam == null
|
|
if (guaranteedParam == null
|
|
|| CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
|
|
|| CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
|
|
LarkRobotUtil.sendMessage("保底视频获取异常,请检查" + DateUtil.getThatDayDateString());
|
|
LarkRobotUtil.sendMessage("保底视频获取异常,请检查" + DateUtil.getThatDayDateString());
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
- Map<String, List<Long>> videoMap = new HashMap<>();
|
|
|
|
|
|
+ Map<Long, List<Long>> videoMap = new HashMap<>();
|
|
for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
|
|
for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
|
|
- if (StringUtils.isEmpty(videoParam.getCarrierId())) {
|
|
|
|
- LarkRobotUtil.sendMessage("保底视频获取异常,CarrierId为空" + DateUtil.getThatDayDateString());
|
|
|
|
|
|
+ if (videoParam.getStaffId() == null) {
|
|
|
|
+ LarkRobotUtil.sendMessage("保底视频获取异常,StaffId为空" + DateUtil.getThatDayDateString());
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
if (CollectionUtils.isEmpty(videoParam.getVideoIds()) || videoParam.getVideoIds().size() < MAX_VIDEO_NUM) {
|
|
if (CollectionUtils.isEmpty(videoParam.getVideoIds()) || videoParam.getVideoIds().size() < MAX_VIDEO_NUM) {
|
|
- LarkRobotUtil.sendMessage("保底视频数量异常,请查看" + guaranteedParam.getDate() + videoParam.getCarrierId());
|
|
|
|
|
|
+ LarkRobotUtil.sendMessage("保底视频数量异常,请查看" + guaranteedParam.getDate() + videoParam.getStaffId());
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
for (Long videoId : videoParam.getVideoIds()) {
|
|
for (Long videoId : videoParam.getVideoIds()) {
|
|
@@ -129,9 +128,9 @@ public class WeComMessageDataJob1 {
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- videoMap.put(videoParam.getCarrierId(), videoParam.getVideoIds());
|
|
|
|
|
|
+ videoMap.put(videoParam.getStaffId(), videoParam.getVideoIds());
|
|
}
|
|
}
|
|
- if (!videoMap.containsKey("default")) {
|
|
|
|
|
|
+ if (!videoMap.containsKey(0L)) {
|
|
LarkRobotUtil.sendMessage("保底视频没有默认组,请查看" + guaranteedParam.getDate());
|
|
LarkRobotUtil.sendMessage("保底视频没有默认组,请查看" + guaranteedParam.getDate());
|
|
throw new RuntimeException();
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
@@ -183,8 +182,7 @@ public class WeComMessageDataJob1 {
|
|
|
|
|
|
public void saveGuaranteedVideoIdList() {
|
|
public void saveGuaranteedVideoIdList() {
|
|
String key = String.format(GUARANTEED_MINI_PROGRAM_KEY, DateUtil.getThatDayDateString());
|
|
String key = String.format(GUARANTEED_MINI_PROGRAM_KEY, DateUtil.getThatDayDateString());
|
|
- String value = (String) redisTemplate.opsForValue().get(key);
|
|
|
|
- GuaranteedParam guaranteedParam = JSONObject.parseObject(value, GuaranteedParam.class);
|
|
|
|
|
|
+ GuaranteedParam guaranteedParam = (GuaranteedParam) redisTemplate.opsForValue().get(key);
|
|
if (guaranteedParam == null || CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
|
|
if (guaranteedParam == null || CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -243,9 +241,9 @@ public class WeComMessageDataJob1 {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//保底数据
|
|
//保底数据
|
|
- List<Long> guaranteedVideoIdList = guaranteedVideoMap.get(String.valueOf(staffWithUser.getStaffId()));
|
|
|
|
|
|
+ List<Long> guaranteedVideoIdList = guaranteedVideoMap.get(staffWithUser.getStaffId());
|
|
if (CollectionUtils.isEmpty(guaranteedVideoIdList)) {
|
|
if (CollectionUtils.isEmpty(guaranteedVideoIdList)) {
|
|
- guaranteedVideoIdList = guaranteedVideoMap.get("default");
|
|
|
|
|
|
+ guaranteedVideoIdList = guaranteedVideoMap.get(0L);
|
|
}
|
|
}
|
|
if (CollectionUtils.isEmpty(guaranteedVideoIdList)) {
|
|
if (CollectionUtils.isEmpty(guaranteedVideoIdList)) {
|
|
LarkRobotUtil.sendMessage("组装数据时,保底数据获取异常");
|
|
LarkRobotUtil.sendMessage("组装数据时,保底数据获取异常");
|