|
@@ -48,72 +48,78 @@ public class AnalysisNewService {
|
|
|
|
|
|
@Resource
|
|
|
private IProBasicProjectPlanService proBasicProjectPlanService;
|
|
|
+
|
|
|
public void companys() throws Exception {
|
|
|
|
|
|
|
|
|
- // 获取当前日期
|
|
|
+// 获取当前日期
|
|
|
Date currentDate = new Date();
|
|
|
|
|
|
- // 创建 Calendar 对象,并设置为当前日期
|
|
|
+// 创建 Calendar 对象,并设置为当前日期
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
|
|
|
- // 将时间设为0点
|
|
|
+// 设置 beginDate 为8月31日0点
|
|
|
+ calendar.set(Calendar.MONTH, Calendar.AUGUST);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 31);
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
calendar.set(Calendar.MINUTE, 0);
|
|
|
calendar.set(Calendar.SECOND, 0);
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
-
|
|
|
- // 设置 beginDate 为前一天的0点
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -1);
|
|
|
Date beginDate = calendar.getTime();
|
|
|
|
|
|
- // 设置 endDate 为当天的0点
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, 1);
|
|
|
+// 设置 endDate 为9月1日0点
|
|
|
+ calendar.set(Calendar.MONTH, Calendar.SEPTEMBER);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
+ calendar.set(Calendar.MINUTE, 0);
|
|
|
+ calendar.set(Calendar.SECOND, 0);
|
|
|
+ calendar.set(Calendar.MILLISECOND, 0);
|
|
|
Date endDate = calendar.getTime();
|
|
|
|
|
|
+
|
|
|
List<ProEconAnalysisSubtableBottom> stringList = new ArrayList<>();
|
|
|
for (ProBasicPowerstation wp : CacheContext.wpls) {
|
|
|
+ if (wp.getId().equals("SXJ_KGDL_GJY_FDC_STA")) {
|
|
|
+ List<ProBasicMeterPoint> meterPoints = proBasicMeterPointService.getBaseMapper().selectList(null);
|
|
|
|
|
|
- List<ProBasicMeterPoint> meterPoints = proBasicMeterPointService.getBaseMapper().selectList(null);
|
|
|
-
|
|
|
- List<ProBasicMeterPoint> collect = meterPoints.stream().filter(i -> i.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
|
|
|
- for (ProBasicMeterPoint po : collect) {
|
|
|
- if (wp.getId().equals(po.getWindpowerstationId())) {
|
|
|
+ List<ProBasicMeterPoint> collect = meterPoints.stream().filter(i -> i.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
|
|
|
+ for (ProBasicMeterPoint po : collect) {
|
|
|
+ if (wp.getId().equals(po.getWindpowerstationId())) {
|
|
|
|
|
|
- String point = po.getNemCode();
|
|
|
- String name = po.getName();
|
|
|
+ String point = po.getNemCode();
|
|
|
+ String name = po.getName();
|
|
|
|
|
|
- //获取当前测点倍率
|
|
|
- double magnification = po.getMagnification();
|
|
|
+ //获取当前测点倍率
|
|
|
+ double magnification = po.getMagnification();
|
|
|
|
|
|
- PointData begin = edosUtil.getSectionData(point, beginDate.getTime());
|
|
|
- PointData end = edosUtil.getSectionData(point, endDate.getTime());
|
|
|
+ PointData begin = edosUtil.getSectionData(point, beginDate.getTime());
|
|
|
+ PointData end = edosUtil.getSectionData(point, endDate.getTime());
|
|
|
|
|
|
- double temp1 =0.0;
|
|
|
- double temp2 =0.0;
|
|
|
+ double temp1 = 0.0;
|
|
|
+ double temp2 = 0.0;
|
|
|
|
|
|
- temp1 = begin.getPointValueInDouble();
|
|
|
- temp2 = end.getPointValueInDouble();
|
|
|
+ temp1 = begin.getPointValueInDouble();
|
|
|
+ temp2 = end.getPointValueInDouble();
|
|
|
|
|
|
|
|
|
- ProEconAnalysisSubtableBottom vo = new ProEconAnalysisSubtableBottom();
|
|
|
+ ProEconAnalysisSubtableBottom vo = new ProEconAnalysisSubtableBottom();
|
|
|
|
|
|
- vo.setId(StringUtils.getUUID());
|
|
|
- vo.setRecordDate(beginDate);
|
|
|
- vo.setWpid(wp.getId());
|
|
|
- vo.setMeterId(begin.getPointName());
|
|
|
- vo.setMeterName(name);
|
|
|
- vo.setStopCode(temp2);
|
|
|
- vo.setStopCodeModify(temp2);
|
|
|
- vo.setDayValue((temp2 - temp1) * magnification);
|
|
|
- vo.setDayValueModify((temp2 - temp1) * magnification);
|
|
|
- stringList.add(vo);
|
|
|
- proEconAnalysisSubtableBottomService.batchAdd(stringList);
|
|
|
+ vo.setId(StringUtils.getUUID());
|
|
|
+ vo.setRecordDate(beginDate);
|
|
|
+ vo.setWpid(wp.getId());
|
|
|
+ vo.setMeterId(begin.getPointName());
|
|
|
+ vo.setMeterName(name);
|
|
|
+ vo.setStopCode(temp2);
|
|
|
+ vo.setStopCodeModify(temp2);
|
|
|
+ vo.setDayValue((temp2 - temp1) * magnification);
|
|
|
+ vo.setDayValueModify((temp2 - temp1) * magnification);
|
|
|
+ stringList.add(vo);
|
|
|
+ proEconAnalysisSubtableBottomService.batchAdd(stringList);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|