Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
energyai_java
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
葛齐林
energyai_java
Commits
445c079a
Commit
445c079a
authored
Jul 04, 2021
by
co_dengxiongwen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
86d54a50
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
51 deletions
+82
-51
WebSocket.java
...src/main/java/com/devplatform/admin/config/WebSocket.java
+3
-1
EquipmentController.java
...form/admin/modules/eq/controller/EquipmentController.java
+11
-7
LiResourceDao.java
...vplatform/admin/modules/liresource/dao/LiResourceDao.java
+49
-42
LiResourceService.java
...m/admin/modules/liresource/service/LiResourceService.java
+8
-0
LiResourceServiceImpl.java
...odules/liresource/service/impl/LiResourceServiceImpl.java
+5
-0
LiResourceMapper.xml
...src/main/resources/mapper/liResource/LiResourceMapper.xml
+6
-1
No files found.
microservice-admin/src/main/java/com/devplatform/admin/config/WebSocket.java
View file @
445c079a
...
@@ -64,7 +64,9 @@ public class WebSocket {
...
@@ -64,7 +64,9 @@ public class WebSocket {
for
(
WebSocket
webSocket
:
webSockets
)
{
for
(
WebSocket
webSocket
:
webSockets
)
{
System
.
out
.
println
(
"【websocket消息】广播消息:"
+
message
);
System
.
out
.
println
(
"【websocket消息】广播消息:"
+
message
);
try
{
try
{
webSocket
.
session
.
getAsyncRemote
().
sendText
(
message
);
synchronized
(
webSocket
.
session
)
{
webSocket
.
session
.
getAsyncRemote
().
sendText
(
message
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
microservice-admin/src/main/java/com/devplatform/admin/modules/eq/controller/EquipmentController.java
View file @
445c079a
...
@@ -10,8 +10,10 @@ import com.devplatform.admin.config.WebSocket;
...
@@ -10,8 +10,10 @@ import com.devplatform.admin.config.WebSocket;
import
com.devplatform.admin.modules.eq.bean.TimedTask
;
import
com.devplatform.admin.modules.eq.bean.TimedTask
;
import
com.devplatform.admin.modules.eq.service.EquipmentService
;
import
com.devplatform.admin.modules.eq.service.EquipmentService
;
import
com.devplatform.admin.modules.eq.service.TimedTaskService
;
import
com.devplatform.admin.modules.eq.service.TimedTaskService
;
import
com.devplatform.admin.modules.liresource.bean.LiResource
;
import
com.devplatform.admin.modules.liresource.bean.LiStation
;
import
com.devplatform.admin.modules.liresource.bean.LiStation
;
import
com.devplatform.admin.modules.liresource.model.LiResourceModel
;
import
com.devplatform.admin.modules.liresource.model.LiResourceModel
;
import
com.devplatform.admin.modules.liresource.service.LiResourceService
;
import
com.devplatform.admin.modules.liresource.service.LiStationService
;
import
com.devplatform.admin.modules.liresource.service.LiStationService
;
import
com.devplatform.admin.modules.sys.bean.SysSystemParams
;
import
com.devplatform.admin.modules.sys.bean.SysSystemParams
;
import
com.devplatform.admin.modules.sys.bean.SysSystemRunningTime
;
import
com.devplatform.admin.modules.sys.bean.SysSystemRunningTime
;
...
@@ -313,6 +315,9 @@ public class EquipmentController extends AbstractController {
...
@@ -313,6 +315,9 @@ public class EquipmentController extends AbstractController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
dataType
=
"String"
)
@PostMapping
(
"/checkModel"
)
@PostMapping
(
"/checkModel"
)
public
R
checkModel
(
Integer
type
,
Integer
status
)
{
public
R
checkModel
(
Integer
type
,
Integer
status
)
{
// 控制资源点启停
checkModelOnOrOff
(
type
,
status
);
SysSystemParams
sysSystemParams
=
sysSystemParamsService
.
getById
(
Constants
.
STRING_1
);
SysSystemParams
sysSystemParams
=
sysSystemParamsService
.
getById
(
Constants
.
STRING_1
);
if
(
type
==
Constants
.
INT_1
){
if
(
type
==
Constants
.
INT_1
){
sysSystemParams
.
setSun
(
status
);
sysSystemParams
.
setSun
(
status
);
...
@@ -333,9 +338,6 @@ public class EquipmentController extends AbstractController {
...
@@ -333,9 +338,6 @@ public class EquipmentController extends AbstractController {
Map
<
String
,
Object
>
list
=
equipmentService
.
getList
();
Map
<
String
,
Object
>
list
=
equipmentService
.
getList
();
webSocket
.
sendAllMessage
(
JSONObject
.
toJSONString
(
list
));
webSocket
.
sendAllMessage
(
JSONObject
.
toJSONString
(
list
));
// 控制资源点启停
checkModelOnOrOff
(
type
,
status
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -374,17 +376,19 @@ public class EquipmentController extends AbstractController {
...
@@ -374,17 +376,19 @@ public class EquipmentController extends AbstractController {
}
}
/**
/**
* 根据选择人工模式,来控制资源点
啊
启停
* 根据选择人工模式,来控制资源点启停
* @param type 1=供暖模式,2=机械通风,3=自然通风
* @param type 1=供暖模式,2=机械通风,3=自然通风
* @param status 1=开启,2=关闭
* @param status 1=开启,2=关闭
*/
*/
private
void
checkModelOnOrOff
(
Integer
type
,
Integer
status
)
{
private
void
checkModelOnOrOff
(
Integer
type
,
Integer
status
)
{
List
<
LiResource
>
list
=
new
ArrayList
();
List
<
LiResource
>
list
=
new
ArrayList
<
LiResource
>
();
// 查询所有模式匹配的资源点
// 查询所有模式匹配的资源点
// list = liResourceService.
list
=
liResourceService
.
queryListByParam
(
type
.
toString
());
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
LiResourceModel
model
=
new
LiResourceModel
();
LiResourceModel
model
=
new
LiResourceModel
();
model
.
setStatus
(
status
);
model
.
setId
(
list
.
get
(
i
).
getId
());
model
.
setStatus
(
status
==
1
?
1
:
0
);
model
.
setActionName
(
list
.
get
(
i
).
getName
()
+
(
status
==
1
?
"开启"
:
"关闭"
));
//操作类型,1=开关
//操作类型,1=开关
model
.
setActionType
(
1
);
model
.
setActionType
(
1
);
onOrOff
(
model
);
onOrOff
(
model
);
...
...
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/dao/LiResourceDao.java
View file @
445c079a
...
@@ -18,46 +18,53 @@ import java.util.List;
...
@@ -18,46 +18,53 @@ import java.util.List;
@Repository
@Repository
public
interface
LiResourceDao
extends
MyBaseMapper
<
LiResource
>
{
public
interface
LiResourceDao
extends
MyBaseMapper
<
LiResource
>
{
/**
/**
* 查询资源点数量
* 查询资源点数量
* @param model
* @param model
* @return
* @return
*/
*/
Integer
queryPageByCount
(
LiResourceModel
model
);
Integer
queryPageByCount
(
LiResourceModel
model
);
/**
/**
* 查询资源点数据
* 查询资源点数据
* @param model
* @param model
* @return
* @return
*/
*/
List
<
LiResource
>
queryPageByList
(
LiResourceModel
model
);
List
<
LiResource
>
queryPageByList
(
LiResourceModel
model
);
/**
/**
* 查询资源点树信息
* 查询资源点树信息
* @param model
* @param model
* @return
* @return
*/
*/
List
<
LiResource
>
getTreeList
(
LiResourceModel
model
);
List
<
LiResource
>
getTreeList
(
LiResourceModel
model
);
/**
/**
* 根据id查询资源点信息
* 根据id查询资源点信息
* @param id
* @param id
* @param stationId
* @param stationId
* @return
* @return
*/
*/
LiResource
getBeanById
(
@Param
(
"id"
)
String
id
,
@Param
(
"stationId"
)
String
stationId
);
LiResource
getBeanById
(
@Param
(
"id"
)
String
id
,
@Param
(
"stationId"
)
String
stationId
);
/**
/**
* 查询图层中资源点的数量
* 查询图层中资源点的数量
* @param tierId
* @param tierId
* @return
* @return
*/
*/
Integer
queryCountByTierId
(
String
tierId
);
Integer
queryCountByTierId
(
String
tierId
);
/**
/**
* 根据资源点编码查询资源点
* 根据资源点编码查询资源点
* @param code
* @param code
* @return
* @return
*/
*/
LiResource
queryByCode
(
String
code
);
LiResource
queryByCode
(
String
code
);
/**
* 查询人工模式下的所有资源点
* @param modeTypes
* @return
*/
List
<
LiResource
>
queryListByParam
(
String
modeTypes
);
}
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/service/LiResourceService.java
View file @
445c079a
...
@@ -53,4 +53,12 @@ public interface LiResourceService extends MyBaseService<LiResource> {
...
@@ -53,4 +53,12 @@ public interface LiResourceService extends MyBaseService<LiResource> {
* @return 资源点详情
* @return 资源点详情
*/
*/
LiResource
queryByCode
(
String
code
);
LiResource
queryByCode
(
String
code
);
/**
* 查询人工模式下的所有资源点
*
* @param modeTypes
* @return
*/
List
<
LiResource
>
queryListByParam
(
String
modeTypes
);
}
}
microservice-admin/src/main/java/com/devplatform/admin/modules/liresource/service/impl/LiResourceServiceImpl.java
View file @
445c079a
...
@@ -46,4 +46,9 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
...
@@ -46,4 +46,9 @@ public class LiResourceServiceImpl extends MyBaseServiceImpl<LiResourceDao, LiRe
return
baseMapper
.
queryByCode
(
code
);
return
baseMapper
.
queryByCode
(
code
);
}
}
@Override
public
List
<
LiResource
>
queryListByParam
(
String
modeTypes
)
{
return
baseMapper
.
queryListByParam
(
modeTypes
);
}
}
}
microservice-admin/src/main/resources/mapper/liResource/LiResourceMapper.xml
View file @
445c079a
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
where deleted = 0 and tier_id = #{tierId}
where deleted = 0 and tier_id = #{tierId}
</select>
</select>
<select
id=
"queryByCode"
resultType=
"com.devplatform.admin.modules.liresource.bean.LiResource"
>
<select
id=
"queryByCode"
resultType=
"com.devplatform.admin.modules.liresource.bean.LiResource"
>
select lr.id,lr.name,lr.code,sd.name as 'type',lr.address_code,lr.port,lr.username,lr.password,lr.deploy_location,lr.
line_name,lr.
station_name
select lr.id,lr.name,lr.code,sd.name as 'type',lr.address_code,lr.port,lr.username,lr.password,lr.deploy_location,lr.station_name
sd2.name as brandName
sd2.name as brandName
from li_resource lr
from li_resource lr
left join sys_dictionary sd on lr.`type` = sd.id and lr.station_id = sd.station_id
left join sys_dictionary sd on lr.`type` = sd.id and lr.station_id = sd.station_id
...
@@ -244,6 +244,11 @@
...
@@ -244,6 +244,11 @@
where lr.deleted = 0 and sd.deleted = 0 and lr.code = #{code}
where lr.deleted = 0 and sd.deleted = 0 and lr.code = #{code}
limit 0,1
limit 0,1
</select>
</select>
<select
id=
"queryListByParam"
resultType=
"com.devplatform.admin.modules.liresource.bean.LiResource"
>
select lr.id,lr.name,lr.type
from li_resource lr
where lr.deleted = 0 and FIND_IN_SET(#{modeTypes},lr.mode_types)
</select>
</mapper>
</mapper>
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