Commit adf96853 authored by tangwei's avatar tangwei

解决冲突

parents d994b4a5 1aebbe6d
...@@ -28,6 +28,10 @@ public class GoLangConstant { ...@@ -28,6 +28,10 @@ public class GoLangConstant {
public static String prodcerappsecret = "9659623b4ebe432fae5d26bdc8a10217"; public static String prodcerappsecret = "9659623b4ebe432fae5d26bdc8a10217";
public static String stationListUrl = "/v1/api/userStationList"; public static String stationListUrl = "/v1/api/userStationList";
public static String stationDetailUrl = "/v1/api/stationDetail"; public static String stationDetailUrl = "/v1/api/stationDetail";
public static String collectorListUrl = "/v1/api/collectorList";
public static String collectorDetailUrl = "/v1/api/collectorDetail";
public static String inverterListUrl = "/v1/api/inverterList";
public static String inverterDetailUrl = "/v1/api/inverterDetail";
public static String resovleRule_data_page_records = "data,page,records"; public static String resovleRule_data_page_records = "data,page,records";
public static String resovleRule_data = "data"; public static String resovleRule_data = "data";
public static String requestPost = "POST"; public static String requestPost = "POST";
......
...@@ -56,6 +56,7 @@ public class HouseholdTestController { ...@@ -56,6 +56,7 @@ public class HouseholdTestController {
@ApiOperation(httpMethod = "POST", value = "锦浪云", notes = "锦浪云") @ApiOperation(httpMethod = "POST", value = "锦浪云", notes = "锦浪云")
public void golangnew() throws IOException { public void golangnew() throws IOException {
// goLangDataAcquisitionService.stationList(); // goLangDataAcquisitionService.stationList();
goLangDataAcquisitionService.stationDetail(); // goLangDataAcquisitionService.collectorList();
goLangDataAcquisitionService.inverterList();
} }
} }
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName(value = "golang_collector_detail", autoResultMap = true)
public class GolangCollectorDetail {
private Date createdTime;
private Long id;
private String sn;
private Long stationid;
private String stationname;
private Long userid;
private String power;
private String powerstr;
private Double etoday;
private String etodaystr;
private Double etotal;
private String etotalstr;
private Double fullhour;
private Double pac;
private String pacstr;
private Integer state;
private Long datatimestamp;
private String collectorsn;
private String productmodel;
private Integer dcinputtype;
private Integer acoutputtype;
private String series;
private String name;
private String addr;
private Integer collectorstate;
private Integer stateexceptionflag;
private Double etoday1;
private Double etotal1;
private String etotal1str;
private Double totalfullhour;
private Integer invertermetermodel;
private Long cratedate;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName(value = "golang_collector_list", autoResultMap = true)
public class GolangCollectorList {
private Date createdTime;
private Long id;
private String stationname;
private Long stationid;
private Long userid;
private String sn;
private String model;
private String name;
private Integer state;
private Long datatimestamp;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName(value = "golang_inveter_list", autoResultMap = true)
public class GolangInverterList {
private Date createdTime;
private Long id;
private String sn;
private Long stationid;
private String stationname;
private Long userid;
private String power;
private String powerstr;
private Double etoday;
private String etodaystr;
private Double etotal;
private String etotalstr;
private Double fullhour;
private Double pac;
private String pacstr;
private Integer state;
private Long datatimestamp;
private String collectorsn;
private String productmodel;
private Integer dcinputtype;
private Integer acoutputtype;
private String series;
private String name;
private String addr;
private Integer collectorstate;
private Integer stateexceptionflag;
private Double etoday1;
private Double etotal1;
private String etotal1str;
private Double totalfullhour;
private Integer invertermetermodel;
private Long cratedate;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import fastjson.JSON;
import fastjson.JSONObject;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
public class Test {
public static void main(String[] args) {
String JsonString = "{\"id\":\"1299184088035566532\",\"userId\":\"1300386381676732593\",\"sn\":\"2805435232050486\",\"inverterMeterModel\":1,\"collectorsn\":\"404231046E215B4B\",\"collectorId\":\"1301093458381870472\",\"contractTime\":1838563200000,\"state\":1,\"stateExceptionFlag\":0,\"simFlowState\":-1,\"fullHour\":2.27,\"fullHourStr\":\"h\",\"currentState\":\"3\",\"warningInfoData\":0,\"timeZone\":8,\"timeZoneStr\":\"UTC+08:00\",\"daylight\":0,\"daylightSwitch\":0,\"model\":\"543\",\"productModel\":\"543\",\"ctrlCommand\":1,\"nationalStandardstr\":\"GN-380L\",\"inverterTemperature\":63.1,\"inverterTemperatureUnit\":\"℃\",\"temp\":150,\"tempName\":\"IGBT温度\",\"stationName\":\"陈益庆\",\"sno\":\"1A4C24\",\"stationId\":\"1299184320438728736\",\"version\":\"81003A\",\"acOutputType\":1,\"dcInputtype\":3,\"rs485ComAddr\":\"101\",\"dataTimestamp\":\"1684996442378\",\"timeStr\":\"2023-05-25 14:34:02\",\"reactivePower\":10,\"apparentPower\":8.3,\"dcPac\":9.128,\"uInitGnd\":0,\"uInitGndStr\":\"V\",\"dcBus\":706.6,\"dcBusStr\":\"V\",\"dcBusHalf\":351.9,\"dcBusHalfStr\":\"V\",\"power\":25,\"powerStr\":\"kWp\",\"powerPec\":\"1\",\"porwerPercent\":0.332,\"pac\":8.31,\"pacStr\":\"kW\",\"pacPec\":\"1\",\"oneSelf\":0,\"eToday\":56.8,\"eTodayStr\":\"kWh\",\"eMonth\":2.266,\"eMonthStr\":\"MWh\",\"eYear\":3.635,\"eYearStr\":\"MWh\",\"eTotal\":3.635,\"eTotalStr\":\"MWh\",\"uPv1\":674.3,\"uPv1Str\":\"V\",\"iPv1\":6.9,\"iPv1Str\":\"A\",\"uPv2\":668,\"uPv2Str\":\"V\",\"iPv2\":6.6,\"iPv2Str\":\"A\",\"uPv3\":0,\"uPv3Str\":\"V\",\"iPv3\":0,\"iPv3Str\":\"A\",\"uPv4\":0,\"uPv4Str\":\"V\",\"iPv4\":0,\"iPv4Str\":\"A\",\"uPv5\":0,\"uPv5Str\":\"V\",\"iPv5\":0,\"iPv5Str\":\"A\",\"uPv6\":0,\"uPv6Str\":\"V\",\"iPv6\":0,\"iPv6Str\":\"A\",\"uPv7\":0,\"uPv7Str\":\"V\",\"iPv7\":0,\"iPv7Str\":\"A\",\"uPv8\":0,\"uPv8Str\":\"V\",\"iPv8\":0,\"iPv8Str\":\"A\",\"uPv9\":0,\"uPv9Str\":\"V\",\"iPv9\":0,\"iPv9Str\":\"A\",\"uPv10\":0,\"uPv10Str\":\"V\",\"iPv10\":0,\"iPv10Str\":\"A\",\"uPv11\":0,\"uPv11Str\":\"V\",\"iPv11\":0,\"iPv11Str\":\"A\",\"uPv12\":0,\"uPv12Str\":\"V\",\"iPv12\":0,\"iPv12Str\":\"A\",\"uPv13\":0,\"uPv13Str\":\"V\",\"iPv13\":0,\"iPv13Str\":\"A\",\"uPv14\":0,\"uPv14Str\":\"V\",\"iPv14\":0,\"iPv14Str\":\"A\",\"uPv15\":0,\"uPv15Str\":\"V\",\"iPv15\":0,\"iPv15Str\":\"A\",\"uPv16\":0,\"uPv16Str\":\"V\",\"iPv16\":0,\"iPv16Str\":\"A\",\"uPv17\":0,\"uPv17Str\":\"V\",\"iPv17\":0,\"iPv17Str\":\"A\",\"uPv18\":0,\"uPv18Str\":\"V\",\"iPv18\":0,\"iPv18Str\":\"A\",\"uPv19\":0,\"uPv19Str\":\"V\",\"iPv19\":0,\"iPv19Str\":\"A\",\"uPv20\":0,\"uPv20Str\":\"V\",\"iPv20\":0,\"iPv20Str\":\"A\",\"uPv21\":0,\"uPv21Str\":\"V\",\"iPv21\":0,\"iPv21Str\":\"A\",\"uPv22\":0,\"uPv22Str\":\"V\",\"iPv22\":0,\"iPv22Str\":\"A\",\"uPv23\":0,\"uPv23Str\":\"V\",\"iPv23\":0,\"iPv23Str\":\"A\",\"uPv24\":0,\"uPv24Str\":\"V\",\"iPv24\":0,\"iPv24Str\":\"A\",\"uPv25\":0,\"uPv25Str\":\"V\",\"iPv25\":0,\"iPv25Str\":\"A\",\"uPv26\":0,\"uPv26Str\":\"V\",\"iPv26\":0,\"iPv26Str\":\"A\",\"uPv27\":0,\"uPv27Str\":\"V\",\"iPv27\":0,\"iPv27Str\":\"A\",\"uPv28\":0,\"uPv28Str\":\"V\",\"iPv28\":0,\"iPv28Str\":\"A\",\"uPv29\":0,\"uPv29Str\":\"V\",\"iPv29\":0,\"iPv29Str\":\"A\",\"uPv30\":0,\"uPv30Str\":\"V\",\"iPv30\":0,\"iPv30Str\":\"A\",\"uPv31\":0,\"uPv31Str\":\"V\",\"iPv31\":0,\"iPv31Str\":\"A\",\"uPv32\":0,\"uPv32Str\":\"V\",\"iPv32\":0,\"iPv32Str\":\"A\",\"pow1\":4653,\"pow1Str\":\"W\",\"pow2\":4409,\"pow2Str\":\"W\",\"pow3\":0,\"pow3Str\":\"W\",\"pow4\":0,\"pow4Str\":\"W\",\"pow5\":0,\"pow5Str\":\"W\",\"pow6\":0,\"pow6Str\":\"W\",\"pow7\":0,\"pow7Str\":\"W\",\"pow8\":0,\"pow8Str\":\"W\",\"pow9\":0,\"pow9Str\":\"W\",\"pow10\":0,\"pow10Str\":\"W\",\"pow11\":0,\"pow11Str\":\"W\",\"pow12\":0,\"pow12Str\":\"W\",\"pow13\":0,\"pow13Str\":\"W\",\"pow14\":0,\"pow14Str\":\"W\",\"pow15\":0,\"pow15Str\":\"W\",\"pow16\":0,\"pow16Str\":\"W\",\"pow17\":0,\"pow17Str\":\"W\",\"pow18\":0,\"pow18Str\":\"W\",\"pow19\":0,\"pow19Str\":\"W\",\"pow20\":0,\"pow20Str\":\"W\",\"pow21\":0,\"pow21Str\":\"W\",\"pow22\":0,\"pow22Str\":\"W\",\"pow23\":0,\"pow23Str\":\"W\",\"pow24\":0,\"pow24Str\":\"W\",\"pow25\":0,\"pow25Str\":\"W\",\"pow26\":0,\"pow26Str\":\"W\",\"pow27\":0,\"pow27Str\":\"W\",\"pow28\":0,\"pow28Str\":\"W\",\"pow29\":0,\"pow29Str\":\"W\",\"pow30\":0,\"pow30Str\":\"W\",\"pow31\":0,\"pow31Str\":\"W\",\"pow32\":0,\"pow32Str\":\"W\",\"uAc1\":229.9,\"uAc1Str\":\"V\",\"iAc1\":12,\"iAc1Str\":\"A\",\"uAc2\":229.8,\"uAc2Str\":\"V\",\"iAc2\":11.8,\"iAc2Str\":\"A\",\"uAc3\":229,\"uAc3Str\":\"V\",\"iAc3\":11.9,\"iAc3Str\":\"A\",\"powerFactor\":1,\"batteryDischargeEnergy\":0,\"batteryDischargeEnergyStr\":\"kWh\",\"batteryChargeEnergy\":0,\"batteryChargeEnergyStr\":\"kWh\",\"homeLoadEnergy\":0,\"homeLoadEnergyStr\":\"kWh\",\"gridPurchasedEnergy\":0,\"gridPurchasedEnergyStr\":\"kWh\",\"gridSellEnergy\":0,\"gridSellEnergyStr\":\"kWh\",\"fac\":49.96,\"facStr\":\"Hz\",\"batteryPower\":0,\"batteryPowerStr\":\"kW\",\"batteryPowerPec\":\"1\",\"batteryPowerZheng\":0,\"batteryPowerFu\":0,\"storageBatteryVoltage\":0,\"storageBatteryVoltageStr\":\"V\",\"storageBatteryCurrent\":0,\"storageBatteryCurrentStr\":\"A\",\"batteryCapacitySoc\":0,\"batteryHealthSoh\":0,\"batteryVoltage\":0,\"batteryVoltageStr\":\"V\",\"bstteryCurrent\":0,\"bstteryCurrentStr\":\"A\",\"batteryPowerBms\":0,\"batteryPowerBmsStr\":\"kW\",\"internalBatteryI\":0,\"batteryChargingCurrent\":0,\"batteryChargingCurrentStr\":\"A\",\"batteryDischargeLimiting\":0,\"batteryDischargeLimitingStr\":\"A\",\"batteryFailureInformation01\":\"0\",\"batteryFailureInformation02\":\"0\",\"batteryTotalChargeEnergy\":0,\"batteryTotalChargeEnergyStr\":\"kWh\",\"batteryTodayChargeEnergy\":0,\"batteryTodayChargeEnergyStr\":\"kWh\",\"batteryMonthChargeEnergy\":0,\"batteryMonthChargeEnergyStr\":\"kWh\",\"batteryYearChargeEnergy\":0,\"batteryYearChargeEnergyStr\":\"kWh\",\"batteryYesterdayChargeEnergy\":0,\"batteryYesterdayChargeEnergyStr\":\"kWh\",\"batteryTotalDischargeEnergy\":0,\"batteryTotalDischargeEnergyStr\":\"kWh\",\"batteryTodayDischargeEnergy\":0,\"batteryTodayDischargeEnergyStr\":\"kWh\",\"batteryMonthDischargeEnergy\":0,\"batteryMonthDischargeEnergyStr\":\"kWh\",\"batteryYearDischargeEnergy\":0,\"batteryYearDischargeEnergyStr\":\"kWh\",\"batteryYesterdayDischargeEnergy\":0,\"batteryYesterdayDischargeEnergyStr\":\"kWh\",\"gridPurchasedTotalEnergy\":0,\"gridPurchasedTotalEnergyStr\":\"kWh\",\"gridPurchasedYearEnergy\":0,\"gridPurchasedYearEnergyStr\":\"kWh\",\"gridPurchasedMonthEnergy\":0,\"gridPurchasedMonthEnergyStr\":\"kWh\",\"gridPurchasedTodayEnergy\":0,\"gridPurchasedTodayEnergyStr\":\"kWh\",\"gridPurchasedYesterdayEnergy\":0,\"gridPurchasedYesterdayEnergyStr\":\"kWh\",\"gridSellTotalEnergy\":0,\"gridSellTotalEnergyStr\":\"kWh\",\"gridSellYearEnergy\":0,\"gridSellYearEnergyStr\":\"kWh\",\"gridSellMonthEnergy\":0,\"gridSellMonthEnergyStr\":\"kWh\",\"gridSellTodayEnergy\":0,\"gridSellTodayEnergyStr\":\"kWh\",\"gridSellYesterdayEnergy\":0,\"gridSellYesterdayEnergyStr\":\"kWh\",\"homeLoadTotalEnergy\":0,\"homeLoadTotalEnergyStr\":\"kWh\",\"homeLoadTodayEnergy\":0,\"homeLoadTodayEnergyStr\":\"kWh\",\"totalLoadPower\":0,\"totalLoadPowerStr\":\"kW\",\"homeLoadYesterdayEnergy\":0,\"homeLoadYesterdayEnergyStr\":\"kWh\",\"familyLoadPower\":0,\"familyLoadPowerStr\":\"kW\",\"familyLoadPercent\":0,\"homeGridYesterdayEnergy\":0,\"homeGridYesterdayEnergyStr\":\"kWh\",\"homeGridTodayEnergy\":0,\"homeGridTodayEnergyStr\":\"kWh\",\"homeGridMonthEnergy\":0,\"homeGridMonthEnergyStr\":\"kWh\",\"homeGridYearEnergy\":0,\"homeGridYearEnergyStr\":\"kWh\",\"homeGridTotalEnergy\":0,\"homeGridTotalEnergyStr\":\"kWh\",\"bypassLoadPower\":0,\"bypassLoadPowerStr\":\"kW\",\"backupYesterdayEnergy\":0,\"backupYesterdayEnergyStr\":\"kWh\",\"backupTodayEnergy\":0,\"backupTodayEnergyStr\":\"kWh\",\"backupMonthEnergy\":0,\"backupMonthEnergyStr\":\"kWh\",\"backupYearEnergy\":0,\"backupYearEnergyStr\":\"kWh\",\"backupTotalEnergy\":0,\"backupTotalEnergyStr\":\"kWh\",\"bypassAcVoltage\":0,\"bypassAcVoltageB\":0,\"bypassAcVoltageC\":0,\"bypassAcCurrent\":0,\"bypassAcCurrentB\":0,\"bypassAcCurrentC\":0,\"pLimitSet\":110,\"pFactorLimitSet\":10,\"pReactiveLimitSet\":0,\"batteryType\":\"0.0\",\"socDischargeSet\":0,\"socChargingSet\":0,\"pEpmSet\":0,\"pEpmSetStr\":\"kW\",\"epmFailSafe\":0,\"epmSafe\":0,\"pEpm\":0,\"pEpmStr\":\"kW\",\"psumCalPec\":\"1\",\"insulationResistance\":0,\"dispersionRate\":0,\"sirRealtime\":1176,\"iLeakLimt\":0,\"upvTotal\":0,\"upvTotalStr\":\"V\",\"ipvTotal\":0,\"ipvTotalStr\":\"A\",\"powTotal\":0,\"powTotalStr\":\"W\",\"parallelStatus\":0,\"parallelAddr\":0,\"parallelPhase\":0,\"parallelBattery\":0,\"batteryAlarm\":\"0\",\"bypassAcOnoffSet\":0,\"bypassAcVoltageSet\":0,\"bypassAcCurrentSet\":0,\"batteryCDEnableSet\":0,\"batteryCDSet\":0,\"batteryCDISet\":0,\"batteryCMaxiSet\":0,\"batteryDMaxiSet\":0,\"batteryUvpSet\":0,\"batteryFcvSet\":0,\"batteryAcvSet\":0,\"batteryOvpSet\":0,\"batteryOlvEnableSet\":0,\"batteryLaTemp\":0,\"offGridDDepth\":0,\"epsDDepth\":0,\"epsSwitchTime\":\"0\",\"acInType\":0,\"energyStorageControl\":\"0\",\"meter1Type\":0,\"meter2Type\":0,\"meter1SiteHigh\":0,\"meter2SiteHigh\":0,\"meter1TypeLow\":0,\"meter2TypeLow\":0,\"psum\":0,\"dcPacStr\":\"kVA\",\"reactivePowerStr\":\"Var\",\"apparentPowerStr\":\"kVA\",\"psumCal\":8.31,\"familyLoadPowerPec\":\"1\",\"psumStr\":\"kW\",\"psumCalStr\":\"kW\"}";
Map<String, Object> map = JSON.parseObject(JsonString, Map.class);
map.keySet().forEach(s -> System.out.println(s.toLowerCase(Locale.ROOT)+" varchar(100),"));
}
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangCollectorDetail;
public interface GolangCollectorDetailMapper extends BaseMapper<GolangCollectorDetail> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangCollectorList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface GolangCollectorListMapper extends BaseMapper<GolangCollectorList> {
@Select("select id from golang_collector_list group by id")
List<Long> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangInverterDetail;
public interface GolangInverterDetailMapper extends BaseMapper<GolangInverterDetail> {
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangInverterList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface GolangInverterListMapper extends BaseMapper<GolangInverterList> {
@Select("select id from golang_inveter_list group by id")
List<Long> getInverterIds();
}
...@@ -3,4 +3,8 @@ package com.yeejoin.amos.api.householdapi.face.service; ...@@ -3,4 +3,8 @@ package com.yeejoin.amos.api.householdapi.face.service;
public interface GoLangDataAcquisitionService { public interface GoLangDataAcquisitionService {
void stationList(); void stationList();
void stationDetail(); void stationDetail();
void collectorList();
void collectorDetail();
void inverterList();
void inverterDetail();
} }
...@@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -4,10 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil; import com.yeejoin.amos.api.householdapi.Utils.GolangRequestUtil;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant; import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation; import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangStationDetail; import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.*;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.GolangStationList; import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.GolangStationDetailMapper;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.GolangStationMapper;
import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper; import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum; import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
...@@ -32,6 +30,24 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -32,6 +30,24 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
private JpStationMapper jpStationMapper; private JpStationMapper jpStationMapper;
@Autowired @Autowired
private GolangStationDetailMapper golangStationDetailMapper; private GolangStationDetailMapper golangStationDetailMapper;
@Autowired
private GolangCollectorListMapper golangCollectorListMapper;
@Autowired
private GolangInverterListMapper golangInverterListMapper;
//户用光伏 场站历史
@Autowired
private HYGFJPStationPowerHistoryMapper hygfjpStationPowerHistoryMapper;
//
@Autowired
private HYGFJPInverterHistoryMapper hygfjpInverterHistoryMapper;
@Autowired
private HYGFJPCollectorHistoryMapper hygfjpCollectorHistoryMapper;
@Autowired
private HYGFJPInverterWarnMapper hygfjpInverterWarnMapper;
@Autowired
private HYGFJPInverterElecHistoryMapper hygfjpInverterElecHistoryMapper;
@Override @Override
public void stationList() { public void stationList() {
...@@ -103,13 +119,87 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -103,13 +119,87 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation.setYearIncome(golangStationDetail.getYearincome()); jpStation.setYearIncome(golangStationDetail.getYearincome());
jpStation.setCumulativeIncome(golangStationDetail.getAllincome()); jpStation.setCumulativeIncome(golangStationDetail.getAllincome());
jpStation.setArea(golangStationDetail.getRegionstr()); jpStation.setArea(golangStationDetail.getRegionstr());
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) { if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation); jpStationMapper.updateById(jpStation);
} else { } else {
jpStationMapper.insert(jpStation); jpStationMapper.insert(jpStation);
} }
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(new Date());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
hygfjpStationPowerHistory.setPower(jpStation.getRealTimePower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
golangStationDetailMapper.insert(golangStationDetail); golangStationDetailMapper.insert(golangStationDetail);
} }
} }
} }
@Override
public void collectorList() {
List<String> stationIds = golangStationMapper.getStationIds();
for (int i = 0; i < stationIds.size(); i++) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo.put("pageNo", 1);
requestInfo.put("pageSize", 100);
String requestParaminfo = JSON.toJSONString(requestInfo);
List<GolangCollectorList> result = golangRequestUtil.getResPonse(GoLangConstant.collectorListUrl,
GoLangConstant.requestPost,
requestParaminfo,
GoLangConstant.resovleRule_data_page_records,
GolangCollectorList.class
);
for (int j = 0; j < result.size(); j++) {
GolangCollectorList golangCollectorList = result.get(j);
golangCollectorList.setCreatedTime(new Date());
golangCollectorListMapper.insert(golangCollectorList);
}
}
}
@Override
public void collectorDetail() {
List<Long> collectorIds = golangCollectorListMapper.getCollectIds();
}
@Override
public void inverterList() {
List<String> stationIds = golangStationMapper.getStationIds();
for (int i = 0; i < stationIds.size(); i++) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationId", Long.valueOf(stationIds.get(i)));
requestInfo.put("pageNo", 1);
requestInfo.put("pageSize", 100);
String requestParaminfo = JSON.toJSONString(requestInfo);
List<GolangInverterList> result = golangRequestUtil.getResPonse(GoLangConstant.inverterListUrl,
GoLangConstant.requestPost,
requestParaminfo,
GoLangConstant.resovleRule_data_page_records,
GolangInverterList.class
);
for (int j = 0; j < result.size(); j++) {
GolangInverterList golangInverterList = result.get(j);
golangInverterList.setCreatedTime(new Date());
golangInverterListMapper.insert(golangInverterList);
}
}
}
@Override
public void inverterDetail() {
List<Long> inverterIds = golangInverterListMapper.getInverterIds();
}
} }
...@@ -21,11 +21,11 @@ import javax.sql.DataSource; ...@@ -21,11 +21,11 @@ import javax.sql.DataSource;
* 若需要配置更多数据源 , 直接在yml中添加数据源配置再增加相应的新的数据源配置类即可 * 若需要配置更多数据源 , 直接在yml中添加数据源配置再增加相应的新的数据源配置类即可
*/ */
@Configuration @Configuration
@MapperScan(basePackages = "com.yeejoin.amos.boot.module.hygf.api.mapper", sqlSessionFactoryRef = "clusterSqlSessionFactory") @MapperScan(basePackages = "com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf", sqlSessionFactoryRef = "clusterSqlSessionFactory")
public class ClusterDbConfig { public class ClusterDbConfig {
private Logger logger = LoggerFactory.getLogger(ClusterDbConfig.class); private Logger logger = LoggerFactory.getLogger(ClusterDbConfig.class);
// 精确到 cluster 目录,以便跟其他数据源隔离 // 精确到 cluster 目录,以便跟其他数据源隔离
private static final String MAPPER_LOCATION = "classpath*:mapper/mysql/*.xml"; private static final String MAPPER_LOCATION = "classpath*:mapper/hygf/*.xml";
@Value("${spring.db2.datasource.url}") @Value("${spring.db2.datasource.url}")
...@@ -64,7 +64,7 @@ public class ClusterDbConfig { ...@@ -64,7 +64,7 @@ public class ClusterDbConfig {
sessionFactory.setDataSource(culsterDataSource); sessionFactory.setDataSource(culsterDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(ClusterDbConfig.MAPPER_LOCATION)); .getResources(ClusterDbConfig.MAPPER_LOCATION));
sessionFactory.setTypeAliasesPackage("com.yeejoin.amos.boot.module.hygf.api.entity"); sessionFactory.setTypeAliasesPackage("com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf");
//mybatis 数据库字段与实体类属性驼峰映射配置 //mybatis 数据库字段与实体类属性驼峰映射配置
sessionFactory.getObject().getConfiguration().setMapUnderscoreToCamelCase(true); sessionFactory.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);
return sessionFactory.getObject(); return sessionFactory.getObject();
......
...@@ -5,22 +5,22 @@ server.port=11006 ...@@ -5,22 +5,22 @@ server.port=11006
## DB properties hygf ## DB properties hygf
## db1-production database ## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url=jdbc:mysql://172.16.10.220:3306/amos_?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.db1.datasource.url=jdbc:mysql://172.16.10.220:3306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username=root spring.db1.datasource.username=root
spring.db1.datasource.password=Yeejoin@2020 spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name: com.mysql.cj.jdbc.Driver spring.db1.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
## db2-sync_data ## db2-sync_data
spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url=jdbc:mysql://172.16.10.220:3306/amos_openapi?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8 spring.db2.datasource.url=jdbc:mysql://172.16.10.220:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username=root spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020 spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver spring.db2.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
## db3-taosiData ## db3-taosiData
spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db3.datasource.url=jdbc:TAOS://139.9.170.47:6041/house_pv_data?user=root&password=taosdata&timezone=GMT%2B8&characterEncoding=utf8 spring.db3.datasource.url=jdbc:TAOS-RS://139.9.170.47:6041/house_pv_data?user=root&password=taosdata&timezone=GMT%2B8&characterEncoding=utf8
spring.db3.datasource.username=root spring.db3.datasource.username=root
spring.db3.datasource.password=taosdata spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name: com.taosdata.jdbc.TSDBDriver spring.db3.datasource.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
# REDIS (RedisProperties) # REDIS (RedisProperties)
......
...@@ -36,7 +36,6 @@ public class JpInvertorElecHistoryAllDto extends BaseDto { ...@@ -36,7 +36,6 @@ public class JpInvertorElecHistoryAllDto extends BaseDto {
private Double wAcVoltage; private Double wAcVoltage;
@ApiModelProperty(value = "U交流电流") @ApiModelProperty(value = "U交流电流")
@TableField("U_AC_current")
private Double uAcCurrent; private Double uAcCurrent;
@ApiModelProperty(value = "V交流电流") @ApiModelProperty(value = "V交流电流")
......
...@@ -26,7 +26,6 @@ public class JpInvertorElecHistoryMonthDto extends BaseDto { ...@@ -26,7 +26,6 @@ public class JpInvertorElecHistoryMonthDto extends BaseDto {
private String snCode; private String snCode;
@ApiModelProperty(value = "U交流电压") @ApiModelProperty(value = "U交流电压")
private Double uAcVoltage; private Double uAcVoltage;
@ApiModelProperty(value = "V交流电压") @ApiModelProperty(value = "V交流电压")
...@@ -46,7 +45,21 @@ public class JpInvertorElecHistoryMonthDto extends BaseDto { ...@@ -46,7 +45,21 @@ public class JpInvertorElecHistoryMonthDto extends BaseDto {
private Double vAcCurrent; private Double vAcCurrent;
@ApiModelProperty(value = "W交流电流") @ApiModelProperty(value = "W交流电流")
private Double uAcVoltage;
@ApiModelProperty(value = "V交流电压")
private Double vAcVoltage;
@ApiModelProperty(value = "W交流电压")
private Double wAcVoltage;
@ApiModelProperty(value = "U交流电流")
private Double uAcCurrent;
@ApiModelProperty(value = "V交流电流")
private Double vAcCurrent;
@ApiModelProperty(value = "W交流电流")
private Double wAcCurrent; private Double wAcCurrent;
@ApiModelProperty(value = "第三方电站id") @ApiModelProperty(value = "第三方电站id")
......
...@@ -42,9 +42,6 @@ public class TdHygfJpInvertorElecHistoryDto { ...@@ -42,9 +42,6 @@ public class TdHygfJpInvertorElecHistoryDto {
@ApiModelProperty(value = "W交流电流") @ApiModelProperty(value = "W交流电流")
private Double wAcCurrent; private Double wAcCurrent;
@ApiModelProperty(value = "品牌")
private String brand;
@ApiModelProperty(value = "时间") @ApiModelProperty(value = "时间")
private Long time; private Long time;
......
...@@ -64,12 +64,6 @@ public class TdHygfJpInvertorElecHistory { ...@@ -64,12 +64,6 @@ public class TdHygfJpInvertorElecHistory {
private Double wAcCurrent; private Double wAcCurrent;
/** /**
* 品牌
*/
@TableField("brand")
private String brand;
/**
* 时间 * 时间
*/ */
@TableField("time") @TableField("time")
......
...@@ -5,6 +5,9 @@ import java.util.List; ...@@ -5,6 +5,9 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.JpCollectorHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
...@@ -20,12 +23,12 @@ public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpColle ...@@ -20,12 +23,12 @@ public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpColle
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime, @Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime); @Param("endTime") long endTime);
List<TdHygfJpCollectorHistoryDto> monthList(@Param("snCode") String snCode, List<JpCollectorHistoryMonthDto> monthList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("month") String month); @Param("thirdStationId") String thirdStationId, @Param("month") String month);
List<TdHygfJpCollectorHistoryDto> yearList(@Param("snCode") String snCode, List<JpCollectorHistoryYearDto> yearList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("year") String year); @Param("thirdStationId") String thirdStationId, @Param("year") String year);
List<TdHygfJpCollectorHistoryDto> allList(@Param("snCode") String snCode, List<JpCollectorHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId); @Param("thirdStationId") String thirdStationId);
} }
...@@ -5,6 +5,9 @@ import java.util.List; ...@@ -5,6 +5,9 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
...@@ -19,4 +22,13 @@ public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpIn ...@@ -19,4 +22,13 @@ public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpIn
List<TdHygfJpInvertorElecHistoryDto> dayList(@Param("snCode") String snCode, List<TdHygfJpInvertorElecHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime, @Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime); @Param("endTime") long endTime);
List<JpInvertorElecHistoryMonthDto> monthList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("month") String month);
List<JpInvertorElecHistoryYearDto> yearList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("year") String year);
List<JpInvertorElecHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId);
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</if> </if>
</where> </where>
</select> </select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryMonthDto"> <select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month
<where> <where>
<if test="snCode!=null"> <if test="snCode!=null">
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
</if> </if>
</where> </where>
</select> </select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryYearDto"> <select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month SELECT * FROM house_pv_data.td_hygf_jp_collector_history_year
<where> <where>
<if test="snCode!=null"> <if test="snCode!=null">
AND `sn_code` = #{snCode} AND `sn_code` = #{snCode}
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
</if> </if>
</where> </where>
</select> </select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryAllDto"> <select id="allList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history_month SELECT * FROM house_pv_data.td_hygf_jp_collector_history_all
<where> <where>
<if test="snCode!=null"> <if test="snCode!=null">
AND `sn_code` = #{snCode} AND `sn_code` = #{snCode}
......
...@@ -15,4 +15,43 @@ ...@@ -15,4 +15,43 @@
</if> </if>
</where> </where>
</select> </select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_month
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
</select>
<select id="yearList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_year
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="year!=null">
AND year = #{year}
</if>
</where>
</select>
<select id="allList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history_all
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -23,8 +23,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -23,8 +23,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
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.JpCollectorHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpCollectorHistoryServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpCollectorHistoryServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -140,7 +142,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -140,7 +142,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/month") @GetMapping(value = "/list/month")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> monthList(@RequestParam(value = "id") long id, public ResponseModel<List<JpCollectorHistoryMonthDto>> monthList(@RequestParam(value = "id") long id,
@RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) { @RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.monthList(id, month)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.monthList(id, month));
} }
...@@ -153,7 +155,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -153,7 +155,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/year") @GetMapping(value = "/list/year")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> yearList(@RequestParam(value = "id") long id, public ResponseModel<List<JpCollectorHistoryYearDto>> yearList(@RequestParam(value = "id") long id,
@RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) { @RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.yearList(id, year)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.yearList(id, year));
} }
...@@ -166,7 +168,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -166,7 +168,7 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/all") @GetMapping(value = "/list/all")
public ResponseModel<List<TdHygfJpCollectorHistoryDto>> allList(@RequestParam(value = "id") long id) { public ResponseModel<List<JpCollectorHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id));
} }
} }
...@@ -23,8 +23,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -23,8 +23,10 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
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.dto.TdHygfJpInvertorElecHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInvertorElecHistoryServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInvertorElecHistoryServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -131,4 +133,42 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController { ...@@ -131,4 +133,42 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) { @RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day)); return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.dayList(id, day));
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/month")
public ResponseModel<List<JpInvertorElecHistoryMonthDto>> monthList(@RequestParam(value = "id") long id,
@RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.monthList(id, month));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/year")
public ResponseModel<List<JpInvertorElecHistoryYearDto>> yearList(@RequestParam(value = "id") long id,
@RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.yearList(id, year));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/all")
public ResponseModel<List<JpInvertorElecHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.allList(id));
}
} }
...@@ -9,13 +9,13 @@ import org.springframework.stereotype.Service; ...@@ -9,13 +9,13 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
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.JpCollectorHistoryMonthDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector; import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpCollectorHistoryService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpCollectorHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryAllMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryMonthMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryYearMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil; import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
...@@ -57,7 +57,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -57,7 +57,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpCollectorHistoryDto> monthList(long id, Date month) { public List<JpCollectorHistoryMonthDto> monthList(long id, Date month) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
...@@ -70,7 +70,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -70,7 +70,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpCollectorHistoryDto> yearList(long id, Date year) { public List<JpCollectorHistoryYearDto> yearList(long id, Date year) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
...@@ -83,7 +83,7 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -83,7 +83,7 @@ public class TdHygfJpCollectorHistoryServiceImpl
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpCollectorHistoryDto> allList(long id) { public List<JpCollectorHistoryAllDto> allList(long id) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
......
...@@ -9,10 +9,12 @@ import org.springframework.stereotype.Service; ...@@ -9,10 +9,12 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper; 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.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.JpInverter;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInvertorElecHistoryService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInvertorElecHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper;
...@@ -51,4 +53,40 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -51,4 +53,40 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
} }
return new ArrayList<>(); return new ArrayList<>();
} }
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryMonthDto> monthList(long id, Date month) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.monthList(invertor.getSnCode(), invertor.getThirdStationId(), month.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryYearDto> yearList(long id, Date year) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.yearList(invertor.getSnCode(), invertor.getThirdStationId(), year.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryAllDto> allList(long id) {
JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) {
return this.baseMapper.allList(invertor.getSnCode(), invertor.getThirdStationId());
}
return new ArrayList<>();
}
} }
\ No newline at end of file
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