Commit 8d417b64 authored by wujiang's avatar wujiang

添加更新曲线接口

parent c21ffff0
......@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto;
......@@ -120,19 +121,22 @@ public class TdHygfJpCollectorHistoryServiceImpl
List<JpCollectorHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
for (int i = 0; i < yearList.size(); i++) {
Map<String, Object> map = yearList.get(i);
map.put("month", month);
map.put("year", year);
long time = dayTime.getTime() + i;
for (JpCollectorHistoryYearDto dto : oldYearList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& dto.getThirdStationId().equals(map.get("third_station_id"))
&& dto.getSnCode().equals(map.get("sn_code")) && dto.getYear().equals(map.get("year"))
&& dto.getMonth().equals(map.get("month"))) {
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime();
break;
}
}
yearList.get(i).put("created_time", time);
yearList.get(i).put("month", month);
yearList.get(i).put("year", year);
}
if (!yearList.isEmpty()) {
this.baseMapper.updateYear(yearList);
......@@ -141,18 +145,20 @@ public class TdHygfJpCollectorHistoryServiceImpl
List<JpCollectorHistoryAllDto> oldAllList = this.baseMapper.allList(null, null);
for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = allList.get(i);
map.put("year", year);
long time = dayTime.getTime() + i;
for (JpCollectorHistoryAllDto dto : oldAllList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& dto.getThirdStationId().equals(map.get("third_station_id"))
&& dto.getSnCode().equals(map.get("sn_code"))
&& dto.getYear().equals(map.get("year"))) {
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime();
break;
}
}
allList.get(i).put("created_time", time);
allList.get(i).put("year", year);
map.put("created_time", time);
}
if (!allList.isEmpty()) {
this.baseMapper.updateAll(allList);
......
......@@ -118,19 +118,21 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
List<JpInvertorElecHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
for (int i = 0; i < yearList.size(); i++) {
Map<String, Object> map = yearList.get(i);
yearList.get(i).put("year", year);
yearList.get(i).put("month", month);
long time = dayTime.getTime() + i;
for (JpInvertorElecHistoryYearDto dto : oldYearList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& dto.getThirdStationId().equals(map.get("third_station_id"))
&& dto.getSnCode().equals(map.get("sn_code")) && dto.getYear().equals(map.get("year"))
&& dto.getMonth().equals(map.get("month"))) {
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime();
break;
}
}
yearList.get(i).put("created_time", time);
yearList.get(i).put("month", month);
yearList.get(i).put("year", year);
}
if (!yearList.isEmpty()) {
this.baseMapper.updateYear(yearList);
......@@ -139,18 +141,20 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
List<JpInvertorElecHistoryAllDto> oldAllList = this.baseMapper.allList(null, null);
for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = allList.get(i);
allList.get(i).put("year", year);
long time = dayTime.getTime() + i;
for (JpInvertorElecHistoryAllDto dto : oldAllList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& dto.getThirdStationId().equals(map.get("third_station_id"))
&& dto.getSnCode().equals(map.get("sn_code"))
&& dto.getYear().equals(map.get("year"))) {
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime();
break;
}
}
allList.get(i).put("created_time", time);
allList.get(i).put("year", year);
}
if (!allList.isEmpty()) {
this.baseMapper.updateAll(allList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment