Commit 5df79d19 authored by tangwei's avatar tangwei

解决冲突

parents b20197e3 78b6a712
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.api.householdapi.controller;
import com.yeejoin.amos.api.householdapi.Utils.GoodWeRequestUtil;
import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils;
import com.yeejoin.amos.api.householdapi.face.dto.GoodWEGenStation;
import com.yeejoin.amos.api.householdapi.face.service.*;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import com.yeejoin.amos.api.householdapi.face.service.impl.SofarDataAcquisitionServiceImpl;
......@@ -52,7 +53,15 @@ public class HouseholdTestController {
@ApiOperation(httpMethod = "POST", value = "固德威示例", notes = "固德威示例")
public void goodweDemo() throws IOException {
// goodWeDataAcquisitionService.stationList();
goodWeDataAcquisitionService.stationDetail();
// goodWeDataAcquisitionService.stationDetail();
// goodWeDataAcquisitionService.inverAlramInfo();
// goodWeDataAcquisitionService.inverterList();
// goodWeDataAcquisitionService.inverterDetail();
// goodWeDataAcquisitionService.stationMonthGen();
// goodWeDataAcquisitionService.stationYearGen();
// goodWeDataAcquisitionService.inverterDetail();
goodWeDataAcquisitionService.inverterMonthGen();
goodWeDataAcquisitionService.inverterYearGen();
}
/**
......
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
// 固德威实时数据
@Data
public class D {
public double vpv3;
public double vpv2;
public double vpv1;
public double fac3;
public double fac2;
public double fac1;
public double vpv4;
public double ipv2;
public double pac;
public double ipv1;
public double ipv4;
public double ipv3;
public double eDay;
public double vac3;
public String creationDate;
public double istr9;
public double vac2;
public double istr8;
public double vac1;
public double istr5;
public double istr10;
public double istr4;
public double eTotal;
public double istr7;
public double istr6;
public double istr1;
public double iac2;
public double istr3;
public double iac1;
public double hTotal;
public double istr2;
public double iac3;
public double istr16;
public double istr15;
public double istr14;
public double istr13;
public double istr12;
public double istr11;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class GoodWEGenStation {
private String date;
private String power;
private String income;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
import org.joda.time.DateTime;
@Data
public class GoodWeAlarmDto {
// stationId string 电站 ID
// adcode string 区域编码
// stationname string 电站名称
// devicesn string 设备 SN
// warningid string 告警 id
// warningname string 告警名称
// status int 状态 1:已处理 0:未处理
// happentime Datetime? 发生时间
// recoverytime Datetime? 恢复时间
// is_add_task Int 是否派送 1:已派送 2:未派送
// error_code string 错误编码-详细参考 3.3 告警错误
private String stationId;
private String adcode;
private String stationname;
private String devicesn;
private String warningid;
private String warningname;
private Integer status;
private DateTime happentime;
private DateTime recoverytime;
private Integer is_add_task;
private String error_code;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class GoodWeINverterDetailDto {
private String id;
private String pw_id;
private String it_name;
private String it_sn;
private String it_type;
private Double it_capacity;
private Double it_checkcode;
private String conn_date;
private Boolean it_change_flag;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class GoodWeInverterCurrentDataDto {
public int error_original;
public D d;
public double out_pac;
public String type;
public double etotal;
public double capacity;
public double tempperature;
public String turnon_time;
public String check_code;
public String name;
public double eday;
public boolean it_change_flag;
public String sn;
public double in_pac;
public int status;
}
package com.yeejoin.amos.api.householdapi.face.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
@Data
public class GoodWeStationMonitorDto {
private String powerstation_id;
private String stationname;
private String first_letter;
private String adcode;
private String location;
private Integer status;
private Double pac;
private Double capacity;
private Double eday;
private Double emonth;
private Double eday_income;
private Double etotal;
private Double etotal_income;
private String powerstation_type;
private String pre_org_id;
private String org_id;
private String longitude;
private String latitude;
private Double pac_kw;
private Double to_hour;
private String currency;
private Double yield_rate;
}
......@@ -35,7 +35,15 @@ public class GoodWeStationDetail {
private Double pac;
@TableField("eday")
private Double eday;
@TableField(exist = false)
private Double emonth;
@TableField(exist = false)
private Double eday_income;
@TableField("etotal")
private Double etotal;
@TableField(exist = false)
private Double etotal_income;
@TableField(exist = false)
private Double yield_rate;
}
......@@ -25,8 +25,14 @@ public class GoodWeStationMonitorList {
private Double capacity;
@TableField("eday")
private Double eday;
@TableField(exist = false)
private Double eday_income;
@TableField("etotal")
private Double etotal;
@TableField(exist = false)
private Double emonth;
@TableField(exist = false)
private Double etotal_income;
@TableField("powerstation_type")
private String powerstation_type;
@TableField("longitude")
......@@ -37,4 +43,17 @@ public class GoodWeStationMonitorList {
private Double pac_kw;
@TableField("to_hour")
private Double to_hour;
@TableField(exist = false)
private Double currency;
@TableField(exist = false)
private Double yield_rate;
@TableField("address")
private String address;
@TableField("owner_name")
private String owner_name;
@TableField("owner_phone")
private String owner_phone;
@TableField("turnon_time")
private String turnon_time;
}
......@@ -4,7 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverter;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface JpInverterMapper extends BaseMapper<JpInverter> {
@Select("SELECT sum(current_power) FROM hygf_jp_inverter WHERE third_code='HW'")
Double getHuaWeiStationCurrentPower();
@Select("select sn_code from hygf_jp_inverter where third_code='GOODWE'")
List<String> getGoodWeSnCodes();
}
......@@ -9,6 +9,9 @@ public interface GoodWeDataAcquisitionService {
* @descrption 场站详情数据入库
*/
void stationDetail();
void stationMonthGen();
void stationYearGen();
/**
* @descrption 采集器列表数据入库
*/
......@@ -25,6 +28,10 @@ public interface GoodWeDataAcquisitionService {
* @descrption 逆变器详情数据入库
*/
void inverterDetail();
void inverterMonthGen();
void inverterYearGen();
/**
* @descrption 采集器告警列表数据入库
*/
......
......@@ -4,7 +4,7 @@ package com.yeejoin.amos.openapi.enums;
public enum PVProducerInfoEnum {
GDW("固德威","GDW"),
GDW("固德威","GOODWE"),
SH("首航","SH"),
JLY("锦浪云","JLY"),
KSOLAR("科士达","KSD"),
......
......@@ -391,6 +391,9 @@ public class IdxBizFanHealthIndexController extends BaseController {
startTimeTop = formatter.format(startDate);
}
List<String> gatewayIds = this.getGatewayIds();
if(this.getGatewayIds().size()==0){
gatewayIds= Arrays.asList("qweqweqweqweqweqwe");
}
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexDays.forEach(item -> {
......@@ -568,8 +571,10 @@ public class IdxBizFanHealthIndexController extends BaseController {
@RequestParam(value = "subSystem",required = false) String subSystem,
@RequestParam(value = "current",required = false) Integer current,
@RequestParam(value = "size",required = false) Integer size){
List<String> gatewayIds = this.getGatewayIds();
if(this.getGatewayIds().size()==0){
gatewayIds= Arrays.asList("qweqweqweqweqweqwe");
}
if (requiredType.equals("按天")){
// if (null != type && type.equals("0")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
......@@ -583,7 +588,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
// Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
// startTimeTop = formatter.format(startDate);
// }
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null);
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexDays.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
});
......@@ -608,7 +613,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
// Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
// startTimeTop = formatter.format(startDate);
// }
List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null);
List<FanHealthIndexHour> fanHealthIndexHours = fanHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexHours.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
});
......@@ -632,7 +637,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
// Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
// startTimeTop = formatter.format(startDate);
// }
List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, null);
List<FanHealthIndexMoment> fanHealthIndexMoments = fanHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size, gatewayIds);
fanHealthIndexMoments.forEach(item -> {
item.setHealthIndex(Double.parseDouble(df.format(item.getHealthIndex())));
});
......
......@@ -265,6 +265,9 @@ public class IdxBizPvHealthIndexController extends BaseController {
List<String> gatewayIds = this.getGatewayIds();
if(gatewayIds.size()==0){
gatewayIds = Arrays.asList("qweqweqweqeqwqweqw");
}
if (requiredType.equals("按天")){
Date startDayTime = DateUtils.getCurrentDayStartTime(new Date());
Date date = DateUtils.dateAddHours(startDayTime, -9);
......
......@@ -101,7 +101,7 @@ public class IPermissionServiceImpl implements IPermissionService {
@Override
public String getCurrentUserPersmissions() {
String rootNodeName = "all";
String rootNodeName = "";
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
String userId = reginParams.getUserModel().getUserId();
StdUserEmpower stdUserEmpower = userEmpowerMapper.selectOne(new QueryWrapper<StdUserEmpower>().eq("amos_user_id", userId).eq("permission_type", "YTH"));
......@@ -112,7 +112,7 @@ public class IPermissionServiceImpl implements IPermissionService {
Map<String, String> companyInfo = userEmpowerMapper.getCompanyInfoByOrgCode(permissionOrgCode);
String companyLevel = companyInfo.get("level").toString();
if (companyLevel.equals("categroy_leve2")) {
return rootNodeName;
return "all";
}
if (companyLevel.equals("area")) {
List<StationBasic> stationBasics = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("project_org_code", permissionOrgCode));
......
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