Commit 8df1dbcb authored by chenzhao's avatar chenzhao

Merge remote-tracking branch 'origin/developer' into developer

parents 137fff5f 48541dab
...@@ -14,16 +14,17 @@ import org.springframework.util.ObjectUtils; ...@@ -14,16 +14,17 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.cache.Redis; import org.typroject.tyboot.component.cache.Redis;
import java.util.*; import java.util.*;
@Component @Component
public class GolangRequestUtil { public class GolangRequestUtil {
private final static String API_REDIS_PREFIX = "HOUSEHOLD_API_CACHE_";
@Autowired @Autowired
private HouseholdPvProducerInfoServiceImpl householdPvProducerInfoServiceImpl; private HouseholdPvProducerInfoServiceImpl householdPvProducerInfoServiceImpl;
@Autowired @Autowired
private GolangStationMapper golangStationMapper; private GolangStationMapper golangStationMapper;
/** /**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息 * @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer * @deprecated 根据厂商编码获取厂商的hearer
...@@ -43,22 +44,36 @@ public class GolangRequestUtil { ...@@ -43,22 +44,36 @@ public class GolangRequestUtil {
} }
/** /**
* @return String 请求返回的response字符串 * @param apiurl 请求url
* @param requestMethod 请求方式
* @param requestParmInfo 请求参数mapper
* @param ResultResolveRule 请求的解析
* @param tClass 需要转换成的bean
* @param <T> 泛型数据
* @return List<T> list<Result>
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
*/ */
public <T> List<T> getResPonse(String apiurl,String requestMethod,String requestParmInfo,String ResultResolveRule,Class <T> tClass) { public <T> List<T> getResPonse(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule, Class<T> tClass) {
String respone = ""; String respone = "";
String params = ""; String params = "";
JSONArray jsonArray = null; JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
try {
HashMap<String, Object> producerInfo = getHeaderOfGolang(); HashMap<String, Object> producerInfo = getHeaderOfGolang();
String baseurl = (String) producerInfo.get("apiurl"); String baseurl = (String) producerInfo.get("apiurl");
HashMap<String, String> headMap = (HashMap<String, String>) producerInfo.get("header"); HashMap<String, String> headMap = (HashMap<String, String>) producerInfo.get("header");
String orginalAuthorization = headMap.get("Authorization") + ":"; String orginalAuthorization = headMap.get("Authorization") + ":";
String url = baseurl + apiurl; String url = baseurl + apiurl;
String appsecret = (String) producerInfo.get("appsecret"); String appsecret = (String) producerInfo.get("appsecret");
JLYHeaderMapHandler(params, headMap, orginalAuthorization, appsecret,apiurl); JLYHeaderMapHandler(params, headMap, orginalAuthorization, appsecret, apiurl);
respone = sendRequest(requestMethod, url,requestParmInfo, headMap); respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone); jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
List<T> result = JSONArray.parseArray(jsonArray.toJSONString(),tClass); if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
} catch (Exception exception) {
return result;
}
return result; return result;
} }
...@@ -66,6 +81,7 @@ public class GolangRequestUtil { ...@@ -66,6 +81,7 @@ public class GolangRequestUtil {
* @param resultResovle 请求返回的解析规则 来源与数据库 * @param resultResovle 请求返回的解析规则 来源与数据库
* @param response 请求返回的字符串 * @param response 请求返回的字符串
* @return 解析后的数据 * @return 解析后的数据
* @desc 根据解析规则解析请求返回数据
*/ */
public JSONArray handlerResponseByResultResolverule(String resultResovle, String response) { public JSONArray handlerResponseByResultResolverule(String resultResovle, String response) {
JSONObject jsonObject = JSONObject.parseObject(response); JSONObject jsonObject = JSONObject.parseObject(response);
...@@ -91,57 +107,6 @@ public class GolangRequestUtil { ...@@ -91,57 +107,6 @@ public class GolangRequestUtil {
return jsonArray; return jsonArray;
} }
/**
* @param seq apiID
* @param cacheField 要缓存的字段
* @param jsonArray 处理后的数据请求
* @param measurement 要在influxdb中存储的数
* @describe 该方法用于缓存需要缓存的字段 且将需要入库的数据进行入库
*/
public void handleResponseAndCacheData(String seq, String cacheField, JSONArray jsonArray, String measurement, String produceID) {
String apiID = API_REDIS_PREFIX + seq;
List list = new ArrayList();
List saveList = new ArrayList();
if (jsonArray.size() > 0) {
for (Object o : jsonArray) {
List<Map<String, Object>> lines = new ArrayList<>();
Map<String, Object> maps1 = (Map<String, Object>) o;
LinkedHashMap<String, Object> sortHashMap = new LinkedHashMap<>();
sortHashMap.put("station_list", "station_list." + measurement);
sortHashMap.put("timestamp", System.currentTimeMillis());
sortHashMap.put("value", 10.1);
Set<String> keys = maps1.keySet();
keys.forEach((key) -> {
maps1.put(key, ObjectUtils.isEmpty(maps1.get(key)) ? "null" : maps1.get(key).toString());
});
if (!ObjectUtils.isEmpty("cacheField")) {
list.add(maps1.get(cacheField));
}
sortHashMap.put("tags", maps1);
lines.add(sortHashMap);
// Map<String, String> maps2 = new HashMap<>();
// maps2.put("key", UUID.randomUUID().toString());
if (!ObjectUtils.isEmpty(measurement)) {
// influxDbConnection.insert(measurement, maps2, maps1);
// log.error(JSONObject.toJSONString(lines));
// tdEngineUtils.writeDataIntoTdEngine(JSONObject.toJSONString(lines));
}
}
}
// tdEngineUtils.writeDataIntoTdEngine(lines.stream().map(s -> String.valueOf(s)).toArray(String[]::new));
if (!ObjectUtils.isEmpty(cacheField)) {
saveList = Redis.getRedisTemplate().opsForList().range(apiID, 0, -1);
if (saveList.size() == 0) {
Redis.getRedisTemplate().opsForList().leftPushAll(apiID, list);
}
saveList = Redis.getRedisTemplate().opsForList().range(apiID, 0, -1);
if (saveList.size() != list.size()) {
Redis.getRedisTemplate().delete(apiID);
Redis.getRedisTemplate().opsForList().leftPushAll(apiID, list);
}
}
}
public String sendRequest(String requestMethod, String url, String params, HashMap<String, String> headMap) { public String sendRequest(String requestMethod, String url, String params, HashMap<String, String> headMap) {
String respone = ""; String respone = "";
if (requestMethod.equals("POST")) { if (requestMethod.equals("POST")) {
...@@ -177,6 +142,12 @@ public class GolangRequestUtil { ...@@ -177,6 +142,12 @@ public class GolangRequestUtil {
headMap.put("Authorization", orginalAuthorization + sign); headMap.put("Authorization", orginalAuthorization + sign);
} }
/**
* @param pageSizeResovle
* @param response
* @return
* @desc 根据分页规则 获取分页数
*/
public Integer getPagesize(String pageSizeResovle, String response) { public Integer getPagesize(String pageSizeResovle, String response) {
Integer pageSize = 0; Integer pageSize = 0;
String[] rules = pageSizeResovle.split(","); String[] rules = pageSizeResovle.split(",");
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.householdapi.constant; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.householdapi.constant;
import org.apache.xmlbeans.impl.xb.xsdschema.Public; import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import java.time.format.DateTimeFormatter;
import java.util.HashMap; import java.util.HashMap;
public class GoLangConstant { public class GoLangConstant {
...@@ -22,6 +23,22 @@ public class GoLangConstant { ...@@ -22,6 +23,22 @@ public class GoLangConstant {
put("5", "外置电表"); put("5", "外置电表");
} }
}; };
public static final HashMap<String, String> alarmLevel = new HashMap<String, String>() {
{
put("1", "提示");
put("2", "一般");
put("3", "紧急");
}
};
public static final HashMap<String, String> alarmstatus = new HashMap<String, String>() {
{
put("0", "未处理");
put("1", "已处理");
put("2", "已恢复");
}
};
public static String baseurl = "https://api.ginlong.com:13333"; public static String baseurl = "https://api.ginlong.com:13333";
public static String tokenurl = ""; public static String tokenurl = "";
public static String prodcerappid = "1300386381676732593"; public static String prodcerappid = "1300386381676732593";
...@@ -32,7 +49,13 @@ public class GoLangConstant { ...@@ -32,7 +49,13 @@ public class GoLangConstant {
public static String collectorDetailUrl = "/v1/api/collectorDetail"; public static String collectorDetailUrl = "/v1/api/collectorDetail";
public static String inverterListUrl = "/v1/api/inverterList"; public static String inverterListUrl = "/v1/api/inverterList";
public static String inverterDetailUrl = "/v1/api/inverterDetail"; public static String inverterDetailUrl = "/v1/api/inverterDetail";
public static String alarmListUrl = "/v1/api/alarmList";
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_records = "data,records";
public static String resovleRule_data = "data"; public static String resovleRule_data = "data";
public static String requestPost = "POST"; public static String requestPost = "POST";
public static String datePattern = "yyyy-MM-dd HH:mm:ss.SSS";
public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern(datePattern);
public static Double kwhToMwh = 0.0001;
public static Double mwhTokwh = 1000.0;
} }
...@@ -56,7 +56,11 @@ public class HouseholdTestController { ...@@ -56,7 +56,11 @@ 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.collectorList();
goLangDataAcquisitionService.inverterList(); //// goLangDataAcquisitionService.inverterList();
goLangDataAcquisitionService.collectorDetail();
goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
} }
} }
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class AlarmDto {
private Long stationId;
private String stationName;
private String alarmDeviceSn;
private String alarmCode;
private String alarmLevel;
private Long alarmBeginTime;
private Long alarmEndTime;
private String alarmMsg;
private String advice;
private String state;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class CollectorDetailDto {
private String sn;
private String state;
private Long factoryTime;
private Double dataUploadCycle;
private Long currentWorkingTime;
private Long totalWorkingTime;
private String stationId;
private String rssiLevel;
private String model;
private String addr;
private String stationName;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
import java.awt.print.PrinterGraphics;
@Data
public class InverterDetailDto {
private Long id;
private String sn;
private Long stationId;
private String stationName;
private Long collectorId;
private String collectorsn;
private String currentState;
private Double pac;
private Double eToday;
private Double eMonth;
private Double eYear;
private String name;
private String productModel;
private String nationalStandards;
private String version;
private Double fullHour;
private Double power;
private Double eTotal;
private Double iAc1;
private Double iAc2;
private Double iAc3;
private Double uAc1;
private Double uAc2;
private Double uAc3;
private Double iPv1;
private Double iPv2;
private Double iPv3;
private Double iPv4;
private Double iPv5;
private Double iPv6;
private Double iPv7;
private Double iPv8;
private Double iPv9;
private Double iPv10;
private Double iPv11;
private Double iPv12;
private Double iPv13;
private Double iPv14;
private Double iPv15;
private Double iPv16;
private Double iPv17;
private Double iPv18;
private Double iPv19;
private Double iPv20;
private Double iPv21;
private Double iPv22;
private Double iPv23;
private Double iPv24;
private Double iPv25;
private Double iPv26;
private Double iPv27;
private Double iPv28;
private Double iPv29;
private Double iPv30;
private Double iPv31;
private Double iPv32;
private Double uPv1;
private Double uPv2;
private Double uPv3;
private Double uPv4;
private Double uPv5;
private Double uPv6;
private Double uPv7;
private Double uPv8;
private Double uPv9;
private Double uPv10;
private Double uPv11;
private Double uPv12;
private Double uPv13;
private Double uPv14;
private Double uPv15;
private Double uPv16;
private Double uPv17;
private Double uPv18;
private Double uPv19;
private Double uPv20;
private Double uPv21;
private Double uPv22;
private Double uPv23;
private Double uPv24;
private Double uPv25;
private Double uPv26;
private Double uPv27;
private Double uPv28;
private Double uPv29;
private Double uPv30;
private Double uPv31;
private Double uPv32;
private Double pow1;
private Double pow2;
private Double pow3;
private Double pow4;
private Double pow5;
private Double pow6;
private Double pow7;
private Double pow8;
private Double pow9;
private Double pow10;
private Double pow11;
private Double pow12;
private Double pow13;
private Double pow14;
private Double pow15;
private Double pow16;
private Double pow17;
private Double pow18;
private Double pow19;
private Double pow20;
private Double pow21;
private Double pow22;
private Double pow23;
private Double pow24;
private Double pow25;
private Double pow26;
private Double pow27;
private Double pow28;
private Double pow29;
private Double pow30;
private Double pow31;
private Double pow32;
}
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
...@@ -116,5 +115,16 @@ public class JpCollector implements Serializable { ...@@ -116,5 +115,16 @@ public class JpCollector implements Serializable {
*/ */
@TableField("third_code") @TableField("third_code")
private String thirdCode; private String thirdCode;
/**
* 场站名称
*/
@TableField("station_name")
private String stationName;
/**
* 场站地址
*/
@TableField("addr")
private String addr;
} }
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
...@@ -34,16 +33,11 @@ public class JpInverter implements Serializable { ...@@ -34,16 +33,11 @@ public class JpInverter implements Serializable {
protected String recUserName; protected String recUserName;
/** /**
* 是否删除
*/
@TableField(value = "is_delete")
public Boolean isDelete=false;
/**
* sn编码 * sn编码
*/ */
@TableField("sn_code") @TableField("sn_code")
private String snCode; private String snCode;
/** /**
* 状态 * 状态
*/ */
...@@ -165,6 +159,11 @@ public class JpInverter implements Serializable { ...@@ -165,6 +159,11 @@ public class JpInverter implements Serializable {
private String thirdStationId; private String thirdStationId;
/** /**
* 第三方电站id
*/
@TableField("third_code")
private String thirdCode;
/**
* 装机容量 * 装机容量
*/ */
@TableField("capacity") @TableField("capacity")
...@@ -175,23 +174,15 @@ public class JpInverter implements Serializable { ...@@ -175,23 +174,15 @@ public class JpInverter implements Serializable {
*/ */
@TableField("total_power_generation") @TableField("total_power_generation")
private Double totalPowerGeneration; private Double totalPowerGeneration;
/**
* 日用电量
*/
@TableField("day_power_use")
private Double dayPowerUse;
/** /**
* 月用电量 * 场站名称
*/ */
@TableField("month_power_use") @TableField("station_name")
private Double monthPowerUse; private String stationName;
/** /**
* 年用电量 * 场站地址
*/ */
@TableField("year_power_use") @TableField("addr")
private Double yearPowerUse; private String addr;
} }
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf; package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -97,5 +98,4 @@ public class JpInverterElectricity implements Serializable { ...@@ -97,5 +98,4 @@ public class JpInverterElectricity implements Serializable {
*/ */
@TableField("third_code") @TableField("third_code")
private String thirdCode; private String thirdCode;
} }
...@@ -215,5 +215,8 @@ public class JpStation implements Serializable { ...@@ -215,5 +215,8 @@ public class JpStation implements Serializable {
private Double monthPowerPse; // 月用电量 private Double monthPowerPse; // 月用电量
@TableField("year_power_use") @TableField("year_power_use")
private Double yearPowerUse; // 年用电量 private Double yearPowerUse; // 年用电量
@TableField("email")
private String email; // 电子邮箱
@TableField("rated_power")
private Double ratedPower; // 额定功率
} }
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_collector_detail", autoResultMap = true) @TableName(value = "golang_collector_detail", autoResultMap = true)
public class GolangCollectorDetail { public class GolangCollectorDetail {
private Date createdTime; private Long createdTime;
private Long id; private Long id;
private String sn; private String sn;
private Long stationid; private Long stationid;
......
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_collector_list", autoResultMap = true) @TableName(value = "golang_collector_list", autoResultMap = true)
public class GolangCollectorList { public class GolangCollectorList {
private Date createdTime; private Long createdTime;
private Long id; private Long id;
private String stationname; private String stationname;
private Long stationid; private Long stationid;
......
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_inveter_detail", autoResultMap = true) @TableName(value = "golang_inveter_detail", autoResultMap = true)
public class GolangInverterDetail { public class GolangInverterDetail {
private Date createdTime; private Long createdTime;
private String gridSellYearEnergy; private String gridSellYearEnergy;
private String batteryAlarm; private String batteryAlarm;
private String storageBatteryVoltageStr; private String storageBatteryVoltageStr;
......
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_inveter_list", autoResultMap = true) @TableName(value = "golang_inveter_list", autoResultMap = true)
public class GolangInverterList { public class GolangInverterList {
private Date createdTime; private Long createdTime;
private Long id; private Long id;
private String sn; private String sn;
private Long stationid; private Long stationid;
......
...@@ -10,7 +10,7 @@ import java.util.Date; ...@@ -10,7 +10,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_station_detail", autoResultMap = true) @TableName(value = "golang_station_detail", autoResultMap = true)
public class GolangStationDetail implements Serializable { public class GolangStationDetail implements Serializable {
private Date createdTime; private Long createdTime;
private Long id; private Long id;
private String stationname; private String stationname;
private String addr; private String addr;
......
...@@ -7,7 +7,7 @@ import java.util.Date; ...@@ -7,7 +7,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "golang_station_list" ,autoResultMap = true) @TableName(value = "golang_station_list" ,autoResultMap = true)
public class GolangStationList implements Serializable { public class GolangStationList implements Serializable {
private Date createdTime; private Long createdTime;
private String id; private String id;
private String stationName; private String stationName;
private String addr; private String addr;
......
...@@ -9,9 +9,9 @@ import java.util.Date; ...@@ -9,9 +9,9 @@ import java.util.Date;
@Data @Data
@TableName(value = "td_hygf_jp_collector_history" ,autoResultMap = true) @TableName(value = "td_hygf_jp_collector_history" ,autoResultMap = true)
public class HYGFJPCollectorHistory implements Serializable { public class HYGFJPCollectorHistory implements Serializable {
private Date createdTime; private Long createdTime;
private String snCode; private String snCode;
private Date time; private Long time;
private Double signalStrength; private Double signalStrength;
private String thirdStationId; private String thirdStationId;
private String thirdCode; private String thirdCode;
......
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
@Data
@TableName(value = "td_hygf_day_power",autoResultMap = true)
public class HYGFJPDayPower implements Serializable {
private Long createdTime;
private String tationId;
private String hour;
private String yearMonthDay;
private Double power;
}
...@@ -9,7 +9,7 @@ import java.util.Date; ...@@ -9,7 +9,7 @@ import java.util.Date;
@Data @Data
@TableName(value = "td_hygf_jp_invertor_elec_history" ,autoResultMap = true) @TableName(value = "td_hygf_jp_invertor_elec_history" ,autoResultMap = true)
public class HYGFJPInverterElecHistory implements Serializable { public class HYGFJPInverterElecHistory implements Serializable {
private Date createdTime; private Long createdTime;
private String snCode; private String snCode;
private Double uAcVoltage; private Double uAcVoltage;
private Double vAcVoltage; private Double vAcVoltage;
......
...@@ -4,12 +4,13 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -4,12 +4,13 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date; import java.util.Date;
@Data @Data
@TableName(value = "td_hygf_jp_inverter_history" ,autoResultMap = true) @TableName(value = "td_hygf_jp_inverter_history" ,autoResultMap = true)
public class HYGFJPInverterHistory implements Serializable { public class HYGFJPInverterHistory implements Serializable {
private Date createdTime; private Long createdTime;
private String snCode; private String snCode;
private String date; private String date;
private Double powerGeneration; private Double powerGeneration;
......
...@@ -7,17 +7,18 @@ import java.io.Serializable; ...@@ -7,17 +7,18 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data @Data
@TableName(value = "td_hygf_jp_inverter_history" ,autoResultMap = true) @TableName(value = "td_hygf_jp_inverter_warn" ,autoResultMap = true)
public class HYGFJPInverterWarn implements Serializable { public class HYGFJPInverterWarn implements Serializable {
private Date createdTime; private Long createdTime;
private long time; private long time;
private String snCode; private String snCode;
private String content; private String content;
private String level; private String level;
private Long time_long; private Long timeLong;
private Long start_time; private Long startTime;
private Long recover_time; private Long recoverTime;
private String treatment; private String treatment;
private String thirdStationId; private String thirdStationId;
private String thirdCode; private String thirdCode;
private String state;
} }
...@@ -7,9 +7,9 @@ import java.io.Serializable; ...@@ -7,9 +7,9 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
@Data @Data
@TableName(value = "td_hygf_jp_invertor_elec_history" ,autoResultMap = true) @TableName(value = "td_hygf_jp_station_power_history" ,autoResultMap = true)
public class HYGFJPStationPowerHistory implements Serializable { public class HYGFJPStationPowerHistory implements Serializable {
private Date createdTime; private Long createdTime;
private Double power; private Double power;
private long time; private long time;
private String thirdStationId; private String thirdStationId;
......
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),"));
}
}
...@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select; ...@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
public interface GolangCollectorListMapper extends BaseMapper<GolangCollectorList> { public interface GolangCollectorListMapper extends BaseMapper<GolangCollectorList> {
@Select("select id from golang_collector_list group by id") @Select("select id from golang_collector_list where sn is not null group by id")
List<Long> getCollectIds(); List<Long> getCollectIds();
} }
...@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select; ...@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
public interface GolangInverterListMapper extends BaseMapper<GolangInverterList> { public interface GolangInverterListMapper extends BaseMapper<GolangInverterList> {
@Select("select id from golang_inveter_list group by id") @Select("select sn from golang_inveter_list where sn is not null group by sn")
List<Long> getInverterIds(); List<String> getInverterSns();
} }
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.HYGFJPDayPower;
public interface HYGFJPDayPowerMapper extends BaseMapper<HYGFJPDayPower> {
}
package com.yeejoin.amos.api.householdapi.face.service;
public interface GoLangDataAcquisition {
}
package com.yeejoin.amos.api.householdapi.face.service; package com.yeejoin.amos.api.householdapi.face.service;
public interface GoLangDataAcquisitionService { public interface GoLangDataAcquisitionService {
/**
* @descrption 场站列表数据入库
*/
void stationList(); void stationList();
/**
* @descrption 场站详情数据入库
*/
void stationDetail(); void stationDetail();
/**
* @descrption 采集器列表数据入库
*/
void collectorList(); void collectorList();
/**
* @descrption 采集器详情数据入库
*/
void collectorDetail(); void collectorDetail();
/**
* @descrption 逆变器列表数据入库
*/
void inverterList(); void inverterList();
/**
* @descrption 逆变器详情数据入库
*/
void inverterDetail(); void inverterDetail();
/**
* @descrption 采集器告警列表数据入库
*/
void inverAlramInfo();
} }
...@@ -17,7 +17,7 @@ spring.db2.datasource.password=Yeejoin@2020 ...@@ -17,7 +17,7 @@ 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-RS://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&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.rs.RestfulDriver spring.db3.datasource.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver
......
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-21
*/
@Data
@ApiModel(value="DayPowerDto", description="")
public class DayPowerDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "第三方电站id")
private String thirdStationId;
@ApiModelProperty(value = " 小时")
private String hour;
@ApiModelProperty(value = "平均功率")
private Double power;
@ApiModelProperty(value = "年月日")
private String yearMonthDay;
}
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 户用光伏监盘采集器表 * 户用光伏监盘采集器表
...@@ -63,4 +68,17 @@ public class JpCollectorDto extends BaseDto { ...@@ -63,4 +68,17 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
@ApiModelProperty(value = "所属电站")
private String stationName;
@ApiModelProperty(value = "电站地址")
private String addr;
@ApiModelProperty(value = "采集器列表")
private List<JpInverter> jpInverters;
private List<String> stationIds;
@ApiModelProperty(value = "采集器名称")
private String name;
} }
...@@ -35,4 +35,5 @@ public class JpCollectorHistoryAllDto { ...@@ -35,4 +35,5 @@ public class JpCollectorHistoryAllDto {
@ApiModelProperty(value = "年") @ApiModelProperty(value = "年")
private String year; private String year;
private long createdTime;
} }
...@@ -14,12 +14,11 @@ import java.util.Date; ...@@ -14,12 +14,11 @@ import java.util.Date;
* @date 2023-09-20 * @date 2023-09-20
*/ */
@Data @Data
@ApiModel(value="JpCollectorHistoryYearDto", description="户用光伏监盘采集器历史表") @ApiModel(value = "JpCollectorHistoryYearDto", description = "户用光伏监盘采集器历史表")
public class JpCollectorHistoryYearDto { public class JpCollectorHistoryYearDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -38,4 +37,6 @@ public class JpCollectorHistoryYearDto { ...@@ -38,4 +37,6 @@ public class JpCollectorHistoryYearDto {
@ApiModelProperty(value = "年") @ApiModelProperty(value = "年")
private String year; private String year;
private long createdTime;
} }
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 户用光伏监盘逆变器表 * 户用光伏监盘逆变器表
...@@ -91,4 +92,8 @@ public class JpInverterDto extends BaseDto { ...@@ -91,4 +92,8 @@ public class JpInverterDto extends BaseDto {
@ApiModelProperty(value = "累计发电量") @ApiModelProperty(value = "累计发电量")
private Double totalPowerGeneration; private Double totalPowerGeneration;
@ApiModelProperty(value = "所属电站")
private String stationName;
private List<String> stationIds;
} }
...@@ -52,4 +52,6 @@ public class JpInvertorElecHistoryAllDto { ...@@ -52,4 +52,6 @@ public class JpInvertorElecHistoryAllDto {
@ApiModelProperty(value = "年") @ApiModelProperty(value = "年")
private String year; private String year;
private Long createdTime;
} }
...@@ -56,4 +56,5 @@ public class JpInvertorElecHistoryMonthDto { ...@@ -56,4 +56,5 @@ public class JpInvertorElecHistoryMonthDto {
@ApiModelProperty(value = "年月") @ApiModelProperty(value = "年月")
private String yearMonth; private String yearMonth;
private Long createdTime;
} }
...@@ -15,12 +15,11 @@ import java.util.Date; ...@@ -15,12 +15,11 @@ import java.util.Date;
* @date 2023-09-20 * @date 2023-09-20
*/ */
@Data @Data
@ApiModel(value="JpInvertorElecHistoryYearDto", description="户用光伏监盘逆变器电能历史表") @ApiModel(value = "JpInvertorElecHistoryYearDto", description = "户用光伏监盘逆变器电能历史表")
public class JpInvertorElecHistoryYearDto { public class JpInvertorElecHistoryYearDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -48,10 +47,12 @@ public class JpInvertorElecHistoryYearDto { ...@@ -48,10 +47,12 @@ public class JpInvertorElecHistoryYearDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
@ApiModelProperty(value = "日期") @ApiModelProperty(value = "月")
private String day; private String month;
@ApiModelProperty(value = "年")
private String year;
@ApiModelProperty(value = "年月") private Long createdTime;
private String yearMonth;
} }
...@@ -21,12 +21,11 @@ import java.util.List; ...@@ -21,12 +21,11 @@ import java.util.List;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel(value="JpStationDto", description="第三方场站") @ApiModel(value = "JpStationDto", description = "第三方场站")
public class JpStationDto extends BaseDto { public class JpStationDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -101,44 +100,48 @@ public class JpStationDto extends BaseDto { ...@@ -101,44 +100,48 @@ public class JpStationDto extends BaseDto {
/** /**
* 电站类型 * 电站类型
*/ */
private String type ; private String type;
/** /**
* 组织编码 * 组织编码
*/ */
private String organizationalCode ; private String organizationalCode;
//日发电量 // 日发电量
private Double dayGenerate; private Double dayGenerate;
//月发电量 // 月发电量
private Double monthGenerate; private Double monthGenerate;
//年发电量 // 年发电量
private Double yearGenerate; private Double yearGenerate;
//日收益 // 日收益
private Double dayIncome; private Double dayIncome;
//月收益 // 月收益
private Double monthIncome; private Double monthIncome;
// 年收益 // 年收益
private Double yearIncome; private Double yearIncome;
//地区 // 地区
private String area; private String area;
List<JpPersonStation> statioId; List<JpPersonStation> statioId;
//累计收益 // 累计收益
private Double cumulativeIncome; private Double cumulativeIncome;
private Double dayPowerUse; // 日用电量 private Double dayPowerUse; // 日用电量
private Double month_power_use; // 月用电量 private Double monthPowerUse; // 月用电量
private Double yearPowerUse; // 年用电量 private Double yearPowerUse; // 年用电量
private int countBuiltNum;//已建设场站数量 private int countBuiltNum;// 已建设场站数量
private int countNBuiltNum;//未建设场站数量 private int countNBuiltNum;// 未建设场站数量
List<JpInverter> jpInverter; List<JpInverter> jpInverter;
List<JpCollector> JpCollector; List<JpCollector> JpCollector;
// 时间
String dateType;
private String email;
private Double ratedPower;
} }
...@@ -36,18 +36,18 @@ public class MonthPowerDto { ...@@ -36,18 +36,18 @@ public class MonthPowerDto {
private Double power; private Double power;
public void setDay(String day) {
public MonthPowerDto() {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
String formattedDate = now.format(formatter); String formattedDate = now.format(formatter);
this.day = formattedDate; this.day = formattedDate;
}
public void setYearMonth(String yearMonth) { DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY-MM");
LocalDateTime now = LocalDateTime.now(); String formattedDate1 = now.format(formatter1);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM"); this.yearMonth = formattedDate1;
String formattedDate = now.format(formatter);
this.yearMonth = formattedDate;
} }
} }
package com.yeejoin.amos.boot.module.hygf.api.dto;
import lombok.Data;
/**
* @description:
* @author: tw
* @createDate: 2023/9/21
*/
@Data
public class PowerCurveDto {
private Object date;
private Double num;
}
...@@ -14,12 +14,11 @@ import java.util.Date; ...@@ -14,12 +14,11 @@ import java.util.Date;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Data @Data
@ApiModel(value="TdHygfJpCollectorHistoryDto", description="户用光伏监盘采集器历史表") @ApiModel(value = "TdHygfJpCollectorHistoryDto", description = "户用光伏监盘采集器历史表")
public class TdHygfJpCollectorHistoryDto { public class TdHygfJpCollectorHistoryDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -35,4 +34,6 @@ public class TdHygfJpCollectorHistoryDto { ...@@ -35,4 +34,6 @@ public class TdHygfJpCollectorHistoryDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
private String timeFormat;
} }
...@@ -53,6 +53,30 @@ public class TdHygfJpInverterWarnDto { ...@@ -53,6 +53,30 @@ public class TdHygfJpInverterWarnDto {
@ApiModelProperty(value = "时间") @ApiModelProperty(value = "时间")
private Long time; private Long time;
private String stationName;
private String stationContact;
private String userName;
private String userPhone;
private String email;
private String address;
private String area;
private Long createdTime;
private String timeLongFormat;
private String startTimeFormat;
private String recoverTimeFormat;
private List<String> stationIds; private List<String> stationIds;
private List<String> states;
} }
...@@ -15,12 +15,11 @@ import java.util.Date; ...@@ -15,12 +15,11 @@ import java.util.Date;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Data @Data
@ApiModel(value="TdHygfJpInvertorElecHistoryDto", description="户用光伏监盘逆变器电能历史表") @ApiModel(value = "TdHygfJpInvertorElecHistoryDto", description = "户用光伏监盘逆变器电能历史表")
public class TdHygfJpInvertorElecHistoryDto { public class TdHygfJpInvertorElecHistoryDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "sn编码") @ApiModelProperty(value = "sn编码")
private String snCode; private String snCode;
...@@ -51,4 +50,8 @@ public class TdHygfJpInvertorElecHistoryDto { ...@@ -51,4 +50,8 @@ public class TdHygfJpInvertorElecHistoryDto {
@ApiModelProperty(value = "第三方厂商标识") @ApiModelProperty(value = "第三方厂商标识")
private String thirdCode; private String thirdCode;
private Long createdTime;
private String timeFormat;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
/** /**
...@@ -20,11 +25,12 @@ import java.util.Date; ...@@ -20,11 +25,12 @@ import java.util.Date;
public class AllPower { public class AllPower {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "created_time")
private Long createdTime;
/** /**
* 第三方电站id * 第三方电站id
*/ */
@TableField("third_station_id") @TableField("tation_id")
private String thirdStationId; private String thirdStationId;
/** /**
...@@ -39,4 +45,18 @@ public class AllPower { ...@@ -39,4 +45,18 @@ public class AllPower {
@TableField("power") @TableField("power")
private Double power; private Double power;
public AllPower() throws InterruptedException{
Thread.sleep(0L,1);
this.createdTime=System.currentTimeMillis();
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY");
String formattedDate1 = now.format(formatter1);
this.year = formattedDate1;
}
} }
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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-21
*/
@Data
@Accessors(chain = true)
@TableName("td_hygf_day_power")
public class DayPower {
private static final long serialVersionUID = 1L;
@TableId(value = "created_time")
private Long createdTime;
/**
* 第三方电站id
*/
@TableField("tation_id")
private String thirdStationId;
/**
* 小时
*/
@TableField("hour")
private String hour;
/**
* 平均功率
*/
@TableField("power")
private Double power;
/**
* 年月日
*/
@TableField("year_month_day")
private String yearMonthDay;
}
...@@ -106,4 +106,21 @@ public class JpCollector extends BaseEntity { ...@@ -106,4 +106,21 @@ public class JpCollector extends BaseEntity {
@TableField("third_code") @TableField("third_code")
private String thirdCode; private String thirdCode;
/**
* 所属电站
*/
@TableField("station_name")
private String stationName;
/**
* 电站地址
*/
@TableField("addr")
private String addr;
/**
* 采集器名称
*/
@TableField("name")
private String name;
} }
...@@ -160,4 +160,16 @@ public class JpInverter extends BaseEntity { ...@@ -160,4 +160,16 @@ public class JpInverter extends BaseEntity {
@TableField("total_power_generation") @TableField("total_power_generation")
private Double totalPowerGeneration; private Double totalPowerGeneration;
/**
* 所属电站
*/
@TableField("station_name")
private String stationName;
/**
* 电站地址
*/
@TableField("addr")
private String addr;
} }
...@@ -201,9 +201,9 @@ public class JpStation extends BaseEntity { ...@@ -201,9 +201,9 @@ public class JpStation extends BaseEntity {
private Double yearPowerUse; // 年用电量 private Double yearPowerUse; // 年用电量
@TableField("email")
private String email; //邮箱
@TableField("rated_power")
private Double ratedPower;
} }
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
/** /**
...@@ -21,10 +27,17 @@ public class MonthPower { ...@@ -21,10 +27,17 @@ public class MonthPower {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "created_time")
private Long createdTime;
/** /**
* 第三方电站id * 第三方电站id
*/ */
@TableField("third_station_id") @TableField("tation_id")
private String thirdStationId; private String thirdStationId;
/** /**
...@@ -45,4 +58,24 @@ public class MonthPower { ...@@ -45,4 +58,24 @@ public class MonthPower {
@TableField("power") @TableField("power")
private Double power; private Double power;
public MonthPower()throws InterruptedException {
Thread.sleep(0L,1);
this.createdTime=System.currentTimeMillis();
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM-dd");
String formattedDate = now.format(formatter);
this.day = formattedDate;
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY-MM");
String formattedDate1 = now.format(formatter1);
this.yearMonth = formattedDate1;
}
} }
package com.yeejoin.amos.boot.module.hygf.api.entity; package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
/** /**
...@@ -20,11 +25,12 @@ import java.util.Date; ...@@ -20,11 +25,12 @@ import java.util.Date;
public class YearPower { public class YearPower {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "created_time")
private Long createdTime;
/** /**
* 第三方电站id * 第三方电站id
*/ */
@TableField("third_station_id") @TableField("tation_id")
private String thirdStationId; private String thirdStationId;
/** /**
...@@ -45,4 +51,19 @@ public class YearPower { ...@@ -45,4 +51,19 @@ public class YearPower {
@TableField("power") @TableField("power")
private Double power; private Double power;
public YearPower() throws InterruptedException{
Thread.sleep(0L,1);
this.createdTime=System.currentTimeMillis();
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM");
String formattedDate = now.format(formatter);
this.month = formattedDate;
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY");
String formattedDate1 = now.format(formatter1);
this.year = formattedDate1;
}
} }
...@@ -19,5 +19,6 @@ public interface JpStationMapper extends BaseMapper<JpStation> { ...@@ -19,5 +19,6 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto); List<JpStationDto> queryForDealerReviewPage(@Param("dto") JpStationDto reviewDto);
JpStationDto queryCount(@Param("dto") JpStationDto reviewDto); JpStationDto queryCount(@Param("dto") JpStationDto reviewDto);
List<Map<String,Object>> countState(@Param("dto") JpStationDto reviewDto); List<Map<String,Object>> countState(@Param("dto") JpStationDto reviewDto);
List<Map<String,Double>> getPowerqx(String dateType);
} }
package com.yeejoin.amos.boot.module.hygf.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2023-09-21
*/
public interface IDayPowerService {
}
package com.yeejoin.amos.boot.module.hygf.api.service; package com.yeejoin.amos.boot.module.hygf.api.service;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 第三方场站接口类 * 第三方场站接口类
* *
...@@ -9,4 +14,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service; ...@@ -9,4 +14,5 @@ package com.yeejoin.amos.boot.module.hygf.api.service;
*/ */
public interface IJpStationService { public interface IJpStationService {
Map<String, List<Object>> getPowerqx(String date, String type, List<Long> statioId);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayPower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2023-09-21
*/
public interface DayPowerMapper extends BaseMapper<DayPower> {
}
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.dto.MonthPowerDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.AllPower;
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 com.yeejoin.amos.boot.module.hygf.api.entity.YearPower;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -13,5 +18,20 @@ import java.util.List; ...@@ -13,5 +18,20 @@ import java.util.List;
*/ */
public interface MonthPowerMapper extends BaseMapper<MonthPower> { public interface MonthPowerMapper extends BaseMapper<MonthPower> {
List<MonthPower> getMonthPower(); List<MonthPower> getMonthPowerint();
List<YearPower> getSumMonthPower(@Param("date") String month);
List<AllPower> getSumYearPower(@Param("date") String ear);
List<PowerCurveDto> getDayPower(@Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("dto")List<Long> statioId);
List<PowerCurveDto> getMonthPower(@Param("date") String month,@Param("dto")List<Long> statioId);
List<PowerCurveDto> getYearPower(@Param("date") String month,@Param("dto")List<Long> statioId);
List<PowerCurveDto> getAllPower(@Param("date") String month,@Param("dto")List<Long> statioId);
List<PowerCurveDto> getDayPowercount(@Param("date") String month,@Param("dto")List<Long> statioId);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -31,4 +32,16 @@ public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpColle ...@@ -31,4 +32,16 @@ public interface TdHygfJpCollectorHistoryMapper extends BaseMapper<TdHygfJpColle
List<JpCollectorHistoryAllDto> allList(@Param("snCode") String snCode, List<JpCollectorHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId); @Param("thirdStationId") String thirdStationId);
List<Map<String, Object>> dayToMonth(@Param("startTime") long startTime, @Param("endTime") long endTime);
List<Map<String, Object>> monthToYear(@Param("month") String month);
List<Map<String, Object>> yearToAll(@Param("year") String year);
void updateMonth(@Param("list") List<Map<String, Object>> list);
void updateYear(@Param("list") List<Map<String, Object>> list);
void updateAll(@Param("list") List<Map<String, Object>> list);
} }
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.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
...@@ -25,4 +24,5 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW ...@@ -25,4 +24,5 @@ public interface TdHygfJpInverterWarnMapper extends BaseMapper<TdHygfJpInverterW
List<TdHygfJpInverterWarnDto> list(@Param("param") TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto); List<TdHygfJpInverterWarnDto> list(@Param("param") TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto);
TdHygfJpInverterWarnDto getByTime(@Param("createdTime") long createdTime);
} }
package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper; package com.yeejoin.amos.boot.module.hygf.api.tdenginemapper;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -31,4 +32,16 @@ public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpIn ...@@ -31,4 +32,16 @@ public interface TdHygfJpInvertorElecHistoryMapper extends BaseMapper<TdHygfJpIn
List<JpInvertorElecHistoryAllDto> allList(@Param("snCode") String snCode, List<JpInvertorElecHistoryAllDto> allList(@Param("snCode") String snCode,
@Param("thirdStationId") String thirdStationId); @Param("thirdStationId") String thirdStationId);
List<Map<String, Object>> dayToMonth(@Param("startTime") long startTime, @Param("endTime") long endTime);
List<Map<String, Object>> monthToYear(@Param("month") String month);
List<Map<String, Object>> yearToAll(@Param("year") String year);
void updateMonth(@Param("list") List<Map<String, Object>> list);
void updateYear(@Param("list") List<Map<String, Object>> list);
void updateAll(@Param("list") List<Map<String, Object>> list);
} }
...@@ -13,5 +13,5 @@ import java.util.Map; ...@@ -13,5 +13,5 @@ import java.util.Map;
* @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); // Map<String,Double> getacgNum(@Param("date") String date);
} }
package com.yeejoin.amos.boot.module.hygf.api.util; package com.yeejoin.amos.boot.module.hygf.api.util;
import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -23,4 +24,55 @@ public class TimeUtil { ...@@ -23,4 +24,55 @@ public class TimeUtil {
todayEnd.set(Calendar.MILLISECOND, 999); todayEnd.set(Calendar.MILLISECOND, 999);
return todayEnd.getTime().getTime(); return todayEnd.getTime().getTime();
} }
public static String dateFormat(Long time) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return dateFormat.format(new Date(time));
}
public static String minuteFormat(Long time) {
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
return dateFormat.format(new Date(time));
}
public static String longFormat(Long time) {
if (time < 1000) {
return "0" + "秒";
}
long second = time / 1000;
long seconds = second % 60;
long minutes = second / 60;
long hours = 0;
if (minutes >= 60) {
hours = minutes / 60;
minutes = minutes % 60;
}
String timeString = "";
String secondString = "";
String minuteString = "";
String hourString = "";
if (seconds < 10) {
secondString = "0" + seconds + "秒";
} else {
secondString = seconds + "秒";
}
if (minutes < 10 && hours < 1) {
minuteString = minutes + "分";
} else if (minutes < 10) {
minuteString = "0" + minutes + "分";
} else {
minuteString = minutes + "分";
}
if (hours < 10) {
hourString = hours + "时";
} else {
hourString = hours + "" + "时";
}
if (hours != 0) {
timeString = hourString + minuteString + secondString;
} else {
timeString = minuteString + secondString;
}
return timeString;
}
} }
<?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.mapper.JpCollectorMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper">
<select id="queryCollectorCountStatus" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="queryCollectorCountStatus" resultType="Map">
select select
hygf_jp_collector.`status`, hygf_jp_collector.`state`,
count(hygf_jp_collector.sequence_nbr) num count(hygf_jp_collector.sequence_nbr) num
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
on hygf_jp_station.third_station_id=hygf_jp_collector.third_station_id on hygf_jp_station.third_station_id=hygf_jp_collector.third_station_id
<where> <where>
<if test="dto.nauserNameme!=null"> <if test="dto.name!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if> </if>
<if test="dto.area!=null"> <if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%") and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
...@@ -28,7 +28,12 @@ ...@@ -28,7 +28,12 @@
<if test="dto.thirdStationId!=null"> <if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </if>
and hygf_jp_collector.`state` is not null and hygf_jp_collector.`state` in ("在线","报警","离线")
</where> </where>
GROUP BY hygf_jp_collector.`status`
GROUP BY hygf_jp_collector.`state`
</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.mapper.JpInverterMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper">
<select id="queryInverterCountStatus" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="queryInverterCountStatus" resultType="Map">
select select
hygf_jp_inverter.`status`, hygf_jp_inverter.`state`,
count(hygf_jp_inverter.sequence_nbr) num count(hygf_jp_inverter.sequence_nbr) num
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
on hygf_jp_station.third_station_id=hygf_jp_inverter.third_station_id on hygf_jp_station.third_station_id=hygf_jp_inverter.third_station_id
<where> <where>
<if test="dto.nauserNameme!=null"> <if test="dto.name!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if> </if>
<if test="dto.area!=null"> <if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%") and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
<if test="dto.thirdStationId!=null"> <if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </if>
and hygf_jp_inverter.`state` is not null and hygf_jp_inverter.`state` in ("在线","报警","离线")
</where> </where>
GROUP BY hygf_jp_inverter.`status` GROUP BY hygf_jp_inverter.`state`
</select> </select>
</mapper> </mapper>
...@@ -5,7 +5,53 @@ ...@@ -5,7 +5,53 @@
<select id="queryForDealerReviewPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="queryForDealerReviewPage" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto">
select * from hygf_jp_station select
`sequence_nbr` sequenceNbr,
`rec_date` recDate,
`rec_user_id` recUserId,
`rec_user_name` recUserName,
`sn_code` snCode,
`capacity` capacity,
`name` ,
`code` ,
`system_code` systemCode,
`access_time` accessTime,
`create_time` createTime,
`address` ,
`longitude` ,
`latitude` ,
`price` ,
`user_name` userName,
`user_phone` userPhone,
`station_contact` stationContact,
`module_count` moduleCount,
`on_grid_type` onGridType,
`on_grid_time` onGridTime,
`third_station_id` thirdStationId,
`third_code` thirdCode,
`station_id` stationId,
`day_power_use` dayPowerUse,
`month_power_use` monthPowerUse,
`year_power_use` yearPowerUse,
FORMAT(`real_time_power`,3) realTimePower,
FORMAT(`accumulated_power`/1000,3) accumulatedPower,
`state` ,
`type`,
`organizational_code` organizationalCode,
`is_delete` isDelete,
FORMAT(`day_generate`,3) dayGenerate,
`month_generate` monthGenerate,
`year_generate` yearGenerate,
`day_income` dayIncome,
`month_income` monthIncome,
`year_income` yearIncome,
`area` ,
`cumulative_income` cumulativeIncome,
`email`,
rated_power ratedPower
from hygf_jp_station
<where> <where>
<if test="dto.name!=null"> <if test="dto.name!=null">
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
...@@ -37,24 +83,25 @@ ...@@ -37,24 +83,25 @@
select select
sum(real_time_power) realTimePower, FORMAT(sum(real_time_power),3) realTimePower,
sum(capacity) capacity, FORMAT(sum(capacity)/1000,3) capacity,
sum(day_generate) dayGenerate, FORMAT(sum(day_generate)/1000,3) dayGenerate,
sum(month_generate) monthGenerate, FORMAT(sum(month_generate)/1000,3) monthGenerate,
sum(year_generate) yearGenerate, FORMAT(sum(year_generate)/1000,3) yearGenerate,
sum(accumulated_power) accumulatedPower, FORMAT(sum(accumulated_power)/1000,3) accumulatedPower,
sum(day_income) dayIncome, FORMAT( sum(day_income),3) dayIncome,
sum(month_income) monthIncome, FORMAT(sum(month_income)/10000,3) monthIncome,
sum(year_income) yearIncome, FORMAT(sum(year_income)/10000,3) yearIncome,
sum(cumulative_income) cumulativeIncome, FORMAT(sum(cumulative_income)/10000,3) cumulativeIncome,
sum(day_power_use) dayPowerUse, FORMAT(sum(day_power_use)/1000,3) dayPowerUse,
sum(month_power_use) monthPowerUse, FORMAT(sum(month_power_use)/1000,3) monthPowerUse,
sum(year_power_use) yearPowerUse, FORMAT(sum(year_power_use)/1000,3) yearPowerUse,
FORMAT(sum(rated_power),3) ratedPower,
count(*) countBuiltNum count(*) countBuiltNum
from hygf_jp_station from hygf_jp_station
<where> <where>
<if test="dto.userName!=null"> <if test="dto.name!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if> </if>
<if test="dto.area!=null"> <if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%") and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
...@@ -86,13 +133,19 @@ ...@@ -86,13 +133,19 @@
<if test="dto.userName!=null"> <if test="dto.userName!=null">
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%") and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if> </if>
<if test="dto.address!=null">
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
<if test="dto.area!=null">
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if test="dto.statioId!=null"> <if test="dto.statioId!=null">
and hygf_jp_station.third_station_id in and hygf_jp_station.third_station_id in
<foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto.statioId" item="item" index="index" open="(" separator="," close=")">
#{item.stationId} #{item.stationId}
</foreach> </foreach>
</if> </if>
and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
</where> </where>
</select> </select>
......
<?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.DayPowerMapper">
</mapper>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<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 id="getMonthPowerint" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower">
SELECT SELECT
avg(power) power, avg(power) power,
third_station_id thirdStationId third_station_id thirdStationId
...@@ -11,4 +11,80 @@ ...@@ -11,4 +11,80 @@
</select> </select>
<select id="getSumMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.YearPower">
SELECT
sum(power) power,
tation_id thirdStationId
FROM house_pv_data.td_hygf_month_power where year_month=#{date} GROUP BY tation_id
</select>
<select id="getSumYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.AllPower">
SELECT
sum(power) power,
tation_id thirdStationId
FROM house_pv_data.td_hygf_year_power where year=#{date} GROUP BY tation_id
</select>
<select id="getDayPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`time` date
FROM house_pv_data.td_hygf_jp_station_power_history where third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and `time` <![CDATA[>=]]> #{startTime} and `time` <![CDATA[<]]> #{endTime}
GROUP BY `time`
</select>
<select id="getMonthPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`day` date
FROM house_pv_data.td_hygf_month_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and year_month = #{date}
GROUP BY `day`
</select>
<select id="getYearPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`month` date
FROM house_pv_data.td_hygf_year_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and `year` = #{date}
GROUP BY `month`
</select>
<select id="getAllPower" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`year` date
FROM house_pv_data.td_hygf_all_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY `year`
</select>
<select id="getDayPowercount" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.PowerCurveDto">
SELECT
sum(power)num,
`hour` date
FROM house_pv_data.td_hygf_day_power where tation_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and year_month_day = #{date}
GROUP BY `hour`
</select>
</mapper> </mapper>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
AND `third_station_id` = #{thirdStationId} AND `third_station_id` = #{thirdStationId}
</if> </if>
<if test="startTime!=null and endTime!=null"> <if test="startTime!=null and endTime!=null">
AND time BETWEEN #{startTime} AND #{endTime} AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if> </if>
</where> </where>
</select> </select>
...@@ -54,4 +54,49 @@ ...@@ -54,4 +54,49 @@
</if> </if>
</where> </where>
</select> </select>
<select id="dayToMonth" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history
<where>
<if test="startTime!=null and endTime!=null">
AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="monthToYear" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history_month
<where>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="yearToAll" resultType="Map">
SELECT sn_code,AVG(signal_strength) AS signal_strength,third_station_id,third_code FROM house_pv_data.td_hygf_jp_collector_history_year
<where>
<if test="year!=null">
AND year = #{year}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<insert id="updateMonth">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_month VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.day},#{item.year_month})
</foreach>
</insert>
<insert id="updateYear">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_year VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.month},#{item.year})
</foreach>
</insert>
<insert id="updateAll">
INSERT INTO house_pv_data.td_hygf_jp_collector_history_all VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.signal_strength},#{item.third_station_id},#{item.third_code},#{item.year})
</foreach>
</insert>
</mapper> </mapper>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
AND `third_station_id` = #{thirdStationId} AND `third_station_id` = #{thirdStationId}
</if> </if>
<if test="date!=null"> <if test="date!=null">
AND `date` LIKE '%'#{date}'%' AND `date` LIKE #{date}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -9,18 +9,23 @@ ...@@ -9,18 +9,23 @@
<if test="dto!=null"> <if test="dto!=null">
third_station_id in third_station_id in
<foreach collection="dto" item="item" index="index" open="(" separator="," close=")"> <foreach collection="dto" item="item" index="index" open="(" separator="," close=")">
#{item.stationId} #{item.thirdStationId}
</foreach> </foreach>
</if> </if>
and `state` in ('未处理','已处理','已恢复')
</where> </where>
GROUP BY `state` GROUP BY `state`
</select> </select>
<select id="list" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto"> <select id="list" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn
<where> <where>
<if test="param.state!=null"> <if test="param.states!=null">
`state` = #{param.state} AND `state` IN
<foreach collection="param.states" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
<if test="param.stationIds!=null"> <if test="param.stationIds!=null">
AND third_station_id IN AND third_station_id IN
...@@ -30,4 +35,13 @@ ...@@ -30,4 +35,13 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getByTime" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto">
SELECT * FROM house_pv_data.td_hygf_jp_inverter_warn
<where>
<if test="createdTime!=null">
AND created_time = #{createdTime}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -54,4 +54,55 @@ ...@@ -54,4 +54,55 @@
</if> </if>
</where> </where>
</select> </select>
<select id="dayToMonth" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history
<where>
<if test="startTime!=null and endTime!=null">
AND time &gt;= #{startTime} AND time &lt;= #{endTime}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="monthToYear" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history_month
<where>
<if test="month!=null">
AND year_month = #{month}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<select id="yearToAll" resultType="Map">
SELECT sn_code,AVG(u_ac_voltage) AS u_ac_voltage,AVG(v_ac_voltage) AS v_ac_voltage,AVG(w_ac_voltage) AS w_ac_voltage,
AVG(u_ac_current) AS u_ac_current,AVG(v_ac_current) AS v_ac_current,AVG(w_ac_current) AS w_ac_current,third_station_id,third_code FROM house_pv_data.td_hygf_jp_invertor_elec_history_year
<where>
<if test="year!=null">
AND year = #{year}
</if>
</where>
GROUP BY sn_code,third_station_id,third_code
</select>
<insert id="updateMonth">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_month VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.day},#{item.year_month})
</foreach>
</insert>
<insert id="updateYear">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_year VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.month},#{item.year})
</foreach>
</insert>
<insert id="updateAll">
INSERT INTO house_pv_data.td_hygf_jp_invertor_elec_history_all VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.created_time},#{item.sn_code},#{item.u_ac_voltage},#{item.v_ac_voltage},#{item.w_ac_voltage},
#{item.u_ac_current},#{item.v_ac_current},#{item.w_ac_current},#{item.third_station_id},#{item.third_code},#{item.year})
</foreach>
</insert>
</mapper> </mapper>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</parent> </parent>
<artifactId>amos-boot-module-hygf-biz</artifactId> <artifactId>amos-boot-module-hygf-biz</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<name>amos-boot-module-jxiop-hygf</name> <name>amos-boot-module-hygf-biz</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
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.DayPowerServiceImpl;
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.DayPowerDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
*
*
* @author system_generator
* @date 2023-09-21
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/day-power")
public class DayPowerController extends BaseController {
@Autowired
DayPowerServiceImpl dayPowerServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<DayPowerDto> save(@RequestBody DayPowerDto model) {
model = dayPowerServiceImpl.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<DayPowerDto> updateBySequenceNbrDayPower(@RequestBody DayPowerDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(dayPowerServiceImpl.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(dayPowerServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<DayPowerDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(dayPowerServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<DayPowerDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<DayPowerDto> page = new Page<DayPowerDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(dayPowerServiceImpl.queryForDayPowerPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<DayPowerDto>> selectForList() {
return ResponseHelper.buildResponse(dayPowerServiceImpl.queryForDayPowerList());
}
}
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; 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 com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl;
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 org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -31,6 +43,12 @@ public class JpCollectorController extends BaseController { ...@@ -31,6 +43,12 @@ public class JpCollectorController extends BaseController {
@Autowired @Autowired
JpCollectorServiceImpl jpCollectorServiceImpl; JpCollectorServiceImpl jpCollectorServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Autowired
JpInverterServiceImpl jpInverterServiceImpl;
/** /**
* 新增户用光伏监盘采集器表 * 新增户用光伏监盘采集器表
* *
...@@ -53,7 +71,8 @@ public class JpCollectorController extends BaseController { ...@@ -53,7 +71,8 @@ public class JpCollectorController extends BaseController {
@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<JpCollectorDto> updateBySequenceNbrJpCollector(@RequestBody JpCollectorDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<JpCollectorDto> updateBySequenceNbrJpCollector(@RequestBody JpCollectorDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(jpCollectorServiceImpl.updateWithModel(model));
} }
...@@ -67,7 +86,8 @@ public class JpCollectorController extends BaseController { ...@@ -67,7 +86,8 @@ public class JpCollectorController extends BaseController {
@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,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(jpCollectorServiceImpl.removeById(sequenceNbr));
} }
...@@ -81,7 +101,14 @@ public class JpCollectorController extends BaseController { ...@@ -81,7 +101,14 @@ public class JpCollectorController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryBySeq(sequenceNbr)); JpCollectorDto jpCollectorDto = jpCollectorServiceImpl.queryBySeq(sequenceNbr);
LambdaQueryWrapper<JpInverter> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JpInverter::getCollectorSnCode, jpCollectorDto.getSnCode());
List<JpInverter> list = jpInverterServiceImpl.list(queryWrapper);
jpCollectorDto.setJpInverters(list);
return ResponseHelper.buildResponse(jpCollectorDto);
} }
/** /**
...@@ -93,13 +120,22 @@ public class JpCollectorController extends BaseController { ...@@ -93,13 +120,22 @@ public class JpCollectorController extends BaseController {
*/ */
@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<JpCollectorDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<JpCollectorDto>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size,JpCollectorDto jpCollectorDto) { @RequestParam(value = "size") int size, JpCollectorDto jpCollectorDto) {
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
if (!pPersonStation.isEmpty()) {
Page<JpCollectorDto> page = new Page<JpCollectorDto>(); Page<JpCollectorDto> page = new Page<JpCollectorDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorPage(page,jpCollectorDto)); List<String> ids = pPersonStation.stream().map(i -> i.getStationId()).collect(Collectors.toList());
jpCollectorDto.setStationIds(ids);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorPage(page, jpCollectorDto));
} else {
return ResponseHelper.buildResponse(new Page<JpCollectorDto>());
}
} }
/** /**
...@@ -108,7 +144,7 @@ public class JpCollectorController extends BaseController { ...@@ -108,7 +144,7 @@ public class JpCollectorController extends BaseController {
* @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<JpCollectorDto>> selectForList() { public ResponseModel<List<JpCollectorDto>> selectForList() {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorList()); return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorList());
......
...@@ -6,14 +6,22 @@ import io.swagger.annotations.Api; ...@@ -6,14 +6,22 @@ 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 com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl;
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 org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -31,6 +39,10 @@ public class JpInverterController extends BaseController { ...@@ -31,6 +39,10 @@ public class JpInverterController extends BaseController {
@Autowired @Autowired
JpInverterServiceImpl jpInverterServiceImpl; JpInverterServiceImpl jpInverterServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
/** /**
* 新增户用光伏监盘逆变器表 * 新增户用光伏监盘逆变器表
* *
...@@ -98,10 +110,20 @@ public class JpInverterController extends BaseController { ...@@ -98,10 +110,20 @@ public class JpInverterController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器表分页查询", notes = "户用光伏监盘逆变器表分页查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器表分页查询", notes = "户用光伏监盘逆变器表分页查询")
public ResponseModel<Page<JpInverterDto>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<Page<JpInverterDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, JpInverterDto jpInverterDto) { @RequestParam(value = "size") int size, JpInverterDto jpInverterDto) {
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
if (!pPersonStation.isEmpty()) {
Page<JpInverterDto> page = new Page<JpInverterDto>(); Page<JpInverterDto> page = new Page<JpInverterDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
List<String> ids = pPersonStation.stream().map(i -> i.getStationId()).collect(Collectors.toList());
jpInverterDto.setStationIds(ids);
return ResponseHelper.buildResponse(jpInverterServiceImpl.queryForJpInverterPage(page, jpInverterDto)); return ResponseHelper.buildResponse(jpInverterServiceImpl.queryForJpInverterPage(page, jpInverterDto));
} else {
return ResponseHelper.buildResponse(new Page<JpInverterDto>());
}
} }
/** /**
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; 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.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterElectricityServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterElectricityServiceImpl;
...@@ -110,7 +109,7 @@ public class JpInverterElectricityController extends BaseController { ...@@ -110,7 +109,7 @@ public class JpInverterElectricityController extends BaseController {
@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<JpInverterElectricityDto>> selectForList() { public ResponseModel<List<JpInverterElectricityDto>> selectForList(@RequestParam(value = "id") String id) {
return ResponseHelper.buildResponse(jpInverterElectricityServiceImpl.queryForJpInverterElectricityList()); return ResponseHelper.buildResponse(jpInverterElectricityServiceImpl.queryForJpInverterElectricityList(id));
} }
} }
...@@ -99,9 +99,10 @@ public class JpStationController extends BaseController { ...@@ -99,9 +99,10 @@ public class JpStationController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/getBysequenceNbr")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个第三方场站", notes = "根据sequenceNbr查询单个第三方场站") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个第三方场站", notes = "根据sequenceNbr查询单个第三方场站")
public ResponseModel<JpStationDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<JpStationDto> selectOne( String id) {
Long sequenceNbr=Long.valueOf(id);
JpStationDto jpStationDto= jpStationServiceImpl.queryBySeq(sequenceNbr); JpStationDto jpStationDto= jpStationServiceImpl.queryBySeq(sequenceNbr);
LambdaQueryWrapper<JpInverter> qug=new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpInverter> qug=new LambdaQueryWrapper<>();
qug.eq(JpInverter::getThirdStationId,jpStationDto.getThirdStationId()); qug.eq(JpInverter::getThirdStationId,jpStationDto.getThirdStationId());
...@@ -145,16 +146,30 @@ public class JpStationController extends BaseController { ...@@ -145,16 +146,30 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/countState") @GetMapping(value = "/countState")
@ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表") @ApiOperation(httpMethod = "GET",value = "场站列表", notes = "场站列表")
public ResponseModel< List<Map<String,Object>>> countState(JpStationDto reviewDto) { public ResponseModel< Map<String,Object> > countState(JpStationDto reviewDto) {
//获取当前人管理场站 //获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId()); qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug); List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
reviewDto.setStatioId(pPersonStation.isEmpty()?null:pPersonStation); reviewDto.setStatioId(pPersonStation.isEmpty()?null:pPersonStation);
List<Map<String,Object>> list= jpStationMapper.countState(reviewDto);
return ResponseHelper.buildResponse(jpStationMapper.countState(reviewDto)); Map<String,Object> collector =new HashMap<>();
collector.put("zx",0);
collector.put("bj",0);
collector.put("lx",0);
if(list!=null&&list.isEmpty()){
for (Map<String, Object> map : list) {
if("在线".equals(map.get("state").toString())){
collector.put("zx",Integer.valueOf(map.get("num").toString()));
}else if("离线".equals(map.get("state").toString())){
collector.put("lx",Integer.valueOf(map.get("num").toString()));
}else if("报警".equals(map.get("state").toString())){
collector.put("bj",Integer.valueOf(map.get("num").toString()));
}
}
}
return ResponseHelper.buildResponse(collector);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -174,9 +189,39 @@ public class JpStationController extends BaseController { ...@@ -174,9 +189,39 @@ public class JpStationController extends BaseController {
} }
List<Map<String,Object>> listCollector= jpCollectorMapper.queryCollectorCountStatus(reviewDto); List<Map<String,Object>> listCollector= jpCollectorMapper.queryCollectorCountStatus(reviewDto);
List<Map<String,Object>> listInverter= jpInverterMapper.queryInverterCountStatus(reviewDto); List<Map<String,Object>> listInverter= jpInverterMapper.queryInverterCountStatus(reviewDto);
Map<String,Object> collector =new HashMap<>();
collector.put("zx",0);
collector.put("gj",0);
collector.put("lx",0);
Map<String,Object> inverter =new HashMap<>();
inverter.put("zx",0);
inverter.put("gj",0);
inverter.put("lx",0);
if(!listCollector.isEmpty()){
for (Map<String, Object> map : listCollector) {
if("在线".equals(map.get("state").toString())){
collector.put("zx",Integer.valueOf(map.get("num").toString()));
}else if("离线".equals(map.get("state").toString())){
collector.put("lx",Integer.valueOf(map.get("num").toString()));
}else if("报警".equals(map.get("state").toString())){
collector.put("gj",Integer.valueOf(map.get("num").toString()));
}
}
}
if(!listInverter.isEmpty()){
for (Map<String, Object> map : listInverter) {
if("在线".equals(map.get("state").toString())){
inverter.put("zx",Integer.valueOf(map.get("num").toString()));
}else if("离线".equals(map.get("state").toString())){
inverter.put("lx",Integer.valueOf(map.get("num").toString()));
}else if("报警".equals(map.get("state").toString())){
inverter.put("gj",Integer.valueOf(map.get("num").toString()));
}
}
}
Map<String,Object> map=new HashMap<>(); Map<String,Object> map=new HashMap<>();
map.put("collector",listCollector); map.put("collector",collector);
map.put("inverter",listInverter); map.put("inverter",inverter);
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
...@@ -197,12 +242,12 @@ public class JpStationController extends BaseController { ...@@ -197,12 +242,12 @@ public class JpStationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/queryUserListyz") @GetMapping(value = "/queryUserListyz")
@ApiOperation(httpMethod = "GET",value = "登陆人管理场站业主列表", notes = "登陆人管理场站业主列表") @ApiOperation(httpMethod = "GET",value = "登陆人管理场站业主列表", notes = "登陆人管理场站业主列表")
public ResponseModel<Set<String>> queryUserList( ) { public ResponseModel<List<String>> queryUserList( ) {
//获取当前人管理场站 //获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId()); qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug); List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
Set data=new HashSet(); List data=new ArrayList();
if(pPersonStation!=null&& !pPersonStation.isEmpty()){ if(pPersonStation!=null&& !pPersonStation.isEmpty()){
for (JpPersonStation jpPersonStation : pPersonStation) { for (JpPersonStation jpPersonStation : pPersonStation) {
data.add(jpPersonStation.getOwner()); data.add(jpPersonStation.getOwner());
...@@ -232,7 +277,30 @@ public class JpStationController extends BaseController { ...@@ -232,7 +277,30 @@ public class JpStationController extends BaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "工率曲线", notes = "电站监控电量收益")
@GetMapping(value = "/getPowerqx")
public ResponseModel< Map<String, List<Object>>> getPowerqx(JpStationDto reviewDto,String date, String type) {
//获取当前人管理场站
List<Long> data=new ArrayList();
if(reviewDto.getThirdStationId()==null){
//获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
if(pPersonStation!=null&&!pPersonStation.isEmpty()){
for (JpPersonStation jpPersonStation : pPersonStation) {
data.add(Long.valueOf(jpPersonStation.getStationId()));
}
}else{
return ResponseHelper.buildResponse(null);
}
}else{
data.add(Long.valueOf(reviewDto.getThirdStationId()));
}
return ResponseHelper.buildResponse(jpStationServiceImpl.getPowerqx( date, type,data));
}
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -111,9 +113,8 @@ public class MonthPowerController extends BaseController { ...@@ -111,9 +113,8 @@ public class MonthPowerController extends BaseController {
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<MonthPowerDto>> selectForList() { public ResponseModel<List<MonthPowerDto>> selectForList() {
monthPowerServiceImpl.getMonthPower(); monthPowerServiceImpl.getMonthPower();
return ResponseHelper.buildResponse(monthPowerServiceImpl.queryForMonthPowerList()); return ResponseHelper.buildResponse(null);
} }
} }
...@@ -171,4 +171,16 @@ public class TdHygfJpCollectorHistoryController extends BaseController { ...@@ -171,4 +171,16 @@ public class TdHygfJpCollectorHistoryController extends BaseController {
public ResponseModel<List<JpCollectorHistoryAllDto>> allList(@RequestParam(value = "id") long id) { public ResponseModel<List<JpCollectorHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id)); return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.allList(id));
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/syncData")
public ResponseModel<Object> syncData() {
return ResponseHelper.buildResponse(tdHygfJpCollectorHistoryServiceImpl.syncData());
}
} }
...@@ -135,7 +135,7 @@ public class TdHygfJpInverterHistoryController extends BaseController { ...@@ -135,7 +135,7 @@ public class TdHygfJpInverterHistoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器历史表列表全部数据查询", notes = "户用光伏监盘逆变器历史表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器历史表列表全部数据查询", notes = "户用光伏监盘逆变器历史表列表全部数据查询")
@GetMapping(value = "/statistics") @GetMapping(value = "/statistics")
public ResponseModel<Map<String, Object>> day(@RequestParam(value = "id") Long id, public ResponseModel<Map<String, Object>> day(@RequestParam(value = "id") String id,
@RequestParam(value = "type") String type, @RequestParam(value = "date") String date) { @RequestParam(value = "type") String type, @RequestParam(value = "date") String date) {
return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.statistics(id,type,date)); return ResponseHelper.buildResponse(tdHygfJpInverterHistoryServiceImpl.statistics(id,type,date));
} }
......
...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -108,6 +109,19 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -108,6 +109,19 @@ public class TdHygfJpInverterWarnController extends BaseController {
} }
/** /**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "time/{createdTime}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个户用光伏监盘逆变器报警表", notes = "根据sequenceNbr查询单个户用光伏监盘逆变器报警表")
public ResponseModel<TdHygfJpInverterWarnDto> selectCreatedTime(@PathVariable Long createdTime) {
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.queryByCreatedTime(createdTime));
}
/**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param current 当前页
...@@ -155,7 +169,7 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -155,7 +169,7 @@ public class TdHygfJpInverterWarnController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectcount") @GetMapping(value = "/selectcount")
public ResponseModel< List<Map<String,Object>>> selectcount(JpStationDto reviewDto) { public ResponseModel< Map<String,Object> > selectcount(JpStationDto reviewDto) {
LambdaQueryWrapper<JpStation> qugda=new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpStation> qugda=new LambdaQueryWrapper<>();
//获取当前人管理场站 //获取当前人管理场站
if(reviewDto.getThirdStationId()==null){ if(reviewDto.getThirdStationId()==null){
...@@ -184,41 +198,19 @@ public class TdHygfJpInverterWarnController extends BaseController { ...@@ -184,41 +198,19 @@ public class TdHygfJpInverterWarnController extends BaseController {
qugda.like(reviewDto.getArea()!=null,JpStation::getArea,reviewDto.getArea()); qugda.like(reviewDto.getArea()!=null,JpStation::getArea,reviewDto.getArea());
List<JpStation> pPersonStation=jpStationMapper.selectList(qugda); List<JpStation> pPersonStation=jpStationMapper.selectList(qugda);
List<Map<String,Object>> datalist= tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation!=null&&!pPersonStation.isEmpty()?pPersonStation:null); List<Map<String,Object>> datalist= tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation!=null&&!pPersonStation.isEmpty()?pPersonStation:null);
return ResponseHelper.buildResponse(datalist); Map<String,Object> collector =new HashMap<>();
} collector.put("wcl",0);
collector.put("ycl",0);
// /** if(datalist!=null&&!datalist.isEmpty()){
// * 获取告警统计 for (Map<String, Object> map : datalist) {
// **/ if("未处理".equals(map.get("state").toString())){
// @TycloudOperation(ApiLevel = UserType.AGENCY) collector.put("wcl",map.get("num"));
// @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询") }else if("已处理".equals(map.get("state").toString())||"已恢复".equals(map.get("state").toString())){
// @GetMapping(value = "/selectcount") collector.put("ycl",map.get("num"));
// public ResponseModel<List<Map<String, Object>>> selectcount(JpStationDto reviewDto) { }
// LambdaQueryWrapper<JpStation> qugda = new LambdaQueryWrapper<>(); }
// // 获取当前人管理场站 }
// if (reviewDto.getThirdStationId() == null) { return ResponseHelper.buildResponse(collector);
// // 获取当前人管理场站 }
// LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
// qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
// List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
// List ids = null;
// if (pPersonStation != null && !pPersonStation.isEmpty()) {
// ids = new ArrayList();
// for (JpPersonStation jpPersonStation : pPersonStation) {
// ids.add(jpPersonStation.getStationId());
// }
// qugda.in(ids != null, JpStation::getThirdStationId, ids);
// }
// } else {
// qugda.eq(JpStation::getThirdStationId, reviewDto.getThirdStationId());
// }
// qugda.like(reviewDto.getUserName() != null, JpStation::getUserName, reviewDto.getUserName());
// qugda.like(reviewDto.getArea() != null, JpStation::getArea, reviewDto.getArea());
// List<JpStation> pPersonStation = jpStationMapper.selectList(qugda);
// List<Map<String, Object>> datalist = tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation);
// return ResponseHelper.buildResponse(datalist);
// }
} }
...@@ -171,4 +171,16 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController { ...@@ -171,4 +171,16 @@ public class TdHygfJpInvertorElecHistoryController extends BaseController {
public ResponseModel<List<JpInvertorElecHistoryAllDto>> allList(@RequestParam(value = "id") long id) { public ResponseModel<List<JpInvertorElecHistoryAllDto>> allList(@RequestParam(value = "id") long id) {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.allList(id)); return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.allList(id));
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器历史表列表全部数据查询", notes = "户用光伏监盘采集器历史表列表全部数据查询")
@GetMapping(value = "/syncData")
public ResponseModel<Object> syncData() {
return ResponseHelper.buildResponse(tdHygfJpInvertorElecHistoryServiceImpl.syncData());
}
} }
package com.yeejoin.amos.boot.module.hygf.biz.scheduled;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpStationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.MonthPowerServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpCollectorHistoryServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInvertorElecHistoryServiceImpl;
/**
* @description:
* @author: tw
* @createDate: 2023/9/21
*/
@EnableScheduling
public class WindSpeedScheduled {
@Autowired
JpStationServiceImpl jpStationServiceImpl;
@Autowired
TdHygfJpCollectorHistoryServiceImpl tdHygfJpCollectorHistoryServiceImpl;
@Autowired
TdHygfJpInvertorElecHistoryServiceImpl tdHygfJpInvertorElecHistoryServiceImpl;
@Scheduled(cron = "${cheduled.crons}")
private void initData() {
jpStationServiceImpl.getMonthPower();
tdHygfJpCollectorHistoryServiceImpl.syncData();
tdHygfJpInvertorElecHistoryServiceImpl.syncData();
}
}
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.yeejoin.amos.boot.module.hygf.api.entity.DayPower;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.DayPowerMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IDayPowerService;
import com.yeejoin.amos.boot.module.hygf.api.dto.DayPowerDto;
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-21
*/
@Service
public class DayPowerServiceImpl extends BaseService<DayPowerDto,DayPower,DayPowerMapper> implements IDayPowerService {
/**
* 分页查询
*/
public Page<DayPowerDto> queryForDayPowerPage(Page<DayPowerDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<DayPowerDto> queryForDayPowerList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
...@@ -39,6 +39,9 @@ public class JpCollectorServiceImpl extends BaseService<JpCollectorDto, JpCollec ...@@ -39,6 +39,9 @@ public class JpCollectorServiceImpl extends BaseService<JpCollectorDto, JpCollec
if (jpCollectorDto.getState() != null) { if (jpCollectorDto.getState() != null) {
wrapper.eq(JpCollector::getState, jpCollectorDto.getState()); wrapper.eq(JpCollector::getState, jpCollectorDto.getState());
} }
if (!jpCollectorDto.getStationIds().isEmpty()) {
wrapper.in(JpCollector::getThirdStationId, jpCollectorDto.getStationIds());
}
entiryPage = (Page<JpCollector>) this.page(entiryPage, wrapper); entiryPage = (Page<JpCollector>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) { if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
page.setTotal(entiryPage.getTotal()); page.setTotal(entiryPage.getTotal());
......
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.JpInverter;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverterElectricity; import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverterElectricity;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterElectricityMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterElectricityMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterElectricityService; import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterElectricityService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterElectricityDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterElectricityDto;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
...@@ -16,7 +22,16 @@ import java.util.List; ...@@ -16,7 +22,16 @@ import java.util.List;
* @date 2023-09-19 * @date 2023-09-19
*/ */
@Service @Service
public class JpInverterElectricityServiceImpl extends BaseService<JpInverterElectricityDto,JpInverterElectricity,JpInverterElectricityMapper> implements IJpInverterElectricityService { public class JpInverterElectricityServiceImpl
extends BaseService<JpInverterElectricityDto, JpInverterElectricity, JpInverterElectricityMapper>
implements IJpInverterElectricityService {
@Autowired
private JpStationServiceImpl jpStationServiceImpl;
@Autowired
private JpInverterServiceImpl JpInverterServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -27,7 +42,12 @@ public class JpInverterElectricityServiceImpl extends BaseService<JpInverterElec ...@@ -27,7 +42,12 @@ public class JpInverterElectricityServiceImpl extends BaseService<JpInverterElec
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<JpInverterElectricityDto> queryForJpInverterElectricityList() { public List<JpInverterElectricityDto> queryForJpInverterElectricityList(String id) {
return this.queryForList("" , false); JpInverter jpInverter = JpInverterServiceImpl.getById(id);
LambdaQueryWrapper<JpInverterElectricity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JpInverterElectricity::getSnCode, jpInverter.getSnCode());
wrapper.eq(JpInverterElectricity::getThirdStationId, jpInverter.getThirdStationId());
List<JpInverterElectricity> list = this.list(wrapper);
return Bean.toModels(list, this.getModelClass());
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import java.util.List; import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -10,6 +11,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -10,6 +11,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
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.mapper.JpInverterMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterService; import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterService;
...@@ -32,6 +34,13 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -32,6 +34,13 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
if (jpInverterDto.getState() != null) { if (jpInverterDto.getState() != null) {
wrapper.eq(JpInverter::getState, jpInverterDto.getState()); wrapper.eq(JpInverter::getState, jpInverterDto.getState());
} }
if(StringUtils.isNotEmpty(jpInverterDto.getSnCode())) {
wrapper.likeRight(JpInverter::getSnCode, jpInverterDto.getSnCode());
}
if (!jpInverterDto.getStationIds().isEmpty()) {
wrapper.in(JpInverter::getThirdStationId, jpInverterDto.getStationIds());
}
wrapper.orderByDesc(JpInverter::getUpdateTime);
entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper); entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) { if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
page.setTotal(entiryPage.getTotal()); page.setTotal(entiryPage.getTotal());
......
...@@ -3,16 +3,23 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -3,16 +3,23 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.PowerCurveDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto; import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation; import com.yeejoin.amos.boot.module.hygf.api.entity.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpStationService; import com.yeejoin.amos.boot.module.hygf.api.service.IJpStationService;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; 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;
import java.util.List;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/** /**
* 第三方场站服务实现类 * 第三方场站服务实现类
...@@ -25,7 +32,10 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -25,7 +32,10 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
@Autowired @Autowired
JpStationMapper jpStationMapper; JpStationMapper jpStationMapper;
@Autowired
MonthPowerMapper monthPowerMapper;
@Autowired
MonthPowerServiceImpl monthPowerServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -40,6 +50,146 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS ...@@ -40,6 +50,146 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
pagenew.setRecords(page.getList()); pagenew.setRecords(page.getList());
return pagenew; return pagenew;
} }
@Async
public void getMonthPower() {
monthPowerServiceImpl.getMonthPower();
}
@Override
public Map<String, List<Object>> getPowerqx(String date, String type,List<Long> statioId) {
List<PowerCurveDto> data=null;
List<Object> listx =new ArrayList<>();
List<Object> listy =new ArrayList<>();
Map<String, List<Object>> map =new HashMap<>();
try {
if(type.equals("day")){
map= gethourList();
data =monthPowerMapper.getDayPowercount(date, statioId);
}else if(type.equals("month")){
map= getDayListOfMonth(date);
data=monthPowerMapper.getMonthPower(date, statioId);
}else if(type.equals("year")){
map= getyearListOfMonth(date);
data= monthPowerMapper.getYearPower(date,statioId);
}else{
map= getyearList();
data= monthPowerMapper.getAllPower(date, statioId);
}
listx =map.get("x");
listy =map.get("y");
if(data!=null&&!data.isEmpty()){
for (PowerCurveDto datum : data) {
for (int i = 0; i < listx.size(); i++) {
if(datum.getDate().equals(listx.get(i).toString())){
listy.remove(i);
String format = new DecimalFormat("#.000").format(datum.getNum());
listy.add(i,format);
break;
}
}
}
}
map.put("x",listx);
map.put("y",listy);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
return map;
}
public static Map<String, List<Object>> getDayListOfMonth(String date) {
Map<String, List<Object>> map =new HashMap<>();
try {
List<Object> listx =new ArrayList<>();
List<Object> listy =new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Date dat = sdf.parse(date);
Calendar aCalendar = Calendar.getInstance();
aCalendar.setTime(dat);
int month = aCalendar.get(Calendar.MONTH) + 1;//月份
int day = aCalendar.getActualMaximum(Calendar.DATE);
for (int i = 1; i <= day; i++) {
String aDate = month+"-"+i;
listx.add(aDate);
listy.add(0);
}
map.put("x",listx);
map.put("y",listy);
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
return map;
}
public static Map<String, List<Object>> getyearListOfMonth(String date) {
Map<String, List<Object>> map =new HashMap<>();
List<Object> listx =new ArrayList<>();
List<Object> listy =new ArrayList<>();
for (int i = 1; i <= 12; i++) {
String aDate = date+"-"+i;
listx.add(aDate);
listy.add(0);
}
map.put("x",listx);
map.put("y",listy);
return map;
}
public static Map<String, List<Object>> getyearList() {
Map<String, List<Object>> map =new HashMap<>();
List<Object> listx =new ArrayList<>();
List<Object> listy =new ArrayList<>();
Calendar aCalendar = Calendar.getInstance(Locale.CHINA);
int year = aCalendar.get(Calendar.YEAR);//年份
for (int i = 1; i <= 10; i++) {
int aDate = year-(10-i);
listx.add(String.valueOf(aDate));
listy.add(0);
}
map.put("x",listx);
map.put("y",listy);
return map;
}
public static Map<String, List<Object>> gethourList() {
Map<String, List<Object>> map =new HashMap<>();
List<Object> listx =new ArrayList<>();
List<Object> listy =new ArrayList<>();
try {
ArrayList<String> dates = new ArrayList<String>();
for (int i = 0; i < 24; i++) {
String s1 =i+":00";
listx.add(s1);
listy.add(0);
}
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
map.put("x",listx);
map.put("y",listy);
return map;
}
} }
\ 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.yeejoin.amos.boot.module.hygf.api.entity.MonthPower; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.AllPowerMapper;
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 com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.YearPowerMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
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.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
/** /**
...@@ -22,6 +29,12 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower, ...@@ -22,6 +29,12 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,
@Autowired @Autowired
MonthPowerMapper monthPowerMapper; MonthPowerMapper monthPowerMapper;
@Autowired
YearPowerServiceImpl yearPowerServiceImpl;
@Autowired
AllPowerServiceImpl allPowerServiceImpl;
@Autowired
YearPowerMapper YearPowerMapper;
/** /**
* 分页查询 * 分页查询
...@@ -39,10 +52,72 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower, ...@@ -39,10 +52,72 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,
@Override @Override
@Async @Transactional
public void getMonthPower() { public void getMonthPower() {
List<MonthPower> list= monthPowerMapper.getMonthPower(); List<MonthPower> list= monthPowerMapper.getMonthPowerint();
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatterday = DateTimeFormatter.ofPattern("YYYY-MM-dd");
String formattedDateday = now.format(formatterday);
LambdaQueryWrapper<MonthPower> wrapperday = new LambdaQueryWrapper<>();
wrapperday.eq(MonthPower::getDay, formattedDateday);
List<MonthPower> listdday= this.list(wrapperday);
if(listdday!=null&&!listdday.isEmpty()){
for (MonthPower monthPower : listdday) {
for (MonthPower power : list) {
if(monthPower.getThirdStationId().equals(power.getThirdStationId())){
monthPower.setPower(power.getPower());
}
}
}
this.saveBatch(listdday);
}else{
this.saveBatch(list); this.saveBatch(list);
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYY-MM");
String formattedDate = now.format(formatter);
List<YearPower> listd= monthPowerMapper.getSumMonthPower(formattedDate);
LambdaQueryWrapper<YearPower> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(YearPower::getMonth, formattedDate);
List<YearPower> listdY= yearPowerServiceImpl.list(wrapper);
if(listdY!=null&&!listdY.isEmpty()){
for (YearPower yearPower : listdY) {
for (YearPower power : listd) {
if(yearPower.getThirdStationId().equals(power.getThirdStationId())){
yearPower.setPower(power.getPower());
}
}
}
yearPowerServiceImpl.saveBatch(listdY);
}else{
yearPowerServiceImpl.saveBatch(listd);
} }
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("YYYY");
String formattedDate1 = now.format(formatter1);
List<AllPower> listdy= monthPowerMapper.getSumYearPower(formattedDate1);
LambdaQueryWrapper<AllPower> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(AllPower::getYear, formattedDate1);
List<AllPower> listdall= allPowerServiceImpl.list(wrapper1);
if(listdall!=null&&!listdall.isEmpty()){
for (AllPower yearPower : listdall) {
for (AllPower power : listdy) {
if(yearPower.getThirdStationId().equals(power.getThirdStationId())){
yearPower.setPower(power.getPower());
}
}
}
allPowerServiceImpl.saveBatch(listdall);
}else{
allPowerServiceImpl.saveBatch(listdy);
}
}
} }
\ 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 java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorHistoryMonthDto; 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.JpCollectorHistoryYearDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryAllDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInvertorElecHistoryYearDto;
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;
...@@ -48,8 +54,14 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -48,8 +54,14 @@ public class TdHygfJpCollectorHistoryServiceImpl
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
if (collector != null) { if (collector != null) {
return this.baseMapper.dayList(collector.getSnCode(), collector.getThirdStationId(), List<TdHygfJpCollectorHistoryDto> list = this.baseMapper.dayList(collector.getSnCode(),
TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); collector.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
if (!list.isEmpty()) {
list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
});
}
return list;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -59,10 +71,11 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -59,10 +71,11 @@ public class TdHygfJpCollectorHistoryServiceImpl
*/ */
public List<JpCollectorHistoryMonthDto> monthList(long id, Date month) { public List<JpCollectorHistoryMonthDto> monthList(long id, Date month) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
Calendar cal = Calendar.getInstance();
cal.setTime(month);
String monthStr = String.valueOf(cal.get(Calendar.YEAR)) + "-" + String.valueOf(cal.get(Calendar.MONTH) + 1);
if (collector != null) { if (collector != null) {
return this.baseMapper.monthList(collector.getSnCode(), collector.getThirdStationId(), return this.baseMapper.monthList(collector.getSnCode(), collector.getThirdStationId(), monthStr);
month.toString());
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -72,10 +85,11 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -72,10 +85,11 @@ public class TdHygfJpCollectorHistoryServiceImpl
*/ */
public List<JpCollectorHistoryYearDto> yearList(long id, Date year) { public List<JpCollectorHistoryYearDto> yearList(long id, Date year) {
JpCollector collector = jpCollectorServiceImpl.getById(id); JpCollector collector = jpCollectorServiceImpl.getById(id);
Calendar cal = Calendar.getInstance();
cal.setTime(year);
String yearStr = String.valueOf(cal.get(Calendar.YEAR));
if (collector != null) { if (collector != null) {
return this.baseMapper.yearList(collector.getSnCode(), collector.getThirdStationId(), return this.baseMapper.yearList(collector.getSnCode(), collector.getThirdStationId(), yearStr);
year.toString());
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -91,4 +105,74 @@ public class TdHygfJpCollectorHistoryServiceImpl ...@@ -91,4 +105,74 @@ public class TdHygfJpCollectorHistoryServiceImpl
} }
return new ArrayList<>(); return new ArrayList<>();
} }
@Async
public Object syncData() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
Date dayTime = cal.getTime();
int day = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR);
// 月表
List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime),
TimeUtil.getEndTimeOfDay(dayTime));
for (int i = 0; i < monthList.size(); i++) {
monthList.get(i).put("created_time", dayTime.getTime() + i);
monthList.get(i).put("day", day);
monthList.get(i).put("year_month", year + "-" + month);
}
if (!monthList.isEmpty()) {
this.baseMapper.updateMonth(monthList);
// 年表
List<Map<String, Object>> yearList = this.baseMapper.monthToYear(String.valueOf(year + "-" + month));
List<JpCollectorHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
for (int i = 0; i < yearList.size(); i++) {
Map<String, Object> map = yearList.get(i);
map.put("month", month);
map.put("year", year);
long time = dayTime.getTime() + i;
for (JpCollectorHistoryYearDto dto : oldYearList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime();
break;
}
}
yearList.get(i).put("created_time", time);
}
if (!yearList.isEmpty()) {
this.baseMapper.updateYear(yearList);
// 总表
List<Map<String, Object>> allList = this.baseMapper.yearToAll(String.valueOf(year));
List<JpCollectorHistoryAllDto> oldAllList = this.baseMapper.allList(null, null);
for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = allList.get(i);
map.put("year", year);
long time = dayTime.getTime() + i;
for (JpCollectorHistoryAllDto dto : oldAllList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime();
break;
}
}
map.put("created_time", time);
}
if (!allList.isEmpty()) {
this.baseMapper.updateAll(allList);
}
}
}
return null;
}
} }
\ No newline at end of file
...@@ -45,11 +45,12 @@ public class TdHygfJpInverterHistoryServiceImpl ...@@ -45,11 +45,12 @@ public class TdHygfJpInverterHistoryServiceImpl
return this.queryForList("", false); return this.queryForList("", false);
} }
public Map<String, Object> statistics(Long id, String type, String date) { public Map<String, Object> statistics(String id, String type, String date) {
JpInverter inverter = jpInverterServiceImpl.getById(id); JpInverter inverter = jpInverterServiceImpl.getById(id);
Double power = null, dailyReturn = null, hours = null; Double power = null, dailyReturn = null, hours = null;
Map<String, Object> map = new HashMap(); Map<String, Object> map = new HashMap();
if (inverter != null) { if (inverter != null) {
date = "%" + date + "%";
if ("day".equals(type)) { if ("day".equals(type)) {
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date); map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
} else if ("month".equals(type)) { } else if ("month".equals(type)) {
...@@ -60,6 +61,10 @@ public class TdHygfJpInverterHistoryServiceImpl ...@@ -60,6 +61,10 @@ public class TdHygfJpInverterHistoryServiceImpl
map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date); map = this.baseMapper.sum(inverter.getSnCode(), inverter.getThirdStationId(), date);
} }
} }
if(!map.containsKey("return"))
{
map.put("return", null);
}
if (map == null) { if (map == null) {
map = new HashMap(); map = new HashMap();
map.put("power", power); map.put("power", power);
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -16,9 +22,11 @@ import com.github.pagehelper.PageInfo; ...@@ -16,9 +22,11 @@ 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;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto; import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
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.JpStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn; import com.yeejoin.amos.boot.module.hygf.api.entity.TdHygfJpInverterWarn;
import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService; import com.yeejoin.amos.boot.module.hygf.api.service.ITdHygfJpInverterWarnService;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarnMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.TimeUtil;
/** /**
* 户用光伏监盘逆变器报警表服务实现类 * 户用光伏监盘逆变器报警表服务实现类
...@@ -30,6 +38,10 @@ import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarn ...@@ -30,6 +38,10 @@ import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.TdHygfJpInverterWarn
public class TdHygfJpInverterWarnServiceImpl public class TdHygfJpInverterWarnServiceImpl
extends BaseService<TdHygfJpInverterWarnDto, TdHygfJpInverterWarn, TdHygfJpInverterWarnMapper> extends BaseService<TdHygfJpInverterWarnDto, TdHygfJpInverterWarn, TdHygfJpInverterWarnMapper>
implements ITdHygfJpInverterWarnService { implements ITdHygfJpInverterWarnService {
@Autowired
JpStationServiceImpl jpStationServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -38,7 +50,40 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -38,7 +50,40 @@ public class TdHygfJpInverterWarnServiceImpl
int pageNum = (int) pageParam.getCurrent(); int pageNum = (int) pageParam.getCurrent();
int pageSize = (int) pageParam.getSize(); int pageSize = (int) pageParam.getSize();
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<TdHygfJpInverterWarnDto> list = this.baseMapper.list(tdHygfJpInverterWarnDto); if (tdHygfJpInverterWarnDto.getState() != null) {
String[] s = tdHygfJpInverterWarnDto.getState().split(",");
tdHygfJpInverterWarnDto.setStates(Arrays.asList(s));
}
if (tdHygfJpInverterWarnDto.getStationName() != null) {
LambdaQueryWrapper<JpStation> wapper = new LambdaQueryWrapper<JpStation>().like(JpStation::getName,
tdHygfJpInverterWarnDto.getStationName());
if (!tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
wapper.in(JpStation::getThirdStationId, tdHygfJpInverterWarnDto.getStationIds());
}
List<JpStation> sList = jpStationServiceImpl.list(wapper);
List<String> ids = sList.stream().map(i -> i.getThirdStationId()).collect(Collectors.toList());
tdHygfJpInverterWarnDto.setStationIds(ids);
}
List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
if (tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
} else {
list = this.baseMapper.list(tdHygfJpInverterWarnDto);
if (!list.isEmpty()) {
list.forEach(i -> {
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
.eq(JpStation::getThirdStationId, i.getThirdStationId()));
if (jpStation != null) {
i.setAddress(jpStation.getAddress());
i.setStationName(jpStation.getName());
i.setArea(jpStation.getArea());
}
if (i.getStartTime() != null) {
i.setStartTimeFormat(TimeUtil.dateFormat(i.getStartTime()));
}
});
}
}
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list); PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
...@@ -54,4 +99,32 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -54,4 +99,32 @@ public class TdHygfJpInverterWarnServiceImpl
public List<TdHygfJpInverterWarnDto> queryForTdHygfJpInverterWarnList() { public List<TdHygfJpInverterWarnDto> queryForTdHygfJpInverterWarnList() {
return this.queryForList("", false); return this.queryForList("", false);
} }
public TdHygfJpInverterWarnDto queryByCreatedTime(long createdTime) {
Map map = new HashMap<>();
map.put("created_time", createdTime);
TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto = this.baseMapper.getByTime(createdTime);
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
.eq(JpStation::getThirdStationId, tdHygfJpInverterWarnDto.getThirdStationId()));
if (jpStation != null) {
tdHygfJpInverterWarnDto.setStationName(jpStation.getName());
tdHygfJpInverterWarnDto.setStationContact(jpStation.getStationContact());
tdHygfJpInverterWarnDto.setUserName(jpStation.getUserName());
tdHygfJpInverterWarnDto.setUserPhone(jpStation.getUserPhone());
tdHygfJpInverterWarnDto.setEmail(jpStation.getEmail());
tdHygfJpInverterWarnDto.setAddress(jpStation.getAddress());
tdHygfJpInverterWarnDto.setArea(jpStation.getArea());
if (tdHygfJpInverterWarnDto.getRecoverTime() != null) {
tdHygfJpInverterWarnDto
.setRecoverTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getRecoverTime()));
tdHygfJpInverterWarnDto.setTimeLongFormat(TimeUtil
.longFormat(tdHygfJpInverterWarnDto.getRecoverTime() - tdHygfJpInverterWarnDto.getStartTime()));
}
if (tdHygfJpInverterWarnDto.getStartTime() != null) {
tdHygfJpInverterWarnDto.setStartTimeFormat(TimeUtil.dateFormat(tdHygfJpInverterWarnDto.getStartTime()));
}
}
return tdHygfJpInverterWarnDto;
}
} }
\ 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 java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -48,8 +51,14 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -48,8 +51,14 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
public List<TdHygfJpInvertorElecHistoryDto> 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) {
return this.baseMapper.dayList(invertor.getSnCode(), invertor.getThirdStationId(), List<TdHygfJpInvertorElecHistoryDto> list = this.baseMapper.dayList(invertor.getSnCode(),
TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day)); invertor.getThirdStationId(), TimeUtil.getStartTimeOfDay(day), TimeUtil.getEndTimeOfDay(day));
if (!list.isEmpty()) {
list.forEach(i -> {
i.setTimeFormat(TimeUtil.minuteFormat(i.getTime()));
});
}
return list;
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -59,9 +68,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -59,9 +68,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
*/ */
public List<JpInvertorElecHistoryMonthDto> monthList(long id, Date month) { public List<JpInvertorElecHistoryMonthDto> monthList(long id, Date month) {
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
Calendar cal = Calendar.getInstance();
cal.setTime(month);
String monthStr = String.valueOf(cal.get(Calendar.YEAR)) + "-" + String.valueOf(cal.get(Calendar.MONTH) + 1);
if (invertor != null) { if (invertor != null) {
return this.baseMapper.monthList(invertor.getSnCode(), invertor.getThirdStationId(), month.toString()); return this.baseMapper.monthList(invertor.getSnCode(), invertor.getThirdStationId(), monthStr);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -71,9 +82,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -71,9 +82,11 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
*/ */
public List<JpInvertorElecHistoryYearDto> yearList(long id, Date year) { public List<JpInvertorElecHistoryYearDto> yearList(long id, Date year) {
JpInverter invertor = jpInvertorServiceImpl.getById(id); JpInverter invertor = jpInvertorServiceImpl.getById(id);
Calendar cal = Calendar.getInstance();
cal.setTime(year);
String yearStr = String.valueOf(cal.get(Calendar.YEAR));
if (invertor != null) { if (invertor != null) {
return this.baseMapper.yearList(invertor.getSnCode(), invertor.getThirdStationId(), year.toString()); return this.baseMapper.yearList(invertor.getSnCode(), invertor.getThirdStationId(), yearStr);
} }
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -89,4 +102,74 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends ...@@ -89,4 +102,74 @@ public class TdHygfJpInvertorElecHistoryServiceImpl extends
} }
return new ArrayList<>(); return new ArrayList<>();
} }
@Async
public Object syncData() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
Date dayTime = cal.getTime();
int day = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH) + 1;
int year = cal.get(Calendar.YEAR);
// 月表
List<Map<String, Object>> monthList = this.baseMapper.dayToMonth(TimeUtil.getStartTimeOfDay(dayTime),
TimeUtil.getEndTimeOfDay(dayTime));
for (int i = 0; i < monthList.size(); i++) {
monthList.get(i).put("created_time", dayTime.getTime() + i);
monthList.get(i).put("day", day);
monthList.get(i).put("year_month", year + "-" + month);
}
if (!monthList.isEmpty()) {
this.baseMapper.updateMonth(monthList);
// 年表
List<Map<String, Object>> yearList = this.baseMapper.monthToYear(String.valueOf(year + "-" + month));
List<JpInvertorElecHistoryYearDto> oldYearList = this.baseMapper.yearList(null, null, String.valueOf(year));
for (int i = 0; i < yearList.size(); i++) {
Map<String, Object> map = yearList.get(i);
yearList.get(i).put("year", year);
yearList.get(i).put("month", month);
long time = dayTime.getTime() + i;
for (JpInvertorElecHistoryYearDto dto : oldYearList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("month") != null && map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())
&& dto.getMonth().equals(map.get("month").toString())) {
time = dto.getCreatedTime();
break;
}
}
yearList.get(i).put("created_time", time);
}
if (!yearList.isEmpty()) {
this.baseMapper.updateYear(yearList);
// 总表
List<Map<String, Object>> allList = this.baseMapper.yearToAll(String.valueOf(year));
List<JpInvertorElecHistoryAllDto> oldAllList = this.baseMapper.allList(null, null);
for (int i = 0; i < allList.size(); i++) {
Map<String, Object> map = allList.get(i);
allList.get(i).put("year", year);
long time = dayTime.getTime() + i;
for (JpInvertorElecHistoryAllDto dto : oldAllList) {
if (dto.getThirdStationId() != null && dto.getSnCode() != null
&& map.get("third_station_id") != null && map.get("sn_code") != null
&& map.get("year") != null
&& dto.getThirdStationId().equals(map.get("third_station_id").toString())
&& dto.getSnCode().equals(map.get("sn_code").toString())
&& dto.getYear().equals(map.get("year").toString())) {
time = dto.getCreatedTime();
break;
}
}
allList.get(i).put("created_time", time);
}
if (!allList.isEmpty()) {
this.baseMapper.updateAll(allList);
}
}
}
return null;
}
} }
\ 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.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.entity.MonthPower;
import com.yeejoin.amos.boot.module.hygf.api.entity.YearPower; import com.yeejoin.amos.boot.module.hygf.api.entity.YearPower;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.MonthPowerMapper;
import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.YearPowerMapper; import com.yeejoin.amos.boot.module.hygf.api.tdenginemapper.YearPowerMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IYearPowerService; import com.yeejoin.amos.boot.module.hygf.api.service.IYearPowerService;
import com.yeejoin.amos.boot.module.hygf.api.dto.YearPowerDto; import com.yeejoin.amos.boot.module.hygf.api.dto.YearPowerDto;
import org.springframework.beans.factory.annotation.Autowired;
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 +22,10 @@ import java.util.List; ...@@ -17,6 +22,10 @@ import java.util.List;
*/ */
@Service @Service
public class YearPowerServiceImpl extends BaseService<YearPowerDto,YearPower,YearPowerMapper> implements IYearPowerService { public class YearPowerServiceImpl extends BaseService<YearPowerDto,YearPower,YearPowerMapper> implements IYearPowerService {
@Autowired
MonthPowerMapper monthPowerMapper;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -30,4 +39,8 @@ public class YearPowerServiceImpl extends BaseService<YearPowerDto,YearPower,Yea ...@@ -30,4 +39,8 @@ public class YearPowerServiceImpl extends BaseService<YearPowerDto,YearPower,Yea
public List<YearPowerDto> queryForYearPowerList() { public List<YearPowerDto> queryForYearPowerList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
} }
\ No newline at end of file
...@@ -201,3 +201,7 @@ dealer.group=1681241774938419202 ...@@ -201,3 +201,7 @@ dealer.group=1681241774938419202
#户用光伏工程角色 #户用光伏工程角色
dealer.engineering=1679674919488614401 dealer.engineering=1679674919488614401
#定时任务获取曲线信息
cheduled.crons=0 0 1 * * ?
\ No newline at end of file
package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import java.util.HashMap;
public class CommonConstans {
//光伏发电量系数
public static final Double pvGenPoweActor = 0.000001;
// 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和
//
// 光伏站:
// (日/月/年)发电量=场站所有逆变器(日/月/年)发电量总和
// 装机容量=场站所有逆变器装机容量总和
//
// 通用:
// 发电量完成率=(月/年)发电量/(月/年)发电量指标
// 小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标
// 可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW)
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000
public static final Double carbonDioxide = 0.997 * 10 / 10000;
// 节约标准煤(万t)=发电量(万kW·h)*0.29
public static final Double standardCoal = 0.29;
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30
public static final Double toner = 0.30;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51
public static final Double sulfurDioxide = 1.51;
// 氮氧化物减排量(t)=发电量(万kW·h)*1.69
public static final Double oxynitride = 1.69;
//吨转万吨
public static final Double tToWT = 0.0001;
//万Kwh转MV
public static final Integer wkwhToMv = 10;
// 正常运行 发电状态=1
// 告警运行 报警状态=1
// 正常停机 停机状态=1
// 故障停机 故障状态=1
// 限功率
// 待机状态 待机状态=1
// 维护状态 维护状态=1
// 通讯中断
public static final HashMap<String, String> fanStatus = new HashMap<String, String>() {
{
put("发电状态", "正常运行");
put("报警状态", "报警运行");
put("停机状态", "停机状态");
put("故障状态", "故障状态");
put("待机状态", "待机状态");
put("维护状态", "维护状态");
put("限功率", "限功率");
put("通讯中断", "通讯中断");
}
};
// 正常运行 运行=1
// 正常停机 停机=1
// 限功率 限额运行=1
// 限电停机 降额运行=1
// 告警运行 告警运行=1
// 故障停机 故障停机=1
// 待机状态 待机=1
// 通讯中断 通讯故障=1
public static final HashMap<String, String> pvStatus = new HashMap<String, String>() {
{
put("运行", "正常运行");
put("停机", "正常停机");
put("限额运行", "限功率");
put("降额运行", "限电停机");
put("告警运行", "告警运行");
put("故障停机", "故障停机");
put("待机", "待机状态");
put("通讯故障", "通讯中断");
}
};
//es EquipIndexName 查绚关键字
public static final String QueryStringEquipmentIndexName = "equipmentIndexName.keyword";
//es EquipIndexName 查绚关键字
public static final String QueryStringEquipmentIndexNameNotKeyword = "equipmentIndexName";
//es gatewayId 查绚关键字
public static final String QueryStringGateWayId = "gatewayId.keyword";
public static final String QueryStringFrontMoudle = "frontModule.keyword";
public static final String QueryStringSystemType = "systemType";
public static final String QueryStringSystemTypeKeyword = "systemType.keyword";
public static final String QueryStringEquipmentNumber = "equipmentNumber";
public static final String QueryStringEquipmentNumberKeyword = "equipmentNumber.keyword";
public static final String QueryStringValue = "value";
public static final String QueryStringValueKeyword = "value.keyword";
public static final String QueryStringValueLabel = "valueLabel";
public static final String QueryStringValueLabelKeyword = "valueLabel.keyword";
public static final String QueryStringDataType = "dataType";
public static final String QueryStringDisplayName = "displayName";
public static final String QueryStringDisplayNameKeyword = "displayName.keyword";
public static final String QueryStringIsAlarm = "isAlarm";
public static final String QueryStringIsAlarmKeyword = "isAlarm.keyword";
public static final String Twodecimalplaces= "%.2f";
public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
}
package com.yeejoin.amos.boot.module.jxiop.biz.dto;
import lombok.Data;
import java.util.Date;
@Data
public class ESEquipmentsDTO {
private String id;
private String address;
private String dataType;
private String equipmentSpecificName;
private String gatewayId;
private String isAlarm;
private Date createdTime;
private String unit;
private String value;
private Float valueF;
private String valueLabel;
private String traceId;
private String equipmentIndexName;
private String equipmentNumber;
private String frontModule;
private String systemType;
private String pictureName;
private String displayName;
private String state;
private String color;
}
...@@ -153,4 +153,10 @@ public class IdxBizFanHealthIndex { ...@@ -153,4 +153,10 @@ public class IdxBizFanHealthIndex {
@TableField("ANOMALY") @TableField("ANOMALY")
private Double ANOMALY; private Double ANOMALY;
/**
* 分析变量名称
*/
@TableField("POINT_NAME")
private String pointName;
} }
...@@ -162,4 +162,11 @@ public class IdxBizPvHealthIndex{ ...@@ -162,4 +162,11 @@ public class IdxBizPvHealthIndex{
@TableField("ANOMALY") @TableField("ANOMALY")
private Double ANOMALY; private Double ANOMALY;
/**
* 分析变量名称
*/
@TableField("POINT_NAME")
private String pointName;
} }
...@@ -37,4 +37,39 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -37,4 +37,39 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode); List<Map<String, Object>> getAllEquipAlarmInfoAnalysisByArea(@Param("areaCode") String areaCode);
List<Map<String, Object>> getSubSystemInfo(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getFanInfoByPage(@Param("gatewayId") String gatewayId);
List<Map<String, Object>> getFanHealthInfoList(@Param("gatewayId") String gatewayId);
List<Map<String, Object>> getSumSystemListByEquipment(@Param("gatewayId") String gatewayId, @Param("equipmentName") String equipmentName);
List<Map<String, Object>> getPointNameListBySumSystem(@Param("gatewayId") String gatewayId, @Param("subSystem") String subSystem);
List<Map<String, Object>> getHealthInfoBySubSystem(@Param("subSystem") String subSystem, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvInfoByPage(@Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvHealthInfoList(@Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvSubSystemInfo(@Param("subarray") String subarray, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvSumSystemListByEquipment(@Param("gatewayId") String gatewayId, @Param("subarray") String subarray);
List<Map<String, Object>> getPvHealthInfoBySubSystem(@Param("equipmentName") String equipmentName, @Param("gatewayId") String gatewayId);
List<Map<String, Object>> getPvPointNameListBySumSystem(@Param("gatewayId") String gatewayId, @Param("equipmentName") String equipmentName);
} }
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