|
@@ -594,16 +594,44 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- List<SopParam> paramList = ruleTimeVO.getSkipSopJson() == null ? new ArrayList<>() : JSON.parseArray(ruleTimeVO.getSkipSopJson(), SopParam.class);
|
|
|
|
|
- List<SopParam> dayList = paramList.stream().filter(e -> e.getDayNum() != null && e.getStartDate() == null && e.getEndDate() == null).collect(Collectors.toList());
|
|
|
|
|
- List<SopParam> timeList = paramList.stream().filter(e -> e.getDayNum() != null && e.getStartDate() != null && e.getEndDate() != null).collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<SopParam> paramList = new ArrayList<>();
|
|
|
|
|
+ try {
|
|
|
|
|
+ String skipSopJson = ruleTimeVO.getSkipSopJson();
|
|
|
|
|
+ if (skipSopJson != null && !skipSopJson.trim().isEmpty() && !"null".equalsIgnoreCase(skipSopJson.trim())) {
|
|
|
|
|
+ paramList = JSON.parseArray(skipSopJson, SopParam.class);
|
|
|
|
|
+ if (paramList == null) {
|
|
|
|
|
+ paramList = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("解析skipSopJson失败,原始值: '{}'", ruleTimeVO.getSkipSopJson(), e);
|
|
|
|
|
+ paramList = new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<SopParam> dayList = paramList.stream()
|
|
|
|
|
+ .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
|
|
+ && e.getStartDate() == null && e.getEndDate() == null)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ List<SopParam> timeList = paramList.stream()
|
|
|
|
|
+ .filter(e -> e.getDayNum() != null && !e.getDayNum().trim().isEmpty()
|
|
|
|
|
+ && e.getStartDate() != null && e.getEndDate() != null)
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
Map<String, List<SopParam>> timeMap = PubFun.listToMapByGroupList(timeList, e -> e.getDayNum());
|
|
Map<String, List<SopParam>> timeMap = PubFun.listToMapByGroupList(timeList, e -> e.getDayNum());
|
|
|
|
|
+
|
|
|
if (CollectionUtils.isNotEmpty(dayList)) {
|
|
if (CollectionUtils.isNotEmpty(dayList)) {
|
|
|
for (SopParam sopParam : dayList) {
|
|
for (SopParam sopParam : dayList) {
|
|
|
String dayNum = sopParam.getDayNum();
|
|
String dayNum = sopParam.getDayNum();
|
|
|
- if (day == Long.valueOf(dayNum)) {
|
|
|
|
|
- log.info("跳过当前sop任务,任务id:{},qwtask天数{},跳过第:{}天", ruleTimeVO.getId(), day, dayNum);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (StringUtils.isEmpty(dayNum) || dayNum.trim().isEmpty()) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (day == Long.valueOf(dayNum.trim())) {
|
|
|
|
|
+ log.info("跳过当前sop任务,任务id:{},qwtask天数{},跳过第:{}天", ruleTimeVO.getId(), day, dayNum);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
|
|
+ log.error("解析dayNum失败,dayNum: '{}'", dayNum, e);
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|