Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
6c08f365
Commit
6c08f365
authored
Apr 26, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备大厅分配
parent
a9fc228e
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
900 additions
and
899 deletions
+900
-899
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteHallPdu.java
...ain/java/com/mortals/xhx/common/pdu/site/SiteHallPdu.java
+61
-0
common-lib/src/main/java/com/mortals/xhx/feign/site/ISiteHallFeign.java
.../main/java/com/mortals/xhx/feign/site/ISiteHallFeign.java
+102
-0
device-manager-ui/admin/src/views/device/list.vue
device-manager-ui/admin/src/views/device/list.vue
+315
-232
device-manager-ui/admin/src/views/system/menu/list.vue
device-manager-ui/admin/src/views/system/menu/list.vue
+8
-0
device-manager/db/add.sql
device-manager/db/add.sql
+9
-1
device-manager/pom.xml
device-manager/pom.xml
+1
-1
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
...c/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
+0
-31
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceEntity.java
...ava/com/mortals/xhx/module/device/model/DeviceEntity.java
+36
-627
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceQuery.java
...java/com/mortals/xhx/module/device/model/DeviceQuery.java
+209
-1
device-manager/src/main/java/com/mortals/xhx/module/device/service/DeviceService.java
.../com/mortals/xhx/module/device/service/DeviceService.java
+3
-0
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleDistributeServiceImpl.java
...evice/service/impl/DeviceModuleDistributeServiceImpl.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+21
-0
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+32
-0
device-manager/src/main/resources/sqlmap/module/device/DeviceMapper.xml
.../src/main/resources/sqlmap/module/device/DeviceMapper.xml
+98
-4
doc/api.md
doc/api.md
+3
-0
doc/设备管理系统.docx
doc/设备管理系统.docx
+0
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteHallPdu.java
0 → 100644
View file @
6c08f365
package
com.mortals.xhx.common.pdu.site
;
import
java.util.Date
;
import
java.util.List
;
import
com.mortals.framework.model.BaseEntityLong
;
import
lombok.Data
;
/**
* 站点大厅信息Pdu对象
*
* @author zxfei
* @date 2023-04-26
*/
@Data
public
class
SiteHallPdu
extends
BaseEntityLong
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 站点ID
*/
private
Long
siteId
;
/**
* 站点名称
*/
private
String
siteName
;
/**
* 大厅名称
*/
private
String
hallName
;
/**
* 地址
*/
private
String
address
;
/**
* 楼层
*/
private
Integer
floor
;
/**
* 楼栋
*/
private
Integer
build
;
/**
* 备注
*/
private
String
remark
;
public
void
initAttrValue
(){
this
.
siteId
=
null
;
this
.
siteName
=
""
;
this
.
hallName
=
""
;
this
.
address
=
""
;
this
.
floor
=
1
;
this
.
build
=
1
;
this
.
remark
=
""
;
}
}
\ No newline at end of file
common-lib/src/main/java/com/mortals/xhx/feign/site/ISiteHallFeign.java
0 → 100644
View file @
6c08f365
package
com.mortals.xhx.feign.site
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SiteHallPdu
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 站点大厅信息 Feign接口
*
* @author zxfei
* @date 2023-04-26
*/
@FeignClient
(
name
=
"base-manager"
,
path
=
"/base"
,
fallbackFactory
=
SiteHallFeignFallbackFactory
.
class
)
public
interface
ISiteHallFeign
extends
IFeign
{
/**
* 查看站点大厅信息列表
*
* @param siteHallPdu
* @return
*/
@PostMapping
(
value
=
"/site/hall/list"
)
Rest
<
RespData
<
List
<
SiteHallPdu
>>>
list
(
@RequestBody
SiteHallPdu
siteHallPdu
);
/**
* 查看站点大厅信息
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/site/hall/info"
)
Rest
<
SiteHallPdu
>
info
(
@RequestParam
(
value
=
"id"
)
Long
id
);
/**
* 删除站点大厅信息
*
* @param ids
* @return
*/
@GetMapping
(
value
=
"/site/hall/delete"
)
Rest
<
Void
>
delete
(
Long
[]
ids
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
/**
* 站点大厅信息保存更新
*
* @param siteHallPdu
* @return
*/
@PostMapping
(
value
=
"/site/hall/save"
)
Rest
<
RespData
<
SiteHallPdu
>>
save
(
@RequestBody
SiteHallPdu
siteHallPdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
}
@Slf4j
@Component
class
SiteHallFeignFallbackFactory
implements
FallbackFactory
<
ISiteHallFeign
>
{
@Override
public
ISiteHallFeign
create
(
Throwable
t
)
{
return
new
ISiteHallFeign
()
{
@Override
public
Rest
<
RespData
<
List
<
SiteHallPdu
>>>
list
(
SiteHallPdu
siteHallPdu
)
{
return
Rest
.
fail
(
"暂时无法获取站点大厅信息列表,请稍后再试!"
);
}
@Override
public
Rest
<
SiteHallPdu
>
info
(
Long
id
)
{
return
Rest
.
fail
(
"暂时无法获取站点大厅信息详细,请稍后再试!"
);
}
@Override
public
Rest
<
Void
>
delete
(
Long
[]
ids
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法删除站点大厅信息,请稍后再试!"
);
}
@Override
public
Rest
<
RespData
<
SiteHallPdu
>>
save
(
SiteHallPdu
siteHallPdu
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法保存站点大厅信息,请稍后再试!"
);
}
};
}
}
device-manager-ui/admin/src/views/device/list.vue
View file @
6c08f365
This diff is collapsed.
Click to expand it.
device-manager-ui/admin/src/views/system/menu/list.vue
View file @
6c08f365
...
@@ -119,6 +119,14 @@ export default {
...
@@ -119,6 +119,14 @@ export default {
// toView(row) {
// toView(row) {
// this.$refs.dialogform.view(row);
// this.$refs.dialogform.view(row);
// },
// },
handAdd
(
row
){
this
.
$router
.
push
({
path
:
this
.
pageInfo
.
add
,
query
:
{},
})
}
},
},
data
()
{
data
()
{
return
{
return
{
...
...
device-manager/db/add.sql
View file @
6c08f365
...
@@ -20,3 +20,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMME
...
@@ -20,3 +20,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMME
2023
-
02
-
2
2023
-
02
-
2
-- ----------------------------
-- ----------------------------
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`productCode`
varchar
(
64
)
default
''
COMMENT
'产品编码'
AFTER
productId
;
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`productCode`
varchar
(
64
)
default
''
COMMENT
'产品编码'
AFTER
productId
;
-- ----------------------------
2023
-
04
-
26
-- ----------------------------
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`hallId`
bigint
(
20
)
COMMENT
'大厅Id'
AFTER
skinName
;
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`hallName`
varchar
(
256
)
default
''
COMMENT
'大厅名称'
AFTER
hallId
;
device-manager/pom.xml
View file @
6c08f365
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<profiles.active>
develop
</profiles.active>
<profiles.active>
develop
</profiles.active>
<profiles.server.port>
18222
</profiles.server.port>
<profiles.server.port>
18222
</profiles.server.port>
<!-- <profiles.platform.type>standalone</profiles.platform.type>-->
<!-- <profiles.platform.type>standalone</profiles.platform.type>-->
<profiles.platform.type>
cloud
</profiles.platform.type>
<profiles.platform.type>
standalone
</profiles.platform.type>
<profiles.datasource.uri>
<profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.98:3306/device-new-platform?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]>
</profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.98:3306/device-new-platform?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]>
</profiles.datasource.uri>
<profiles.datasource.username>
root
</profiles.datasource.username>
<profiles.datasource.username>
root
</profiles.datasource.username>
...
...
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
6c08f365
...
@@ -603,7 +603,7 @@ public class DeviceApiController {
...
@@ -603,7 +603,7 @@ public class DeviceApiController {
@PostMapping
(
"callbackByProduct"
)
@PostMapping
(
"callbackByProduct"
)
@UnAuth
@UnAuth
public
String
callbackByProduct
(
@RequestBody
DeviceMsgReq
deviceMsgReq
)
{
public
String
callbackByProduct
(
@RequestBody
DeviceMsgReq
deviceMsgReq
)
{
log
.
info
(
"【设备数据消息接收】【请求体】--> "
+
JSONObject
.
toJSONString
(
deviceMsgReq
));
log
.
info
(
"【设备
产品
数据消息接收】【请求体】--> "
+
JSONObject
.
toJSONString
(
deviceMsgReq
));
ApiResp
<
String
>
rsp
=
new
ApiResp
<>();
ApiResp
<
String
>
rsp
=
new
ApiResp
<>();
rsp
.
setMsg
(
ApiRespCodeEnum
.
SUCCESS
.
getLabel
());
rsp
.
setMsg
(
ApiRespCodeEnum
.
SUCCESS
.
getLabel
());
rsp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
rsp
.
setCode
(
ApiRespCodeEnum
.
SUCCESS
.
getValue
());
...
...
device-manager/src/main/java/com/mortals/xhx/common/utils/DownMsgTask.java
View file @
6c08f365
...
@@ -85,37 +85,6 @@ public class DownMsgTask implements Runnable {
...
@@ -85,37 +85,6 @@ public class DownMsgTask implements Runnable {
TimeUnit
.
SECONDS
.
sleep
(
1
);
TimeUnit
.
SECONDS
.
sleep
(
1
);
}
}
/*
list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).forEach(item -> {
//根据设备编码查询设备
DeviceEntity deviceEntity = deviceService.getExtCache(item.getDeviceCode());
if (!ObjectUtils.isEmpty(deviceEntity)) {
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.DEVICECODE, item.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), item.getData(), header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(item.getMessageType());
deviceLogEntity.setContent(item.getData());
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity,null);
} else {
log.info("未找到设备,deviceCode:{}", item.getDeviceCode());
}
});*/
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"异常:"
,
e
);
log
.
error
(
"异常:"
,
e
);
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceEntity.java
View file @
6c08f365
This diff is collapsed.
Click to expand it.
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceQuery.java
View file @
6c08f365
package
com.mortals.xhx.module.device.model
;
package
com.mortals.xhx.module.device.model
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
/**
/**
* 设备查询对象
* 设备查询对象
*
*
* @author zxfei
* @author zxfei
* @date 2023-0
2-25
* @date 2023-0
4-26
*/
*/
public
class
DeviceQuery
extends
DeviceEntity
{
public
class
DeviceQuery
extends
DeviceEntity
{
/** 开始 主键ID,主键,自增长 */
/** 开始 主键ID,主键,自增长 */
...
@@ -413,6 +415,26 @@ public class DeviceQuery extends DeviceEntity {
...
@@ -413,6 +415,26 @@ public class DeviceQuery extends DeviceEntity {
/** 产品编码排除列表 */
/** 产品编码排除列表 */
private
List
<
String
>
productCodeNotList
;
private
List
<
String
>
productCodeNotList
;
/** 开始 大厅Id */
private
Long
hallIdStart
;
/** 结束 大厅Id */
private
Long
hallIdEnd
;
/** 增加 大厅Id */
private
Long
hallIdIncrement
;
/** 大厅Id列表 */
private
List
<
Long
>
hallIdList
;
/** 大厅Id排除列表 */
private
List
<
Long
>
hallIdNotList
;
/** 大厅名称 */
private
List
<
String
>
hallNameList
;
/** 大厅名称排除列表 */
private
List
<
String
>
hallNameNotList
;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private
List
<
DeviceQuery
>
orConditionList
;
private
List
<
DeviceQuery
>
orConditionList
;
...
@@ -2726,6 +2748,119 @@ public class DeviceQuery extends DeviceEntity {
...
@@ -2726,6 +2748,119 @@ public class DeviceQuery extends DeviceEntity {
this
.
productCodeNotList
=
productCodeNotList
;
this
.
productCodeNotList
=
productCodeNotList
;
}
}
/**
* 获取 开始 大厅Id
* @return hallIdStart
*/
public
Long
getHallIdStart
(){
return
this
.
hallIdStart
;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public
void
setHallIdStart
(
Long
hallIdStart
){
this
.
hallIdStart
=
hallIdStart
;
}
/**
* 获取 结束 大厅Id
* @return $hallIdEnd
*/
public
Long
getHallIdEnd
(){
return
this
.
hallIdEnd
;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public
void
setHallIdEnd
(
Long
hallIdEnd
){
this
.
hallIdEnd
=
hallIdEnd
;
}
/**
* 获取 增加 大厅Id
* @return hallIdIncrement
*/
public
Long
getHallIdIncrement
(){
return
this
.
hallIdIncrement
;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public
void
setHallIdIncrement
(
Long
hallIdIncrement
){
this
.
hallIdIncrement
=
hallIdIncrement
;
}
/**
* 获取 大厅Id
* @return hallIdList
*/
public
List
<
Long
>
getHallIdList
(){
return
this
.
hallIdList
;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public
void
setHallIdList
(
List
<
Long
>
hallIdList
){
this
.
hallIdList
=
hallIdList
;
}
/**
* 获取 大厅Id
* @return hallIdNotList
*/
public
List
<
Long
>
getHallIdNotList
(){
return
this
.
hallIdNotList
;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public
void
setHallIdNotList
(
List
<
Long
>
hallIdNotList
){
this
.
hallIdNotList
=
hallIdNotList
;
}
/**
* 获取 大厅名称
* @return hallNameList
*/
public
List
<
String
>
getHallNameList
(){
return
this
.
hallNameList
;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public
void
setHallNameList
(
List
<
String
>
hallNameList
){
this
.
hallNameList
=
hallNameList
;
}
/**
* 获取 大厅名称
* @return hallNameNotList
*/
public
List
<
String
>
getHallNameNotList
(){
return
this
.
hallNameNotList
;
}
/**
* 设置 大厅名称
* @param hallNameNotList
*/
public
void
setHallNameNotList
(
List
<
String
>
hallNameNotList
){
this
.
hallNameNotList
=
hallNameNotList
;
}
/**
/**
* 设置 主键ID,主键,自增长
* 设置 主键ID,主键,自增长
* @param id
* @param id
...
@@ -4105,6 +4240,79 @@ public class DeviceQuery extends DeviceEntity {
...
@@ -4105,6 +4240,79 @@ public class DeviceQuery extends DeviceEntity {
return
this
;
return
this
;
}
}
/**
* 设置 大厅Id
* @param hallId
*/
public
DeviceQuery
hallId
(
Long
hallId
){
setHallId
(
hallId
);
return
this
;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public
DeviceQuery
hallIdStart
(
Long
hallIdStart
){
this
.
hallIdStart
=
hallIdStart
;
return
this
;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public
DeviceQuery
hallIdEnd
(
Long
hallIdEnd
){
this
.
hallIdEnd
=
hallIdEnd
;
return
this
;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public
DeviceQuery
hallIdIncrement
(
Long
hallIdIncrement
){
this
.
hallIdIncrement
=
hallIdIncrement
;
return
this
;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public
DeviceQuery
hallIdList
(
List
<
Long
>
hallIdList
){
this
.
hallIdList
=
hallIdList
;
return
this
;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public
DeviceQuery
hallIdNotList
(
List
<
Long
>
hallIdNotList
){
this
.
hallIdNotList
=
hallIdNotList
;
return
this
;
}
/**
* 设置 大厅名称
* @param hallName
*/
public
DeviceQuery
hallName
(
String
hallName
){
setHallName
(
hallName
);
return
this
;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public
DeviceQuery
hallNameList
(
List
<
String
>
hallNameList
){
this
.
hallNameList
=
hallNameList
;
return
this
;
}
/**
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
* @return orConditionList
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/DeviceService.java
View file @
6c08f365
...
@@ -48,6 +48,9 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
...
@@ -48,6 +48,9 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
*/
*/
void
restartApp
(
DeviceEntity
deviceEntity
,
Context
context
);
void
restartApp
(
DeviceEntity
deviceEntity
,
Context
context
);
void
batchUpdateHall
(
DeviceEntity
deviceEntity
,
Context
context
);
/**
/**
* 设备启用停用
* 设备启用停用
* @param id
* @param id
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleDistributeServiceImpl.java
View file @
6c08f365
...
@@ -73,7 +73,7 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
...
@@ -73,7 +73,7 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
//RuntimeUtil
//RuntimeUtil
//部署路径是否存在 如果不存在 创建目录,
//部署路径是否存在 如果不存在 创建目录,
String
path
=
GlobalSysInfo
.
getParamValue
(
Constant
.
DISTRIBUTE_PATH
,
"/home/publish/
device-manager-ui
/homeDeviceUrl"
);
String
path
=
GlobalSysInfo
.
getParamValue
(
Constant
.
DISTRIBUTE_PATH
,
"/home/publish/
app
/homeDeviceUrl"
);
String
code
=
distributeEntity
.
getProductCode
();
String
code
=
distributeEntity
.
getProductCode
();
String
imageRe
=
distributeEntity
.
getImageResolutionValue
();
String
imageRe
=
distributeEntity
.
getImageResolutionValue
();
String
disPath
=
"/"
+
path
+
"/"
+
code
+
"/"
+
imageRe
;
String
disPath
=
"/"
+
path
+
"/"
+
code
+
"/"
+
imageRe
;
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
6c08f365
...
@@ -261,6 +261,27 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -261,6 +261,27 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
}
}
@Override
public
void
batchUpdateHall
(
DeviceEntity
deviceEntity
,
Context
context
)
{
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
.
getIdList
()))
{
throw
new
AppException
(
"请选择需要更新大厅的设备!"
);
}
if
(
ObjectUtils
.
isEmpty
(
deviceEntity
.
getHallId
())){
throw
new
AppException
(
"设备所属大厅不能为空!"
);
}
DeviceQuery
condition
=
new
DeviceQuery
();
condition
.
setIdList
(
deviceEntity
.
getIdList
());
DeviceQuery
deviceQuery
=
new
DeviceQuery
();
deviceQuery
.
setHallId
(
deviceEntity
.
getHallId
());
deviceQuery
.
setHallName
(
deviceEntity
.
getHallName
());
deviceQuery
.
setUpdateTime
(
new
Date
());
this
.
getDeviceDao
().
update
(
deviceQuery
,
condition
);
}
@Override
@Override
public
void
deviceEnabled
(
Long
id
,
Integer
enabled
,
Context
context
)
{
public
void
deviceEnabled
(
Long
id
,
Integer
enabled
,
Context
context
)
{
DeviceEntity
deviceEntity
=
this
.
get
(
id
,
context
);
DeviceEntity
deviceEntity
=
this
.
get
(
id
,
context
);
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
6c08f365
...
@@ -14,10 +14,12 @@ import com.mortals.xhx.base.system.param.service.ParamService;
...
@@ -14,10 +14,12 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.base.system.upload.service.UploadService
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SiteHallPdu
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.common.pdu.skin.SkinBasePdu
;
import
com.mortals.xhx.common.pdu.skin.SkinBasePdu
;
import
com.mortals.xhx.common.utils.QRCodeUtil
;
import
com.mortals.xhx.common.utils.QRCodeUtil
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.feign.site.ISiteHallFeign
;
import
com.mortals.xhx.feign.skin.ISkinBaseFeign
;
import
com.mortals.xhx.feign.skin.ISkinBaseFeign
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceMapEntity
;
import
com.mortals.xhx.module.device.model.DeviceMapEntity
;
...
@@ -73,6 +75,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -73,6 +75,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
private
String
platFormType
;
//版本,默认云服务版本
private
String
platFormType
;
//版本,默认云服务版本
@Autowired
@Autowired
private
SiteService
siteService
;
private
SiteService
siteService
;
@Autowired
public
ISiteHallFeign
siteHallFeign
;
public
DeviceController
()
{
public
DeviceController
()
{
...
@@ -100,6 +104,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -100,6 +104,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this
.
addDict
(
model
,
"skinProductCodeMap"
,
skinProductCodeMap
);
this
.
addDict
(
model
,
"skinProductCodeMap"
,
skinProductCodeMap
);
}
}
}
}
//siteHallFeign.list(new SiteHallPdu().setSiteId(context.g);)
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
...
@@ -108,6 +113,14 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -108,6 +113,14 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
List
<
OrderCol
>
orderColList
=
new
ArrayList
<>();
List
<
OrderCol
>
orderColList
=
new
ArrayList
<>();
orderColList
.
add
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
));
orderColList
.
add
(
new
OrderCol
(
"createTime"
,
OrderCol
.
DESCENDING
));
query
.
setOrderColList
(
orderColList
);
query
.
setOrderColList
(
orderColList
);
SiteHallPdu
siteHallPdu
=
new
SiteHallPdu
();
siteHallPdu
.
setSiteId
(
query
.
getSiteId
());
Rest
<
RespData
<
List
<
SiteHallPdu
>>>
rest
=
siteHallFeign
.
list
(
siteHallPdu
);
if
(
rest
.
getCode
()==
YesNoEnum
.
YES
.
getValue
()){
Map
<
String
,
String
>
hallMap
=
rest
.
getData
().
getData
().
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getHallName
(),
(
o
,
n
)
->
n
));
this
.
addDict
(
model
,
"hallId"
,
hallMap
);
}
super
.
doListBefore
(
query
,
model
,
context
);
super
.
doListBefore
(
query
,
model
,
context
);
}
}
...
@@ -328,6 +341,25 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -328,6 +341,25 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return
Rest
.
ok
(
model
);
return
Rest
.
ok
(
model
);
}
}
/**
* 设备批量更新设备所属大厅
*/
@PostMapping
(
value
=
"batchUpdateHall"
)
public
Rest
<
Void
>
batchUpdateHall
(
@RequestBody
DeviceEntity
deviceEntity
)
{
log
.
info
(
"批量设备重启"
,
deviceEntity
.
getDeviceCode
());
String
busiDesc
=
this
.
getModuleDesc
()
+
"批量更新所属大厅"
;
Rest
<
Void
>
rest
=
Rest
.
ok
(
busiDesc
+
" 【成功】"
);
try
{
this
.
service
.
batchUpdateHall
(
deviceEntity
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"批量更新所属大厅"
,
e
);
rest
=
Rest
.
fail
(
super
.
convertException
(
e
));
}
return
rest
;
}
@Override
@Override
public
void
doImportDataBefore
(
List
<
DeviceEntity
>
list
,
boolean
updateSupport
,
Context
context
)
throws
AppException
{
public
void
doImportDataBefore
(
List
<
DeviceEntity
>
list
,
boolean
updateSupport
,
Context
context
)
throws
AppException
{
...
...
device-manager/src/main/resources/sqlmap/module/device/DeviceMapper.xml
View file @
6c08f365
This diff is collapsed.
Click to expand it.
doc/api.md
View file @
6c08f365
...
@@ -666,6 +666,9 @@ key|String|消息唯一标识|是|-
...
@@ -666,6 +666,9 @@ key|String|消息唯一标识|是|-
}
}
```
```
## 码表
## 码表
### 响应结果码表
### 响应结果码表
...
...
doc/设备管理系统.docx
View file @
6c08f365
No preview for this file type
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