Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
d1513f1b
Commit
d1513f1b
authored
Jan 29, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改一体化现场问题
parent
043c39de
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
295 additions
and
224 deletions
+295
-224
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+6
-6
pom.xml
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/pom.xml
+2
-1
UserEmpowerMapper.java
...module/jxiop/biz/amosprojectmapper/UserEmpowerMapper.java
+2
-1
PrivilegeController.java
...boot/module/jxiop/biz/controller/PrivilegeController.java
+212
-150
EquipAlarmEventServiceImpl.java
...le/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
+57
-56
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+1
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+9
-3
AlarmEventServiceImpl.java
.../module/jxiop/biz/service/impl/AlarmEventServiceImpl.java
+3
-3
EquipAlarmEventServiceImpl.java
...le/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
+3
-3
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
d1513f1b
...
...
@@ -1666,9 +1666,9 @@ public class CommonServiceImpl {
Table
healthData
=
Table
.
create
(
"healthData"
);
healthData
.
addColumns
(
DoubleColumn
.
create
(
"analysisVariable"
,
analysisVariable
),
DoubleColumn
.
create
(
"stdDev"
,
stdDev
),
DoubleColumn
.
create
(
"centerValue"
,
centerValue
),
StringColumn
.
create
(
"ProcessPoint1Id"
,
ProcessPoint1Id
),
DoubleColumn
.
create
(
"ProcessPoint1"
,
ProcessPoint1
),
StringColumn
.
create
(
"ProcessPoint2Id"
,
ProcessPoint2Id
),
DoubleColumn
.
create
(
"ProcessPoint2"
,
ProcessPoint2
),
StringColumn
.
create
(
"ProcessPoint3Id"
,
ProcessPoint3Id
),
DoubleColumn
.
create
(
"ProcessPoint3"
,
ProcessPoint3
),
StringColumn
.
create
(
"analysisVariableId"
,
analysisVariableIds
));
logger
.
info
(
"------------------------------------------开始调用健康指数计算算法开始----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始调用
风机
健康指数计算算法开始----------------------------------------"
);
logger
.
info
(
"------------------------------------------调用地址:"
+
baseUrlZSFX
);
logger
.
info
(
"------------------------------------------调用参数:"
+
JSON
.
toJSONString
(
requestMap
));
//
logger.info("------------------------------------------调用参数:"+JSON.toJSONString(requestMap));
String
response
=
HttpUtil
.
createPost
(
baseUrlZSFX
).
body
(
JSON
.
toJSONString
(
requestMap
)).
execute
().
body
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
...
...
@@ -1752,7 +1752,7 @@ public class CommonServiceImpl {
try
{
logger
.
info
(
"--------------------response: "
+
response
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------调用
风机
健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始计算预警----------------------------------------"
);
// healthStatusIndicatorService.healthWarningMinute(calendar, time);
...
...
@@ -1949,9 +1949,9 @@ public class CommonServiceImpl {
Table
healthData
=
Table
.
create
(
"healthData"
);
healthData
.
addColumns
(
DoubleColumn
.
create
(
"analysisVariable"
,
analysisVariable
),
DoubleColumn
.
create
(
"stdDev"
,
stdDev
),
DoubleColumn
.
create
(
"centerValue"
,
centerValue
),
StringColumn
.
create
(
"ProcessPoint1Id"
,
ProcessPoint1Id
),
DoubleColumn
.
create
(
"ProcessPoint1"
,
ProcessPoint1
),
StringColumn
.
create
(
"ProcessPoint2Id"
,
ProcessPoint2Id
),
DoubleColumn
.
create
(
"ProcessPoint2"
,
ProcessPoint2
),
StringColumn
.
create
(
"ProcessPoint3Id"
,
ProcessPoint3Id
),
DoubleColumn
.
create
(
"ProcessPoint3"
,
ProcessPoint3
),
StringColumn
.
create
(
"analysisVariableId"
,
analysisVariableIds
));
logger
.
info
(
"------------------------------------------开始调用健康指数计算算法开始----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始调用
光伏
健康指数计算算法开始----------------------------------------"
);
logger
.
info
(
"------------------------------------------调用地址:"
+
baseUrlZSFX
);
logger
.
info
(
"------------------------------------------调用参数:"
+
JSON
.
toJSONString
(
requestMap
));
//
logger.info("------------------------------------------调用参数:"+JSON.toJSONString(requestMap));
String
response
=
HttpUtil
.
createPost
(
baseUrlZSFX
).
body
(
JSON
.
toJSONString
(
requestMap
)).
execute
().
body
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
response
);
if
(
jsonObject
.
containsKey
(
"indexValue"
))
{
...
...
@@ -2029,7 +2029,7 @@ public class CommonServiceImpl {
}
try
{
logger
.
info
(
"--------------------response: "
+
response
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------调用
光伏
健康指数计算算法结束----------------------------------------"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/pom.xml
View file @
d1513f1b
...
...
@@ -15,11 +15,12 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
<!--
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-ugp-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependency>
-->
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-common-biz
</artifactId>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/amosprojectmapper/UserEmpowerMapper.java
View file @
d1513f1b
...
...
@@ -13,5 +13,6 @@ import java.util.Map;
* @createDate: 2023/11/9
*/
public
interface
UserEmpowerMapper
extends
BaseMapper
<
StdUserEmpower
>
{
@Select
(
"select company_name as companyName , level from privilege_company where org_code = #{orgCode}"
)
Map
<
String
,
String
>
getCompanyInfoByOrgCode
(
String
orgCode
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PrivilegeController.java
View file @
d1513f1b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.CompanyTreeDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.ListCompanyModel
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.StdUserEmpower
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.UserOrgTreeModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* @description:
...
...
@@ -37,143 +46,196 @@ import java.util.stream.Collectors;
@RestController
@Api
(
tags
=
"平台单位部门树"
)
@RequestMapping
(
value
=
"/companyClient"
)
public
class
PrivilegeController
extends
BaseController
{
@Autowired
private
RedisUtils
redisUtils
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/queryOrgTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位、部门树"
,
notes
=
"查询单位、子单位、部门树"
)
public
FeignClientResult
<
Collection
<
UserOrgTreeModel
>>
queryOrgTree
()
{
//获取当前登录人单位
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
FeignClientResult
<
Collection
<
UserOrgTreeModel
>>
de
=
Privilege
.
companyClient
.
queryOrgTree
(
companyId
);
return
de
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/subcompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位"
,
notes
=
"查询单位、子单位"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
subcompany
(
String
orgCode
,
String
type
)
{
Long
companyId
=
null
;
if
(
orgCode
!=
null
){
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
else
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
}
//获取当前登录人单位
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
CompanyModel
companyModel
=
dat
.
getResult
();
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
//如果是公司则获取所有片区
// 86*353*328*364
if
(
companyModel
.
getLevel
().
equals
(
"categroy_leve2"
)){
Collection
<
CompanyModel
>
companyModelList
=
de
.
getResult
();
companyModelList
=
companyModelList
.
stream
().
filter
(
companyModel1
->
companyModel1
.
getCompanyName
().
contains
(
"区域"
)).
collect
(
Collectors
.
toList
());
companyModelList
.
parallelStream
().
forEach
((
companyModel1
)->{
companyModel1
.
setChildren
(
new
ArrayList
());});
return
ResponseHelper
.
buildResponse
(
companyModelList
);
}
//如果是片区则获取片区
if
(
companyModel
.
getLevel
().
equals
(
"area"
)){
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
if
(!
"add"
.
equals
(
type
)){
if
(
companyModel
.
getLevel
().
equals
(
"station"
)){
FeignClientResult
<
CompanyModel
>
areaInfo
=
Privilege
.
companyClient
.
seleteOne
(
companyModel
.
getParentId
());
list
.
add
(
areaInfo
.
getResult
());
}
}
//如果是场站获取片区
public
class
PrivilegeController
extends
BaseController
{
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
@Value
(
"${yth.qg.id}"
)
private
Long
qgCompanyId
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/queryOrgTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位、部门树"
,
notes
=
"查询单位、子单位、部门树"
)
public
FeignClientResult
<
Collection
<
UserOrgTreeModel
>>
queryOrgTree
()
{
// 获取当前登录人单位
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
Long
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
FeignClientResult
<
Collection
<
UserOrgTreeModel
>>
de
=
Privilege
.
companyClient
.
queryOrgTree
(
companyId
);
return
de
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/subcompany"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询单位、子单位"
,
notes
=
"查询单位、子单位"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
subcompany
(
String
orgCode
,
String
type
)
{
// Long companyId =null;
// if(orgCode!=null){
// LinkedHashMap<Object, Object> l = (LinkedHashMap<Object, Object>) Privilege.companyClient
// .queryByOrgcode(orgCode).getResult();
// for (Map.Entry<Object, Object> it : l.entrySet()) {
//
// CompanyModel companyModel = JSONObject.parseObject(JSONObject.toJSONString(it.getValue()),
// CompanyModel.class);
// if (companyModel != null) {
// companyId = companyModel.getSequenceNbr();
// }
// break;
// }
//
// }else{
// ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// companyId = reginParams.getCompany().getSequenceNbr();
// }
// //获取当前登录人单位
// List<ListCompanyModel> data = new ArrayList();
// FeignClientResult<CompanyModel> dat = Privilege.companyClient.seleteOne(companyId);
// CompanyModel companyModel=dat.getResult();
// List<CompanyModel> list =new ArrayList<>();
// //如果是公司则获取所有片区
//// 86*353*328*364
// if(companyModel.getLevel().equals("departmentorcompany")){
// Collection<CompanyModel> companyModelList= de.getResult();
// companyModelList=companyModelList.stream().filter(companyModel1 ->companyModel1.getCompanyName().contains("区域")).collect(Collectors.toList());
// companyModelList.parallelStream().forEach((companyModel1)->{companyModel1.setChildren(new ArrayList());});
// return ResponseHelper.buildResponse(companyModelList);
// }
// //如果是片区则获取片区
// if(companyModel.getLevel().equals("area")){
// list.add(companyModel);
// return ResponseHelper.buildResponse(list);
// }
// if(!"add".equals(type)){
// if(companyModel.getLevel().equals("station")){
// FeignClientResult<CompanyModel> areaInfo = Privilege.companyClient.seleteOne(companyModel.getParentId());
// list.add(areaInfo.getResult());
// }
// }
// 如果是场站获取片区
// if(companyModel.getLevel().equals("station")){
// FeignClientResult<CompanyModel> areaInfo = Privilege.companyClient.seleteOne(companyModel.getParentId());
// list.add(areaInfo.getResult());
// }
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/stationTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属场站"
,
notes
=
"查询所属场站"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
stationTree
(
String
orgCode
)
{
Long
companyId
=
null
;
if
(
orgCode
!=
null
){
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
else
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
}
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
CompanyModel
companyModel
=
dat
.
getResult
();
companyModel
.
setChildren
(
de
.
getResult
());
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/permissionTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属场站"
,
notes
=
"查询所属场站"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
permissionTree
(
@RequestParam
(
required
=
false
,
defaultValue
=
"86*353*328"
)
String
orgCode
)
{
Long
companyId
=
null
;
if
(
orgCode
!=
null
){
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
CompanyModel
companyModel
=
dat
.
getResult
();
companyModel
.
setChildren
(
de
.
getResult
());
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
String
companyLevel
=
"categroy_leve2"
;
String
companyName
=
""
;
Long
parentId
=
null
;
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
Map
<
String
,
String
>
companyInfo
=
new
HashMap
<
String
,
String
>();
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
// throw new BadRequest("您当前未配置数据权限!");
}
else
{
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
companyLevel
=
companyInfo
.
get
(
"level"
).
toString
();
companyName
=
companyInfo
.
get
(
"companyName"
).
toString
();
}
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
qgCompanyId
);
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
// 如果是全国
if
(
companyLevel
.
equals
(
"categroy_leve2"
))
{
Collection
<
CompanyModel
>
companyModelList
=
de
.
getResult
();
companyModelList
=
companyModelList
.
stream
()
.
filter
(
companyModel1
->
companyModel1
.
getCompanyName
().
contains
(
"区域"
))
.
collect
(
Collectors
.
toList
());
companyModelList
.
parallelStream
().
forEach
((
companyModel1
)
->
{
companyModel1
.
setChildren
(
new
ArrayList
());
});
return
ResponseHelper
.
buildResponse
(
companyModelList
);
}
// 如果是片区则获取片区
if
(
companyLevel
.
equals
(
"area"
)||(!
"add"
.
equals
(
type
)&&
companyLevel
.
equals
(
"station"
)))
{
Collection
<
CompanyModel
>
companyModelList
=
de
.
getResult
();
companyModelList
=
companyModelList
.
stream
()
.
filter
(
companyModel1
->
companyModel1
.
getCompanyName
().
contains
(
"区域"
))
.
collect
(
Collectors
.
toList
());
for
(
CompanyModel
companyModel
:
companyModelList
)
{
if
(
companyModel
.
getCompanyName
().
equals
(
companyName
))
{
list
.
add
(
companyModel
);
break
;
}
}
list
.
parallelStream
().
forEach
((
companyModel1
)
->
{
companyModel1
.
setChildren
(
new
ArrayList
());
});
return
ResponseHelper
.
buildResponse
(
list
);
}
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/stationTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属场站"
,
notes
=
"查询所属场站"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
stationTree
(
String
orgCode
)
{
Long
companyId
=
null
;
if
(
orgCode
!=
null
)
{
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
else
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
companyId
=
reginParams
.
getCompany
().
getSequenceNbr
();
}
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
CompanyModel
companyModel
=
dat
.
getResult
();
companyModel
.
setChildren
(
de
.
getResult
());
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/permissionTree"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询所属场站"
,
notes
=
"查询所属场站"
)
public
ResponseModel
<
Collection
<
CompanyModel
>>
permissionTree
(
@RequestParam
(
required
=
false
,
defaultValue
=
"86*353*328"
)
String
orgCode
)
{
Long
companyId
=
null
;
if
(
orgCode
!=
null
)
{
LinkedHashMap
<
Object
,
Object
>
l
=
(
LinkedHashMap
<
Object
,
Object
>)
Privilege
.
companyClient
.
queryByOrgcode
(
orgCode
).
getResult
();
for
(
Map
.
Entry
<
Object
,
Object
>
it
:
l
.
entrySet
())
{
CompanyModel
companyModel
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
it
.
getValue
()),
CompanyModel
.
class
);
if
(
companyModel
!=
null
)
{
companyId
=
companyModel
.
getSequenceNbr
();
}
break
;
}
}
List
<
ListCompanyModel
>
data
=
new
ArrayList
();
FeignClientResult
<
Collection
<
CompanyModel
>>
de
=
Privilege
.
companyClient
.
querySubAgencyTree
(
companyId
);
FeignClientResult
<
CompanyModel
>
dat
=
Privilege
.
companyClient
.
seleteOne
(
companyId
);
CompanyModel
companyModel
=
dat
.
getResult
();
companyModel
.
setChildren
(
de
.
getResult
());
List
<
CompanyModel
>
list
=
new
ArrayList
<>();
list
.
add
(
companyModel
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
View file @
d1513f1b
...
...
@@ -26,62 +26,63 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.EquipAlarmEventMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.EquipDivergenceAlarmEventMapper
;
@Service
public
class
EquipAlarmEventServiceImpl
extends
BaseService
<
EquipAlarmEventDto
,
EquipAlarmEvent
,
EquipAlarmEventMapper
>
{
public
class
EquipAlarmEventServiceImpl
extends
BaseService
<
EquipAlarmEventDto
,
EquipAlarmEvent
,
EquipAlarmEventMapper
>
{
@Autowired
EquipAlarmEventMapper
equipAlarmEventMapper
;
@Autowired
StationBasicMapper
stationBasicMapper
;
@Autowired
EquipDivergenceAlarmEventMapper
equipDivergenceAlarmEventMapper
;
@Autowired
EquipAlarmEventMapper
equipAlarmEventMapper
;
@Autowired
StationBasicMapper
stationBasicMapper
;
@Autowired
EquipDivergenceAlarmEventMapper
equipDivergenceAlarmEventMapper
;
public
ResultsData
getEventByEquipIndex
(
String
gatewayId
,
int
current
,
int
size
,
String
equipIndex
,
String
frontModule
)
{
List
<
EquipAlarmEventDto
>
equipAlarmEvents
=
new
ArrayList
<>();
LambdaQueryWrapper
<
EquipAlarmEvent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
equipIndex
!=
null
)
{
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getEquipIndex
,
equipIndex
);
}
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getGatewayId
,
gatewayId
);
if
(
frontModule
!=
null
)
{
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getFrontModule
,
frontModule
);
}
Calendar
calendar
=
Calendar
.
getInstance
(
);
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
7
);
queryWrapper
.
gt
(
EquipAlarmEvent:
:
getCreatedTime
,
calendar
.
getTime
()
);
int
count
=
equipAlarmEventMapper
.
selectCount
(
queryWrapper
);
IPage
<
EquipAlarmEvent
>
p
=
new
Page
<>(
current
,
size
);
equipAlarmEvents
=
equipAlarmEventMapper
.
getAlarmEventList
(
gatewayId
,
equipIndex
,
frontModule
,
(
p
.
getCurrent
()-
1
)*
p
.
getSize
(),
p
.
getSize
(),
calendar
.
getTime
());
//
equipAlarmEvents = equipAlarmEventMapper.selectList(queryWrapper);
//
equipAlarmEvents=page.getRecords();
equipAlarmEvents
.
forEach
(
i
->
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
}
else
{
i
.
setValue
(
"分"
);
}
}
);
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
count
,
false
,
current
,
equipAlarmEvents
);
ColModel
colModelEventMovement
=
new
ColModel
(
"equipName"
,
"equipName"
,
"设备名"
,
"设备名"
,
"dataGrid"
,
"equipName"
);
ColModel
colModelStationName
=
new
ColModel
(
"alarmDesc"
,
"alarmDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"alarmDesc
"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"createdTime"
,
"createdTime"
,
"告警时间"
,
"告警时间"
,
"dataGrid"
,
"createdTim
e"
);
ColModel
colModelValueDesc
=
new
ColModel
(
"value"
,
"value"
,
"动作"
,
"动作"
,
"dataGrid"
,
"value"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelValueDesc
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
public
ResultsData
getEquipDivergenceEvent
(
String
gatewayId
,
int
current
,
int
size
)
{
PageHelper
.
startPage
(
current
,
size
);
public
ResultsData
getEventByEquipIndex
(
String
gatewayId
,
int
current
,
int
size
,
String
equipIndex
,
String
frontModule
)
{
List
<
EquipAlarmEventDto
>
equipAlarmEvents
=
new
ArrayList
<>();
LambdaQueryWrapper
<
EquipAlarmEvent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
equipIndex
!=
null
)
{
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getEquipIndex
,
equipIndex
);
}
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getGatewayId
,
gatewayId
);
if
(
frontModule
!=
null
)
{
queryWrapper
.
eq
(
EquipAlarmEvent:
:
getFrontModule
,
frontModule
);
}
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
7
);
queryWrapper
.
gt
(
EquipAlarmEvent:
:
getCreatedTime
,
calendar
.
getTime
()
);
int
count
=
equipAlarmEventMapper
.
selectCount
(
queryWrapper
);
IPage
<
EquipAlarmEvent
>
p
=
new
Page
<>(
current
,
size
);
equipAlarmEvents
=
equipAlarmEventMapper
.
getAlarmEventList
(
gatewayId
,
equipIndex
,
frontModule
,
(
p
.
getCurrent
()
-
1
)
*
p
.
getSize
(),
p
.
getSize
(),
calendar
.
getTime
());
//
equipAlarmEvents = equipAlarmEventMapper.selectList(queryWrapper);
//
equipAlarmEvents=page.getRecords();
equipAlarmEvents
.
forEach
(
i
->
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
}
else
{
i
.
setValue
(
"分"
);
}
}
);
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
count
,
false
,
current
,
equipAlarmEvents
);
ColModel
colModelEventMovement
=
new
ColModel
(
"equipName"
,
"equipName"
,
"设备名"
,
"设备名"
,
"dataGrid"
,
"equipName"
);
ColModel
colModelStationName
=
new
ColModel
(
"alarmDesc"
,
"alarmDesc"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"alarmDesc"
);
ColModel
colModelEventDesc
=
new
ColModel
(
"createdTime"
,
"createdTime"
,
"告警时间"
,
"告警时间"
,
"dataGrid"
,
"createdTime
"
);
ColModel
colModelValueDesc
=
new
ColModel
(
"value"
,
"value"
,
"动作"
,
"动作"
,
"dataGrid"
,
"valu
e"
);
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelValueDesc
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
public
ResultsData
getEquipDivergenceEvent
(
String
gatewayId
,
int
current
,
int
size
)
{
PageHelper
.
startPage
(
current
,
size
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
2
);
List
<
EquipDivergenceAlarmEvent
>
alarmEventList
=
equipDivergenceAlarmEventMapper
.
getEventList
(
gatewayId
,
null
,
null
,
calendar
.
getTime
());
List
<
EquipDivergenceAlarmEvent
>
alarmEventList
=
equipDivergenceAlarmEventMapper
.
getEventList
(
gatewayId
,
null
,
null
,
calendar
.
getTime
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Calendar
car
=
Calendar
.
getInstance
();
...
...
@@ -91,12 +92,12 @@ public class EquipAlarmEventServiceImpl extends BaseService<EquipAlarmEventDto,
// } else if ("false".equals(i.getValue())) {
// i.setValue("分");
// }
long
mills
=
i
.
getCreatedTime
()
;
long
mills
=
i
.
getCreatedTime
()
/
1000000
;
car
.
setTimeInMillis
(
mills
);
// System.out.println(sdf.format(car.getTime()));
String
time
=
sdf
.
format
(
car
.
getTime
());
if
(
time
.
contains
(
"1970"
))
{
mills
=
i
.
getCreatedTime
()
/
1000000
;
if
(
time
.
contains
(
"1970
-
"
))
{
mills
=
i
.
getCreatedTime
();
car
.
setTimeInMillis
(
mills
);
time
=
sdf
.
format
(
car
.
getTime
());
}
...
...
@@ -118,5 +119,5 @@ public class EquipAlarmEventServiceImpl extends BaseService<EquipAlarmEventDto,
colModelEventDesc
,
colModelValueDesc
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
d1513f1b
...
...
@@ -149,7 +149,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
@Override
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
String
table
=
gateway
;
Map
<
String
,
List
<
String
>>
queryCodntion
=
new
HashMap
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
d1513f1b
...
...
@@ -149,13 +149,19 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"30秒平均风速"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
speendOrirradiate
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result
,
"30秒平均风速"
));
}
else
if
(
stationCacheInfoDto
.
getStationType
().
contains
(
"GFDZ"
)){
if
(
result
!=
null
)
{
speendOrirradiate
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result
,
"30秒平均风速"
));
}
}
else
if
(
stationCacheInfoDto
.
getStationType
().
contains
(
"GFDZ"
)){
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
speendOrirradiate
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"WTX-801_25_WTX-801_总辐射"
));
if
(
result
!=
null
)
{
speendOrirradiate
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"WTX-801_25_WTX-801_总辐射"
));
}
}
else
{
speendOrirradiate
=
"0.00"
;
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/AlarmEventServiceImpl.java
View file @
d1513f1b
...
...
@@ -166,12 +166,12 @@ public class AlarmEventServiceImpl extends BaseService<AlarmEventDto, AlarmEvent
i
.
setValue
(
"分"
);
}
i
.
setStationName
(
"升压站"
);
long
mills
=
i
.
getCreatedTime
()
;
long
mills
=
i
.
getCreatedTime
()
/
1000000
;
car
.
setTimeInMillis
(
mills
);
// System.out.println(sdf.format(car.getTime()));
String
time
=
sdf
.
format
(
car
.
getTime
());
if
(
time
.
contains
(
"1970"
))
{
mills
=
i
.
getCreatedTime
()
/
1000000
;
if
(
time
.
contains
(
"1970
-
"
))
{
mills
=
i
.
getCreatedTime
();
car
.
setTimeInMillis
(
mills
);
time
=
sdf
.
format
(
car
.
getTime
());
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-warn-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EquipAlarmEventServiceImpl.java
View file @
d1513f1b
...
...
@@ -64,12 +64,12 @@ public class EquipAlarmEventServiceImpl
}
else
if
(
"false"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"分"
);
}
long
mills
=
i
.
getCreatedTime
()
;
long
mills
=
i
.
getCreatedTime
()
/
1000000
;
car
.
setTimeInMillis
(
mills
);
// System.out.println(sdf.format(car.getTime()));
String
time
=
sdf
.
format
(
car
.
getTime
());
if
(
time
.
contains
(
"1970"
))
{
mills
=
i
.
getCreatedTime
()
/
1000000
;
if
(
time
.
contains
(
"1970
-
"
))
{
mills
=
i
.
getCreatedTime
();
car
.
setTimeInMillis
(
mills
);
time
=
sdf
.
format
(
car
.
getTime
());
}
...
...
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