Commit 7fa26d14 authored by tangwei's avatar tangwei

修改采集器接口

parent fe165651
...@@ -273,7 +273,9 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD ...@@ -273,7 +273,9 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
contractDataDto.setPersonalOffsetY(contractTemplate.getPersonalOffsety()); contractDataDto.setPersonalOffsetY(contractTemplate.getPersonalOffsety());
contractDataDto.setPersonalKeywordIndex(contractTemplate.getPersonalKeywordIndex()); contractDataDto.setPersonalKeywordIndex(contractTemplate.getPersonalKeywordIndex());
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy-MM-dd");
Date now=new Date();
String daty= myFmt2.format(now);
List<TemplateParamDto> templateParam=new ArrayList<>(); List<TemplateParamDto> templateParam=new ArrayList<>();
SimpleDateFormat sdfdate = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdfdate = new SimpleDateFormat("yyyy-MM-dd");
...@@ -290,6 +292,8 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD ...@@ -290,6 +292,8 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
templateParam.add(new TemplateParamDto("projectAddressDetail",householdContract.getProjectAddressName()!=null?householdContract.getProjectAddressName()+householdContract.getProjectAddressDetail():null)); templateParam.add(new TemplateParamDto("projectAddressDetail",householdContract.getProjectAddressName()!=null?householdContract.getProjectAddressName()+householdContract.getProjectAddressDetail():null));
templateParam.add(new TemplateParamDto("componentPower",householdContract.getComponentPower()!=null?String.valueOf(householdContract.getComponentPower()):null)); templateParam.add(new TemplateParamDto("componentPower",householdContract.getComponentPower()!=null?String.valueOf(householdContract.getComponentPower()):null));
templateParam.add(new TemplateParamDto("stationPower",householdContract.getStationPower()!=null?String.valueOf(householdContract.getStationPower()):null)); templateParam.add(new TemplateParamDto("stationPower",householdContract.getStationPower()!=null?String.valueOf(householdContract.getStationPower()):null));
templateParam.add(new TemplateParamDto("signingTime",daty));
Long contractLockId=qiyuesuoServiceImpl.addContract(contractDataDto , templateParam); Long contractLockId=qiyuesuoServiceImpl.addContract(contractDataDto , templateParam);
householdContract.setContractLockId(contractLockId); householdContract.setContractLockId(contractLockId);
householdContract.setInitiateStatus(HouseholdContractEnum.发起状态_已发起.getCode()); householdContract.setInitiateStatus(HouseholdContractEnum.发起状态_已发起.getCode());
......
...@@ -55,7 +55,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -55,7 +55,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
if (collector != null) { if (collector != null) {
List<TdHygfJpCollectorHistoryDto> list = this.baseMapper.dayList(collector.getSnCode(), List<TdHygfJpCollectorHistoryDto> list = this.baseMapper.dayList(collector.getSnCode(),
collector.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); collector.getThirdStationId(), TimeUtil.getStartTimeOfDay(day)- 8 * 60 * 60 * 1000, TimeUtil.getEndTimeOfDay(day)- 8 * 60 * 60 * 1000);
if (!list.isEmpty()) { if (!list.isEmpty()) {
list.forEach(i -> { list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime())); i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
...@@ -106,6 +106,9 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -106,6 +106,9 @@ public class TdHygfJpCollectorHistoryServiceImpl
return new ArrayList<>(); return new ArrayList<>();
} }
@Async @Async
public Object syncData() { public Object syncData() {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
...@@ -115,12 +118,14 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -115,12 +118,14 @@ public class TdHygfJpCollectorHistoryServiceImpl
int month = cal.get(Calendar.MONTH) + 1; int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR); int year = cal.get(Calendar.YEAR);
// 月表 // 月表
List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime), List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime)- 8 * 60 * 60 * 1000,
TimeUtil.getEndTimeOfDay(dayTime)); TimeUtil.getEndTimeOfDay(dayTime)- 8 * 60 * 60 * 1000);
for (int i = 0; i < monthList.size(); i++) { for (int i = 0; i < monthList.size(); i++) {
monthList.get(i).put("created_time", dayTime.getTime() + i); monthList.get(i).put("created_time", dayTime.getTime() + i);
monthList.get(i).put("day", day); monthList.get(i).put("day", day);
monthList.get(i).put("year_month", year + "-" + month); monthList.get(i).put("year_month", year + "-" + month);
monthList.get(i).put("sn_code", monthList.get(i).get("sn_code").toString().trim());
} }
if (!monthList.isEmpty()) { if (!monthList.isEmpty()) {
List<JpCollectorHistoryMonthDto> listold= this.baseMapper.monthList(null, null, year + "-" + month); List<JpCollectorHistoryMonthDto> listold= this.baseMapper.monthList(null, null, year + "-" + month);
...@@ -129,7 +134,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -129,7 +134,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
for (Map<String, Object> map : monthList) { for (Map<String, Object> map : monthList) {
for (JpCollectorHistoryMonthDto jpCollectorHistoryMonthDto : listold) { for (JpCollectorHistoryMonthDto jpCollectorHistoryMonthDto : listold) {
if(map.get("third_station_id").toString().equals(jpCollectorHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().equals(jpCollectorHistoryMonthDto.getSnCode())){ if(map.get("third_station_id").toString().equals(jpCollectorHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().trim().equals(jpCollectorHistoryMonthDto.getSnCode().trim())&&map.get("day").toString().equals(jpCollectorHistoryMonthDto.getDay())){
map.put("created_time",jpCollectorHistoryMonthDto.getCreatedTime()) ; map.put("created_time",jpCollectorHistoryMonthDto.getCreatedTime()) ;
} }
} }
...@@ -155,7 +160,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -155,7 +160,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
&& map.get("third_station_id") != null && map.get("sn_code") != null && map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null && map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString()) && dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getSnCode().trim().equals(map.get("sn_code").toString().trim())
&& dto.getYear().equals(map.get("year").toString()) && dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) { && dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime(); time = dto.getCreatedTime();
...@@ -178,7 +183,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -178,7 +183,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
&& map.get("third_station_id") != null && map.get("sn_code") != null && map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString()) && dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getSnCode().trim().equals(map.get("sn_code").toString().trim())
&& dto.getYear().equals(map.get("year").toString())) { && dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime(); time = dto.getCreatedTime();
break; break;
......
...@@ -49,7 +49,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -49,7 +49,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) { if (invertor != null) {
List<TdHygfJpInvertorElecHistoryDto> list = this.baseMapper.dayList(invertor.getSnCode(), List<TdHygfJpInvertorElecHistoryDto> list = this.baseMapper.dayList(invertor.getSnCode(),
invertor.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); invertor.getThirdStationId(), TimeUtil.getStartTimeOfDay(day)- 8 * 60 * 60 * 1000, TimeUtil.getEndTimeOfDay(day)- 8 * 60 * 60 * 1000);
if (!list.isEmpty()) { if (!list.isEmpty()) {
list.forEach(i -> { list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime())); i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
...@@ -69,7 +69,8 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -69,7 +69,8 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
cal.setTime(month); cal.setTime(month);
String monthStr = String.valueOf(cal.get(Calendar.YEAR)) + "-" + String.valueOf(cal.get(Calendar.MONTH) + 1); String monthStr = String.valueOf(cal.get(Calendar.YEAR)) + "-" + String.valueOf(cal.get(Calendar.MONTH) + 1);
if (invertor != null) { if (invertor != null) {
return this.baseMapper.monthList(invertor.getSnCode(), invertor.getThirdStationId(), monthStr); List<JpInvertorElecHistoryMonthDto> li= this.baseMapper.monthList(invertor.getSnCode().trim(), invertor.getThirdStationId(), monthStr);
return li;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -83,7 +84,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -83,7 +84,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
cal.setTime(year); cal.setTime(year);
String yearStr = String.valueOf(cal.get(Calendar.YEAR)); String yearStr = String.valueOf(cal.get(Calendar.YEAR));
if (invertor != null) { if (invertor != null) {
return this.baseMapper.yearList(invertor.getSnCode(), invertor.getThirdStationId(), yearStr); return this.baseMapper.yearList(invertor.getSnCode().trim(), invertor.getThirdStationId(), yearStr);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -95,7 +96,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -95,7 +96,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) { if (invertor != null) {
return this.baseMapper.allList(invertor.getSnCode(), invertor.getThirdStationId()); return this.baseMapper.allList(invertor.getSnCode().trim(), invertor.getThirdStationId());
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -109,12 +110,13 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -109,12 +110,13 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
int month = cal.get(Calendar.MONTH) + 1; int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR); int year = cal.get(Calendar.YEAR);
// 月表 // 月表
List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime), List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime)- 8 * 60 * 60 * 1000,
TimeUtil.getEndTimeOfDay(dayTime)); TimeUtil.getEndTimeOfDay(dayTime)- 8 * 60 * 60 * 1000);
for (int i = 0; i < monthList.size(); i++) { for (int i = 0; i < monthList.size(); i++) {
monthList.get(i).put("created_time", dayTime.getTime() + i); monthList.get(i).put("created_time", dayTime.getTime() + i);
monthList.get(i).put("day", day); monthList.get(i).put("day", day);
monthList.get(i).put("year_month", year + "-" + month); monthList.get(i).put("year_month", year + "-" + month);
monthList.get(i).put("sn_code", monthList.get(i).get("sn_code").toString().trim());
} }
if (!monthList.isEmpty()) { if (!monthList.isEmpty()) {
...@@ -125,7 +127,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -125,7 +127,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
for (Map<String, Object> map : monthList) { for (Map<String, Object> map : monthList) {
for (JpInvertorElecHistoryMonthDto jpInvertorElecHistoryMonthDto : listold) { for (JpInvertorElecHistoryMonthDto jpInvertorElecHistoryMonthDto : listold) {
if (map.get("third_station_id").toString().equals(jpInvertorElecHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().equals(jpInvertorElecHistoryMonthDto.getSnCode())) { if (map.get("third_station_id").toString().equals(jpInvertorElecHistoryMonthDto.getThirdStationId())&&map.get("sn_code").toString().trim().equals(jpInvertorElecHistoryMonthDto.getSnCode().trim())&&map.get("day").toString().equals(jpInvertorElecHistoryMonthDto.getDay())) {
map.put("created_time", jpInvertorElecHistoryMonthDto.getCreatedTime()); map.put("created_time", jpInvertorElecHistoryMonthDto.getCreatedTime());
} }
} }
...@@ -151,7 +153,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -151,7 +153,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
&& map.get("third_station_id") != null && map.get("sn_code") != null && map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null && map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString()) && dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getSnCode().trim().equals(map.get("sn_code").toString().trim())
&& dto.getYear().equals(map.get("year").toString()) && dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) { && dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime(); time = dto.getCreatedTime();
...@@ -174,7 +176,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -174,7 +176,7 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
&& map.get("third_station_id") != null && map.get("sn_code") != null && map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString()) && dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString()) && dto.getSnCode().trim().equals(map.get("sn_code").toString().trim())
&& dto.getYear().equals(map.get("year").toString())) { && dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime(); time = dto.getCreatedTime();
break; break;
......
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