Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
info-publish-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
赵啸非
info-publish-platform
Commits
292cf086
Commit
292cf086
authored
Dec 06, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改同步逻辑
parent
22aafc34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
common-lib/src/main/java/com/mortals/xhx/feign/device/IDeviceMessageFeign.java
...ava/com/mortals/xhx/feign/device/IDeviceMessageFeign.java
+14
-1
info-publish-manager-ui/admin/src/views/device/drawershow.vue
...-publish-manager-ui/admin/src/views/device/drawershow.vue
+1
-1
info-publish-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+15
-0
No files found.
common-lib/src/main/java/com/mortals/xhx/feign/device/IDeviceMessageFeign.java
View file @
292cf086
package
com.mortals.xhx.feign.device
;
package
com.mortals.xhx.feign.device
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.common.pdu.UploadDeviceReq
;
import
com.mortals.xhx.common.pdu.device.DeviceMsgReqPdu
;
import
com.mortals.xhx.common.pdu.device.DeviceMsgReqPdu
;
import
com.mortals.xhx.feign.IFeign
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
...
@@ -29,7 +30,14 @@ public interface IDeviceMessageFeign extends IFeign {
...
@@ -29,7 +30,14 @@ public interface IDeviceMessageFeign extends IFeign {
@PostMapping
(
value
=
"/api/callbackByProduct"
)
@PostMapping
(
value
=
"/api/callbackByProduct"
)
Rest
<
String
>
callbackByProduct
(
@RequestBody
DeviceMsgReqPdu
devicePdu
);
Rest
<
String
>
callbackByProduct
(
@RequestBody
DeviceMsgReqPdu
devicePdu
);
/**
* 设备消息 下发
*
* @param req
* @return
*/
@PostMapping
(
value
=
"/notify/downMsg"
)
Rest
<
String
>
downMsg
(
@RequestBody
UploadDeviceReq
req
);
}
}
...
@@ -44,6 +52,11 @@ class DeviceMessageFeignFallbackFactory implements FallbackFactory<IDeviceMessag
...
@@ -44,6 +52,11 @@ class DeviceMessageFeignFallbackFactory implements FallbackFactory<IDeviceMessag
public
Rest
<
String
>
callbackByProduct
(
DeviceMsgReqPdu
devicePdu
)
{
public
Rest
<
String
>
callbackByProduct
(
DeviceMsgReqPdu
devicePdu
)
{
return
Rest
.
fail
(
"发送消息失败,请稍后再试!"
);
return
Rest
.
fail
(
"发送消息失败,请稍后再试!"
);
}
}
@Override
public
Rest
<
String
>
downMsg
(
UploadDeviceReq
req
)
{
return
Rest
.
fail
(
"发送消息失败,请稍后再试!"
);
}
};
};
}
}
}
}
...
...
info-publish-manager-ui/admin/src/views/device/drawershow.vue
View file @
292cf086
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<Field
:span=
"20"
label=
"选择工作人员"
prop=
"roomId"
v-model=
"form.workmanId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.workmanId"
placeholder=
"请选择人员"
/>
<Field
:span=
"20"
label=
"选择工作人员"
prop=
"roomId"
v-model=
"form.workmanId"
:multiple=
"true"
type=
"select"
:enumData=
"dict.workmanId"
placeholder=
"请选择人员"
/>
<Field
:span=
"20"
label=
"轮播图片"
><fileUpload
v-model=
"filePaths"
:limit=
"limit"
:fileType=
"fileType"
:fileName=
"form.fileName"
@
getFileName=
"getFileName"
prePath=
"/file/fileupload"
/></Field>
<Field
:span=
"20"
label=
"轮播图片"
><fileUpload
v-model=
"filePaths"
:limit=
"limit"
:fileType=
"fileType"
:fileName=
"form.fileName"
@
getFileName=
"getFileName"
prePath=
"/file/fileupload"
/>
建议图片分辨率大小为1000*1200
</Field>
...
...
info-publish-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
292cf086
...
@@ -9,8 +9,10 @@ import com.mortals.xhx.common.code.DeviceMethodEnum;
...
@@ -9,8 +9,10 @@ import com.mortals.xhx.common.code.DeviceMethodEnum;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.EnabledEnum
;
import
com.mortals.xhx.common.code.EnabledEnum
;
import
com.mortals.xhx.common.pdu.LoginForm
;
import
com.mortals.xhx.common.pdu.LoginForm
;
import
com.mortals.xhx.common.pdu.UploadDeviceReq
;
import
com.mortals.xhx.common.pdu.device.DeviceReq
;
import
com.mortals.xhx.common.pdu.device.DeviceReq
;
import
com.mortals.xhx.feign.device.IDeviceFeign
;
import
com.mortals.xhx.feign.device.IDeviceFeign
;
import
com.mortals.xhx.feign.device.IDeviceMessageFeign
;
import
com.mortals.xhx.module.device.dao.DeviceDao
;
import
com.mortals.xhx.module.device.dao.DeviceDao
;
import
com.mortals.xhx.module.device.model.*
;
import
com.mortals.xhx.module.device.model.*
;
import
com.mortals.xhx.module.device.service.DeviceFileService
;
import
com.mortals.xhx.module.device.service.DeviceFileService
;
...
@@ -55,6 +57,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -55,6 +57,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Autowired
@Autowired
private
WorkmanService
workmanService
;
private
WorkmanService
workmanService
;
@Autowired
private
IDeviceMessageFeign
messageFeign
;
@Override
@Override
protected
String
getExtKey
(
DeviceEntity
data
)
{
protected
String
getExtKey
(
DeviceEntity
data
)
{
return
data
.
getDeviceCode
();
return
data
.
getDeviceCode
();
...
@@ -141,8 +146,16 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -141,8 +146,16 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeviceFileEntityList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getDeviceFileEntityList
()))
{
saveDeviceFile
(
entity
,
context
);
saveDeviceFile
(
entity
,
context
);
}
}
notifyDevice
(
entity
);
}
}
private
void
notifyDevice
(
DeviceEntity
entity
)
{
UploadDeviceReq
uploadDeviceReq
=
new
UploadDeviceReq
();
uploadDeviceReq
.
setDeviceCodeList
(
Arrays
.
asList
(
entity
.
getDeviceCode
()));
uploadDeviceReq
.
setAction
(
"edition"
);
log
.
info
(
"downMsg:{}"
,
JSON
.
toJSONString
(
uploadDeviceReq
));
messageFeign
.
downMsg
(
uploadDeviceReq
);
}
@Override
@Override
protected
void
updateAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateAfter
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
...
@@ -162,6 +175,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -162,6 +175,8 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceFileService
.
remove
(
deviceIds
,
context
);
deviceFileService
.
remove
(
deviceIds
,
context
);
saveDeviceFile
(
entity
,
context
);
saveDeviceFile
(
entity
,
context
);
}
}
notifyDevice
(
entity
);
}
}
private
void
saveDeviceFile
(
DeviceEntity
entity
,
Context
context
)
{
private
void
saveDeviceFile
(
DeviceEntity
entity
,
Context
context
)
{
...
...
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