Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
11e48397
Commit
11e48397
authored
Sep 20, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into developer_bw
parents
86b5d7bf
691e403e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
469 additions
and
60 deletions
+469
-60
GolangRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
+59
-0
GoodWeRequestUtil.java
...eejoin/amos/api/householdapi/Utils/GoodWeRequestUtil.java
+54
-0
SofarRequestUtil.java
...yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
+48
-3
SunlightUtil.java
...com/yeejoin/amos/api/householdapi/Utils/SunlightUtil.java
+60
-0
GoLangDataAcquisitionServiceImpl.java
...i/face/service/impl/GoLangDataAcquisitionServiceImpl.java
+0
-0
GoodWeDataAcquisitionServiceImpl.java
...i/face/service/impl/GoodWeDataAcquisitionServiceImpl.java
+83
-18
SofarDataAcquisitionServiceImpl.java
...pi/face/service/impl/SofarDataAcquisitionServiceImpl.java
+52
-7
SunlightServiceImpl.java
...i/householdapi/face/service/impl/SunlightServiceImpl.java
+55
-12
TanYinDataAcquisitionServiceImpl.java
...i/face/service/impl/TanYinDataAcquisitionServiceImpl.java
+5
-4
SchedulerConfig.java
...rc/main/java/com/yeejoin/amos/config/SchedulerConfig.java
+21
-0
AcceptanceCheckServiceImpl.java
...ule/hygf/biz/service/impl/AcceptanceCheckServiceImpl.java
+3
-1
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+11
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+1
-1
OAuthResource.java
.../amos/boot/module/jxiop/biz/controller/OAuthResource.java
+2
-3
LargeScreenImpl.java
...s/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
+2
-2
DZMTSJServiceImpl.java
...boot/module/jxiop/biz/jxdz/factory/DZMTSJServiceImpl.java
+6
-4
application-dev1.properties
...onitor-biz/src/main/resources/application-dev1.properties
+4
-1
JXDZMapper.xml
...itor-biz/src/main/resources/mapper/cluster/JXDZMapper.xml
+3
-3
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GolangRequestUtil.java
View file @
11e48397
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.api.householdapi.Utils;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.log.Log
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -11,6 +12,7 @@ import com.yeejoin.amos.api.householdapi.constant.GoLangConstant;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.houseapi.HousepvapiRecords
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper
;
import
com.yeejoin.amos.openapi.enums.PVProducerInfoEnum
;
import
fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -43,6 +45,63 @@ public class GolangRequestUtil {
return
hashMap
;
}
/**
* 这个方法是为了查出全部的数据
* @param apiurl 请求url
* @param requestMethod 请求方式
* @param requestInfo 请求信息
* @param ResultResolveRule 请求的解析
* @param tClass 需要转换成的bean
* @param <T> 泛型数据
* @return List<T> list<Result>
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
*/
public
<
T
>
List
<
T
>
getResPonseList
(
String
apiurl
,
String
requestMethod
,
HashMap
<
String
,
Object
>
requestInfo
,
String
ResultResolveRule
,
Class
<
T
>
tClass
)
{
String
respone
=
""
;
String
params
=
""
;
JSONArray
jsonArray
=
null
;
List
<
T
>
result
=
new
ArrayList
<>();
Integer
pageNo
=
1
;
try
{
do
{
requestInfo
.
put
(
"pageNo"
,
pageNo
);
String
requestParmInfo
=
JSON
.
toJSONString
(
requestInfo
);
HashMap
<
String
,
Object
>
producerInfo
=
getHeaderOfGolang
();
String
baseurl
=
(
String
)
producerInfo
.
get
(
"apiurl"
);
HashMap
<
String
,
String
>
headMap
=
(
HashMap
<
String
,
String
>)
producerInfo
.
get
(
"header"
);
String
orginalAuthorization
=
headMap
.
get
(
"Authorization"
)
+
":"
;
String
url
=
baseurl
+
apiurl
;
String
appsecret
=
(
String
)
producerInfo
.
get
(
"appsecret"
);
JLYHeaderMapHandler
(
params
,
headMap
,
orginalAuthorization
,
appsecret
,
apiurl
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
jsonArray
=
handlerResponseByResultResolverule
(
ResultResolveRule
,
respone
);
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
result
.
addAll
(
JSONArray
.
parseArray
(
jsonArray
.
toJSONString
(),
tClass
));
}
//处理其他页数的数据
JSONObject
responeJSON
=
JSONObject
.
parseObject
(
respone
);
JSONObject
data
=
responeJSON
.
getJSONObject
(
"data"
);
Integer
responePages
=
0
;
if
(
data
.
containsKey
(
"pages"
)){
responePages
=
data
.
getInteger
(
"pages"
);
}
else
{
JSONObject
page
=
data
.
getJSONObject
(
"page"
);
responePages
=
page
.
getInteger
(
"pages"
);
}
if
(
responePages
==
pageNo
){
break
;
}
else
{
pageNo
++;
}
}
while
(
true
);
}
catch
(
Exception
exception
)
{
log
.
error
(
exception
.
getMessage
(),
exception
);
return
result
;
}
return
result
;
}
/**
* @param apiurl 请求url
* @param requestMethod 请求方式
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/GoodWeRequestUtil.java
View file @
11e48397
...
...
@@ -46,6 +46,55 @@ public class GoodWeRequestUtil {
}
return
hashMap
;
}
/**
* @param apiurl 请求url
* @param requestMethod 请求方式
* @param requestInfo 请求参数mapper
* @param ResultResolveRule 请求的解析
* @param tClass 需要转换成的bean
* @param <T> 泛型数据
* @return List<T> list<Result>
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
*/
public
<
T
>
List
<
T
>
getResPonseList
(
String
apiurl
,
String
requestMethod
,
HashMap
<
String
,
Object
>
requestInfo
,
String
ResultResolveRule
,
Class
<
T
>
tClass
)
{
String
respone
=
""
;
JSONArray
jsonArray
=
null
;
List
<
T
>
result
=
new
ArrayList
<>();
Integer
pageNo
=
1
;
try
{
do
{
requestInfo
.
put
(
"page_index"
,
pageNo
);
String
requestParmInfo
=
fastjson
.
JSON
.
toJSONString
(
requestInfo
);
HashMap
<
String
,
String
>
headMap
=
getHeaderOfGoodWE
();
String
url
=
GoodWeConstant
.
baseurl
+
apiurl
;
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
//token如果失效重新获取{"code":100002,"msg":"授权已失效,请重新登录","data":null}
if
(
JSONObject
.
parseObject
(
respone
).
getInteger
(
"code"
)
==
100002
){
redisUtils
.
del
(
redisKey
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
getHeaderOfGoodWE
());
}
jsonArray
=
handlerResponseByResultResolverule
(
ResultResolveRule
,
respone
);
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
result
.
addAll
(
JSONArray
.
parseArray
(
jsonArray
.
toJSONString
(),
tClass
));
}
//处理其他页数的数据
JSONObject
responeJSON
=
JSONObject
.
parseObject
(
respone
);
JSONObject
data
=
responeJSON
.
getJSONObject
(
"data"
);
Integer
record
=
data
.
getInteger
(
"record"
);
Integer
pageSize
=
requestInfo
.
get
(
"page_size"
)==
null
||
(
Integer
)
requestInfo
.
get
(
"page_size"
)==
0
?
1
:(
Integer
)
requestInfo
.
get
(
"page_size"
);
Integer
responePages
=(
record
/
pageSize
)+
1
;
if
(
responePages
==
pageNo
){
break
;
}
else
{
pageNo
++;
}
}
while
(
true
);
}
catch
(
Exception
exception
)
{
return
result
;
}
return
result
;
}
/**
* @param apiurl 请求url
...
...
@@ -66,6 +115,11 @@ public class GoodWeRequestUtil {
HashMap
<
String
,
String
>
headMap
=
getHeaderOfGoodWE
();
String
url
=
GoodWeConstant
.
baseurl
+
apiurl
;
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
//token如果失效重新获取{"code":100002,"msg":"授权已失效,请重新登录","data":null}
if
(
JSONObject
.
parseObject
(
respone
).
getInteger
(
"code"
)
==
100002
){
redisUtils
.
del
(
redisKey
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
getHeaderOfGoodWE
());
}
jsonArray
=
handlerResponseByResultResolverule
(
ResultResolveRule
,
respone
);
if
(!
ObjectUtils
.
isEmpty
(
jsonArray
))
{
result
=
JSONArray
.
parseArray
(
jsonArray
.
toJSONString
(),
tClass
);
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/SofarRequestUtil.java
View file @
11e48397
...
...
@@ -5,16 +5,14 @@ import cn.hutool.http.HttpUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.api.householdapi.constant.GoodWeConstant
;
import
com.yeejoin.amos.api.householdapi.constant.SoFarConstant
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.Sunlight
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Component
...
...
@@ -86,6 +84,53 @@ public class SofarRequestUtil {
return
requestHeader
;
}
/**
* @param apiurl 请求url
* @param requestMethod 请求方式
* @param requestInfo 请求参数mapper
* @param ResultResolveRule 请求的解析
* @param tClass 需要转换成的bean
* @param <T> 泛型数据
* @return List<T> list<Result>
* @desc 根据请求参数发送http请求并且对于返回的数据进行处理
*/
public
<
T
>
List
<
T
>
getResPonseList
(
String
apiurl
,
String
requestMethod
,
Map
<
String
,
Object
>
requestInfo
,
String
ResultResolveRule
,
Class
<
T
>
tClass
)
{
String
respone
=
""
;
List
<
T
>
result
=
new
ArrayList
<>();
Integer
pageNo
=
1
;
try
{
do
{
requestInfo
.
put
(
"page"
,
pageNo
);
String
requestParmInfo
=
JSON
.
toJSONString
(
requestInfo
);
HashMap
<
String
,
String
>
headMap
=
getHeaderOfSofar
();
String
url
=
SoFarConstant
.
baseurl
+
apiurl
;
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
//token如果失效重新获取{"code": 500,"msg": "Login status has expired","success": false}
if
(
JSONObject
.
parseObject
(
respone
).
getInteger
(
"code"
)
==
500
){
redisUtils
.
del
(
redisKey
);
respone
=
sendRequest
(
requestMethod
,
url
,
requestParmInfo
,
headMap
);
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
respone
);
if
(
jsonObject
!=
null
&&
jsonObject
.
get
(
ResultResolveRule
)!=
null
){
result
.
addAll
(
JSONArray
.
parseArray
(
fastjson
.
JSON
.
toJSONString
(
jsonObject
.
get
(
ResultResolveRule
)),
tClass
));
}
//处理其他页数的数据
JSONObject
responeJSON
=
JSONObject
.
parseObject
(
respone
);
Integer
total
=
responeJSON
.
getInteger
(
"total"
);
Integer
pageSize
=
requestInfo
.
get
(
"size"
)==
null
||
(
Integer
)
requestInfo
.
get
(
"size"
)==
0
?
1
:(
Integer
)
requestInfo
.
get
(
"size"
);
Integer
responePages
=(
total
/
pageSize
)+
1
;
if
(
responePages
==
pageNo
){
break
;
}
else
{
pageNo
++;
}
}
while
(
true
);
}
catch
(
Exception
exception
)
{
exception
.
printStackTrace
();
}
return
result
;
}
/**
* @param apiurl 请求url
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/Utils/SunlightUtil.java
View file @
11e48397
...
...
@@ -6,9 +6,12 @@ import cn.hutool.http.HttpResponse;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.gson.Gson
;
import
com.yeejoin.amos.api.householdapi.face.dto.SunlightDto
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.tdeingine.Sunlight
;
import
com.yeejoin.amos.api.householdapi.face.orm.mapper.houseapi.HousepvapiRecordsMapper
;
import
fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
...
...
@@ -23,7 +26,9 @@ import javax.naming.Name;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -207,6 +212,61 @@ public class SunlightUtil {
}
}
/**
* 获取全部的数据
* @param url
* @param bodyparam
* @return
*/
public
JSONObject
getDataList
(
String
url
,
Map
<
String
,
Object
>
bodyparam
){
JSONObject
resultData
=
new
JSONObject
();
JSONArray
pageList
=
new
JSONArray
();
Integer
pageNo
=
1
;
try
{
do
{
bodyparam
.
put
(
"curPage"
,
pageNo
);
//请求头
HttpRequest
request
=
HttpUtil
.
createPost
(
dfurl
+
url
);
request
.
header
(
"Content-Type"
,
"application/json;charset=UTF-8"
);
request
.
header
(
"sys_code"
,
"901"
);
request
.
header
(
"x-access-key"
,
access_key
);
//请求body
bodyparam
.
put
(
"appkey"
,
appkey
);
bodyparam
.
put
(
"token"
,
this
.
getSunlightToken
());
Gson
gson
=
new
Gson
();
String
body
=
gson
.
toJson
(
bodyparam
);
request
.
body
(
body
);
HttpResponse
execute
=
request
.
execute
();
if
(!
execute
.
isOk
())
{
throw
new
RuntimeException
(
execute
.
body
());
}
String
res
=
UnicodeUtil
.
toString
(
execute
.
body
());
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
res
,
true
);
resultData
=
JSONUtil
.
parseObj
(
jsonObject
.
get
(
"result_data"
),
true
);
if
(
resultData
!=
null
&&
resultData
.
get
(
"pageList"
)!=
null
){
pageList
.
addAll
(
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
resultData
.
get
(
"pageList"
))));
resultData
.
putOpt
(
"pageList"
,
pageList
);
}
//处理其他页数的数据
Integer
rowCount
=
resultData
.
getInt
(
"rowCount"
);
Integer
pageSize
=
bodyparam
.
get
(
"size"
)==
null
||
(
Integer
)
bodyparam
.
get
(
"size"
)==
0
?
1
:(
Integer
)
bodyparam
.
get
(
"size"
);
Integer
responePages
=(
rowCount
/
pageSize
)+
1
;
if
(
responePages
==
pageNo
){
break
;
}
else
{
pageNo
++;
}
}
while
(
true
);
}
catch
(
Exception
e
)
{
log
.
error
(
"失败,msg={}"
,
e
.
getMessage
());
e
.
printStackTrace
();
throw
new
RuntimeException
(
e
.
getMessage
());
}
return
resultData
;
}
//获取接口数据
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoLangDataAcquisitionServiceImpl.java
View file @
11e48397
This diff is collapsed.
Click to expand it.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/GoodWeDataAcquisitionServiceImpl.java
View file @
11e48397
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -35,10 +36,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
...
...
@@ -109,12 +107,13 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
requestInfo
.
put
(
"page_index"
,
1
);
requestInfo
.
put
(
"page_size"
,
200
);
// requestInfo.put("key", "龙虎山北区");
String
requstParam
=
JSON
.
toJSONString
(
requestInfo
);
String
today
=
DateUtil
.
today
();
String
hour
=
new
Date
().
getHours
()
+
":00"
;
List
<
GoodWeStationMonitorDto
>
goodWeStationLists
=
goodWeRequestUtil
.
getResPonse
(
GoodWeConstant
.
stationListStatusUrl
,
GoodWeConstant
.
requestPost
,
requ
stParam
,
List
<
GoodWeStationMonitorDto
>
goodWeStationLists
=
goodWeRequestUtil
.
getResPonse
List
(
GoodWeConstant
.
stationListStatusUrl
,
GoodWeConstant
.
requestPost
,
requ
estInfo
,
GoodWeConstant
.
resovleRule_data_list
,
GoodWeStationMonitorDto
.
class
);
//删除多余的场站
deleteBDWStation
(
goodWeStationLists
);
if
(
goodWeStationLists
.
size
()
>
0
)
{
goodWeStationLists
.
forEach
(
goodWeStationMonitorDto
->
{
GoodWeStationMonitorList
goodWeStationList
=
new
GoodWeStationMonitorList
();
...
...
@@ -296,7 +295,9 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
TdHYGFStationAllGenerate
.
setYearTime
(
DateUtil
.
format
(
today1
,
"yyyy"
));
TdHYGFStationAllGenerate
.
setYear
(
DateUtil
.
format
(
today1
,
"yyyy"
));
TdHYGFStationAllGenerate
.
setGenerate
(
jpStation
.
getYearGenerate
());
TdHYGFStationAllGenerate
.
setFullhour
(
jpStation
.
getYearGenerate
()
/
jpStation
.
getCapacity
());
if
(
ObjectUtils
.
isNotEmpty
(
jpStation
.
getYearGenerate
()))
{
TdHYGFStationAllGenerate
.
setFullhour
(
jpStation
.
getYearGenerate
()
/
jpStation
.
getCapacity
());
}
TdHYGFStationAllGenerate
.
setIncome
(
jpStation
.
getYearIncome
());
// 新加
TdHYGFStationAllGenerate
.
setAmosCompanyCode
(
jpStation
.
getAmosCompanyCode
());
...
...
@@ -315,13 +316,37 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
logger
.
info
(
"-------固德威同步场站和告警结束"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
}
/**
* 删除多余的场站
* @param goodWeStationLists
*/
private
void
deleteBDWStation
(
List
<
GoodWeStationMonitorDto
>
goodWeStationLists
)
{
if
(
CollectionUtil
.
isNotEmpty
(
goodWeStationLists
)){
List
<
String
>
stationIds
=
new
ArrayList
<>();
for
(
GoodWeStationMonitorDto
goodWeStationMonitorDto
:
goodWeStationLists
)
{
stationIds
.
add
(
goodWeStationMonitorDto
.
getPowerstation_id
());
}
QueryWrapper
<
JpStation
>
wrapper
=
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
GDW
.
getCode
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpStations
)){
for
(
JpStation
jpStation
:
jpStations
)
{
if
(!
stationIds
.
contains
(
jpStation
.
getThirdStationId
())){
//删除多余数据
jpStationMapper
.
deleteById
(
jpStation
.
getSequenceNbr
());
}
}
}
}
}
@Override
@Scheduled
(
cron
=
"${dataRequstScheduled.GoodWe}"
)
@Async
public
void
stationDetail
()
{
long
ts
=
System
.
currentTimeMillis
();
logger
.
info
(
"-------固德威同步场站详情开始"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
List
<
String
>
stationIds
=
goodWeStationMonitorListMapper
.
getStationIds
();
// List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
List
<
String
>
stationIds
=
getStationIds
();
stationIds
.
forEach
(
stationId
->
{
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
String
requstParam
=
JSON
.
toJSONString
(
requestInfo
);
...
...
@@ -352,13 +377,34 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
logger
.
info
(
"-------固德威同步场站详情结束"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
}
/**
* 获取场站id
* @return
*/
private
List
<
String
>
getStationIds
()
{
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
requestInfo
.
put
(
"page_index"
,
1
);
requestInfo
.
put
(
"page_size"
,
200
);
List
<
GoodWeStationMonitorDto
>
goodWeStationLists
=
goodWeRequestUtil
.
getResPonseList
(
GoodWeConstant
.
stationListStatusUrl
,
GoodWeConstant
.
requestPost
,
requestInfo
,
GoodWeConstant
.
resovleRule_data_list
,
GoodWeStationMonitorDto
.
class
);
List
<
String
>
stationIds
=
new
ArrayList
<>();
if
(
CollectionUtil
.
isNotEmpty
(
goodWeStationLists
)){
for
(
GoodWeStationMonitorDto
goodWeStationMonitorDto
:
goodWeStationLists
)
{
stationIds
.
add
(
goodWeStationMonitorDto
.
getPowerstation_id
());
}
}
return
stationIds
;
}
@Override
@Scheduled
(
cron
=
"${dataRequstScheduled.GoodWe}"
)
@Async
public
void
stationMonthGen
()
{
long
ts
=
System
.
currentTimeMillis
();
logger
.
info
(
"-------固德威同步场站月发电量开始"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
List
<
String
>
stationIds
=
goodWeStationMonitorListMapper
.
getStationIds
();
// List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
List
<
String
>
stationIds
=
getStationIds
();
stationIds
.
forEach
(
stationId
->
{
String
currentMonth
=
DateUtil
.
format
(
new
Date
(),
"yyyyMM"
);
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
...
...
@@ -395,7 +441,8 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
public
void
stationYearGen
()
{
long
ts
=
System
.
currentTimeMillis
();
logger
.
info
(
"-------固德威同步场站年发电量开始"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
List
<
String
>
stationIds
=
goodWeStationMonitorListMapper
.
getStationIds
();
// List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
List
<
String
>
stationIds
=
getStationIds
();
stationIds
.
forEach
(
stationId
->
{
String
currentYear
=
DateUtil
.
format
(
new
Date
(),
"yyyy"
);
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
...
...
@@ -438,7 +485,10 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
public
void
inverterList
()
{
long
ts
=
System
.
currentTimeMillis
();
logger
.
info
(
"-------固德威同步逆变器开始"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
List
<
String
>
stationIds
=
goodWeStationMonitorListMapper
.
getStationIds
();
// List<String> stationIds = goodWeStationMonitorListMapper.getStationIds();
List
<
String
>
stationIds
=
getStationIds
();
//删除多余的逆变器
deleteGDWInverter
(
stationIds
);
stationIds
.
stream
().
forEach
(
stationId
->
{
HashMap
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
requestInfo
.
put
(
"page_index"
,
1
);
...
...
@@ -446,9 +496,8 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
requestInfo
.
put
(
"pw_id"
,
stationId
);
JpStation
jpStation
=
jpStationMapper
.
selectOne
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_station_id"
,
stationId
).
orderByDesc
(
"create_time"
));
String
requstParam
=
JSON
.
toJSONString
(
requestInfo
);
List
<
GoodWeINverterDetailDto
>
inverterDetailDtoList
=
goodWeRequestUtil
.
getResPonse
(
GoodWeConstant
.
queryInventerUrl
,
GoodWeConstant
.
requestPost
,
requstParam
,
List
<
GoodWeINverterDetailDto
>
inverterDetailDtoList
=
goodWeRequestUtil
.
getResPonseList
(
GoodWeConstant
.
queryInventerUrl
,
GoodWeConstant
.
requestPost
,
requestInfo
,
GoodWeConstant
.
resovleRule_data_list
,
GoodWeINverterDetailDto
.
class
);
inverterDetailDtoList
.
forEach
(
goodWeINverterDetailDto
->
{
// System.out.println(goodWeINverterDetailDto.getIt_sn());
...
...
@@ -480,6 +529,23 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
logger
.
info
(
"-------固德威同步逆变器结束"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
}
/**
* 删除多余的逆变器
* @param stationIds
*/
private
void
deleteGDWInverter
(
List
<
String
>
stationIds
)
{
QueryWrapper
<
JpInverter
>
wrapper
=
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
GDW
.
getCode
());
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpInverters
)){
for
(
JpInverter
jpInverter
:
jpInverters
)
{
if
(!
stationIds
.
contains
(
jpInverter
.
getThirdStationId
())){
//删除多余数据
jpInverterMapper
.
deleteById
(
jpInverter
.
getSequenceNbr
());
}
}
}
}
@Override
@Scheduled
(
cron
=
"${dataRequstScheduled.GoodWe}"
)
@Async
...
...
@@ -847,9 +913,8 @@ public class GoodWeDataAcquisitionServiceImpl implements GoodWeDataAcquisitionSe
requestInfo
.
put
(
"endtime"
,
today
+
" 23:59:59"
);
requestInfo
.
put
(
"stationid"
,
stationid
);
// requestInfo.put("status", 2);
String
requstParam
=
JSON
.
toJSONString
(
requestInfo
);
List
<
GoodWeAlarmDto
>
alarmList
=
goodWeRequestUtil
.
getResPonse
(
GoodWeConstant
.
alarmListUrl
,
GoodWeConstant
.
requestPost
,
requstParam
,
GoodWeConstant
.
resovleRule_data_list
,
GoodWeAlarmDto
.
class
);
List
<
GoodWeAlarmDto
>
alarmList
=
goodWeRequestUtil
.
getResPonseList
(
GoodWeConstant
.
alarmListUrl
,
GoodWeConstant
.
requestPost
,
requestInfo
,
GoodWeConstant
.
resovleRule_data_list
,
GoodWeAlarmDto
.
class
);
alarmList
.
forEach
(
goodWeAlarmDto
->
{
if
(!
ObjectUtils
.
isEmpty
(
goodWeAlarmDto
.
getDevicesn
()))
{
HYGFJPInverterWarn
hygfjpInverterWarn
=
hygfjpInverterWarnMapper
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SofarDataAcquisitionServiceImpl.java
View file @
11e48397
...
...
@@ -12,8 +12,7 @@ import java.util.Map;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
javax.annotation.PostConstruct
;
import
cn.hutool.core.collection.CollectionUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -118,18 +117,65 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
Map
<
String
,
Object
>
requestInfo
=
new
HashMap
<>();
requestInfo
.
put
(
"page"
,
1
);
requestInfo
.
put
(
"size"
,
1000
);
String
param
=
JSON
.
toJSONString
(
requestInfo
);
List
<
SofarStationList
>
jsonObject
=
requestUtil
.
getResPonse
(
SoFarConstant
.
stationListUrl
,
SoFarConstant
.
requestPost
,
param
,
SoFarConstant
.
resovleRule_data
,
SofarStationList
.
class
);
List
<
SofarStationList
>
jsonObject
=
requestUtil
.
getResPonseList
(
SoFarConstant
.
stationListUrl
,
SoFarConstant
.
requestPost
,
requestInfo
,
SoFarConstant
.
resovleRule_data
,
SofarStationList
.
class
);
// 新增td电站
for
(
SofarStationList
sunlight
:
jsonObject
)
{
sunlight
.
setCreatedTime
(
System
.
currentTimeMillis
());
sofarStationListMapper
.
insert
(
sunlight
);
}
//删除多余的信息
deleteSHMessage
(
jsonObject
);
// mysql电站信息
this
.
stationDetail
(
jsonObject
);
}
/**
* 删除多余的首航场站
* @param sofarStationLists
*/
private
void
deleteSHMessage
(
List
<
SofarStationList
>
sofarStationLists
)
{
if
(
CollectionUtil
.
isNotEmpty
(
sofarStationLists
)){
List
<
String
>
stationIds
=
new
ArrayList
<>();
for
(
SofarStationList
sofarStationList
:
sofarStationLists
)
{
stationIds
.
add
(
sofarStationList
.
getId
().
toString
());
}
//场站
QueryWrapper
<
JpStation
>
wrapper
=
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpStations
)){
for
(
JpStation
jpStation
:
jpStations
)
{
if
(!
stationIds
.
contains
(
jpStation
.
getThirdStationId
())){
//删除多余数据
jpStationMapper
.
deleteById
(
jpStation
.
getSequenceNbr
());
}
}
}
//采集器
QueryWrapper
<
JpCollector
>
wrapper1
=
new
QueryWrapper
<
JpCollector
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpCollector
>
jpCollectors
=
jpCollectorMapper
.
selectList
(
wrapper1
);
if
(
CollectionUtil
.
isNotEmpty
(
jpCollectors
)){
for
(
JpCollector
jpCollector
:
jpCollectors
)
{
if
(!
stationIds
.
contains
(
jpCollector
.
getThirdStationId
())){
//删除多余数据
jpCollectorMapper
.
deleteById
(
jpCollector
.
getSequenceNbr
());
}
}
}
//逆变器
QueryWrapper
<
JpInverter
>
wrapper2
=
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
SH
.
getCode
());
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
wrapper2
);
if
(
CollectionUtil
.
isNotEmpty
(
jpInverters
)){
for
(
JpInverter
jpInverter
:
jpInverters
)
{
if
(!
stationIds
.
contains
(
jpInverter
.
getThirdStationId
())){
//删除多余数据
jpInverterMapper
.
deleteById
(
jpInverter
.
getSequenceNbr
());
}
}
}
}
}
@Override
public
void
stationDetail
(
List
<
SofarStationList
>
list
)
{
...
...
@@ -1212,8 +1258,7 @@ public class SofarDataAcquisitionServiceImpl implements SofarDataAcquisitionServ
// if (jpStation.getThirdStationId().equals("517021808701218816")){
// System.out.println("6666666666666666666666666");
// }
String
param
=
JSON
.
toJSONString
(
requestInfo
);
List
<
SofarWarm
>
jsonObject2
=
requestUtil
.
getResPonse
(
SoFarConstant
.
alert
,
SoFarConstant
.
requestPost
,
param
,
List
<
SofarWarm
>
jsonObject2
=
requestUtil
.
getResPonseList
(
SoFarConstant
.
alert
,
SoFarConstant
.
requestPost
,
requestInfo
,
SoFarConstant
.
stationAlertItems
,
SofarWarm
.
class
);
// if (jsonObject2 != null && jsonObject2.size() > 0) {
// System.out.println("88888888888888888888888");
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/SunlightServiceImpl.java
View file @
11e48397
package
com
.
yeejoin
.
amos
.
api
.
householdapi
.
face
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.json.JSONObject
;
...
...
@@ -7,13 +8,8 @@ import cn.hutool.json.JSONUtil;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.google.gson.JsonObject
;
import
com.qiniu.util.Json
;
import
com.yeejoin.amos.api.householdapi.Utils.SunlightUtil
;
import
com.yeejoin.amos.api.householdapi.constant.ImasterConstant
;
import
com.yeejoin.amos.api.householdapi.constant.KSolarConstant
;
import
com.yeejoin.amos.api.householdapi.face.dto.Device
;
import
com.yeejoin.amos.api.householdapi.face.dto.KsolarAlarmDto
;
import
com.yeejoin.amos.api.householdapi.face.dto.SunlightDto
;
import
com.yeejoin.amos.api.householdapi.face.dto.SunlightWarm
;
import
com.yeejoin.amos.api.householdapi.face.orm.houseapi.entity.hygf.JpCollector
;
...
...
@@ -37,7 +33,6 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.text.SimpleDateFormat
;
...
...
@@ -46,8 +41,6 @@ import java.util.concurrent.TimeUnit;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
javax.annotation.PostConstruct
;
/**
* @description:
* @author: tw
...
...
@@ -113,8 +106,10 @@ public class SunlightServiceImpl implements SunlightService {
bodyparam
.
put
(
"ps_type"
,
"1,3,4,5,6,7,8"
);
bodyparam
.
put
(
"size"
,
3000
);
bodyparam
.
put
(
"curPage"
,
1
);
JSONObject
data
=
SunlightUtil
.
get
data
(
SunlightUtil
.
getPowerStationList
,
bodyparam
);
JSONObject
data
=
SunlightUtil
.
get
DataList
(
SunlightUtil
.
getPowerStationList
,
bodyparam
);
List
<
Sunlight
>
list
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
data
.
get
(
"pageList"
)),
Sunlight
.
class
);
//删除多余的场站
deleteYGMessage
(
data
);
this
.
stationDetail
(
data
);
for
(
Sunlight
sunlight
:
list
)
{
...
...
@@ -124,6 +119,54 @@ public class SunlightServiceImpl implements SunlightService {
logger
.
info
(
"-------阳光同步电站/逆变器/采集器结束"
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
}
/**
* 删除多余的阳光场站
* @param data
*/
private
void
deleteYGMessage
(
JSONObject
data
)
{
// 所有场站信息
List
<
SunlightDto
>
sunlightDtos
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
data
.
get
(
"pageList"
)),
SunlightDto
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
sunlightDtos
)){
List
<
String
>
stationIds
=
new
ArrayList
<>();
for
(
SunlightDto
sunlightDto
:
sunlightDtos
)
{
stationIds
.
add
(
sunlightDto
.
getPs_id
().
toString
());
}
//场站
QueryWrapper
<
JpStation
>
wrapper
=
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
jpStations
)){
for
(
JpStation
jpStation
:
jpStations
)
{
if
(!
stationIds
.
contains
(
jpStation
.
getThirdStationId
())){
//删除多余数据
jpStationMapper
.
deleteById
(
jpStation
.
getSequenceNbr
());
}
}
}
//采集器
QueryWrapper
<
JpCollector
>
wrapper1
=
new
QueryWrapper
<
JpCollector
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpCollector
>
jpCollectors
=
jpCollectorMapper
.
selectList
(
wrapper1
);
if
(
CollectionUtil
.
isNotEmpty
(
jpCollectors
)){
for
(
JpCollector
jpCollector
:
jpCollectors
)
{
if
(!
stationIds
.
contains
(
jpCollector
.
getThirdStationId
())){
//删除多余数据
jpCollectorMapper
.
deleteById
(
jpCollector
.
getSequenceNbr
());
}
}
}
//逆变器
QueryWrapper
<
JpInverter
>
wrapper2
=
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
YG
.
getCode
());
List
<
JpInverter
>
jpInverters
=
jpInverterMapper
.
selectList
(
wrapper2
);
if
(
CollectionUtil
.
isNotEmpty
(
jpInverters
)){
for
(
JpInverter
jpInverter
:
jpInverters
)
{
if
(!
stationIds
.
contains
(
jpInverter
.
getThirdStationId
())){
//删除多余数据
jpInverterMapper
.
deleteById
(
jpInverter
.
getSequenceNbr
());
}
}
}
}
}
// 电站数据如库,电站统计数据入库
public
void
stationDetail
(
JSONObject
data
)
{
// 所有场站信息
...
...
@@ -271,7 +314,7 @@ public class SunlightServiceImpl implements SunlightService {
bodyparamjp11
.
put
(
"size"
,
3000
);
bodyparamjp11
.
put
(
"curPage"
,
1
);
bodyparamjp11
.
put
(
"device_type_list"
,
lif11
);
JSONObject
jsonObject1data11
=
SunlightUtil
.
get
data
(
SunlightUtil
.
getDeviceList
,
bodyparamjp11
);
JSONObject
jsonObject1data11
=
SunlightUtil
.
get
DataList
(
SunlightUtil
.
getDeviceList
,
bodyparamjp11
);
List
<
Device
>
listdtx
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject1data11
.
get
(
"pageList"
)),
Device
.
class
);
// 获取电站下逆变器
...
...
@@ -282,7 +325,7 @@ public class SunlightServiceImpl implements SunlightService {
bodyparamjp
.
put
(
"size"
,
3000
);
bodyparamjp
.
put
(
"curPage"
,
1
);
bodyparamjp
.
put
(
"device_type_list"
,
lif
);
JSONObject
jsonObject1data
=
SunlightUtil
.
get
data
(
SunlightUtil
.
getDeviceList
,
bodyparamjp
);
JSONObject
jsonObject1data
=
SunlightUtil
.
get
DataList
(
SunlightUtil
.
getDeviceList
,
bodyparamjp
);
List
<
Device
>
listd
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject1data
.
get
(
"pageList"
)),
Device
.
class
);
// 获取电站,月发电量
...
...
@@ -1000,7 +1043,7 @@ public class SunlightServiceImpl implements SunlightService {
Map
<
String
,
Object
>
bodyparamf
=
new
HashMap
<>();
bodyparamf
.
put
(
"size"
,
1000
);
bodyparamf
.
put
(
"curPage"
,
1
);
JSONObject
jsonObject
=
SunlightUtil
.
get
data
(
SunlightUtil
.
getFaultAlarmInfo
,
bodyparamf
);
JSONObject
jsonObject
=
SunlightUtil
.
get
DataList
(
SunlightUtil
.
getFaultAlarmInfo
,
bodyparamf
);
List
<
SunlightWarm
>
listd
=
jsonObject
.
get
(
"pageList"
)
!=
null
?
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
jsonObject
.
get
(
"pageList"
)),
SunlightWarm
.
class
)
:
null
;
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/TanYinDataAcquisitionServiceImpl.java
View file @
11e48397
...
...
@@ -67,10 +67,7 @@ import java.text.SimpleDateFormat;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -566,6 +563,10 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
for
(
TanYinInveterInfo
tanYinInveterInfo
:
tanYinInveterInfos
)
{
// region 逆变器信息
JSONObject
tanYinInveterInfoResultJson
=
tanYinInveterInfoResultMap
.
getJSONObject
(
tanYinInveterInfo
.
getSn
());
//处理空指针问题
if
(
Objects
.
isNull
(
tanYinInveterInfoResultJson
)){
continue
;
}
TanYinInveterInfo
tanYinInveterInfoDTO
=
tanYinInveterInfoResultJson
.
toJavaObject
(
TanYinInveterInfo
.
class
);
tanYinInveterInfoDTO
.
setProjectNo
(
tanYinInveterInfo
.
getProjectNo
());
tanYinInveterInfoDTO
.
setDeviceName
(
tanYinInveterInfo
.
getDeviceName
());
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/config/SchedulerConfig.java
0 → 100644
View file @
11e48397
package
com
.
yeejoin
.
amos
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
@Configuration
@EnableScheduling
public
class
SchedulerConfig
{
@Bean
public
ThreadPoolTaskScheduler
taskScheduler
()
{
ThreadPoolTaskScheduler
scheduler
=
new
ThreadPoolTaskScheduler
();
scheduler
.
setPoolSize
(
10
);
// 设置线程池大小为10
scheduler
.
setThreadNamePrefix
(
"my-scheduled-task-"
);
// 设置线程名称前缀
scheduler
.
initialize
();
// 初始化线程池
return
scheduler
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/AcceptanceCheckServiceImpl.java
View file @
11e48397
...
...
@@ -278,7 +278,7 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
da
.
setOperationContent
(
"验收审核-片区运营审核-"
+
(
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
));
if
(
approvalStatus
.
equals
(
"0"
)){
up
.
set
(
AcceptanceCheck:
:
getBasicGridNode
,
"ys-fawu,ys-tourong"
);
up
.
set
(
AcceptanceCheck:
:
getAcceptanceCheckStatus
,
GridStatusEnum
.
YSROLESDSH
.
getCode
());
Boolean
flag
=
true
;
LambdaQueryWrapper
<
HygfRectificationOrder
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
...
...
@@ -294,6 +294,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
}
if
(
CollectionUtil
.
isNotEmpty
(
hygfRectificationOrders
)
&&
flag
){
up
.
set
(
AcceptanceCheck:
:
getAcceptanceCheckStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
up
.
set
(
AcceptanceCheck:
:
getAcceptanceCheckStatus
,
GridStatusEnum
.
YSROLESDSH
.
getCode
());
}
}
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
片区运营审核
.
getCode
()
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
11e48397
...
...
@@ -807,7 +807,9 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
Double
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"equipmentName"
),
100.0
);
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
}
else
{
}
else
if
(
0.0
==
equipmentHealthScore
){
item
.
put
(
"warningName"
,
"危险"
);
}
else
{
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getStatus
,
item
.
get
(
"station"
));
...
...
@@ -902,6 +904,9 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
if
(
0.0
==
equipmentHealthScore
){
item
.
put
(
"warningName"
,
"危险"
);
item
.
put
(
"status"
,
"危险"
);
}
else
{
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
...
...
@@ -981,6 +986,8 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
Double
equipmentHealthScore
=
equipmentHealthIndexMap
.
getOrDefault
(
item
.
get
(
"subarray"
),
100.0
);
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
}
else
if
(
0.0
==
equipmentHealthScore
){
item
.
put
(
"warningName"
,
"危险"
);
}
else
{
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"设备"
);
...
...
@@ -1061,6 +1068,9 @@ public class TDBigScreenAnalyseController extends BaseController implements Appl
if
(
100.0
==
equipmentHealthScore
)
{
item
.
put
(
"warningName"
,
"安全"
);
item
.
put
(
"status"
,
"安全"
);
}
else
if
(
0.0
==
equipmentHealthScore
){
item
.
put
(
"warningName"
,
"危险"
);
item
.
put
(
"status"
,
"危险"
);
}
else
{
LambdaQueryWrapper
<
IdxBizPvHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizPvHealthLevel:
:
getAnalysisObjType
,
"设备"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
11e48397
...
...
@@ -490,7 +490,7 @@ public class MonitorFanIdxController extends BaseController {
SimpleDateFormat
myFmt2
=
new
SimpleDateFormat
(
"yyyy"
);
String
monthy
=
myFmt2
.
format
(
new
Date
());
QueryWrapper
<
StationPlan
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
select
(
"sum(value) as
value
,monthly"
);
wrapper
.
select
(
"sum(value) as
`value`
,monthly"
);
wrapper
.
eq
(
"year"
,
monthy
);
wrapper
.
eq
(
"station_basic_id"
,
stationBasic
.
getSequenceNbr
());
wrapper
.
groupBy
(
"monthly"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/OAuthResource.java
View file @
11e48397
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -42,7 +41,7 @@ public class OAuthResource {
public
static
final
String
SECRETKEY
=
"qaz"
;
private
final
static
String
AUTHORIZE
=
"http://%s/authorize?redirect_uri=%s"
;
private
final
static
String
AUTOLOGIN
=
"http://%s/autologin?token=%s&userId=%s&redirectURI=%s"
;
private
final
static
String
BIGSCREEN
=
"/vizagfun/jepc?appId=jepc1&top=monitor&bottom=ovarall"
;
private
final
static
String
BIGSCREEN
=
"/vizagfun/jepc?appId=jepc1&to
ken=%s&to
p=monitor&bottom=ovarall"
;
@Value
(
"${appKey:AMOS_ADMIN}"
)
private
String
APP_KEY
;
@Value
(
"${product:AMOS-WEB-ADMIN}"
)
...
...
@@ -77,7 +76,7 @@ public class OAuthResource {
}
String
userId
=
(
String
)
feignClientResult
.
getResult
().
get
(
"userId"
);
String
amosToken
=
(
String
)
feignClientResult
.
getResult
().
get
(
"token"
);
redirectUrl
=
String
.
format
(
AUTOLOGIN
,
host
,
amosToken
,
userId
,
getRedirectURI
(
BIGSCREEN
));
redirectUrl
=
String
.
format
(
AUTOLOGIN
,
host
,
amosToken
,
userId
,
getRedirectURI
(
String
.
format
(
BIGSCREEN
,
amosToken
)
));
log
.
info
(
"重定向访问地址:{}"
,
redirectUrl
);
response
.
sendRedirect
(
redirectUrl
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
View file @
11e48397
...
...
@@ -857,7 +857,7 @@ public class LargeScreenImpl {
// 计划完成量
Map
<
String
,
Double
>
mapwc
=
new
HashMap
<>();
QueryWrapper
<
StationPlan
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
select
(
" monthly ,sum(value)
value
"
);
wrapper
.
select
(
" monthly ,sum(value)
`value`
"
);
wrapper
.
eq
(
"year"
,
monthy
);
wrapper
.
groupBy
(
"monthly"
);
List
<
Map
<
String
,
Object
>>
list1
=
StationPlanMapper
.
selectMaps
(
wrapper
);
...
...
@@ -943,7 +943,7 @@ public class LargeScreenImpl {
// 计划完成量
Map
<
String
,
Double
>
mapwc
=
new
HashMap
<>();
QueryWrapper
<
StationPlan
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
select
(
" monthly ,sum(value)
value
"
);
wrapper
.
select
(
" monthly ,sum(value)
`value`
"
);
wrapper
.
eq
(
"year"
,
monthy
);
wrapper
.
in
(
"station_basic_id"
,
idsStationId
);
wrapper
.
groupBy
(
"monthly"
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/jxdz/factory/DZMTSJServiceImpl.java
View file @
11e48397
...
...
@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.ParseException
;
import
java.time.LocalDate
;
...
...
@@ -50,6 +51,7 @@ public class DZMTSJServiceImpl implements IJXDZService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
buildData
(
Integer
accessType
,
Long
dateTime
)
{
List
<
StationDailyDataVO
>
list
=
new
ArrayList
<>();
if
(
JXDZAccessTypeEnum
.
BULU
.
getCode
().
equals
(
accessType
))
{
...
...
@@ -80,14 +82,14 @@ public class DZMTSJServiceImpl implements IJXDZService {
stationDailyDataVO
.
setName
(
name
);
stationDailyDataVO
.
setWorkTicketTotalNums
(
jxdzMapper
.
countWorkTicketTotalByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkTicketProcessingNums
(
jxdzMapper
.
countWorkTicketProcessingByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkTicketInvalidatedNums
(
jxdzMapper
.
countWork
Order
InvalidatedByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkTicketExecutingNums
(
jxdzMapper
.
countWorkTicketInvalidatedByCode
(
code
).
doubleValue
(
));
stationDailyDataVO
.
setWorkTicketInvalidatedNums
(
jxdzMapper
.
countWork
Ticket
InvalidatedByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkTicketExecutingNums
(
Double
.
valueOf
(
0
));
stationDailyDataVO
.
setWorkTicketTerminatedNums
(
jxdzMapper
.
countWorkTicketTerminatedByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setRegularTasksNums
(
jxdzMapper
.
countRegularTasksByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setInspectionTasksNums
(
jxdzMapper
.
countInspectionTasksByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderTotalNums
(
jxdzMapper
.
countWorkOrderTotalByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderInvalidatedNums
(
jxdzMapper
.
countWorkOrder
ToBeOpen
edByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderToBeOpenedNums
(
jxdzMapper
.
countWorkOrderTo
tal
ByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderInvalidatedNums
(
jxdzMapper
.
countWorkOrder
Invalidat
edByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderToBeOpenedNums
(
jxdzMapper
.
countWorkOrderTo
BeOpened
ByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderTerminatedNums
(
jxdzMapper
.
countWorkOrderTerminatedByCode
(
code
).
doubleValue
());
stationDailyDataVO
.
setWorkOrderStartNums
(
jxdzMapper
.
countWorkOrderStartByCode
(
code
).
doubleValue
());
//调用core 接口
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/application-dev1.properties
View file @
11e48397
...
...
@@ -169,7 +169,10 @@ jxdzTokenUserName=jiangxi_epc
jxdzTokenPassword
=
123456
jxdzPublicKey
=
04508e9c4df8463c784df2dde2536e792851a8f3fd0e5ff29b7bf1a5d9e3f566aa49a7a5fe7683e3dc4dc30dd7bc8773838a9e4fbcf7dfac53461c8777a6aed691
jxdzScheduledEnable
=
false
amos.system.user.user-name
=
hygf_robot
amos.system.user.password
=
a123456789
amos.system.user.app-key
=
AMOS_STUDIO
amos.system.user.product
=
AMOS_STUDIO_WEB
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/mapper/cluster/JXDZMapper.xml
View file @
11e48397
...
...
@@ -9,15 +9,15 @@
<select
id=
"countWorkTicketProcessingByCode"
resultType=
"java.lang.Integer"
>
select COUNT(1) from yxgl_gzp_main where WERKS=#{code} and ZSTAT in
('01','02','03','04','05','06','07','08','09','10','11','12','15','17','20','21','22','23','24','25','26','27','28','29','30','31','32','33')
('01','02','03','04','05','06','07','08','09','10','11','12','15','1
6','1
7','20','21','22','23','24','25','26','27','28','29','30','31','32','33')
</select>
<select
id=
"countWorkTicketInvalidatedByCode"
resultType=
"java.lang.Integer"
>
select COUNT(1) from yxgl_gzp_main where WERKS=#{code} and ZSTAT
='19'
select COUNT(1) from yxgl_gzp_main where WERKS=#{code} and ZSTAT
in ('19','18')
</select>
<select
id=
"countWorkTicketTerminatedByCode"
resultType=
"java.lang.Integer"
>
select COUNT(1) from yxgl_gzp_main where WERKS=#{code} and ZSTAT
='13'
select COUNT(1) from yxgl_gzp_main where WERKS=#{code} and ZSTAT
in ('13','14')
</select>
<select
id=
"countRegularTasksByCode"
resultType=
"java.lang.Integer"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment