Commit 2e21653c authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 288206e2 9513c97e
...@@ -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)
......
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpCollectorHistoryAllDto", description="户用光伏监盘采集器历史表")
public class JpCollectorHistoryAllDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "信号强度")
private Double signalStrength;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "年")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpCollectorHistoryMonthDto", description="户用光伏监盘采集器历史表")
public class JpCollectorHistoryMonthDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "信号强度")
private Double signalStrength;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "日期")
private String day;
@ApiModelProperty(value = "年月")
private String yearMonth;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpCollectorHistoryYearDto", description="户用光伏监盘采集器历史表")
public class JpCollectorHistoryYearDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "信号强度")
private Double signalStrength;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "日期")
private String month;
@ApiModelProperty(value = "年")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpInvertorElecHistoryAllDto", description="户用光伏监盘逆变器电能历史表")
public class JpInvertorElecHistoryAllDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "U交流电压")
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;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "年")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpInvertorElecHistoryMonthDto", description="户用光伏监盘逆变器电能历史表")
public class JpInvertorElecHistoryMonthDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "U交流电压")
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;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "日期")
private String day;
@ApiModelProperty(value = "年月")
private String yearMonth;
}
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@ApiModel(value="JpInvertorElecHistoryYearDto", description="户用光伏监盘逆变器电能历史表")
public class JpInvertorElecHistoryYearDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码")
private String snCode;
@ApiModelProperty(value = "U交流电压")
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;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = "第三方厂商标识")
private String thirdCode;
@ApiModelProperty(value = "日期")
private String day;
@ApiModelProperty(value = "年月")
private String yearMonth;
}
...@@ -5,6 +5,9 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,9 @@ import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
/** /**
...@@ -32,4 +35,19 @@ public class MonthPowerDto { ...@@ -32,4 +35,19 @@ public class MonthPowerDto {
@ApiModelProperty(value = "平均功率") @ApiModelProperty(value = "平均功率")
private Double power; private Double power;
public void setDay(String day) {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
String formattedDate = now.format(formatter);
this.day = formattedDate;
}
public void setYearMonth(String yearMonth) {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM");
String formattedDate = now.format(formatter);
this.yearMonth = formattedDate;
}
} }
...@@ -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;
......
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_collector_history_all")
public class JpCollectorHistoryAll extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* 信号强度
*/
@TableField("signal_strength")
private Double signalStrength;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 年
*/
@TableField("year")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_collector_history_month")
public class JpCollectorHistoryMonth extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* 信号强度
*/
@TableField("signal_strength")
private Double signalStrength;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 日期
*/
@TableField("day")
private String day;
/**
* 年月
*/
@TableField("year_month")
private String yearMonth;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_collector_history_year")
public class JpCollectorHistoryYear extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* 信号强度
*/
@TableField("signal_strength")
private Double signalStrength;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 日期
*/
@TableField("month")
private String month;
/**
* 年
*/
@TableField("year")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_invertor_elec_history_all")
public class JpInvertorElecHistoryAll extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* U交流电压
*/
@TableField("U_AC_voltage")
private Double uAcVoltage;
/**
* V交流电压
*/
@TableField("V_AC_voltage")
private Double vAcVoltage;
/**
* W交流电压
*/
@TableField("W_AC_voltage")
private Double wAcVoltage;
/**
* U交流电流
*/
@TableField("U_AC_current")
private Double uAcCurrent;
/**
* V交流电流
*/
@TableField("V_AC_current")
private Double vAcCurrent;
/**
* W交流电流
*/
@TableField("W_AC_current")
private Double wAcCurrent;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 年
*/
@TableField("year")
private String year;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_invertor_elec_history_month")
public class JpInvertorElecHistoryMonth extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* U交流电压
*/
@TableField("U_AC_voltage")
private Double uAcVoltage;
/**
* V交流电压
*/
@TableField("V_AC_voltage")
private Double vAcVoltage;
/**
* W交流电压
*/
@TableField("W_AC_voltage")
private Double wAcVoltage;
/**
* U交流电流
*/
@TableField("U_AC_current")
private Double uAcCurrent;
/**
* V交流电流
*/
@TableField("V_AC_current")
private Double vAcCurrent;
/**
* W交流电流
*/
@TableField("W_AC_current")
private Double wAcCurrent;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 日期
*/
@TableField("day")
private String day;
/**
* 年月
*/
@TableField("year_month")
private String yearMonth;
}
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("td_hygf_jp_invertor_elec_history_year")
public class JpInvertorElecHistoryYear extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* sn编码
*/
@TableField("sn_code")
private String snCode;
/**
* U交流电压
*/
@TableField("U_AC_voltage")
private Double uAcVoltage;
/**
* V交流电压
*/
@TableField("V_AC_voltage")
private Double vAcVoltage;
/**
* W交流电压
*/
@TableField("W_AC_voltage")
private Double wAcVoltage;
/**
* U交流电流
*/
@TableField("U_AC_current")
private Double uAcCurrent;
/**
* V交流电流
*/
@TableField("V_AC_current")
private Double vAcCurrent;
/**
* W交流电流
*/
@TableField("W_AC_current")
private Double wAcCurrent;
/**
* 第三方电站id
*/
@TableField("third_station_id")
private String thirdStationId;
/**
* 第三方厂商标识
*/
@TableField("third_code")
private String thirdCode;
/**
* 日期
*/
@TableField("day")
private String day;
/**
* 年月
*/
@TableField("year_month")
private String yearMonth;
}
...@@ -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")
......
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘采集器历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpCollectorHistoryAllService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘采集器历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpCollectorHistoryMonthService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘采集器历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpCollectorHistoryYearService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘逆变器电能历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpInvertorElecHistoryAllService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘逆变器电能历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpInvertorElecHistoryMonthService {
}
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 户用光伏监盘逆变器电能历史表接口类
*
* @author system_generator
* @date 2023-09-20
*/
public interface IJpInvertorElecHistoryYearService {
}
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
import java.util.List;
/** /**
* 按月统计接口类 * 按月统计接口类
* *
...@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -8,5 +12,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
* @date 2023-09-20 * @date 2023-09-20
*/ */
public interface IMonthPowerService { public interface IMonthPowerService {
void getMonthPower();
} }
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import java.util.Map;
/** /**
* 户用光伏监盘电站功率表接口类 * 户用光伏监盘电站功率表接口类
* *
...@@ -9,4 +11,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -9,4 +11,7 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/ */
public interface ITdHygfJpStationPowerHistoryService { public interface ITdHygfJpStationPowerHistoryService {
Map<String,Double> getacgNum();
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryAll;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘采集器历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpCollectorHistoryAllMapper extends BaseMapper<JpCollectorHistoryAll> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘采集器历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpCollectorHistoryMonthMapper extends BaseMapper<JpCollectorHistoryMonth> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryYear;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘采集器历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpCollectorHistoryYearMapper extends BaseMapper<JpCollectorHistoryYear> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryAll;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘逆变器电能历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpInvertorElecHistoryAllMapper extends BaseMapper<JpInvertorElecHistoryAll> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryMonth;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘逆变器电能历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpInvertorElecHistoryMonthMapper extends BaseMapper<JpInvertorElecHistoryMonth> {
}
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryYear;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 户用光伏监盘逆变器电能历史表 Mapper 接口
*
* @author system_generator
* @date 2023-09-20
*/
public interface JpInvertorElecHistoryYearMapper extends BaseMapper<JpInvertorElecHistoryYear> {
}
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower; import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/** /**
* 按月统计 Mapper 接口 * 按月统计 Mapper 接口
* *
...@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface MonthPowerMapper extends BaseMapper<MonthPower> { public interface MonthPowerMapper extends BaseMapper<MonthPower> {
List<MonthPower> getMonthPower();
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpCollectorHistory; import java.util.List;
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.entity.TdHygfJpCollectorHistory;
/** /**
* 户用光伏监盘采集器历史表 Mapper 接口 * 户用光伏监盘采集器历史表 Mapper 接口
...@@ -11,4 +19,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +19,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpCollectorHistory> { public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpCollectorHistory> {
List<TdHygfJpCollectorHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@Param("endTime") long endTime);
List<JpCollectorHistoryMonthDto> monthList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("month") String month);
List<JpCollectorHistoryYearDto> yearList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("year") String year);
List<JpCollectorHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterHistory; import java.util.Map;
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.entity.TdHygfJpInverterHistory;
/** /**
* 户用光伏监盘逆变器历史表 Mapper 接口 * 户用光伏监盘逆变器历史表 Mapper 接口
...@@ -11,4 +15,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +15,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface TdHygfJpInverterHistoryMapper extends BaseMapper<TdHygfJpInverterHistory> { public interface TdHygfJpInverterHistoryMapper extends BaseMapper<TdHygfJpInverterHistory> {
Map<String, Object> sum(@Param("snCode") String snCode, @Param("thirdStationId") String thirdStationId,
@Param("date") String date);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInvertorElecHistory; import java.util.List;
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.entity.TdHygfJpInvertorElecHistory;
/** /**
* 户用光伏监盘逆变器电能历史表 Mapper 接口 * 户用光伏监盘逆变器电能历史表 Mapper 接口
...@@ -11,4 +19,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +19,16 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpInvertorElecHistory> { public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpInvertorElecHistory> {
List<TdHygfJpInvertorElecHistoryDto> dayList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId, @Param("startTime") long startTime,
@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);
} }
...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; ...@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpStationPowerHistory; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpStationPowerHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/** /**
* 户用光伏监盘电站功率表 Mapper 接口 * 户用光伏监盘电站功率表 Mapper 接口
...@@ -10,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -10,5 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @date 2023-09-19 * @date 2023-09-19
*/ */
public interface TdHygfJpStationPowerHistoryMapper extends BaseMapper<TdHygfJpStationPowerHistory> { public interface TdHygfJpStationPowerHistoryMapper extends BaseMapper<TdHygfJpStationPowerHistory> {
Map<String,Double> getacgNum(@Param("date") String date);
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryAllMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryMonthMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryYearMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryAllMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryMonthMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryYearMapper">
</mapper>
...@@ -2,4 +2,13 @@ ...@@ -2,4 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper">
<select id="getMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.MonthPowerDto">
SELECT
avg(power) power,
third_station_id thirdStationId
FROM house_pv_data.td_hygf_jp_station_power_history where created_time <![CDATA[>=]]> today()-8h and created_time <![CDATA[<]]> today()+1d-8h GROUP BY third_station_id
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpCollectorHistoryMapper">
<select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpCollectorHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</select>
<select id="monthList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_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.JpCollectorHistoryYearDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_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.JpCollectorHistoryAllDto">
SELECT * FROM house_pv_data.td_hygf_jp_collector_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>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper">
<select id="sum" resultType="Map">
SELECT sum(power_generation) AS power,sum(daily_return) AS dailyReturn,sum(generation_hours) AS hours FROM house_pv_data.td_hygf_jp_inverter_history
<where>
<if test="snCode!=null">
AND `sn_code` = #{snCode}
</if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="date!=null">
AND `date` LIKE '%'#{date}'%'
</if>
</where>
</select>
</mapper> </mapper>
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper">
<select id="getCountTdHygfJpInverterWarn" resultType="map"> <select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT `state`,count(`state`) num SELECT `state`,count(`state`) num
FROM house_pv_data.td_hygf_jp_inverter_warn FROM house_pv_data.td_hygf_jp_inverter_warn
...@@ -23,7 +21,13 @@ ...@@ -23,7 +21,13 @@
<where> <where>
<if test="param.state!=null"> <if test="param.state!=null">
`state` = #{param.state} `state` = #{param.state}
</if> </if>
<if test="param.stationIds!=null">
AND third_station_id IN
<foreach collection="param.stationIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInvertorElecHistoryMapper">
<select id="list" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto"> <select id="dayList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInvertorElecHistoryDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn SELECT * FROM house_pv_data.td_hygf_jp_invertor_elec_history
<where> <where>
<if test="param.state!=null"> <if test="snCode!=null">
`state` = #{param.state} AND `sn_code` = #{snCode}
</if> </if>
<if test="thirdStationId!=null">
AND `third_station_id` = #{thirdStationId}
</if>
<if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime}
</if>
</where>
</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> </where>
</select> </select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpStationPowerHistoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpStationPowerHistoryMapper">
<select id="getCountTdHygfJpInverterWarn" resultType="map">
SELECT AVG(power) acgNum FROM house_pv_data.td_hygf_jp_station_power_history WHERE created_time > #{date} INTERVAL(1d);
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorHistoryAllServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘采集器历史表Api")
@RequestMapping(value = "/jp-collector-history-all")
public class JpCollectorHistoryAllController extends BaseController {
@Autowired
JpCollectorHistoryAllServiceImpl jpCollectorHistoryAllServiceImpl;
/**
* 新增户用光伏监盘采集器历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘采集器历史表", notes = "新增户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryAllDto> save(@RequestBody JpCollectorHistoryAllDto model) {
model = jpCollectorHistoryAllServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器历史表", notes = "根据sequenceNbr更新户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryAllDto> updateBySequenceNbrJpCollectorHistoryAll(@RequestBody JpCollectorHistoryAllDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryAllServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘采集器历史表", notes = "根据sequenceNbr删除户用光伏监盘采集器历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpCollectorHistoryAllServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器历史表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryAllDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryAllServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表分页查询", notes = "户用光伏监盘采集器历史表分页查询")
public ResponseModel<Page<JpCollectorHistoryAllDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpCollectorHistoryAllDto> page = new Page<JpCollectorHistoryAllDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpCollectorHistoryAllServiceImpl.queryForJpCollectorHistoryAllPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpCollectorHistoryAllDto>> selectForList() {
return ResponseHelper.buildResponse(jpCollectorHistoryAllServiceImpl.queryForJpCollectorHistoryAllList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorHistoryMonthServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘采集器历史表Api")
@RequestMapping(value = "/jp-collector-history-month")
public class JpCollectorHistoryMonthController extends BaseController {
@Autowired
JpCollectorHistoryMonthServiceImpl jpCollectorHistoryMonthServiceImpl;
/**
* 新增户用光伏监盘采集器历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘采集器历史表", notes = "新增户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryMonthDto> save(@RequestBody JpCollectorHistoryMonthDto model) {
model = jpCollectorHistoryMonthServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器历史表", notes = "根据sequenceNbr更新户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryMonthDto> updateBySequenceNbrJpCollectorHistoryMonth(@RequestBody JpCollectorHistoryMonthDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryMonthServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘采集器历史表", notes = "根据sequenceNbr删除户用光伏监盘采集器历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpCollectorHistoryMonthServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器历史表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryMonthDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryMonthServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表分页查询", notes = "户用光伏监盘采集器历史表分页查询")
public ResponseModel<Page<JpCollectorHistoryMonthDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpCollectorHistoryMonthDto> page = new Page<JpCollectorHistoryMonthDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpCollectorHistoryMonthServiceImpl.queryForJpCollectorHistoryMonthPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpCollectorHistoryMonthDto>> selectForList() {
return ResponseHelper.buildResponse(jpCollectorHistoryMonthServiceImpl.queryForJpCollectorHistoryMonthList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorHistoryYearServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryYearDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘采集器历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘采集器历史表Api")
@RequestMapping(value = "/jp-collector-history-year")
public class JpCollectorHistoryYearController extends BaseController {
@Autowired
JpCollectorHistoryYearServiceImpl jpCollectorHistoryYearServiceImpl;
/**
* 新增户用光伏监盘采集器历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘采集器历史表", notes = "新增户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryYearDto> save(@RequestBody JpCollectorHistoryYearDto model) {
model = jpCollectorHistoryYearServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器历史表", notes = "根据sequenceNbr更新户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryYearDto> updateBySequenceNbrJpCollectorHistoryYear(@RequestBody JpCollectorHistoryYearDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryYearServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘采集器历史表", notes = "根据sequenceNbr删除户用光伏监盘采集器历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpCollectorHistoryYearServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器历史表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器历史表")
public ResponseModel<JpCollectorHistoryYearDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorHistoryYearServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表分页查询", notes = "户用光伏监盘采集器历史表分页查询")
public ResponseModel<Page<JpCollectorHistoryYearDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpCollectorHistoryYearDto> page = new Page<JpCollectorHistoryYearDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpCollectorHistoryYearServiceImpl.queryForJpCollectorHistoryYearPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpCollectorHistoryYearDto>> selectForList() {
return ResponseHelper.buildResponse(jpCollectorHistoryYearServiceImpl.queryForJpCollectorHistoryYearList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInvertorElecHistoryAllServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘逆变器电能历史表Api")
@RequestMapping(value = "/jp-invertor-elec-history-all")
public class JpInvertorElecHistoryAllController extends BaseController {
@Autowired
JpInvertorElecHistoryAllServiceImpl jpInvertorElecHistoryAllServiceImpl;
/**
* 新增户用光伏监盘逆变器电能历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘逆变器电能历史表", notes = "新增户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryAllDto> save(@RequestBody JpInvertorElecHistoryAllDto model) {
model = jpInvertorElecHistoryAllServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryAllDto> updateBySequenceNbrJpInvertorElecHistoryAll(@RequestBody JpInvertorElecHistoryAllDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryAllServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpInvertorElecHistoryAllServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryAllDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryAllServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表分页查询", notes = "户用光伏监盘逆变器电能历史表分页查询")
public ResponseModel<Page<JpInvertorElecHistoryAllDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpInvertorElecHistoryAllDto> page = new Page<JpInvertorElecHistoryAllDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpInvertorElecHistoryAllServiceImpl.queryForJpInvertorElecHistoryAllPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpInvertorElecHistoryAllDto>> selectForList() {
return ResponseHelper.buildResponse(jpInvertorElecHistoryAllServiceImpl.queryForJpInvertorElecHistoryAllList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInvertorElecHistoryMonthServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘逆变器电能历史表Api")
@RequestMapping(value = "/jp-invertor-elec-history-month")
public class JpInvertorElecHistoryMonthController extends BaseController {
@Autowired
JpInvertorElecHistoryMonthServiceImpl jpInvertorElecHistoryMonthServiceImpl;
/**
* 新增户用光伏监盘逆变器电能历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘逆变器电能历史表", notes = "新增户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryMonthDto> save(@RequestBody JpInvertorElecHistoryMonthDto model) {
model = jpInvertorElecHistoryMonthServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryMonthDto> updateBySequenceNbrJpInvertorElecHistoryMonth(@RequestBody JpInvertorElecHistoryMonthDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryMonthServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpInvertorElecHistoryMonthServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryMonthDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryMonthServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表分页查询", notes = "户用光伏监盘逆变器电能历史表分页查询")
public ResponseModel<Page<JpInvertorElecHistoryMonthDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpInvertorElecHistoryMonthDto> page = new Page<JpInvertorElecHistoryMonthDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpInvertorElecHistoryMonthServiceImpl.queryForJpInvertorElecHistoryMonthPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpInvertorElecHistoryMonthDto>> selectForList() {
return ResponseHelper.buildResponse(jpInvertorElecHistoryMonthServiceImpl.queryForJpInvertorElecHistoryMonthList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInvertorElecHistoryYearServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 户用光伏监盘逆变器电能历史表
*
* @author system_generator
* @date 2023-09-20
*/
@RestController
@Api(tags = "户用光伏监盘逆变器电能历史表Api")
@RequestMapping(value = "/jp-invertor-elec-history-year")
public class JpInvertorElecHistoryYearController extends BaseController {
@Autowired
JpInvertorElecHistoryYearServiceImpl jpInvertorElecHistoryYearServiceImpl;
/**
* 新增户用光伏监盘逆变器电能历史表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘逆变器电能历史表", notes = "新增户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryYearDto> save(@RequestBody JpInvertorElecHistoryYearDto model) {
model = jpInvertorElecHistoryYearServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryYearDto> updateBySequenceNbrJpInvertorElecHistoryYear(@RequestBody JpInvertorElecHistoryYearDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryYearServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr删除户用光伏监盘逆变器电能历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(jpInvertorElecHistoryYearServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器电能历史表")
public ResponseModel<JpInvertorElecHistoryYearDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpInvertorElecHistoryYearServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表分页查询", notes = "户用光伏监盘逆变器电能历史表分页查询")
public ResponseModel<Page<JpInvertorElecHistoryYearDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<JpInvertorElecHistoryYearDto> page = new Page<JpInvertorElecHistoryYearDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(jpInvertorElecHistoryYearServiceImpl.queryForJpInvertorElecHistoryYearPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpInvertorElecHistoryYearDto>> selectForList() {
return ResponseHelper.buildResponse(jpInvertorElecHistoryYearServiceImpl.queryForJpInvertorElecHistoryYearList());
}
}
...@@ -210,17 +210,7 @@ public class JpStationController extends BaseController { ...@@ -210,17 +210,7 @@ public class JpStationController extends BaseController {
} }
return ResponseHelper.buildResponse(data); return ResponseHelper.buildResponse(data);
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "第三方场站列表全部数据查询", notes = "第三方场站列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<JpStationDto>> selectForList() {
return ResponseHelper.buildResponse(jpStationServiceImpl.queryForJpStationList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "电站监控电量收益", notes = "电站监控电量收益") @ApiOperation(httpMethod = "GET",value = "电站监控电量收益", notes = "电站监控电量收益")
......
...@@ -110,6 +110,10 @@ public class MonthPowerController extends BaseController { ...@@ -110,6 +110,10 @@ public class MonthPowerController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "按月统计列表全部数据查询", notes = "按月统计列表全部数据查询") @ApiOperation(httpMethod = "GET",value = "按月统计列表全部数据查询", notes = "按月统计列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<MonthPowerDto>> selectForList() { public ResponseModel<List<MonthPowerDto>> selectForList() {
monthPowerServiceImpl.getMonthPower();
return ResponseHelper.buildResponse(monthPowerServiceImpl.queryForMonthPowerList()); return ResponseHelper.buildResponse(monthPowerServiceImpl.queryForMonthPowerList());
} }
} }
...@@ -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;
...@@ -127,8 +129,46 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -127,8 +129,46 @@ 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/day") @GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpCollectorHistory>> dayList(@RequestParam(value = "id") long id, public ResponseModel<List<TdHygfJpCollectorHistoryDto>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat() Date day) { @RequestParam(value = "day") @DateTimeFormat(pattern = "yyyy-MM-dd") Date day) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.dayList(id, day));
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/month")
public ResponseModel<List<JpCollectorHistoryMonthDto>> monthList(@RequestParam(value = "id") long id,
@RequestParam(value = "month") @DateTimeFormat(pattern = "yyyy-MM") Date month) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.monthList(id, month));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/year")
public ResponseModel<List<JpCollectorHistoryYearDto>> yearList(@RequestParam(value = "id") long id,
@RequestParam(value = "year") @DateTimeFormat(pattern = "yyyy") Date year) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.yearList(id, year));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/list/all")
public ResponseModel<List<JpCollectorHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id));
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.RequestParam;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.List; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterHistoryServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
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.module.hygf.api.dto.TdHygfJpInverterHistoryDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterHistoryDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterHistoryServiceImpl;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* 户用光伏监盘逆变器历史表 * 户用光伏监盘逆变器历史表
...@@ -28,88 +39,105 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -28,88 +39,105 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
@RequestMapping(value = "/td-hygf-jp-inverter-history") @RequestMapping(value = "/td-hygf-jp-inverter-history")
public class TdHygfJpInverterHistoryController extends BaseController { public class TdHygfJpInverterHistoryController extends BaseController {
@Autowired @Autowired
TdHygfJpInverterHistoryServiceImpl tdHygfJpInverterHistoryServiceImpl; TdHygfJpInverterHistoryServiceImpl tdHygfJpInverterHistoryServiceImpl;
/** /**
* 新增户用光伏监盘逆变器历史表 * 新增户用光伏监盘逆变器历史表
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘逆变器历史表", notes = "新增户用光伏监盘逆变器历史表") @ApiOperation(httpMethod = "POST", value = "新增户用光伏监盘逆变器历史表", notes = "新增户用光伏监盘逆变器历史表")
public ResponseModel<TdHygfJpInverterHistoryDto> save(@RequestBody TdHygfJpInverterHistoryDto model) { public ResponseModel<TdHygfJpInverterHistoryDto> save(@RequestBody TdHygfJpInverterHistoryDto model) {
model = tdHygfJpInverterHistoryServiceImpl.createWithModel(model); model = tdHygfJpInverterHistoryServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr更新
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器历史表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器历史表", notes = "根据sequenceNbr更新户用光伏监盘逆变器历史表")
public ResponseModel<TdHygfJpInverterHistoryDto> updateBySequenceNbrTdHygfJpInverterHistory(@RequestBody TdHygfJpInverterHistoryDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<TdHygfJpInverterHistoryDto> updateBySequenceNbrTdHygfJpInverterHistory(
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.updateWithModel(model)); @RequestBody TdHygfJpInverterHistoryDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.updateWithModel(model));
} }
/** /**
* 根据sequenceNbr删除 * 根据sequenceNbr删除
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘逆变器历史表", notes = "根据sequenceNbr删除户用光伏监盘逆变器历史表") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘逆变器历史表", notes = "根据sequenceNbr删除户用光伏监盘逆变器历史表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request,
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.removeById(sequenceNbr)); @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
} return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.removeById(sequenceNbr));
}
/** /**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘逆变器历史表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器历史表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个户用光伏监盘逆变器历史表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器历史表")
public ResponseModel<TdHygfJpInverterHistoryDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<TdHygfJpInverterHistoryDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryBySeq(sequenceNbr));
} }
/** /**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
* @param current 每页大小 * @param current 每页大小
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器历史表分页查询", notes = "户用光伏监盘逆变器历史表分页查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器历史表分页查询", notes = "户用光伏监盘逆变器历史表分页查询")
public ResponseModel<Page<TdHygfJpInverterHistoryDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<TdHygfJpInverterHistoryDto>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size) { @RequestParam(value = "size") int size) {
Page<TdHygfJpInverterHistoryDto> page = new Page<TdHygfJpInverterHistoryDto>(); Page<TdHygfJpInverterHistoryDto> page = new Page<TdHygfJpInverterHistoryDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryForTdHygfJpInverterHistoryPage(page)); return ResponseHelper
.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryForTdHygfJpInverterHistoryPage(page));
} }
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘逆变器历史表列表全部数据查询", notes = "户用光伏监盘逆变器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器历史表列表全部数据查询", notes = "户用光伏监盘逆变器历史表列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<TdHygfJpInverterHistoryDto>> selectForList() { public ResponseModel<List<TdHygfJpInverterHistoryDto>> selectForList() {
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryForTdHygfJpInverterHistoryList()); return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.queryForTdHygfJpInverterHistoryList());
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器历史表列表全部数据查询", notes = "户用光伏监盘逆变器历史表列表全部数据查询")
@GetMapping(value = "/statistics")
public ResponseModel<Map<String, Object>> day(@RequestParam(value = "id") Long id,
@RequestParam(value = "type") String type, @RequestParam(value = "date") String date) {
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.statistics(id,type,date));
}
} }
...@@ -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;
...@@ -127,8 +129,46 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController { ...@@ -127,8 +129,46 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器电能历史表列表全部数据查询", notes = "户用光伏监盘逆变器电能历史表列表全部数据查询")
@GetMapping(value = "/list/day") @GetMapping(value = "/list/day")
public ResponseModel<List<TdHygfJpInvertorElecHistory>> dayList(@RequestParam(value = "id") long id, public ResponseModel<List<TdHygfJpInvertorElecHistoryDto>> dayList(@RequestParam(value = "id") long id,
@RequestParam(value = "day") @DateTimeFormat() 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));
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryAll;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryAllMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpCollectorHistoryAllService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘采集器历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpCollectorHistoryAllServiceImpl extends BaseService<JpCollectorHistoryAllDto,JpCollectorHistoryAll,JpCollectorHistoryAllMapper> implements IJpCollectorHistoryAllService {
/**
* 分页查询
*/
public Page<JpCollectorHistoryAllDto> queryForJpCollectorHistoryAllPage(Page<JpCollectorHistoryAllDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryAllDto> queryForJpCollectorHistoryAllList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryMonth;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryMonthMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpCollectorHistoryMonthService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘采集器历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpCollectorHistoryMonthServiceImpl extends BaseService<JpCollectorHistoryMonthDto,JpCollectorHistoryMonth,JpCollectorHistoryMonthMapper> implements IJpCollectorHistoryMonthService {
/**
* 分页查询
*/
public Page<JpCollectorHistoryMonthDto> queryForJpCollectorHistoryMonthPage(Page<JpCollectorHistoryMonthDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryMonthDto> queryForJpCollectorHistoryMonthList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollectorHistoryYear;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpCollectorHistoryYearMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpCollectorHistoryYearService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryYearDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘采集器历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpCollectorHistoryYearServiceImpl extends BaseService<JpCollectorHistoryYearDto,JpCollectorHistoryYear,JpCollectorHistoryYearMapper> implements IJpCollectorHistoryYearService {
/**
* 分页查询
*/
public Page<JpCollectorHistoryYearDto> queryForJpCollectorHistoryYearPage(Page<JpCollectorHistoryYearDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryYearDto> queryForJpCollectorHistoryYearList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryAll;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryAllMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInvertorElecHistoryAllService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘逆变器电能历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpInvertorElecHistoryAllServiceImpl extends BaseService<JpInvertorElecHistoryAllDto,JpInvertorElecHistoryAll,JpInvertorElecHistoryAllMapper> implements IJpInvertorElecHistoryAllService {
/**
* 分页查询
*/
public Page<JpInvertorElecHistoryAllDto> queryForJpInvertorElecHistoryAllPage(Page<JpInvertorElecHistoryAllDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryAllDto> queryForJpInvertorElecHistoryAllList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryMonth;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryMonthMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInvertorElecHistoryMonthService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryMonthDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘逆变器电能历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpInvertorElecHistoryMonthServiceImpl extends BaseService<JpInvertorElecHistoryMonthDto,JpInvertorElecHistoryMonth,JpInvertorElecHistoryMonthMapper> implements IJpInvertorElecHistoryMonthService {
/**
* 分页查询
*/
public Page<JpInvertorElecHistoryMonthDto> queryForJpInvertorElecHistoryMonthPage(Page<JpInvertorElecHistoryMonthDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryMonthDto> queryForJpInvertorElecHistoryMonthList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInvertorElecHistoryYear;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.JpInvertorElecHistoryYearMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInvertorElecHistoryYearService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 户用光伏监盘逆变器电能历史表服务实现类
*
* @author system_generator
* @date 2023-09-20
*/
@Service
public class JpInvertorElecHistoryYearServiceImpl extends BaseService<JpInvertorElecHistoryYearDto,JpInvertorElecHistoryYear,JpInvertorElecHistoryYearMapper> implements IJpInvertorElecHistoryYearService {
/**
* 分页查询
*/
public Page<JpInvertorElecHistoryYearDto> queryForJpInvertorElecHistoryYearPage(Page<JpInvertorElecHistoryYearDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<JpInvertorElecHistoryYearDto> queryForJpInvertorElecHistoryYearList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto; import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto;
...@@ -40,10 +41,5 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -40,10 +41,5 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
return pagenew; return pagenew;
} }
/**
* 列表查询 示例
*/
public List<JpStationDto> queryForJpStationList() {
return this.queryForList("" , false);
}
} }
\ No newline at end of file
...@@ -4,6 +4,8 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower; ...@@ -4,6 +4,8 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IMonthPowerService; import com.yeejoin.amos.boot.module.hygf.api.service.IMonthPowerService;
import com.yeejoin.amos.boot.module.hygf.api.dto.MonthPowerDto; import com.yeejoin.amos.boot.module.hygf.api.dto.MonthPowerDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -17,6 +19,10 @@ import java.util.List; ...@@ -17,6 +19,10 @@ import java.util.List;
*/ */
@Service @Service
public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,MonthPowerMapper> implements IMonthPowerService { public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,MonthPowerMapper> implements IMonthPowerService {
@Autowired
MonthPowerMapper monthPowerMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -30,4 +36,13 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower, ...@@ -30,4 +36,13 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,
public List<MonthPowerDto> queryForMonthPowerList() { public List<MonthPowerDto> queryForMonthPowerList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
@Override
@Async
public void getMonthPower() {
List<MonthPower> list= monthPowerMapper.getMonthPower();
this.saveBatch(list);
}
} }
\ No newline at end of file
...@@ -9,7 +9,9 @@ import org.springframework.stereotype.Service; ...@@ -9,7 +9,9 @@ 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.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;
...@@ -42,15 +44,50 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -42,15 +44,50 @@ public class TdHygfJpCollectorHistoryServiceImpl
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpCollectorHistory> dayList(long id, Date day) { public List<TdHygfJpCollectorHistoryDto> dayList(long id, Date day) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.dayList(collector.getSnCode(), collector.getThirdStationId(),
TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryMonthDto> monthList(long id, Date month) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.monthList(collector.getSnCode(), collector.getThirdStationId(),
month.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryYearDto> yearList(long id, Date year) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) {
return this.baseMapper.yearList(collector.getSnCode(), collector.getThirdStationId(),
year.toString());
}
return new ArrayList<>();
}
/**
* 列表查询 示例
*/
public List<JpCollectorHistoryAllDto> allList(long id) {
JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
LambdaQueryChainWrapper<TdHygfJpCollectorHistory> warpper = this.lambdaQuery() return this.baseMapper.allList(collector.getSnCode(), collector.getThirdStationId());
.between(TdHygfJpCollectorHistory::getTime, TimeUtil.getStartTimeOfDay(day),
TimeUtil.getEndTimeOfDay(day))
.eq(TdHygfJpCollectorHistory::getSnCode, collector.getSnCode())
.eq(TdHygfJpCollectorHistory::getThirdStationId, collector.getThirdStationId());
return this.baseMapper.selectList(warpper);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterHistory; import java.util.Date;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper; import java.util.HashMap;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterHistoryService; import java.util.List;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterHistoryDto; import java.util.Map;
import org.typroject.tyboot.core.rdbms.service.BaseService;
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 com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterHistoryDto;
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.TdHygfJpInverterHistory;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterHistoryMapper;
/** /**
* 户用光伏监盘逆变器历史表服务实现类 * 户用光伏监盘逆变器历史表服务实现类
...@@ -16,18 +24,48 @@ import java.util.List; ...@@ -16,18 +24,48 @@ import java.util.List;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Service @Service
public class TdHygfJpInverterHistoryServiceImpl extends BaseService<TdHygfJpInverterHistoryDto,TdHygfJpInverterHistory,TdHygfJpInverterHistoryMapper> implements ITdHygfJpInverterHistoryService { public class TdHygfJpInverterHistoryServiceImpl
/** extends BaseService<TdHygfJpInverterHistoryDto, TdHygfJpInverterHistory, TdHygfJpInverterHistoryMapper>
* 分页查询 implements ITdHygfJpInverterHistoryService {
*/
public Page<TdHygfJpInverterHistoryDto> queryForTdHygfJpInverterHistoryPage(Page<TdHygfJpInverterHistoryDto> page) { @Autowired
return this.queryForPage(page, null, false); private JpInverterServiceImpl jpInverterServiceImpl;
}
/**
/** * 分页查询
* 列表查询 示例 */
*/ public Page<TdHygfJpInverterHistoryDto> queryForTdHygfJpInverterHistoryPage(Page<TdHygfJpInverterHistoryDto> page) {
public List<TdHygfJpInverterHistoryDto> queryForTdHygfJpInverterHistoryList() { return this.queryForPage(page, null, false);
return this.queryForList("" , false); }
}
/**
* 列表查询 示例
*/
public List<TdHygfJpInverterHistoryDto> queryForTdHygfJpInverterHistoryList() {
return this.queryForList("", false);
}
public Map<String, Object> statistics(Long id, String type, String date) {
JpInverter inverter = jpInverterServiceImpl.getById(id);
Double power = null, dailyReturn = null, hours = null;
Map<String, Object> map = new HashMap();
if (inverter != null) {
if ("day".equals(type)) {
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
} else if ("month".equals(type)) {
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
} else if ("year".equals(type)) {
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
} else if ("all".equals(type)) {
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
}
}
if (map == null) {
map = new HashMap();
map.put("power", power);
map.put("return", dailyReturn);
map.put("hours", hours);
}
return map;
}
} }
\ No newline at end of file
...@@ -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;
...@@ -43,15 +45,47 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -43,15 +45,47 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<TdHygfJpInvertorElecHistory> dayList(long id, Date day) { public List<TdHygfJpInvertorElecHistoryDto> dayList(long id, Date day) {
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
if (invertor != null) { if (invertor != null) {
LambdaQueryChainWrapper<TdHygfJpInvertorElecHistory> warpper = this.lambdaQuery() return this.baseMapper.dayList(invertor.getSnCode(), invertor.getThirdStationId(),
.between(TdHygfJpInvertorElecHistory::getTime, TimeUtil.getStartTimeOfDay(day), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
TimeUtil.getEndTimeOfDay(day)) }
.eq(TdHygfJpInvertorElecHistory::getSnCode, invertor.getSnCode()) return new ArrayList<>();
.eq(TdHygfJpInvertorElecHistory::getThirdStationId, invertor.getThirdStationId()); }
return this.baseMapper.selectList(warpper);
/**
* 列表查询 示例
*/
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<>(); return new ArrayList<>();
} }
......
...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpStationPowerHistory; ...@@ -4,10 +4,12 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpStationPowerHistory;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpStationPowerHistoryMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpStationPowerHistoryMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpStationPowerHistoryService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpStationPowerHistoryService;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpStationPowerHistoryDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpStationPowerHistoryDto;
import org.springframework.scheduling.annotation.Async;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 户用光伏监盘电站功率表服务实现类 * 户用光伏监盘电站功率表服务实现类
...@@ -30,4 +32,11 @@ public class TdHygfJpStationPowerHistoryServiceImpl extends BaseService<TdHygfJp ...@@ -30,4 +32,11 @@ public class TdHygfJpStationPowerHistoryServiceImpl extends BaseService<TdHygfJp
public List<TdHygfJpStationPowerHistoryDto> queryForTdHygfJpStationPowerHistoryList() { public List<TdHygfJpStationPowerHistoryDto> queryForTdHygfJpStationPowerHistoryList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
@Override
@Async
public Map<String, Double> getacgNum() {
return null;
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.text.CharSequenceUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -148,7 +149,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -148,7 +149,7 @@ public class BigScreenAnalyseController extends BaseController {
@RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "size", required = false) Integer size,
@RequestParam(value = "warningName", required = false) String warningName) { @RequestParam(value = "warningName", required = false) String warningName) {
Integer count = idxBizFanWarningRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType); Integer count = idxBizFanWarningRecordMapper.getEquipWarningInfoByPageCount(arae, station, stationType);
List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, current, size, warningName); List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName);
Page<IdxBizFanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size); Page<IdxBizFanWarningRecord> idxBizFanWarningRecordPage = new Page<>(current, size);
idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage); idxBizFanWarningRecordPage.setRecords(idxBizFanWarningRecordIPage);
idxBizFanWarningRecordPage.setTotal(count); idxBizFanWarningRecordPage.setTotal(count);
...@@ -246,4 +247,62 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -246,4 +247,62 @@ public class BigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "片区设备预警统计分析 - 右下角柱状图 ", notes = "片区设备预警统计分析 - 右下角柱状图 ")
@GetMapping(value = "/getAllEquipAlarmInfoAnalysis")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfoAnalysis(@RequestParam(required = false) String stationType,
@RequestParam(required = false) String areaCode) {
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> allEquipAlarmInfo = new ArrayList<>();
if (CharSequenceUtil.isNotEmpty(stationType)) {
if ("fan".equals(stationType)) {
allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoAnalysisByStationType("idx_biz_fan_warning_record", areaCode, "idx_biz_fan_point_process_variable_classification");
} else if ("pv".equals(stationType)) {
allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoAnalysisByStationType("idx_biz_pv_warning_record", areaCode, "idx_biz_pv_point_process_variable_classification");
}
} else {
allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoAnalysisByArea(areaCode);
}
HashMap<String, Integer> wxMap = new HashMap<>();
HashMap<String, Integer> zyMap = new HashMap<>();
HashMap<String, Integer> jgMap = new HashMap<>();
allEquipAlarmInfo.forEach(item -> {
if ("危险".equals(item.get("warningName"))) {
wxMap.put(item.get("pointName").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("注意".equals(item.get("warningName"))) {
zyMap.put(item.get("pointName").toString(), Integer.parseInt(item.get("num").toString()));
} else if ("警告".equals(item.get("warningName"))) {
jgMap.put(item.get("pointName").toString(), Integer.parseInt(item.get("num").toString()));
}
});
List<Integer> wxList = new ArrayList<>();
List<Integer> zyList = new ArrayList<>();
List<Integer> jgList = new ArrayList<>();
List<String> list = allEquipAlarmInfo.stream().map(t -> t.get("pointName").toString()).collect(Collectors.toList());
list.forEach(item -> {
wxList.add(wxMap.getOrDefault(item, 0));
zyList.add(zyMap.getOrDefault(item, 0));
jgList.add(jgMap.getOrDefault(item, 0));
});
HashMap<String, Object> wxMapResult = new HashMap<>();
wxMapResult.put("data", wxList);
wxMapResult.put("name", "危险");
HashMap<String, Object> zyMapResult = new HashMap<>();
zyMapResult.put("data", zyList);
zyMapResult.put("name", "注意");
HashMap<String, Object> jgMapResult = new HashMap<>();
jgMapResult.put("data", jgList);
jgMapResult.put("name", "警告");
List<Map<String, Object>> hashMaps = Arrays.asList(wxMapResult, zyMapResult, jgMapResult);
resultMap.put("axisData", list);
resultMap.put("seriesData", hashMaps);
return ResponseHelper.buildResponse(resultMap);
}
} }
...@@ -30,4 +30,11 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -30,4 +30,11 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getHealthInfoByStation(@Param("areaCode") String areaCode); List<Map<String, Object>> getHealthInfoByStation(@Param("areaCode") String areaCode);
List<Map<String, Object>> equipWarningRadarMap(@Param("stationCode") String stationCode); List<Map<String, Object>> equipWarningRadarMap(@Param("stationCode") String stationCode);
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByStationType(@Param("tableName") String tableName,
@Param("areaCode") String areaCode,
@Param("tableName2") String tableName2);
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode);
} }
...@@ -245,4 +245,61 @@ ...@@ -245,4 +245,61 @@
GROUP BY GROUP BY
a.warningName a.warningName
</select> </select>
<select id="getAllEquipAlarmInfoAnalysisByStationType" resultType="java.util.Map">
SELECT
( SELECT POINT_NAME FROM ${tableName2} WHERE GATEWAY_ID = a.GATEWAY_ID AND INDEX_ADDRESS = a.INDEX_ADDRESS ) AS pointName,
a.WARNING_NAME as warningName,
count(1) as num
FROM
${tableName} a
<where>
<if test="areaCode != null and areaCode != ''">
a.ARAE = #{areaCode}
</if>
</where>
group by pointName,
a.WARNING_NAME
having pointName IS NOT NULL
AND pointName != ''
</select>
<select id="getAllEquipAlarmInfoAnalysisByArea" resultType="java.util.Map">
SELECT
a.*
FROM
(
SELECT
( SELECT POINT_NAME FROM idx_biz_pv_point_process_variable_classification WHERE GATEWAY_ID = idx_biz_pv_warning_record.GATEWAY_ID AND INDEX_ADDRESS = idx_biz_pv_warning_record.INDEX_ADDRESS ) AS pointName,
WARNING_NAME AS warningName,
count( 1 ) AS num
FROM
idx_biz_pv_warning_record
<where>
<if test="areaCode != null and areaCode != ''">
ARAE = #{areaCode}
</if>
</where>
GROUP BY
pointName,
WARNING_NAME UNION ALL
SELECT
( SELECT POINT_NAME FROM idx_biz_fan_point_process_variable_classification WHERE GATEWAY_ID = idx_biz_fan_warning_record.GATEWAY_ID AND INDEX_ADDRESS = idx_biz_fan_warning_record.INDEX_ADDRESS ) AS pointName,
WARNING_NAME AS warningName,
count( 1 ) AS num
FROM
idx_biz_fan_warning_record
<where>
<if test="areaCode != null and areaCode != ''">
ARAE = #{areaCode}
</if>
</where>
GROUP BY
pointName,
WARNING_NAME
) a
WHERE
a.pointName IS NOT NULL
AND a.pointName != ''
</select>
</mapper> </mapper>
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