Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
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
廖旭伟
self-service
Commits
4439c66a
Commit
4439c66a
authored
May 14, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下发设备开柜指令
parent
ce0a2f62
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
2 deletions
+69
-2
common-lib/src/main/java/com/mortals/xhx/common/pdu/device/DeviceNotifyPdu.java
...va/com/mortals/xhx/common/pdu/device/DeviceNotifyPdu.java
+15
-0
common-lib/src/main/java/com/mortals/xhx/feign/device/IDeviceFeign.java
.../main/java/com/mortals/xhx/feign/device/IDeviceFeign.java
+13
-1
sst-manager/db/add_db.sql
sst-manager/db/add_db.sql
+4
-1
sst-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+37
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/device/DeviceNotifyPdu.java
0 → 100644
View file @
4439c66a
package
com.mortals.xhx.common.pdu.device
;
import
lombok.Data
;
import
java.util.List
;
/**
* 下发设备消息
*/
@Data
public
class
DeviceNotifyPdu
{
private
List
<
String
>
deviceCodeList
;
private
String
action
;
private
String
content
;
}
common-lib/src/main/java/com/mortals/xhx/feign/device/IDeviceFeign.java
View file @
4439c66a
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.feign.device;
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.feign.device;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.device.DeviceNotifyPdu
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.feign.IFeign
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
...
@@ -58,7 +59,13 @@ public interface IDeviceFeign extends IFeign {
...
@@ -58,7 +59,13 @@ public interface IDeviceFeign extends IFeign {
@PostMapping
(
value
=
"/device/save"
)
@PostMapping
(
value
=
"/device/save"
)
Rest
<
RespData
<
DevicePdu
>>
save
(
@RequestBody
DevicePdu
devicePdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
Rest
<
RespData
<
DevicePdu
>>
save
(
@RequestBody
DevicePdu
devicePdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
/**
* 接收第三方平台下发设备消息
* @param deviceNotifyPdu
* @return
*/
@PostMapping
(
value
=
"/notify/downMsg"
)
Rest
<
String
>
downMsg
(
@RequestBody
DeviceNotifyPdu
deviceNotifyPdu
);
}
}
...
@@ -87,6 +94,11 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
...
@@ -87,6 +94,11 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
public
Rest
<
RespData
<
DevicePdu
>>
save
(
DevicePdu
devicePdu
,
String
authorization
)
{
public
Rest
<
RespData
<
DevicePdu
>>
save
(
DevicePdu
devicePdu
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法保存设备,请稍后再试!"
);
return
Rest
.
fail
(
"暂时无法保存设备,请稍后再试!"
);
}
}
@Override
public
Rest
<
String
>
downMsg
(
DeviceNotifyPdu
deviceNotifyPdu
)
{
return
Rest
.
fail
(
"暂时无法接收第三方平台下发设备消息,请稍后再试!"
);
}
};
};
}
}
}
}
...
...
sst-manager/db/add_db.sql
View file @
4439c66a
...
@@ -193,4 +193,7 @@ CREATE TABLE mortals_xhx_user_matter_examine(
...
@@ -193,4 +193,7 @@ CREATE TABLE mortals_xhx_user_matter_examine(
`updateUserId`
bigint
(
20
)
COMMENT
'更新用户'
,
`updateUserId`
bigint
(
20
)
COMMENT
'更新用户'
,
`updateTime`
datetime
COMMENT
'更新时间'
,
`updateTime`
datetime
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'用户申报事项审批'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'用户申报事项审批'
;
\ No newline at end of file
--------待执行脚本
ALTER
TABLE
`mortals_xhx_sst_basic`
ADD
COLUMN
`countdown`
tinyint
(
2
)
DEFAULT
'0'
COMMENT
'操作倒计时单位分'
AFTER
`elderEnable`
;
\ No newline at end of file
sst-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
4439c66a
...
@@ -11,6 +11,7 @@ import com.mortals.xhx.common.code.YesNoEnum;
...
@@ -11,6 +11,7 @@ import com.mortals.xhx.common.code.YesNoEnum;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.device.DeviceAlarmPdu
;
import
com.mortals.xhx.common.pdu.device.DeviceAlarmPdu
;
import
com.mortals.xhx.common.pdu.device.DeviceModuleUsePdu
;
import
com.mortals.xhx.common.pdu.device.DeviceModuleUsePdu
;
import
com.mortals.xhx.common.pdu.device.DeviceNotifyPdu
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.common.pdu.device.DevicePdu
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.common.utils.BeanUtil
;
import
com.mortals.xhx.feign.device.IDeviceAlarmFeign
;
import
com.mortals.xhx.feign.device.IDeviceAlarmFeign
;
...
@@ -247,4 +248,40 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
...
@@ -247,4 +248,40 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
return
ret
;
}
}
@PostMapping
({
"openBox"
})
@UnAuth
public
Rest
<
Object
>
openBox
(
@RequestBody
DeviceEntity
device
)
{
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
String
busiDesc
=
"设备开柜"
;
int
code
=
1
;
try
{
DeviceNotifyPdu
pdu
=
new
DeviceNotifyPdu
();
List
<
String
>
deviceCodeList
=
new
ArrayList
<>();
deviceCodeList
.
add
(
device
.
getDeviceCode
());
pdu
.
setDeviceCodeList
(
deviceCodeList
);
pdu
.
setAction
(
"openBox"
);
Rest
<
String
>
rest
=
deviceFeign
.
downMsg
(
pdu
);
if
(
rest
.
getCode
()==
1
)
{
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
}
else
{
code
=
-
1
;
model
.
put
(
"message_info"
,
busiDesc
+
"失败"
);
}
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
catch
(
Exception
var9
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var9
);
}
this
.
init
(
model
,
context
);
ret
.
setCode
(
code
);
ret
.
setData
(
model
);
ret
.
setDict
(
model
.
get
(
"dict"
));
ret
.
setMsg
(
model
.
get
(
"message_info"
)
==
null
?
""
:
model
.
remove
(
"message_info"
).
toString
());
return
ret
;
}
}
}
\ No newline at end of file
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