|
@@ -238,7 +238,8 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
|
|
|
calendar.set(lastDay.getYear(), lastDay.getMonth(), 1);
|
|
|
lastDay.setYear(calendar.get(Calendar.YEAR));
|
|
|
lastDay.setMonth(calendar.get(Calendar.MONTH) + 1);
|
|
|
- lastDay.setDay(calendar.getActualMaximum(Calendar.DATE));
|
|
|
+ lastDay.setDay(1);
|
|
|
+ lastDay.setHour(0);
|
|
|
List<RemoteDegreeLogVO> lastList = remoteDegreeLogMapper.selectList(lastDay);
|
|
|
|
|
|
for (int i = 1; i <= days; i++) {
|
|
@@ -262,11 +263,12 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
|
|
|
if (degreeLog.getType().equals(1)) {
|
|
|
positiveTotal = positiveTotal.add(new BigDecimal(degreeLog.getResult()));
|
|
|
// 找到下个月时间
|
|
|
+ log.info("i:" + i + ",days:" + days);
|
|
|
if (i == days) {// 从下个月第一天找
|
|
|
Optional<RemoteDegreeLogVO> lastR = lastList.stream().filter(item -> item.getPositionNum().equals(degreeLog.getPositionNum())).findFirst();
|
|
|
if (lastR.isPresent()) {
|
|
|
- //log.info("1: " + degreeLog.getDay() + "," + degreeLog.getDay() + ","+ degreeLog.getDay() + ","+ lastR.get().getDay());
|
|
|
- positiveTotal = positiveTotal.subtract(new BigDecimal(lastR.get().getResult()));
|
|
|
+ log.info("1: " + positiveTotal + "," + degreeLog.getDay() + "," + lastR.get().getDay() + "," + lastR.get().getResult());
|
|
|
+ positiveTotal = new BigDecimal(lastR.get().getResult()).subtract(positiveTotal);
|
|
|
}
|
|
|
} else {// 从后天时间找,减去昨天的数据
|
|
|
Optional<RemoteDegreeLogVO> lastR = list.stream().filter(item -> item.getPositionNum().equals(degreeLog.getPositionNum()) && item.getDay().equals(degreeLog.getDay() + 1)).findFirst();
|
|
@@ -276,23 +278,6 @@ public class BigScreenSbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, Sb
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /*else {
|
|
|
- negativeTotal = negativeTotal.add(new BigDecimal(degreeLog.getResult()));
|
|
|
- // 找到上个时间
|
|
|
- if(i == 0){// 从昨天找
|
|
|
- Optional<RemoteDegreeLogVO> lastR = lastList.stream().filter(item -> item.getPositionNum().equals(degreeLog.getPositionNum())).findFirst();
|
|
|
- if(lastR.isPresent()){
|
|
|
- log.info(JSONObject.toJSONString(lastR.get()));
|
|
|
- negativeTotal = negativeTotal.subtract(new BigDecimal(lastR.get().getResult()));
|
|
|
- }
|
|
|
- }else{// 从今天上个时间找,减去上个小时的数据
|
|
|
- Optional<RemoteDegreeLogVO> lastR = list.stream().filter(item -> item.getPositionNum().equals(degreeLog.getPositionNum()) && item.getDay().equals(degreeLog.getDay()-1)).findFirst();
|
|
|
- if(lastR.isPresent()){
|
|
|
- log.info(JSONObject.toJSONString(lastR.get()));
|
|
|
- negativeTotal = negativeTotal.subtract(new BigDecimal(lastR.get().getResult()));
|
|
|
- }
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
}
|
|
|
}
|