Commit 799b3501 authored by tangwei's avatar tangwei

修改首航采集

parent 5ab55f4d
...@@ -19,7 +19,7 @@ public interface SofarDataAcquisitionService { ...@@ -19,7 +19,7 @@ public interface SofarDataAcquisitionService {
/** /**
* @descrption 采集器列表数据入库 * @descrption 采集器列表数据入库
*/ */
void collectorList( List<SofarStationList> jsonObject); void collectorList(SofarStationList jsonObject );
/** /**
* @descrption 采集器详情数据入库 * @descrption 采集器详情数据入库
*/ */
......
...@@ -76,7 +76,8 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -76,7 +76,8 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
private JpCollectorMapper jpCollectorMapper; private JpCollectorMapper jpCollectorMapper;
@Autowired @Autowired
TdJpStationMapper tdJpStationMapper; TdJpStationMapper tdJpStationMapper;
@Autowired
private HYGFJPStationPowerHistoryMapper hygfjpStationPowerHistoryMapper;
@Autowired @Autowired
private HYGFJPDayPowerMapper hygfjpDayPowerMapper; private HYGFJPDayPowerMapper hygfjpDayPowerMapper;
...@@ -274,7 +275,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -274,7 +275,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
//获取发电量 //获取发电量
Map<String, Object> requestInfoyn = new HashMap<>(); Map<String, Object> requestInfoyn = new HashMap<>();
requestInfoyn.put("deviceSn", jsonObject2.get(0).getDeviceSn()); requestInfoyn.put("deviceSn", jsonObject2.get(0).getDeviceSn());
requestInfoyn.put("startTime",year+"" ); requestInfoyn.put("startTime",year+"" );
...@@ -300,9 +301,9 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -300,9 +301,9 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
if(!jsonObjectyfn.isEmpty()){ if(!jsonObjectyfn.isEmpty()){
for (Sofarhistorical sofarhistorical : jsonObjectyfn) { for (Sofarhistorical sofarhistorical : jsonObjectyfn) {
if(sofarhistorical.getDataList().get(0).getKey().equals("generation")){ if(sofarhistorical.getDataList().get(0).getKey().equals("generation")){
// 发电量 // 发电量
jpStation.setYearGenerate(sofarhistorical.getDataList().get(0).getValue()!=null?Double.valueOf(sofarhistorical.getDataList().get(0).getValue()):null); jpStation.setYearGenerate(sofarhistorical.getDataList().get(0).getValue()!=null?Double.valueOf(sofarhistorical.getDataList().get(0).getValue()):null);
// 月收益 // 月收益
jpStation.setYearIncome(jpStation.getYearGenerate()!=null?jpStation.getYearGenerate()*0.45:null); jpStation.setYearIncome(jpStation.getYearGenerate()!=null?jpStation.getYearGenerate()*0.45:null);
} }
...@@ -343,6 +344,26 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -343,6 +344,26 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
hygfjpDayPowerMapper.insert(hygfjpDayPower); hygfjpDayPowerMapper.insert(hygfjpDayPower);
} }
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistory.setStationState(jpStation.getState());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
//增加td 电站区域公司,经销商绑定表 //增加td 电站区域公司,经销商绑定表
// TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
// eq("third_code",PVProducerInfoEnum.SH.getCode()). // eq("third_code",PVProducerInfoEnum.SH.getCode()).
...@@ -494,15 +515,15 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -494,15 +515,15 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
} }
@Override @Override
public void collectorList( List<SofarStationList> jsonObject) { public void collectorList(SofarStationList jsonObject) {
for (SofarStationList sunlightDto : jsonObject) {
//获取所电站下采集器 //获取所电站下采集器
Map<String, Object> requestInfo2 = new HashMap<>(); Map<String, Object> requestInfo2 = new HashMap<>();
requestInfo2.put("stationId", sunlightDto.getId()); requestInfo2.put("stationId", jsonObject.getId());
requestInfo2.put("deviceType", "COLLECTOR"); requestInfo2.put("deviceType", "COLLECTOR");
String param2 = JSON.toJSONString(requestInfo2); String param2 = JSON.toJSONString(requestInfo2);
List<SofarInverter> jsonObject2= requestUtil.getResPonse( List<SofarInverter> jsonObject2= requestUtil.getResPonse(
...@@ -586,7 +607,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ ...@@ -586,7 +607,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
// hygfjpCollectorHistoryMapper.insert(hygfjpCollectorHistory); // hygfjpCollectorHistoryMapper.insert(hygfjpCollectorHistory);
// } // }
}
......
...@@ -84,7 +84,8 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -84,7 +84,8 @@ public class SunlightServiceImpl implements SunlightService {
private HYGFJPInverterWarnMapper hygfjpInverterWarnMapper; private HYGFJPInverterWarnMapper hygfjpInverterWarnMapper;
@Autowired @Autowired
SunlightUtil SunlightUtil; SunlightUtil SunlightUtil;
@Autowired
private HYGFJPStationPowerHistoryMapper hygfjpStationPowerHistoryMapper;
@Autowired @Autowired
TdJpStationMapper tdJpStationMapper; TdJpStationMapper tdJpStationMapper;
@Autowired @Autowired
...@@ -142,9 +143,9 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -142,9 +143,9 @@ public class SunlightServiceImpl implements SunlightService {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
SunlightDto sunlightDto=list.get(i); SunlightDto sunlightDto=list.get(i);
if(i==160){ // if(i==160){
System.out.println("22222"); // System.out.println("22222");
} // }
// System.out.println(i+"===================================================="); // System.out.println(i+"====================================================");
JpStation jpStation=null; JpStation jpStation=null;
...@@ -332,6 +333,27 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -332,6 +333,27 @@ public class SunlightServiceImpl implements SunlightService {
hygfjpDayPowerMapper.insert(hygfjpDayPower); hygfjpDayPowerMapper.insert(hygfjpDayPower);
} }
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
//新加
hygfjpStationPowerHistory.setAmosCompanyCode(jpStation.getAmosCompanyCode());
hygfjpStationPowerHistory.setRegionalCompaniesCode(jpStation.getRegionalCompaniesCode());
hygfjpStationPowerHistory.setStationName(jpStation.getName());
hygfjpStationPowerHistory.setStationState(jpStation.getState());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
//增加td 电站区域公司,经销商绑定表 //增加td 电站区域公司,经销商绑定表
// TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>(). // TdJpStation tdJpStation = tdJpStationMapper.selectOne(new QueryWrapper<TdJpStation>().
// eq("third_code", PVProducerInfoEnum.YG.getCode()). // eq("third_code", PVProducerInfoEnum.YG.getCode()).
...@@ -903,11 +925,6 @@ public class SunlightServiceImpl implements SunlightService { ...@@ -903,11 +925,6 @@ public class SunlightServiceImpl implements SunlightService {
} }
try { try {
TimeUnit.MINUTES.sleep(1); TimeUnit.MINUTES.sleep(1);
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.hwsms; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.api.hwsms;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import springfox.bean.validators.plugins.schema.MinMaxAnnotationPlugin;
import javax.net.ssl.*; import javax.net.ssl.*;
import java.io.*; import java.io.*;
...@@ -151,6 +152,16 @@ public class HwSendSms { ...@@ -151,6 +152,16 @@ public class HwSendSms {
} }
} }
public static void main(String[] args) {
String appSecret="SnD8QvdkfDgNeLi8W2H6oDJnoNTZ";
String appKey="n7F6k8BorRkog9q5n6pq315reGk8";
String wsseHeader = buildWsseHeader(appKey, appSecret);
System.out.println(wsseHeader);
}
/** /**
* 构造请求Body体 * 构造请求Body体
* @param sender * @param sender
......
...@@ -679,7 +679,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -679,7 +679,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
} }
e.printStackTrace();
throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!"); throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
......
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