Commit 8d417b64 authored by wujiang's avatar wujiang

添加更新曲线接口

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