Commit bc15e875 authored by tangwei's avatar tangwei

修改日数据

parent 6f1a71f3
......@@ -37,5 +37,5 @@ public class JpCollectorHistoryMonthDto {
@ApiModelProperty(value = "年月")
private String yearMonth;
private long createdTime;
}
......@@ -123,7 +123,25 @@ public class TdHygfJpCollectorHistoryServiceImpl
monthList.get(i).put("year_month", year + "-" + month);
}
if (!monthList.isEmpty()) {
this.baseMapper.updateMonth(monthList);
List<JpCollectorHistoryMonthDto> listold= this.baseMapper.monthList(null, null, year + "-" + month);
if(listold!=null){
for (Map<String, Object> map : monthList) {
for (JpCollectorHistoryMonthDto jpCollectorHistoryMonthDto : listold) {
if(map.get("third_station_id").toString().equals(jpCollectorHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().equals(jpCollectorHistoryMonthDto.getSnCode())){
map.put("created_time",jpCollectorHistoryMonthDto.getCreatedTime()) ;
}
}
}
this.baseMapper.updateMonth(monthList);
}else{
this.baseMapper.updateMonth(monthList);
}
// 年表
List<Map<String, Object>> yearList = this.baseMapper.monthToYear(String.valueOf(year + "-" + month));
List<JpCollectorHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
......
......@@ -6,16 +6,13 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
......@@ -120,7 +117,27 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
monthList.get(i).put("year_month", year + "-" + month);
}
if (!monthList.isEmpty()) {
this.baseMapper.updateMonth(monthList);
List<JpInvertorElecHistoryMonthDto> listold= this.baseMapper.monthList(null, null, year + "-" + month);
if(listold!=null) {
for (Map<String, Object> map : monthList) {
for (JpInvertorElecHistoryMonthDto jpInvertorElecHistoryMonthDto : listold) {
if (map.get("third_station_id").toString().equals(jpInvertorElecHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().equals(jpInvertorElecHistoryMonthDto.getSnCode())) {
map.put("created_time", jpInvertorElecHistoryMonthDto.getCreatedTime());
}
}
}
this.baseMapper.updateMonth(monthList);
}else{
this.baseMapper.updateMonth(monthList);
}
// 年表
List<Map<String, Object>> yearList = this.baseMapper.monthToYear(String.valueOf(year + "-" + month));
List<JpInvertorElecHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
......
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