Commit 42a432aa authored by chenzhao's avatar chenzhao

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

parents dc72176e de9c6a7a
package com.yeejoin.amos.api.householdapi.Utils;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.http.Method;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.api.householdapi.constant.ImasterConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.*;
@Component
public class ImasterUtils {
private String redisKey = "XSRF-TOKEN";
@Autowired
RedisUtils redisUtils;
/**
* @return HashMap<String, Object> 发送请求前的准备 准备header信息
* @deprecated 根据厂商编码获取厂商的hearer
*/
public static HashMap<String, String> getHeader() {
HashMap<String, String> hashMap = new HashMap<>();
String requestParam="";
HashMap<String, String> hashMaphead = new HashMap<>();
try {
requestParam = "{ \"userName\": \""+ImasterConstant.account+"\", \"systemCode\": \""+ImasterConstant.password+"\"}";
} catch (Exception e) {
throw new RuntimeException(e);
}
String url = ImasterConstant.baseurl + ImasterConstant.tokenUrl;
HttpResponse execute = HttpUtil.createRequest(Method.POST, url).body(requestParam).execute();
String token = execute.header("xsrf-token");
hashMap.put("XSRF-TOKEN", token);
return hashMap;
}
/**
* @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) {
String respone = "";
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
try {
Object o = redisUtils.get(redisKey);
if(o != null) {
HashMap<String, String> headMap = new HashMap<>();
headMap.put("XSRF-TOKEN", o.toString());
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
JSONObject jsonObject = JSONObject.parseObject(respone);
if(jsonObject.get("failCode").toString().equals("305")) {
headMap = getHeader();
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey,headMap.get("XSRF-TOKEN"));
}
} else {
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
}
} else {
HashMap<String, String> headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolverule(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey,headMap.get("XSRF-TOKEN"));
}
}
} catch (Exception exception) {
return result;
}
return result;
}
/**
* @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> getResPonseOther(String apiurl, String requestMethod, String requestParmInfo, String ResultResolveRule, Class<T> tClass) {
String respone = "";
String params = "";
JSONArray jsonArray = null;
List<T> result = new ArrayList<>();
try {
Object o = redisUtils.get(redisKey);
if(o != null) {
HashMap<String, String> headMap = new HashMap<>();
headMap.put("XSRF-TOKEN", o.toString());
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
JSONObject jsonObject = JSONObject.parseObject(respone);
if(jsonObject.get("failCode").toString().equals("305")) {
headMap = getHeader();
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolveruleOther(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey,headMap.get("XSRF-TOKEN"));
}
} else {
jsonArray = handlerResponseByResultResolveruleOther(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
}
}
} else {
HashMap<String, String> headMap = getHeader();
String url = ImasterConstant.baseurl + apiurl;
respone = sendRequest(requestMethod, url, requestParmInfo, headMap);
jsonArray = handlerResponseByResultResolveruleOther(ResultResolveRule, respone);
if (!ObjectUtils.isEmpty(jsonArray)) {
result = JSONArray.parseArray(jsonArray.toJSONString(), tClass);
redisUtils.set(redisKey,headMap.get("XSRF-TOKEN"));
}
}
} catch (Exception exception) {
return result;
}
return result;
}
/**
* @param resultResovle 请求返回的解析规则 来源与数据库
* @param response 请求返回的字符串
* @return 解析后的数据
* @desc 根据解析规则解析请求返回数据
*/
public static JSONArray handlerResponseByResultResolverule(String resultResovle, String response) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONArray jsonArray = new JSONArray();
if (ObjectUtil.isNotEmpty(resultResovle)) {
String[] rules = resultResovle.split(",");
if (rules.length > 0) {
for (int i = 0; i < rules.length; i++) {
try {
jsonObject = (JSONObject) jsonObject.get(rules[i]);
if (jsonObject == null) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
} catch (Exception exception) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
}
}
if (jsonArray.size() == 0) {
jsonArray.addAll((JSONArray)jsonObject.get("list"));
}
}
return jsonArray;
}
/**
* @param resultResovle 请求返回的解析规则 来源与数据库
* @param response 请求返回的字符串
* @return 解析后的数据
* @desc 根据解析规则解析请求返回数据
*/
public static JSONArray handlerResponseByResultResolveruleOther(String resultResovle, String response) {
JSONObject jsonObject = JSONObject.parseObject(response);
JSONArray jsonArray = new JSONArray();
JSONArray jsonArrayRet = new JSONArray();
if (ObjectUtil.isNotEmpty(resultResovle)) {
String[] rules = resultResovle.split(",");
if (rules.length > 0) {
for (int i = 0; i < rules.length; i++) {
try {
jsonObject = (JSONObject) jsonObject.get(rules[i]);
if (jsonObject == null) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
} catch (Exception exception) {
jsonArray = (JSONArray) jsonObject.get(rules[i]);
}
}
}
if (jsonArray.size() != 0) {
for( int i=0; i<jsonArray.size();i++ ) {
JSONObject jsonObject1 = (JSONObject) jsonArray.get(i);
JSONObject jsonObject2 = (JSONObject)jsonObject1.get("dataItemMap");
if(jsonObject1.get("sn") != null) {
jsonObject2.put("inverterId", jsonObject1.get("sn").toString());
}
if(jsonObject1.get("stationCode") != null) {
jsonObject2.put("stationCode", jsonObject1.get("stationCode").toString());
}
jsonArrayRet.add(jsonObject2);
}
}
}
return jsonArrayRet;
}
public static String sendRequest(String requestMethod, String url, String params, HashMap<String, String> headMap) {
String respone = "";
if (requestMethod.equals("POST")) {
respone = HttpUtil.createPost(url).headerMap(headMap, false).
body(params).execute().body();
}
if (requestMethod.equals("GET")) {
respone = HttpUtil.createGet(url).headerMap(headMap, true).
body(params).execute().body();
}
return respone;
}
/***
*
* @param params 参数字符窜
* @param headMap header头
* @param orginalAuthorization 原始的orginalAuthorization
* @param appsecret appsecret
* @desc 锦浪云请求参数及head头处理
*/
public void JLYHeaderMapHandler(String params, HashMap<String, String> headMap, String orginalAuthorization, String appsecret, String apiurl) {
String contentMD5 = GoLangHeaderUtils.getDigest(params);
headMap.put("Date", GoLangHeaderUtils.getGMTTime());
String param = "POST" + "\n" + contentMD5 + "\n" + "application/json" + "\n" + headMap.get("Date") + "\n" + apiurl;
String sign = "";
try {
sign = GoLangHeaderUtils.HmacSHA1Encrypt(param, appsecret);
} catch (Exception e) {
throw new RuntimeException(e);
}
headMap.put("Content-MD5", contentMD5);
headMap.put("Authorization", orginalAuthorization + sign);
}
/**
* @param pageSizeResovle
* @param response
* @return
* @desc 根据分页规则 获取分页数
*/
public Integer getPagesize(String pageSizeResovle, String response) {
Integer pageSize = 0;
String[] rules = pageSizeResovle.split(",");
JSONObject jsonObject = JSONObject.parseObject(response);
if (rules.length > 0) {
for (int i = 0; i < rules.length - 1; i++) {
jsonObject = (JSONObject) jsonObject.get(rules[i]);
}
}
pageSize = (Integer) jsonObject.get(rules[rules.length - 1]);
return pageSize;
}
// public static void main(String[] args) {
// HashMap<String, Object> requestInfo = new HashMap<>();
// requestInfo.put("pageNo", 1);
// String requestParaminfo = JSON.toJSONString(requestInfo);
// getResPonse(ImasterConstant.stationListUrl,
// GoLangConstant.requestPost,
// requestParaminfo,
// ImasterConstant.resovleRule_data_page_records,
// ImasterStationList.class
// );
//
// }
}
package com.yeejoin.amos.api.householdapi.Utils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.cache.enumeration.CacheType;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* @author DELL
*/
@Component
public class RedisUtils {
public static String VAR_SPLITOR = ":";
public static Long DEFAULT_SESSION_EXPIRATION = 2592000L;
@Autowired
private RedisTemplate redisTemplate;
/**
* 指定缓存失效时间
*
* @param key 键
* @param time 时间(秒)
* @return
*/
public boolean expire(String key, long time) {
if (time > 0) {
redisTemplate.expire(key, time, TimeUnit.SECONDS);
return true;
} else {
throw new RuntimeException("超时时间小于0");
}
}
/**
* 根据key 获取过期时间
*
* @param key 键 不能为null
* @return 时间(秒) 返回0代表为永久有效
*/
public long getExpire(String key) {
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
}
/**
* 判断key是否存在
*
* @param key 键
* @return true 存在 false不存在
*/
public boolean hasKey(String key) {
return redisTemplate.hasKey(key);
}
/**
* 删除缓存
*
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public void del(String... key) {
if (key != null && key.length > 0) {
if (key.length == 1) {
redisTemplate.delete(key[0]);
} else {
redisTemplate.delete(CollectionUtils.arrayToList(key));
}
}
}
// ============================String=============================
/**
* 普通缓存获取
*
* @param key 键
* @return 值
*/
public Object get(String key) {
Object object = redisTemplate.opsForValue().get(key);
return key == null ? null : object;
}
/**
* 普通缓存放入
*
* @param key 键
* @param value 值
* @return true成功 false失败
*/
public boolean set(String key, Object value) {
redisTemplate.opsForValue().set(key, value);
return true;
}
/**
* 普通缓存放入并设置时间
*
* @param key 键
* @param value 值
* @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期
* @return true成功 false 失败
*/
public boolean set(String key, Object value, long time) {
if (time > 0) {
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
} else {
this.set(key, value);
}
return true;
}
/**
* 递增
*
* @param key 键
* @param by 要增加几(大于0)
* @return
*/
public long incr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递增因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, delta);
}
/**
* 递减
*
* @param key 键
* @param by 要减少几(小于0)
* @return
*/
public long decr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递减因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, -delta);
}
// ================================Map=================================
/**
* HashGet
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return 值
*/
public Object hget(String key, String item) {
return redisTemplate.opsForHash().get(key, item);
}
/**
* 获取hashKey对应的所有键值
*
* @param key 键
* @return 对应的多个键值
*/
public Map<Object, Object> hmget(String key) {
return redisTemplate.opsForHash().entries(key);
}
/**
* HashSet
*
* @param key 键
* @param map 对应多个键值
* @return true 成功 false 失败
*/
public boolean hmset(String key, Map<String, Object> map) {
redisTemplate.opsForHash().putAll(key, map);
return true;
}
/**
* HashSet 并设置时间
*
* @param key 键
* @param map 对应多个键值
* @param time 时间(秒)
* @return true成功 false失败
*/
public boolean hmset(String key, Map<String, Object> map, long time) {
redisTemplate.opsForHash().putAll(key, map);
if (time > 0) {
expire(key, time);
}
return true;
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value) {
redisTemplate.opsForHash().put(key, item, value);
return true;
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key 键
* @param item 项
* @param value 值
* @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value, long time) {
redisTemplate.opsForHash().put(key, item, value);
if (time > 0) {
expire(key, time);
}
return true;
}
/**
* 删除hash表中的值
*
* @param key 键 不能为null
* @param item 项 可以使多个 不能为null
*/
public void hdel(String key, Object... item) {
redisTemplate.opsForHash().delete(key, item);
}
/**
* 判断hash表中是否有该项的值
*
* @param key 键 不能为null
* @param item 项 不能为null
* @return true 存在 false不存在
*/
public boolean hHasKey(String key, String item) {
return redisTemplate.opsForHash().hasKey(key, item);
}
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
*
* @param key 键
* @param item 项
* @param by 要增加几(大于0)
* @return
*/
public double hincr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, by);
}
/**
* hash递减
*
* @param key 键
* @param item 项
* @param by 要减少记(小于0)
* @return
*/
public double hdecr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, -by);
}
// ============================set=============================
/**
* 根据key获取Set中的所有值
*
* @param key 键
* @return
*/
public Set<Object> sGet(String key) {
return redisTemplate.opsForSet().members(key);
}
/**
* 根据value从一个set中查询,是否存在
*
* @param key 键
* @param value 值
* @return true 存在 false不存在
*/
public boolean sHasKey(String key, Object value) {
return redisTemplate.opsForSet().isMember(key, value);
}
/**
* 将数据放入set缓存
*
* @param key 键
* @param values 值 可以是多个
* @return 成功个数
*/
public long sSet(String key, Object... values) {
return redisTemplate.opsForSet().add(key, values);
}
/**
* 将set数据放入缓存
*
* @param key 键
* @param time 时间(秒)
* @param values 值 可以是多个
* @return 成功个数
*/
public long sSetAndTime(String key, long time, Object... values) {
final Long count = redisTemplate.opsForSet().add(key, values);
if (time > 0) {
expire(key, time);
}
return count;
}
/**
* 获取set缓存的长度
*
* @param key 键
* @return
*/
public long sGetSetSize(String key) {
return redisTemplate.opsForSet().size(key);
}
/**
* 移除值为value的
*
* @param key 键
* @param values 值 可以是多个
* @return 移除的个数
*/
public long setRemove(String key, Object... values) {
final Long count = redisTemplate.opsForSet().remove(key, values);
return count;
}
// ===============================list=================================
/**
* 获取list缓存的内容
*
* @param key 键
* @param start 开始
* @param end 结束 0 到 -1代表所有值
* @return
*/
public List<Object> lGet(String key, long start, long end) {
return redisTemplate.opsForList().range(key, start, end);
}
/**
* 获取list缓存的长度
*
* @param key 键
* @return
*/
public long lGetListSize(String key) {
return redisTemplate.opsForList().size(key);
}
/**
* 通过索引 获取list中的值
*
* @param key 键
* @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
* @return
*/
public Object lGetIndex(String key, long index) {
return redisTemplate.opsForList().index(key, index);
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public boolean lSet(String key, Object value) {
redisTemplate.opsForList().rightPush(key, value);
return true;
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public boolean lSet(String key, Object value, long time) {
redisTemplate.opsForList().rightPush(key, value);
if (time > 0) {
expire(key, time);
}
return true;
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @return
*/
public boolean lSet(String key, List<Object> value) {
redisTemplate.opsForList().rightPushAll(key, value);
return true;
}
/**
* 将list放入缓存
*
* @param key 键
* @param value 值
* @param time 时间(秒)
* @return
*/
public boolean lSet(String key, List<Object> value, long time) {
redisTemplate.opsForList().rightPushAll(key, value);
if (time > 0) {
expire(key, time);
}
return true;
}
/**
* 根据索引修改list中的某条数据
*
* @param key 键
* @param index 索引
* @param value 值
* @return
*/
public boolean lUpdateIndex(String key, long index, Object value) {
redisTemplate.opsForList().set(key, index, value);
return true;
}
public Long getAndDeletePatternKeys(String pattern) {
Set<String> keys = redisTemplate.keys(pattern);
if (!CollectionUtils.isEmpty(keys)) {
return redisTemplate.delete(keys);
}
return null;
}
public Set<String> getPatternKeys(String pattern) {
return redisTemplate.keys(pattern);
}
/**
* 获取指定前缀key列表
*
* @return
*/
public Set<String> getKeys(String prefix) {
return redisTemplate.keys(prefix.concat("*"));
}
public Boolean refresh(String token) {
String cacheKey = genKey(new String[]{CacheType.ERASABLE.name(), "SESSION_TOKEN", RequestContext.getProduct(), token});
boolean hasKey = redisTemplate.hasKey(cacheKey);
if (hasKey) {
redisTemplate.expire(cacheKey, DEFAULT_SESSION_EXPIRATION, TimeUnit.SECONDS);
}
return hasKey;
}
public static String genKey(String... keyMembers) {
return StringUtils.join(keyMembers, VAR_SPLITOR).toUpperCase();
}
}
package com.yeejoin.amos.api.householdapi.constant;
import java.util.HashMap;
/**
* 北向-华为常量
*/
public class ImasterConstant {
public static final HashMap<String, String> stationStaus = new HashMap<String, String>() {
{
put("1", "离线");
put("2", "告警");
put("3", "在线");
}
};
public static final HashMap<String, String> alarmstatus = new HashMap<String, String>() {
{
put("1", "未处理");
}
};
public static final HashMap<String, String> alarmLevel = new HashMap<String, String>() {
{
put("1", "严重");
put("2", "重要");
put("3", "次要");
put("4", "提示");
}
};
public static String baseurl ="https://cn.fusionsolar.huawei.com";
public static String account ="ahsjmg-API";
public static String password ="huawei123";
public static String tokenUrl ="/thirdData/login";
public static String requestPOST="POST";
public static String requestGET="GET";
public static String stationListUrl="/thirdData/stations";
public static String stationDetailUrl = "/thirdData/getStationRealKpi";
public static String collectorListUrl = "/thirdData/getDevList";
public static String collectorDetailUrl = "/thirdData/getDevRealKpi";
public static String alarmListUrl = "/thirdData/getAlarmList";
public static String resovleRule_data_page_records = "data";
public static String resovle_rows="rows";
public static int devTypeC=62;
public static int devTypeI=1;
}
...@@ -2,7 +2,10 @@ package com.yeejoin.amos.api.householdapi.controller; ...@@ -2,7 +2,10 @@ package com.yeejoin.amos.api.householdapi.controller;
import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils; import com.yeejoin.amos.api.householdapi.Utils.HouseholdPvUtils;
import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.GoLangDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.service.ImasterDataService;
import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService; import com.yeejoin.amos.api.householdapi.face.service.KSolarDataAcquisitionService;
import com.yeejoin.amos.api.householdapi.face.service.impl.ImasterDataServiceImpl;
import fastjson.JSON;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -31,6 +34,8 @@ public class HouseholdTestController { ...@@ -31,6 +34,8 @@ public class HouseholdTestController {
private GoLangDataAcquisitionService goLangDataAcquisitionService; private GoLangDataAcquisitionService goLangDataAcquisitionService;
@Autowired @Autowired
private KSolarDataAcquisitionService kSolarDataAcquisitionService; private KSolarDataAcquisitionService kSolarDataAcquisitionService;
@Autowired
private ImasterDataService imasterDataService;
/** /**
...@@ -119,4 +124,27 @@ public class HouseholdTestController { ...@@ -119,4 +124,27 @@ public class HouseholdTestController {
// goLangDataAcquisitionService.inverAlramInfo(); // goLangDataAcquisitionService.inverAlramInfo();
} }
/**
* 新增户用光伏-厂商API haders
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/imasterNew")
@ApiOperation(httpMethod = "POST", value = "北向", notes = "北向")
public void imasterNew() throws IOException {
// imasterDataService.stationList();
// imasterDataService.stationDetail();
// imasterDataService.collectorList();
// imasterDataService.inverterList();
imasterDataService.inverterDetail();
// goLangDataAcquisitionService.collectorList();
//// goLangDataAcquisitionService.inverterList();
// goLangDataAcquisitionService.collectorDetail();
// goLangDataAcquisitionService.inverterDetail();
// goLangDataAcquisitionService.inverAlramInfo();
}
} }
package com.yeejoin.amos.api.householdapi.face.dto;
import lombok.Data;
@Data
public class ImasterAlarmDto {
private Integer alarmId;
private Integer alarmType;
private Long raiseTime;
private String stationName;
private Integer lev;
private Integer devTypeId;
private String stationCode;
private String alarmName;
private String alarmCause;
private String devName;
private String repairSuggestion;
private String esnCode;
private Integer status;
}
...@@ -16,7 +16,7 @@ import java.util.Date; ...@@ -16,7 +16,7 @@ import java.util.Date;
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
@TableName("hygf_jp_inverter") @TableName("hygf_jp_inverter")
public class JpInverter implements Serializable { public class JpInverter implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_collector_list", autoResultMap = true)
public class ImasterCollectorList {
private Long createdTime;
private Long id;
private String stationCode;
private String stationName;
private String devName;
private String esnCode;
private Integer devTypeId;
private String softwareVersion;
private String invType;
private Double longitude;
private Double latitude;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_inverter_list", autoResultMap = true)
public class ImasterInverterList {
private Long createdTime;
private Long id;
private String stationCode;
private String stationName;
private String collectorSnCode;
private String devName;
private String esnCode;
private Integer devTypeId;
private String softwareVersion;
private String invType;
private Double longitude;
private Double latitude;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_inverter_list_details", autoResultMap = true)
public class ImasterInverterListDetails {
private Long createdTime;
private String inverterId;
Double pv26_i ;
Double pv2_u ;
Double pv28_i ;
Double pv4_u ;
Double pv22_i ;
Double power_factor ;
Double pv6_u ;
Double mppt_total_cap ;
Double pv24_i ;
Double pv8_u ;
Double open_time ;
Double pv22_u ;
Double a_i ;
Double pv24_u ;
Double mppt_9_cap ;
Double c_i ;
Double pv20_u ;
Double pv19_u ;
Double pv15_u ;
Double reactive_power ;
Double a_u ;
Double pv17_u ;
Double c_u ;
Double mppt_8_cap ;
Double pv20_i ;
Double pv15_i ;
Double efficiency ;
Double pv17_i ;
Double pv11_i ;
Double pv13_i ;
Double pv11_u ;
Double mppt_power ;
Double pv13_u ;
Double run_state ;
Double close_time ;
Double pv19_i ;
Double mppt_7_cap ;
Double mppt_5_cap ;
Double pv27_u ;
Double pv2_i ;
Double active_power ;
Double pv4_i ;
Double pv6_i ;
Double pv8_i ;
Double mppt_6_cap ;
Double pv27_i ;
Double pv1_u ;
Double pv3_u ;
Double pv23_i ;
Double pv5_u ;
Double pv25_i ;
Double pv7_u ;
Double pv23_u ;
Double inverter_state ;
Double pv9_u ;
Double pv25_u ;
Double total_cap ;
Double mppt_3_cap ;
Double b_i ;
Double pv21_u ;
Double mppt_10_cap ;
Double pv16_u ;
Double pv18_u ;
Double temperature ;
Double bc_u ;
Double b_u ;
Double pv21_i ;
Double elec_freq ;
Double mppt_4_cap ;
Double pv16_i ;
Double pv18_i ;
Double day_cap ;
Double pv12_i ;
Double pv14_i ;
Double pv12_u ;
Double mppt_1_cap ;
Double pv14_u ;
Double pv10_u ;
Double pv26_u ;
Double pv1_i ;
Double pv28_u ;
Double pv3_i ;
Double mppt_2_cap ;
Double pv5_i ;
Double ab_u ;
Double ca_u ;
Double pv7_i ;
Double pv10_i ;
Double pv9_i ;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details" ,autoResultMap = true)
public class ImasterStationDetail {
private Long createdTime;
private String stationCode ;
private Double day_power ;
private Double month_power;
private Double total_power;
private Double day_income ;
private Double total_income ;
private Integer real_health_state;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_day" ,autoResultMap = true)
public class ImasterStationDetailsDay {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_month" ,autoResultMap = true)
public class ImasterStationDetailsMonth {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName(value = "imaster_station_details_year" ,autoResultMap = true)
public class ImasterStationDetailsYear {
private Long createdTime;
private String stationCode ;
private Double installedCapacity ;
private Double radiationIntensity;
private Double theoryPower ;
private Double performanceRatio ;
private Double inverterPower ;
private Double ongridPower ;
private Double usePower ;
private Double powerProfit ;
private Double perpowerRatio;
private Double reductionTotalCo2 ;
private Double reductionTotalCoal ;
private Double reductionTotalTree;
}
package com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "imaster_station_list" ,autoResultMap = true)
public class ImasterStationList implements Serializable {
private Long createdTime;
private String latitude;
private String longitude;
private String plantAddress;
private String plantName;
private String plantCode;
private String contactPerson;
private String contactMethod;
private String gridConnectionDate;
private Double capacity;
}
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.ImasterCollectorList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface ImasterCollectorListMapper extends BaseMapper<ImasterCollectorList> {
@Select("select id from imaster_collector_list where esn_code is not null group by id")
List<Long> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterListDetails;
public interface ImasterInverterListDetailsMapper extends BaseMapper<ImasterInverterListDetails> {
}
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.ImasterInverterList;
import org.apache.ibatis.annotations.Select;
import java.util.List;
public interface ImasterInverterListMapper extends BaseMapper<ImasterInverterList> {
@Select("select esn_code from imaster_inverter_list where esn_code is not null group by esn_code")
List<String> getCollectIds();
}
package com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterInverterListDetails;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.ImasterStationDetail;
public interface ImasterStationDetailsMapper extends BaseMapper<ImasterStationDetail> {
}
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.ImasterStationList;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import java.util.List;
public interface ImasterStationMapper extends BaseMapper<ImasterStationList> {
@Select("select * from imaster_station_list")
List<ImasterStationList> getStationInfo();
@Select("select plant_code as plantCode from imaster_station_list group by plant_code")
List<String> getStationIds();
}
package com.yeejoin.amos.api.householdapi.face.service;
public interface ImasterDataService {
/**
* @descrption 场站列表数据入库
*/
void stationList();
/**
* @descrption 场站详情数据入库
*/
void stationDetail();
/**
* @descrption 采集器列表数据入库
*/
void collectorList();
/**
* @descrption 采集器详情数据入库
*/
void collectorDetail();
/**
* @descrption 逆变器列表数据入库
*/
void inverterList();
/**
* @descrption 逆变器详情数据入库
*/
void inverterDetail();
/**
* @descrption 采集器告警列表数据入库
*/
void inverAlramInfo();
}
package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.api.householdapi.Utils.ImasterUtils;
import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import com.yeejoin.amos.api.householdapi.constant.ImasterConstant;
import com.yeejoin.amos.api.householdapi.face.dto.AlarmDto;
import com.yeejoin.amos.api.householdapi.face.dto.CollectorDetailDto;
import com.yeejoin.amos.api.householdapi.face.dto.ImasterAlarmDto;
import com.yeejoin.amos.api.householdapi.face.dto.InverterDetailDto;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpCollector;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverter;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpInverterElectricity;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpStation;
import com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.*;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpCollectorMapper;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpInverterElectricityMapper;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpInverterMapper;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.hygf.JpStationMapper;
import com.yeejoin.amos.api.householdapi.face.orm.mapper.tdengine.*;
import com.yeejoin.amos.api.householdapi.face.service.ImasterDataService;
import com.yeejoin.amos.openapi.enums.PVProducerInfoEnum;
import fastjson.JSON;
import org.apache.commons.lang.time.DateUtils;
import org.joda.time.DateTimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service
public class ImasterDataServiceImpl implements ImasterDataService {
//北向请求工具封装
@Autowired
private ImasterUtils imasterUtils;
//北向mapper
@Autowired
private ImasterStationMapper imasterStationMapper;
//北向mapper
@Autowired
private ImasterCollectorListMapper imasterCollectorListMapper;
//北向mapper
@Autowired
private ImasterInverterListMapper imasterInverterListMapper;
//北向mapper
@Autowired
private ImasterInverterListDetailsMapper imasterInverterListDetailsMapper;
//北向mapper
@Autowired
private ImasterStationDetailsMapper imasterStationDetailsMapper;
//定时任务执行频率 当前为10分钟一次
private final String dataRequstScheduled = "0 0/60 * * * *";
//监盘场站mapper
@Autowired
private JpStationMapper jpStationMapper;
//监盘采集器mapper
@Autowired
private JpCollectorMapper jpCollectorMapper;
//监盘逆变器mapper
@Autowired
private JpInverterMapper jpInverterMapper;
//户用光伏场站历史mapper
@Autowired
private HYGFJPStationPowerHistoryMapper hygfjpStationPowerHistoryMapper;
//户用光伏逆变器历史mapper
@Autowired
private HYGFJPInverterHistoryMapper hygfjpInverterHistoryMapper;
//户用光伏采集器历史mapper
@Autowired
private HYGFJPCollectorHistoryMapper hygfjpCollectorHistoryMapper;
//户用光伏逆变器告警
@Autowired
private HYGFJPInverterWarnMapper hygfjpInverterWarnMapper;
//户用光伏逆变器历史mapper
@Autowired
private HYGFJPInverterElecHistoryMapper hygfjpInverterElecHistoryMapper;
//户用光伏日发电量
@Autowired
private HYGFJPDayPowerMapper hygfjpDayPowerMapper;
//户用光伏日发电量
@Autowired
JpInverterElectricityMapper jpInverterElectricityMapper;
@Scheduled(cron = dataRequstScheduled)
@Override
public void stationList() {
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("pageNo", 1);
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterStationList> result = imasterUtils.getResPonse(ImasterConstant.stationListUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterStationList.class
);
for (int i = 0; i < result.size(); i++) {
ImasterStationList imasterStationList = result.get(i);
imasterStationList.setCreatedTime(System.currentTimeMillis());
imasterStationMapper.insert(imasterStationList);
}
}
@Scheduled(cron = dataRequstScheduled)
@Override
public void stationDetail() {
List<String> stationList = imasterStationMapper.getStationIds();
String today = DateUtil.today();
String hour = new Date().getHours() + ":00";
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationCodes", stationList.stream().collect(Collectors.joining(",")));
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterStationDetail> result = imasterUtils.getResPonseOther(ImasterConstant.stationDetailUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterStationDetail.class
);
// List<ImasterStationDetail> result1 = imasterUtils.getResPonse(ImasterConstant.stationDetailUrl,
// GoLangConstant.requestPost,
// requestParaminfo,
// ImasterConstant.resovleRule_data_page_records,
// ImasterStationDetail.class
// );
// List<ImasterStationDetail> result2 = imasterUtils.getResPonse(ImasterConstant.stationDetailUrl,
// GoLangConstant.requestPost,
// requestParaminfo,
// ImasterConstant.resovleRule_data_page_records,
// ImasterStationDetail.class
// );
// List<ImasterStationDetail> result3 = imasterUtils.getResPonse(ImasterConstant.stationDetailUrl,
// GoLangConstant.requestPost,
// requestParaminfo,
// ImasterConstant.resovleRule_data_page_records,
// ImasterStationDetail.class
// );
for (int j = 0; j < result.size(); j++) {
QueryWrapper<ImasterStationList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("plant_code", result.get(j).getStationCode());
queryWrapper.orderByDesc("created_time");
List<ImasterStationList> imasterStationListAll = imasterStationMapper.selectList(queryWrapper);
ImasterStationList imasterStationList = imasterStationListAll.get(0);
ImasterStationDetail imasterStationDetail = result.get(j);
imasterStationDetail.setStationCode(imasterStationList.getPlantCode());
imasterStationDetail.setCreatedTime(System.currentTimeMillis());
imasterStationDetailsMapper.insert(imasterStationDetail);
JpStation jpStation = jpStationMapper.selectOne(new QueryWrapper<JpStation>().
eq("third_code", PVProducerInfoEnum.HUAWEI.getCode()).
eq("third_station_id", imasterStationList.getPlantCode()));
//给户用光伏存储的数据赋值
if (ObjectUtils.isEmpty(jpStation)) {
jpStation = new JpStation();
}
// jpStation.setSnCode(imasterStationDetail.getNmicode());
jpStation.setCapacity(Double.valueOf(imasterStationList.getCapacity()));
jpStation.setName(imasterStationList.getPlantName());
// jpStation.setPrice(Double.valueOf(imasterStationDetail.getPrice()));
jpStation.setAddress(imasterStationList.getPlantAddress());
jpStation.setLongitude(imasterStationList.getLongitude());
jpStation.setLatitude(imasterStationList.getLatitude());
// jpStation.setUserName(imasterStationDetail.getUsername());
// jpStation.setUserPhone(String.valueOf(imasterStationDetail.getUsermobile()));
jpStation.setStationContact(imasterStationList.getContactPerson());
// jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(imasterStationDetail.getModule()))?0:Math.toIntExact(imasterStationDetail.getModule()));
//并网类型
// jpStation.setState(ImasterConstant.stationStaus.get(String.valueOf(imasterStationDetail.getRealHealthState())));
jpStation.setThirdStationId(imasterStationList.getPlantCode());
jpStation.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
// jpStation.setRealTimePower(imasterStationDetail.getPower());
// jpStation.setOnGridType(GoLangConstant.intoNetWorkStatus.get(String.valueOf(imasterStationDetail.getStationtypenew())));
jpStation.setDayGenerate(imasterStationDetail.getDay_power());
jpStation.setMonthGenerate(imasterStationDetail.getMonth_power());
// jpStation.setMonthGenerate(imasterStationDetail.getMonthPower());
// jpStation.setYearGenerate(imasterStationDetail.getYearenergy());
jpStation.setAccumulatedPower(imasterStationDetail.getTotal_power());
jpStation.setDayIncome(imasterStationDetail.getDay_income());
jpStation.setCumulativeIncome(imasterStationDetail.getTotal_income());
jpStation.setState(ImasterConstant.stationStaus.get(String.valueOf(imasterStationDetail.getReal_health_state())));
// jpStation.setDayIncome(imasterStationDetail.getDayIncome());
// jpStation.setMonthIncome(imasterStationDetail.getMonthincome());
// jpStation.setYearIncome(imasterStationDetail.getYearincome());
// jpStation.setCumulativeIncome(imasterStationDetail.getTotalIncome());
// jpStation.setArea(imasterStationDetail.getRegionstr());
// jpStation.setEmail(imasterStationDetail.getUseremail());
// jpStation.setOnGridTime(new Date(imasterStationDetail.getFispowertime()));
// jpStation.setAccessTime(new Date(imasterStationDetail.getFisgeneratetime()));
// jpStation.setCreateTime(new Date(imasterStationDetail.getCreatedate()));
// jpStation.setRatedPower(Double.valueOf(imasterStationDetail.getInverterpower()));
if (!ObjectUtils.isEmpty(jpStation.getSequenceNbr())) {
jpStationMapper.updateById(jpStation);
} else {
jpStationMapper.insert(jpStation);
}
HYGFJPStationPowerHistory hygfjpStationPowerHistory = new HYGFJPStationPowerHistory();
hygfjpStationPowerHistory.setCreatedTime(System.currentTimeMillis());
hygfjpStationPowerHistory.setThirdStationId(jpStation.getThirdStationId());
// hygfjpStationPowerHistory.setPower(imasterStationDetail.getPower());
hygfjpStationPowerHistory.setThirdCode(jpStation.getThirdCode());
hygfjpStationPowerHistory.setTime(System.currentTimeMillis());
hygfjpStationPowerHistoryMapper.insert(hygfjpStationPowerHistory);
HYGFJPDayPower hygfjpDayPower = hygfjpDayPowerMapper.selectOne(
new QueryWrapper<HYGFJPDayPower>().
eq("tation_id", imasterStationList.getPlantCode()).
eq("year_month_day", today).
eq("hour", hour)
);
if (ObjectUtils.isEmpty(hygfjpDayPower)) {
hygfjpDayPower = new HYGFJPDayPower();
}
hygfjpDayPower.setTationId(imasterStationList.getPlantCode());
hygfjpDayPower.setHour(hour);
hygfjpDayPower.setYearMonthDay(today);
// hygfjpDayPower.setPower(imasterStationDetail.getPower());
if (ObjectUtils.isEmpty(hygfjpDayPower.getCreatedTime())) {
hygfjpDayPower.setCreatedTime(System.currentTimeMillis());
hygfjpDayPowerMapper.insert(hygfjpDayPower);
} else {
hygfjpDayPowerMapper.insert(hygfjpDayPower);
}
}
}
@Scheduled(cron = dataRequstScheduled)
@Override
public void collectorList() {
List<String> stationIds = imasterStationMapper.getStationIds();
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationCodes", stationIds.stream().collect(Collectors.joining(",")));
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterCollectorList> result = imasterUtils.getResPonse(ImasterConstant.collectorListUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterCollectorList.class
);
for (int j = 0; j < result.size(); j++) {
QueryWrapper<ImasterStationList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("plant_code", result.get(j).getStationCode());
queryWrapper.orderByDesc("created_time");
List<ImasterStationList> imasterStationListAll = imasterStationMapper.selectList(queryWrapper);
ImasterStationList imasterStationList = imasterStationListAll.get(0);
ImasterCollectorList imasterCollectorList = result.get(j);
imasterCollectorList.setStationName(imasterStationList.getPlantName());
imasterCollectorList.setCreatedTime(System.currentTimeMillis());
if(imasterCollectorList.getDevTypeId() == ImasterConstant.devTypeC) {
imasterCollectorListMapper.insert(imasterCollectorList);
JpCollector jpCollector = jpCollectorMapper.selectOne(new QueryWrapper<JpCollector>().
eq("third_station_id", imasterCollectorList.getStationCode()).
eq("third_code", PVProducerInfoEnum.HUAWEI.getCode()).
eq("sn_code", imasterCollectorList.getEsnCode()));
if (ObjectUtils.isEmpty(jpCollector)) {
jpCollector = new JpCollector();
}
//sn编码
jpCollector.setSnCode(imasterCollectorList.getEsnCode());
//类型
// jpCollector.setType(collectorDetailDto.getModel());
//更新时间
jpCollector.setUpdateTime(new Date());
//出场日期
// jpCollector.setDischargeDate(new Date(collectorDetailDto.getFactoryTime()));
// //生产日期
// jpCollector.setProductDate(new Date(collectorDetailDto.getFactoryTime()));
// //数据上传间隔
// jpCollector.setDataPeriod(collectorDetailDto.getDataUploadCycle());
// //本次上电时间
// jpCollector.setThisWorkTime(new DateTime(collectorDetailDto.getCurrentWorkingTime()));
// //累计工作时间
// jpCollector.setTotalWorkTime(new DateTime(collectorDetailDto.getTotalWorkingTime()));
//第三方电站id
jpCollector.setThirdStationId(imasterCollectorList.getStationCode());
//第三方厂商标识
jpCollector.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
//第三方厂商标识
// jpCollector.setState(GoLangConstant.stationStaus.get(collectorDetailDto.getState()));
jpCollector.setStationName(imasterStationList.getPlantName());
jpCollector.setVersion(imasterCollectorList.getSoftwareVersion());
// jpCollector.setAddr(collectorDetailDto.getAddr());
// jpCollector.setName(collectorDetailDto.getName());
if (ObjectUtils.isEmpty(jpCollector.getSequenceNbr())) {
jpCollectorMapper.insert(jpCollector);
} else {
jpCollectorMapper.updateById(jpCollector);
}
// td-collector-history
HYGFJPCollectorHistory hygfjpCollectorHistory = new HYGFJPCollectorHistory();
hygfjpCollectorHistory.setTime(System.currentTimeMillis());
hygfjpCollectorHistory.setCreatedTime(System.currentTimeMillis());
hygfjpCollectorHistory.setSnCode(imasterCollectorList.getEsnCode());
// hygfjpCollectorHistory.setSignalStrength(Double.valueOf(collectorDetailDto.getRssiLevel()));
hygfjpCollectorHistory.setThirdStationId(imasterCollectorList.getStationCode());
hygfjpCollectorHistory.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfjpCollectorHistoryMapper.insert(hygfjpCollectorHistory);
}
}
}
@Override
public void collectorDetail() {
}
@Scheduled(cron = dataRequstScheduled)
@Override
public void inverterList() {
List<String> stationIds = imasterStationMapper.getStationIds();
for (int i = 0; i < stationIds.size(); i++) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("stationCodes", stationIds.stream().collect(Collectors.joining(",")));
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterInverterList> result = imasterUtils.getResPonse(ImasterConstant.collectorListUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterInverterList.class
);
for (int j = 0; j < result.size(); j++) {
QueryWrapper<ImasterStationList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("plant_code", result.get(j).getStationCode());
queryWrapper.orderByDesc("created_time");
List<ImasterStationList> imasterStationListAll = imasterStationMapper.selectList(queryWrapper);
ImasterStationList imasterStationList = imasterStationListAll.get(0);
ImasterInverterList imasterInverterList = result.get(j);
imasterInverterList.setStationName(imasterStationList.getPlantName());
imasterInverterList.setCreatedTime(System.currentTimeMillis());
if(imasterInverterList.getDevTypeId() == ImasterConstant.devTypeI) {
imasterInverterListMapper.insert(imasterInverterList);
}
}
}
}
@Scheduled(cron = dataRequstScheduled)
@Override
public void inverterDetail() {
List<String> inverterSns = imasterInverterListMapper.getCollectIds();
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
String collect = inverterSns.stream().collect(Collectors.joining(","));
requestInfo.put("sns", collect);
requestInfo.put("devTypeId", 1);
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterInverterListDetails> result = imasterUtils.getResPonseOther(ImasterConstant.collectorDetailUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterInverterListDetails.class
);
for (int j = 0; j < result.size(); j++) {
ImasterInverterListDetails inverterDetailDto = result.get(j);
inverterDetailDto.setCreatedTime((System.currentTimeMillis()));
imasterInverterListDetailsMapper.insert(result.get(j));
QueryWrapper<ImasterInverterList> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("esn_code", result.get(j).getInverterId());
queryWrapper.orderByDesc("created_time");
List<ImasterInverterList> imasterInverterLists = imasterInverterListMapper.selectList(queryWrapper);
ImasterInverterList imasterInverterList = imasterInverterLists.get(0);
QueryWrapper<ImasterCollectorList> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("dev_name", imasterInverterList.getDevName());
queryWrapper1.orderByDesc("created_time");
List<ImasterCollectorList> collectorLists = imasterCollectorListMapper.selectList(queryWrapper1);
ImasterCollectorList collectorList = collectorLists.get(0);
JpInverter jpInverter = jpInverterMapper.selectOne(new QueryWrapper<JpInverter>().
eq("third_station_id", imasterInverterList.getStationCode()).
eq("third_code", PVProducerInfoEnum.HUAWEI.getCode()).
eq("sn_code", imasterInverterList.getEsnCode()));
if (ObjectUtils.isEmpty(jpInverter)) {
jpInverter = new JpInverter();
}
jpInverter.setSnCode(imasterInverterList.getEsnCode());
jpInverter.setCollectorSnCode(collectorList.getEsnCode());
jpInverter.setCollectorId(String.valueOf(collectorList.getId()));
jpInverter.setDayPowerGeneration(inverterDetailDto.getDay_cap());
// jpInverter.setState(GoLangConstant.stationStaus.get(inverterDetailDto.getCurrentState()));
// jpInverter.setCollectorId(inverterDetailDto.getCollectorId());
// jpInverter.setCollectorSnCode(inverterDetailDto.getCollectorsn());
jpInverter.setUpdateTime(new Date());
// jpInverter.setCurrentPower(inverterDetailDto.getPac());
// jpInverter.setDayPowerGeneration(inverterDetailDto.getEToday());
// jpInverter.setMonthPowerGeneration(inverterDetailDto.getEMonth() * GoLangConstant.mwhTokwh);
// jpInverter.setYearPowerGeneration(inverterDetailDto.getEYear() * GoLangConstant.mwhTokwh);
// jpInverter.setTotalPowerGeneration(inverterDetailDto.getETotal() * GoLangConstant.mwhTokwh);
// jpInverter.setBrand(inverterDetailDto.getName());
// jpInverter.setModel(inverterDetailDto.getProductModel());
// jpInverter.setNationalStandard(inverterDetailDto.getNationalStandards());
jpInverter.setVersion(imasterInverterList.getSoftwareVersion());
// jpInverter.setGenerationHours(String.valueOf(inverterDetailDto.getFullHour()));
jpInverter.setId(imasterInverterList.getId());
// jpInverter.setCapacity(inverterDetailDto.getPower().intValue());
jpInverter.setThirdStationId(String.valueOf(imasterInverterList.getStationCode()));
jpInverter.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverter.setStationName(imasterInverterList.getStationName());
if (!ObjectUtils.isEmpty(jpInverter.getSequenceNbr())) {
jpInverterMapper.updateById(jpInverter);
} else {
jpInverterMapper.insert(jpInverter);
}
String jsonString = JSON.toJSONString(inverterDetailDto);
Map<String, Object> hanlderResult = JSON.parseObject(jsonString, Map.class);
JpInverterElectricity jpInverterElectricityR = jpInverterElectricityMapper.selectOne(new QueryWrapper<JpInverterElectricity>().
eq("sn_code", imasterInverterList.getEsnCode()).
eq("type", "交流").
eq("name", "A")
);
if (ObjectUtils.isEmpty(jpInverterElectricityR)) {
jpInverterElectricityR = new JpInverterElectricity();
}
jpInverterElectricityR.setInverterId(String.valueOf(imasterInverterList.getId()));
jpInverterElectricityR.setSnCode(imasterInverterList.getEsnCode());
jpInverterElectricityR.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverterElectricityR.setThirdStationId(imasterInverterList.getStationCode());
jpInverterElectricityR.setType("交流");
jpInverterElectricityR.setName("A");
jpInverterElectricityR.setVoltage(inverterDetailDto.getA_u());
jpInverterElectricityR.setCurrent(inverterDetailDto.getA_i());
if (ObjectUtils.isEmpty(jpInverterElectricityR.getSequenceNbr())) {
jpInverterElectricityMapper.insert(jpInverterElectricityR);
} else {
jpInverterElectricityMapper.updateById(jpInverterElectricityR);
}
JpInverterElectricity jpInverterElectricityB = jpInverterElectricityMapper.selectOne(new QueryWrapper<JpInverterElectricity>().
eq("sn_code", imasterInverterList.getEsnCode()).
eq("type", "交流").
eq("name", "B")
);
if (ObjectUtils.isEmpty(jpInverterElectricityB)) {
jpInverterElectricityB = new JpInverterElectricity();
}
jpInverterElectricityB.setInverterId(String.valueOf(imasterInverterList.getId()));
jpInverterElectricityB.setSnCode(imasterInverterList.getEsnCode());
jpInverterElectricityB.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverterElectricityB.setThirdStationId(imasterInverterList.getStationCode());
jpInverterElectricityB.setType("交流");
jpInverterElectricityB.setName("B");
jpInverterElectricityB.setVoltage(inverterDetailDto.getB_u());
jpInverterElectricityB.setCurrent(inverterDetailDto.getB_i());
if (ObjectUtils.isEmpty(jpInverterElectricityB.getSequenceNbr())) {
jpInverterElectricityMapper.insert(jpInverterElectricityB);
} else {
jpInverterElectricityMapper.updateById(jpInverterElectricityB);
}
JpInverterElectricity jpInverterElectricityC = jpInverterElectricityMapper.selectOne(new QueryWrapper<JpInverterElectricity>().
eq("sn_code", imasterInverterList.getEsnCode()).
eq("type", "交流").
eq("name", "C")
);
if (ObjectUtils.isEmpty(jpInverterElectricityC)) {
jpInverterElectricityC = new JpInverterElectricity();
}
jpInverterElectricityC.setInverterId(String.valueOf(imasterInverterList.getId()));
jpInverterElectricityC.setSnCode(imasterInverterList.getEsnCode());
jpInverterElectricityC.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverterElectricityC.setThirdStationId(imasterInverterList.getStationCode());
jpInverterElectricityC.setType("交流");
jpInverterElectricityC.setName("C");
jpInverterElectricityC.setVoltage(inverterDetailDto.getC_u());
jpInverterElectricityC.setCurrent(inverterDetailDto.getC_i());
if (ObjectUtils.isEmpty(jpInverterElectricityC.getSequenceNbr())) {
jpInverterElectricityMapper.insert(jpInverterElectricityC);
} else {
jpInverterElectricityMapper.updateById(jpInverterElectricityC);
}
for (int k1 = 1; k1 < 29; k1++) {
JpInverterElectricity jpInverterElectricity = jpInverterElectricityMapper.selectOne(new QueryWrapper<JpInverterElectricity>().
eq("sn_code", imasterInverterList.getEsnCode()).
eq("type", "直流").
eq("name", "PV" + k1)
);
if (ObjectUtils.isEmpty(jpInverterElectricity)) {
jpInverterElectricity = new JpInverterElectricity();
}
jpInverterElectricity.setInverterId(String.valueOf(imasterInverterList.getId()));
jpInverterElectricity.setSnCode(imasterInverterList.getEsnCode());
jpInverterElectricity.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
jpInverterElectricity.setThirdStationId(String.valueOf(imasterInverterList.getStationCode()));
jpInverterElectricity.setType("直流");
jpInverterElectricity.setName("PV" + k1);
jpInverterElectricity.setVoltage(Double.valueOf(hanlderResult.get("pv" + k1 + "_u").toString()));
jpInverterElectricity.setCurrent(Double.valueOf(hanlderResult.get("pv" + k1 + "_i").toString()));
// jpInverterElectricity.setPower(Double.valueOf(hanlderResult.get("pow" + k1).toString()));
if (ObjectUtils.isEmpty(jpInverterElectricity.getSequenceNbr())) {
jpInverterElectricityMapper.insert(jpInverterElectricity);
} else {
jpInverterElectricityMapper.updateById(jpInverterElectricity);
}
}
HYGFJPInverterElecHistory hygfjpInverterElecHistory = new HYGFJPInverterElecHistory();
hygfjpInverterElecHistory.setThirdStationId(String.valueOf(imasterInverterList.getStationCode()));
hygfjpInverterElecHistory.setCreatedTime(System.currentTimeMillis());
hygfjpInverterElecHistory.setSnCode(imasterInverterList.getEsnCode());
hygfjpInverterElecHistory.setUAcCurrent(inverterDetailDto.getA_i());
hygfjpInverterElecHistory.setVAcCurrent(inverterDetailDto.getB_i());
hygfjpInverterElecHistory.setWAcCurrent(inverterDetailDto.getC_i());
hygfjpInverterElecHistory.setUAcVoltage(inverterDetailDto.getA_u());
hygfjpInverterElecHistory.setVAcVoltage(inverterDetailDto.getB_u());
hygfjpInverterElecHistory.setWAcVoltage(inverterDetailDto.getC_u());
hygfjpInverterElecHistory.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfjpInverterElecHistory.setTime(System.currentTimeMillis());
hygfjpInverterElecHistoryMapper.insert(hygfjpInverterElecHistory);
// 逆变器历史
String today = DateUtil.today();
HYGFJPInverterHistory hygfjpInverterHistory = hygfjpInverterHistoryMapper.selectOne(new QueryWrapper<HYGFJPInverterHistory>().eq("sn_code", imasterInverterList.getEsnCode()).eq("date", today));
if (ObjectUtils.isEmpty(hygfjpInverterHistory)) {
hygfjpInverterHistory = new HYGFJPInverterHistory();
}
hygfjpInverterHistory.setDate(today);
hygfjpInverterHistory.setThirdStationId(String.valueOf(imasterInverterList.getStationCode()));
hygfjpInverterHistory.setInverterId(String.valueOf(imasterInverterList.getId()));
hygfjpInverterHistory.setSnCode(imasterInverterList.getEsnCode());
hygfjpInverterHistory.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
// hygfjpInverterHistory.setGenerationHours(inverterDetailDto.getFullHour());
// hygfjpInverterHistory.setPowerGeneration(inverterDetailDto.getEToday());
if (ObjectUtils.isEmpty(hygfjpInverterHistory.getCreatedTime())) {
hygfjpInverterHistory.setCreatedTime(System.currentTimeMillis());
hygfjpInverterHistoryMapper.insert(hygfjpInverterHistory);
} else {
hygfjpInverterHistoryMapper.insert(hygfjpInverterHistory);
}
}
}
@Scheduled(cron = dataRequstScheduled)
@Override
public void inverAlramInfo() {
List<String> inverterSns = imasterInverterListMapper.getCollectIds();
for (int i = 0; i < inverterSns.size(); i++) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
HashMap<String, Object> requestInfo = new HashMap<>();
requestInfo.put("sns", inverterSns.stream().collect(Collectors.joining(",")));
requestInfo.put("language", "zh_CN ");
requestInfo.put("devTypes", 1);
requestInfo.put("beginTime", DateUtil.today());
requestInfo.put("endTime", DateUtil.today());
String requestParaminfo = JSON.toJSONString(requestInfo);
List<ImasterAlarmDto> result = imasterUtils.getResPonse(ImasterConstant.alarmListUrl,
GoLangConstant.requestPost,
requestParaminfo,
ImasterConstant.resovleRule_data_page_records,
ImasterAlarmDto.class
);
for (int j = 0; j < result.size(); j++) {
ImasterAlarmDto alarmDto = result.get(j);
if (!ObjectUtils.isEmpty(alarmDto.getEsnCode())) {
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper.selectOne(new QueryWrapper<HYGFJPInverterWarn>()
.eq("sn_code", alarmDto.getEsnCode())
.eq("start_time", alarmDto.getRaiseTime())
.eq("third_station_id", String.valueOf(alarmDto.getStationCode()))
);
if (ObjectUtils.isEmpty(hygfjpInverterWarn)) {
hygfjpInverterWarn = new HYGFJPInverterWarn();
}
hygfjpInverterWarn.setTime(System.currentTimeMillis());
hygfjpInverterWarn.setTimeLong(System.currentTimeMillis());
hygfjpInverterWarn.setSnCode(alarmDto.getEsnCode());
hygfjpInverterWarn.setThirdStationId(String.valueOf(alarmDto.getStationCode()));
hygfjpInverterWarn.setLevel(ImasterConstant.alarmLevel.get(alarmDto.getLev().toString()));
hygfjpInverterWarn.setContent(alarmDto.getAlarmName());
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfjpInverterWarn.setTreatment(alarmDto.getDevName());
hygfjpInverterWarn.setStartTime(alarmDto.getRaiseTime());
hygfjpInverterWarn.setState(ImasterConstant.alarmstatus.get(alarmDto.getStatus().toString()));
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
hygfjpInverterWarnMapper.insert(hygfjpInverterWarn);
} else {
hygfjpInverterWarnMapper.insert(hygfjpInverterWarn);
}
}
}
}
}
}
...@@ -69,6 +69,11 @@ ...@@ -69,6 +69,11 @@
<artifactId>tablesaw-json</artifactId> <artifactId>tablesaw-json</artifactId>
<version>0.43.1</version> <version>0.43.1</version>
</dependency> </dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-privilege</artifactId>
<version>1.9.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -23,6 +24,9 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper; ...@@ -23,6 +24,9 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper; import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
...@@ -36,6 +40,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -36,6 +40,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
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 java.io.UnsupportedEncodingException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -73,13 +78,16 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -73,13 +78,16 @@ public class BigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘") @ApiOperation(httpMethod = "GET", value = "场站设备健康状态指数与趋势 - 仪表盘", notes = "场站设备健康状态指数与趋势 - 仪表盘")
@GetMapping(value = "/getHealthScoreInfo") @GetMapping(value = "/getHealthScoreInfo")
public ResponseModel<Map<String, BigDecimal>> getHealthScoreInfo(@RequestParam(required = false) String areaCode, @RequestParam(required = false) String stationCode) { public ResponseModel<Map<String, BigDecimal>> getHealthScoreInfo(@RequestParam(required = false) String areaCode,
@RequestParam(required = false) String stationCode,
if (StrUtil.isNotEmpty(stationCode)) { @RequestParam (required = false) String tableName) {
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
if (CharSequenceUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getStationName(); stationCode = stationBasic.getFanGatewayId();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfoByStation(stationCode, tableName));
return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
HashMap<String, BigDecimal> stringBigDecimalHashMap = new HashMap<>();
stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode)); stringBigDecimalHashMap.put("value", idxBizFanHealthIndexMapper.getHealthScoreInfo(areaCode, stationCode));
return ResponseHelper.buildResponse(stringBigDecimalHashMap); return ResponseHelper.buildResponse(stringBigDecimalHashMap);
} }
...@@ -92,7 +100,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -92,7 +100,7 @@ public class BigScreenAnalyseController extends BaseController {
if (StrUtil.isNotEmpty(stationCode)) { if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getStationName(); stationCode = stationBasic.getFanGatewayId();
} }
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
...@@ -112,11 +120,10 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -112,11 +120,10 @@ public class BigScreenAnalyseController extends BaseController {
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各片区设备预警情况(条) ", notes = "全域各片区设备预警情况(条) ") @ApiOperation(httpMethod = "GET", value = "全域各片区设备预警情况(条) ", notes = "全域各片区设备预警情况(条) ")
@GetMapping(value = "/getAllEquipAlarmInfo") @GetMapping(value = "/getAllEquipAlarmInfo")
public ResponseModel<Map<String, Object>> getAllEquipAlarmInfo(@RequestParam(required = false) String tableName) { public ResponseModel<Map<String, Object>> getAllEquipAlarmInfo(@RequestParam(required = false) String tableName) throws Exception {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfo(tableName); List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfo(tableName);
HashMap<String, Integer> wxMap = new HashMap<>(); HashMap<String, Integer> wxMap = new HashMap<>();
...@@ -135,10 +142,29 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -135,10 +142,29 @@ public class BigScreenAnalyseController extends BaseController {
List<Integer> zyList = new ArrayList<>(); List<Integer> zyList = new ArrayList<>();
List<Integer> jgList = new ArrayList<>(); List<Integer> jgList = new ArrayList<>();
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
FeignClientResult<List<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("AREA");
List<CompanyModel> companyModels = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
companyModels = listFeignClientResult.getResult();
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
List<String> collect = companyModels.stream().map(t -> t.getCompanyName()).collect(Collectors.toList());
if ("idx_biz_fan_warning_record".equals(tableName)) { if ("idx_biz_fan_warning_record".equals(tableName)) {
list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区"); list = collect;
// list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
} else { } else {
list = Arrays.asList("华北片区", "东北片区", "华东片区", "华南片区", "西南片区", "西北片区", "华中片区"); list = collect;
Collections.reverse(list);
// list = Arrays.asList("华北片区", "东北片区", "华东片区", "华南片区", "西南片区", "西北片区", "华中片区");
} }
list.forEach(item -> { list.forEach(item -> {
wxList.add(wxMap.getOrDefault(item, 0)); wxList.add(wxMap.getOrDefault(item, 0));
...@@ -166,11 +192,26 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -166,11 +192,26 @@ public class BigScreenAnalyseController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "全域各片区设备健康状态指数 ", notes = "全域各片区设备健康状态指数 ") @ApiOperation(httpMethod = "GET", value = "全域各片区设备健康状态指数 ", notes = "全域各片区设备健康状态指数 ")
@GetMapping(value = "/getHealthInfoByArea") @GetMapping(value = "/getHealthInfoByArea")
public ResponseModel<Map<String, Object>> getHealthInfoByArea() { public ResponseModel<Map<String, Object>> getHealthInfoByArea() throws Exception {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea(); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoByArea();
Map<String, BigDecimal> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> new BigDecimal(t.get("healthIndex").toString()))); Map<String, BigDecimal> collect = healthListInfo.stream().collect(Collectors.toMap(t -> t.get("area").toString(), t -> new BigDecimal(t.get("healthIndex").toString())));
List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区"); // List<String> list = Arrays.asList("华中片区", "西北片区", "西南片区", "华南片区", "华东片区", "东北片区", "华北片区");
List<String> list = new ArrayList<>();
FeignClientResult<List<CompanyModel>> listFeignClientResult = Privilege.companyClient.queryAgencyList("AREA");
List<CompanyModel> companyModels = new ArrayList<>();
if (!ObjectUtils.isEmpty(listFeignClientResult)) {
if (listFeignClientResult.getStatus() == 200) {
companyModels = listFeignClientResult.getResult();
} else {
throw new RuntimeException(listFeignClientResult.getMessage());
}
}
list = companyModels.stream().map(CompanyModel::getCompanyName).collect(Collectors.toList());
List<Object> seriesData = new ArrayList<>(); List<Object> seriesData = new ArrayList<>();
list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100")))); list.forEach(item -> seriesData.add(collect.getOrDefault(item, new BigDecimal("100"))));
resultMap.put("axisData", list); resultMap.put("axisData", list);
...@@ -282,7 +323,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -282,7 +323,7 @@ public class BigScreenAnalyseController extends BaseController {
public ResponseModel<Map<String, Object>> assessIndexRadarMap(@RequestParam(required = false, value = "stationCode") String stationCode) { public ResponseModel<Map<String, Object>> assessIndexRadarMap(@RequestParam(required = false, value = "stationCode") String stationCode) {
if (StrUtil.isNotEmpty(stationCode)) { if (StrUtil.isNotEmpty(stationCode)) {
StationBasic stationBasic = stationBasicMapper.selectById(stationCode); StationBasic stationBasic = stationBasicMapper.selectById(stationCode);
stationCode = stationBasic.getBoosterGatewayId(); stationCode = stationBasic.getFanGatewayId();
} }
List<Map<String, Object>> list = idxBizFanHealthIndexMapper.equipWarningRadarMap(stationCode); List<Map<String, Object>> list = idxBizFanHealthIndexMapper.equipWarningRadarMap(stationCode);
Map<String, Integer> warningNumMap = list.stream().collect(Collectors.toMap(t -> t.get("warningName").toString(), t -> Integer.parseInt(t.get("num").toString()))); Map<String, Integer> warningNumMap = list.stream().collect(Collectors.toMap(t -> t.get("warningName").toString(), t -> Integer.parseInt(t.get("num").toString())));
...@@ -400,12 +441,18 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -400,12 +441,18 @@ public class BigScreenAnalyseController extends BaseController {
item.put("warningName", idxBizFanHealthLevel.getHealthLevel()); item.put("warningName", idxBizFanHealthLevel.getHealthLevel());
} }
item.put("healthIndex", equipmentHealthScore); item.put("healthIndex", equipmentHealthScore);
String equipmentName = CharSequenceUtil.replace(item.get("equipmentName").toString(), "集电Ⅳ线#", ""); // String equipmentName = CharSequenceUtil.replace(item.get("equipmentName").toString(), "集电Ⅳ线#", "");
String replace = CharSequenceUtil.replace(equipmentName, "集电Ⅲ线#", ""); // String replace = CharSequenceUtil.replace(equipmentName, "集电Ⅲ线#", "");
String replace1 = CharSequenceUtil.replace(replace, "集电Ⅱ线#", ""); // String replace1 = CharSequenceUtil.replace(replace, "集电Ⅱ线#", "");
String replace2 = CharSequenceUtil.replace(replace1, "集电Ⅰ线#", ""); // String replace2 = CharSequenceUtil.replace(replace1, "集电Ⅰ线#", "");
String replace3 = CharSequenceUtil.replace(replace2, "风机系统", ""); // String replace3 = CharSequenceUtil.replace(replace2, "风机", "");
item.put("equipmentNameSimple", replace3);
String equipmentName = item.get("equipmentName").toString();
String str1 = equipmentName.substring(0, equipmentName.indexOf("#"));
String str2 = equipmentName.substring(str1.length()+1, equipmentName.length());
String str3 = CharSequenceUtil.replace(str2, "风机", "");
item.put("equipmentNameSimple", str3);
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
...@@ -448,8 +495,8 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -448,8 +495,8 @@ public class BigScreenAnalyseController extends BaseController {
@ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表") @ApiOperation(value = "该子系统各指标预警 - 风站中间 下方列表")
@GetMapping("/getSubSystemPointInfo") @GetMapping("/getSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(@RequestParam(value = "subSystem", required = false) String subSystem, public ResponseModel<Page<Map<String, Object>>> getSubSystemPointInfo(@RequestParam(value = "subSystem", required = false) String subSystem,
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException {
subSystem = java.net.URLDecoder.decode(subSystem,"UTF-8");
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
...@@ -464,7 +511,7 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -464,7 +511,7 @@ public class BigScreenAnalyseController extends BaseController {
} else { } else {
LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IdxBizFanHealthLevel> query = new LambdaQueryWrapper<>();
query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备"); query.eq(IdxBizFanHealthLevel::getAnalysisObjType, "设备");
query.eq(IdxBizFanHealthLevel::getStatus, stationBasic.getStationName()); query.eq(IdxBizFanHealthLevel::getStatus, item.get("station"));
query.le(IdxBizFanHealthLevel::getGroupLowerLimit, equipmentHealthScore); query.le(IdxBizFanHealthLevel::getGroupLowerLimit, equipmentHealthScore);
query.ge(IdxBizFanHealthLevel::getGroupUpperLimit, equipmentHealthScore); query.ge(IdxBizFanHealthLevel::getGroupUpperLimit, equipmentHealthScore);
IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query); IdxBizFanHealthLevel idxBizFanHealthLevel = idxBizFanHealthLevelMapper.selectOne(query);
...@@ -509,6 +556,8 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -509,6 +556,8 @@ public class BigScreenAnalyseController extends BaseController {
item.put("warningName", idxBizFanHealthLevel.getHealthLevel()); item.put("warningName", idxBizFanHealthLevel.getHealthLevel());
} }
item.put("healthIndex", equipmentHealthScore); item.put("healthIndex", equipmentHealthScore);
String subarray = CharSequenceUtil.replace(item.get("subarray").toString(), "#", "");
item.put("subarray", subarray);
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
...@@ -551,8 +600,8 @@ public class BigScreenAnalyseController extends BaseController { ...@@ -551,8 +600,8 @@ public class BigScreenAnalyseController extends BaseController {
@ApiOperation(value = "光伏 该装备下各指标预警 - 风站中间 下方列表") @ApiOperation(value = "光伏 该装备下各指标预警 - 风站中间 下方列表")
@GetMapping("/getPvSubSystemPointInfo") @GetMapping("/getPvSubSystemPointInfo")
public ResponseModel<Page<Map<String, Object>>> getPvSubSystemPointInfo(@RequestParam(value = "equipmentName", required = false) String equipmentName, public ResponseModel<Page<Map<String, Object>>> getPvSubSystemPointInfo(@RequestParam(value = "equipmentName", required = false) String equipmentName,
@RequestParam(value = "stationId", required = false) String stationId) { @RequestParam(value = "stationId", required = false) String stationId) throws UnsupportedEncodingException {
equipmentName = java.net.URLDecoder.decode(equipmentName,"UTF-8");
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId()); List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
......
...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn ...@@ -20,6 +20,9 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); BigDecimal getHealthScoreInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
BigDecimal getHealthScoreInfoByStation(@Param("stationCode") String stationCode, @Param("tableName") String tableName);
List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode); List<Map<String, Object>> getHealthListInfo(@Param("areaCode") String areaCode, @Param("stationCode") String stationCode);
List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName); List<Map<String, Object>> getAllEquipAlarmInfo(@Param("tableName") String tableName);
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
AND ANALYSIS_OBJ_TYPE = '片区' AND ANALYSIS_OBJ_TYPE = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode} AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站' AND ANALYSIS_OBJ_TYPE = '场站'
</if> </if>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
AND ANALYSIS_OBJ_TYPE = '片区' AND ANALYSIS_OBJ_TYPE = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode} AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站' AND ANALYSIS_OBJ_TYPE = '场站'
</if> </if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"> <if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
...@@ -53,6 +53,25 @@ ...@@ -53,6 +53,25 @@
) a ) a
</select> </select>
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT
IFNULL( HEALTH_INDEX , 100 ) AS healthIndex
FROM
${tableName}
<where>
ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="stationCode != null and stationCode != ''">
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
</if>
</where>
limit 1
</select>
<select id="getHealthListInfo" resultType="java.util.Map"> <select id="getHealthListInfo" resultType="java.util.Map">
SELECT SELECT
IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex, IFNULL( AVG( HEALTH_INDEX ), 100 ) AS avgHealthIndex,
...@@ -81,7 +100,7 @@ ...@@ -81,7 +100,7 @@
AND ANALYSIS_OBJ_TYPE = '片区' AND ANALYSIS_OBJ_TYPE = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode} AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站' AND ANALYSIS_OBJ_TYPE = '场站'
</if> </if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"> <if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
...@@ -102,7 +121,7 @@ ...@@ -102,7 +121,7 @@
AND ANALYSIS_OBJ_TYPE = '片区' AND ANALYSIS_OBJ_TYPE = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
AND STATION = #{stationCode} AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站' AND ANALYSIS_OBJ_TYPE = '场站'
</if> </if>
<if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"> <if test="(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')">
...@@ -320,12 +339,11 @@ ...@@ -320,12 +339,11 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '子系统'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统') AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND GATEWAY_ID = #{gatewayId}
...@@ -337,7 +355,8 @@ ...@@ -337,7 +355,8 @@
<select id="getFanInfoByPage" resultType="java.util.Map"> <select id="getFanInfoByPage" resultType="java.util.Map">
SELECT SELECT
EQUIPMENT_NAME as equipmentName, EQUIPMENT_NAME as equipmentName,
INDEX_ADDRESS as indexAddress INDEX_ADDRESS as indexAddress,
STATION as station
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
...@@ -359,8 +378,7 @@ ...@@ -359,8 +378,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '设备'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
...@@ -378,8 +396,9 @@ ...@@ -378,8 +396,9 @@
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
SUB_SYSTEM IS NOT NULL AND SUB_SYSTEM != ''
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} '风机系统') AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND GATEWAY_ID = #{gatewayId}
...@@ -392,7 +411,8 @@ ...@@ -392,7 +411,8 @@
<select id="getPointNameListBySumSystem" resultType="java.util.Map"> <select id="getPointNameListBySumSystem" resultType="java.util.Map">
SELECT SELECT
POINT_NAME as pointName, POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress INDEX_ADDRESS as indexAddress,
STATION AS station
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
<where> <where>
...@@ -414,8 +434,7 @@ ...@@ -414,8 +434,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE= '测点'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
AND POINT_NAME IS NOT NULL AND POINT_NAME IS NOT NULL
...@@ -460,6 +479,8 @@ ...@@ -460,6 +479,8 @@
</where> </where>
GROUP BY GROUP BY
SUBARRAY SUBARRAY
ORDER BY
SUBARRAY
</select> </select>
<select id="getPvHealthInfoList" resultType="java.util.Map"> <select id="getPvHealthInfoList" resultType="java.util.Map">
...@@ -469,8 +490,7 @@ ...@@ -469,8 +490,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '子阵'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
...@@ -488,12 +508,11 @@ ...@@ -488,12 +508,11 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '设备'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
<if test="subarray != null and subarray != ''"> <if test="subarray != null and subarray != ''">
AND SUBARRAY = #{subarray} AND SUBARRAY = concat('#', #{subarray})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND GATEWAY_ID = #{gatewayId}
...@@ -511,7 +530,7 @@ ...@@ -511,7 +530,7 @@
idx_biz_pv_point_process_variable_classification idx_biz_pv_point_process_variable_classification
<where> <where>
<if test="subarray != null and subarray != ''"> <if test="subarray != null and subarray != ''">
AND SUBARRAY = #{subarray} AND SUBARRAY = concat('#', #{subarray})
</if> </if>
<if test="gatewayId != null and gatewayId != ''"> <if test="gatewayId != null and gatewayId != ''">
AND GATEWAY_ID = #{gatewayId} AND GATEWAY_ID = #{gatewayId}
...@@ -534,8 +553,7 @@ ...@@ -534,8 +553,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
<where> <where>
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '测点'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
AND POINT_NAME IS NOT NULL AND POINT_NAME IS NOT NULL
...@@ -595,7 +613,14 @@ ...@@ -595,7 +613,14 @@
FROM FROM
idx_biz_fan_point_process_variable_classification idx_biz_fan_point_process_variable_classification
WHERE WHERE
TAG_CODE = '分析变量' UNION ALL TAG_CODE = '分析变量'
AND ARAE is not null
AND STATION is not null
AND EQUIPMENT_NAME is not null
AND SUB_SYSTEM is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
UNION ALL
SELECT SELECT
ARAE AS area, ARAE AS area,
STATION AS station, STATION AS station,
...@@ -607,6 +632,12 @@ ...@@ -607,6 +632,12 @@
idx_biz_pv_point_process_variable_classification idx_biz_pv_point_process_variable_classification
WHERE WHERE
TAG_CODE = '分析变量' TAG_CODE = '分析变量'
AND ARAE is not null
AND STATION is not null
AND SUBARRAY is not null
AND EQUIPMENT_NAME is not null
AND POINT_NAME is not null
AND INDEX_ADDRESS is not null
) a ) a
</select> </select>
...@@ -622,8 +653,7 @@ ...@@ -622,8 +653,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '场站'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -635,8 +665,7 @@ ...@@ -635,8 +665,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '场站'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -659,8 +688,7 @@ ...@@ -659,8 +688,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '设备'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -672,8 +700,7 @@ ...@@ -672,8 +700,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '子阵'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -697,8 +724,7 @@ ...@@ -697,8 +724,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '子系统'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -710,8 +736,7 @@ ...@@ -710,8 +736,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '设备'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -731,8 +756,7 @@ ...@@ -731,8 +756,7 @@
FROM FROM
idx_biz_fan_health_index idx_biz_fan_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '测点'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
...@@ -744,8 +768,7 @@ ...@@ -744,8 +768,7 @@
FROM FROM
idx_biz_pv_health_index idx_biz_pv_health_index
WHERE WHERE
STATION IS NOT NULL ANALYSIS_OBJ_TYPE = '测点'
AND STATION != ''
AND ANALYSIS_TYPE = '按天' AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = CURRENT_DATE
GROUP BY GROUP BY
......
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
<where> <where>
a.project_org_code = c.project_org_code a.project_org_code = c.project_org_code
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND project_org_code like concat(#{parentCode},'%') AND a.project_org_code like concat(#{parentCode},'%')
</if> </if>
</where> </where>
GROUP BY GROUP BY
......
...@@ -316,7 +316,7 @@ public class PersonQrCodeController extends BaseController { ...@@ -316,7 +316,7 @@ public class PersonQrCodeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getDetailInfoByObjectId") @GetMapping(value = "/getDetailInfoByObjectId")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 三级弹窗左侧信息API", notes = "评估大屏 - 三级弹窗左侧信息API") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 三级弹窗左侧信息API", notes = "评估大屏 - 三级弹窗左侧信息API")
public ResponseModel<Map<String, Object>> getDetailInfoByObjectId(@RequestParam(value = "objectId") String objectId, public ResponseModel<Map<String, Object>> getDetailInfoByObjectId(@RequestParam(value = "objectId", required = false) String objectId,
@RequestParam(value = "column") String column, @RequestParam(value = "column") String column,
@RequestParam(required = false, value = "jobId") String jobId) { @RequestParam(required = false, value = "jobId") String jobId) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
......
...@@ -215,17 +215,18 @@ ...@@ -215,17 +215,18 @@
<select id="getJobDetailInfoByObjectId" resultType="java.util.Map"> <select id="getJobDetailInfoByObjectId" resultType="java.util.Map">
SELECT SELECT
IFNULL(`JOB_DESCRIPTION`, '') as `name`, IFNULL(a.`JOB_DESCRIPTION`, '') as `name`,
case case
when QRCODE_COLOR = 'red' then '重大' when a.QRCODE_COLOR = 'red' then '重大'
when QRCODE_COLOR = 'yellow' then '超时' when a.QRCODE_COLOR = 'yellow' then '超时'
else '正常' end as `status`, else '正常' end as `status`,
IFNULL(QRCODE_COLOR, 'green') as qrCodeColor, IFNULL(a.QRCODE_COLOR, 'green') as qrCodeColor,
IFNULL(ZFZR, '') as person, b.REAL_NAME as person,
'' as phone, b.MOBILE as phone,
IFNULL(CREATE_TIME, '') as `recDate` IFNULL(a.CREATE_TIME, '') as `recDate`
FROM FROM
fdgl_job_main fdgl_job_main a
where DBID = #{objectId} left join privilege_agency_user b on a.ZFZR = b.SEQUENCE_NBR
where a.DBID = #{objectId}
</select> </select>
</mapper> </mapper>
...@@ -94,6 +94,8 @@ public class CommonConstans { ...@@ -94,6 +94,8 @@ public class CommonConstans {
public static final String QueryStringEquipmentIndexName = "equipmentIndexName.keyword"; public static final String QueryStringEquipmentIndexName = "equipmentIndexName.keyword";
//es EquipIndexName 查绚关键字 //es EquipIndexName 查绚关键字
public static final String QueryStringEquipmentIndexNameNotKeyword = "equipmentIndexName"; public static final String QueryStringEquipmentIndexNameNotKeyword = "equipmentIndexName";
public static final String QueryStringEquipmentSpecificNameNotKeyword = "equipmentSpecificName.keyword";
//es gatewayId 查绚关键字 //es gatewayId 查绚关键字
public static final String QueryStringGateWayId = "gatewayId.keyword"; public static final String QueryStringGateWayId = "gatewayId.keyword";
public static final String QueryStringFrontMoudle = "frontModule.keyword"; public static final String QueryStringFrontMoudle = "frontModule.keyword";
......
...@@ -764,12 +764,16 @@ public class MonitorFanIdxController extends BaseController { ...@@ -764,12 +764,16 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId, current, size)); return ResponseHelper.buildResponse(monitorFanIndicatorImpl.collectingBox(gatewayId, current, size));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "汇流箱支路电流偏差率") @ApiOperation(value = "汇流箱支路电流偏差率")
@GetMapping("/getDeaviAtionRate") @GetMapping("/getDeaviAtionRate")
public ResponseModel<Page<DeaviationRateDto>> getDeaviAtionRate(@RequestParam(value = "stationId") String stationId, String equipNumber) { public ResponseModel<ResultsData> getDeaviAtionRate(@RequestParam(value = "stationId") String stationId,
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getDeaviAtionRate(stationId, equipNumber)); @RequestParam(value = "zz") String zz, @RequestParam(value = "nbq") String nbq,
} @RequestParam(value = "hlx") String hlx) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
return ResponseHelper.buildResponse(monitorFanIndicatorImpl.getDeaviAtionRate(gatewayId, zz, nbq, hlx));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
...@@ -855,29 +855,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -855,29 +855,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
data = listDatum.getDisplayName(); data = listDatum.getDisplayName();
} }
} }
statusMap.put("addres",listDatum.getAddress());
statusMap.put("data", data); statusMap.put("data", data);
statusMap.put("state", listDatum.getValue().equals("false") ? 0 : 1); statusMap.put("state", listDatum.getValue().equals("false") ? 0 : 1);
statusMap.put("status", listDatum.getValue().equals("false") ? 0 : 1); statusMap.put("status", listDatum.getValue().equals("false") ? 0 : 1);
if(listDatum.getEquipmentIndexName().equals("直流屏装置1网络状态1")||listDatum.getEquipmentIndexName().equals("直流屏装置2网络状态1")){ statusMap.put("title", listDatum.getValue().equals("false") ? "断" : "通");
statusMap.put("title", listDatum.getValue().equals("false") ? "断" : "通");
}else{
statusMap.put("title", listDatum.getValue().equals("false") ? "通" : "断");
}
statusMaps.add(statusMap); statusMaps.add(statusMap);
} }
statusMaps.sort(Comparator.comparingLong(o -> Long.parseLong(o.get("addres").toString())));
Collator instance = Collator.getInstance(Locale.CHINA);
Collections.sort(statusMaps, (e1, e2) -> {
return instance.compare(e1.get("data"), e2.get("data"));
});
return statusMaps; return statusMaps;
} }
...@@ -1325,10 +1310,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1325,10 +1310,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("1svg", "1SVG"); resultMap.put("1svg", "1SVG");
resultMap.put("2svg", "2SVG"); resultMap.put("2svg", "2SVG");
resultMap.put("xzsvg", "夏造 SVG"); resultMap.put("xzsvg", "夏造SVG");
resultMap.put("xzaggavc", "夏造 AGGAVC"); resultMap.put("xzaggavc", "夏造AGCAVC");
resultMap.put("xzgyxh", "夏造 公用信号"); resultMap.put("xzgyxh", "夏造公用信号");
resultMap.put("xzjzlp", "夏造 交直流屏"); resultMap.put("xzjzlp", "夏造交直流屏");
//下方重复列表数据 //下方重复列表数据
List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10); List<Map<String, String>> boosterStationInfo = monitorFanIndicatorregionMapper.getMajorBoosterStationInfo(gatewayId, "ASC", 10);
...@@ -2157,28 +2142,59 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2157,28 +2142,59 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public Page<DeaviationRateDto> getDeaviAtionRate(String stationId, String equipNumber) { public ResultsData getDeaviAtionRate(String gatewayId, String zz, String nbq, String hlx) {
StationCacheInfoDto stationCacheInfoDto = commonServiceImpl.getStationCacheInfoDtoByStationId(stationId); ArrayList<Map<String, Object>> resultList = new ArrayList<>();
Page<DeaviationRateDto> deaviationRateDtoPage = new Page<>(1, 100); Map<String, List<String>> queryConditon = new HashMap<>();
List<DeaviationRateDto> deaviationRateDtoList = new ArrayList<>(); queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, List<String>> queryCondition = new HashMap<>(); Map<String, String> likeMap = new HashMap<>();
queryCondition.put(CommonConstans.QueryStringEquipmentNumber, Arrays.asList(equipNumber)); likeMap.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "路电流");
queryCondition.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId())); //hlx=hlx.replace("#0", "#");
Map<String, String> shouldCodtion = new HashMap<>(); //likeMap.put(CommonConstans.QueryStringEquipmentSpecificNameNotKeyword, hlx);
shouldCodtion.put(CommonConstans.QueryStringEquipmentIndexName, "路电流"); String nhlx =zz+"/"+nbq+"/"+ hlx.replace("#0", "#");
List<ESEquipments> indicatorsDtoList = commonServiceImpl.getListDataByCondtions(queryCondition, shouldCodtion, ESEquipments.class); List<ESEquipments> list = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null,
Random random = new Random(); ESEquipments.class, likeMap);
indicatorsDtoList.forEach(esEquipments -> {
DeaviationRateDto deaviationRateDto = new DeaviationRateDto(); // Map<String, List<String>> queryConditon1 = new HashMap<>();
deaviationRateDto.setName(esEquipments.getEquipmentIndexName()); // queryConditon1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
deaviationRateDto.setCurrentValue(esEquipments.getValue()); // Map<String, String> likeMap1 = new HashMap<>();
deaviationRateDto.setOffset(String.valueOf(random.nextDouble())); // likeMap1.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "平均电流");
deaviationRateDto.setAttValue(String.valueOf(random.nextDouble())); // List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null,
deaviationRateDtoList.add(deaviationRateDto); // ESEquipments.class, likeMap1);
});
deaviationRateDtoPage.setRecords(deaviationRateDtoList); if (!ValidationUtil.isEmpty(list)) {
return deaviationRateDtoPage; list=list.stream().filter(i->i.getEquipmentSpecificName().contains(nhlx)).collect(Collectors.toList());
}
Double avageValue = 0.0;
avageValue = list.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueF()))
.mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).average().getAsDouble();
avageValue = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, avageValue));
for (ESEquipments s : list) {
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("hlx", s.getEquipmentIndexName());
double now = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, s.getValueF()));
resultMap.put("now", now);
resultMap.put("avg", avageValue);
double c = now - avageValue;
if (c < 0) {
c = -c;
}
double lsv = c / avageValue;
lsv = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, lsv));
resultMap.put("lsv", lsv);
resultList.add(resultMap);
}
}
// 构建平台数据
DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList);
ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx");
ColModel colModelStationName = new ColModel("now", "now", "当前值", "当前值", "dataGrid", "now");
ColModel colModelEventDesc = new ColModel("avg", "avg", "平均值", "平均值", "dataGrid", "avg");
ColModel colModelAlarmGroupName = new ColModel("pcv", "pcv", "偏差率", "偏差率", "dataGrid", "pcv");
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc,
colModelAlarmGroupName);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
// @Scheduled(cron = "0 */10 * * * ?") // @Scheduled(cron = "0 */10 * * * ?")
// //@Scheduled(cron = "0/1 * * * * ?") // //@Scheduled(cron = "0/1 * * * * ?")
......
...@@ -293,14 +293,14 @@ public class MonitoringServiceImpl { ...@@ -293,14 +293,14 @@ public class MonitoringServiceImpl {
SocialContributionDto completionRatioDto = new SocialContributionDto(); SocialContributionDto completionRatioDto = new SocialContributionDto();
completionRatioDto.setTitle(completionRatio); completionRatioDto.setTitle(completionRatio);
completionRatioDto.setUnit("%"); completionRatioDto.setUnit("%");
SocialContributionDto useHoursDto = new SocialContributionDto(); // SocialContributionDto useHoursDto = new SocialContributionDto();
useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get()))); // useHoursDto.setTitle(String.format(CommonConstans.Twodecimalplaces, (fdzannualPower.get() * CommonConstans.wkwhToMv / fdzInstallCapacity.get() + gfzannualPower.get() * CommonConstans.wkwhToMv / gfzinstallCapacity.get())));
useHoursDto.setUnit("h"); // useHoursDto.setUnit("h");
socialContributionDtoList.add(dailyPowerdto); socialContributionDtoList.add(dailyPowerdto);
socialContributionDtoList.add(monthlyPowerdto); socialContributionDtoList.add(monthlyPowerdto);
socialContributionDtoList.add(annualPowerdto); socialContributionDtoList.add(annualPowerdto);
socialContributionDtoList.add(completionRatioDto); socialContributionDtoList.add(completionRatioDto);
socialContributionDtoList.add(useHoursDto); // socialContributionDtoList.add(useHoursDto);
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
socialContributionDtoPage.setCurrent(1); socialContributionDtoPage.setCurrent(1);
......
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