Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cneeds-server
Overview
Overview
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
zhangzr
cneeds-server
Commits
dc5f5e01
Commit
dc5f5e01
authored
May 29, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复适量配置功能
parent
033f1b47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
DeviceInfoChannelService.java
...needs/server/device/service/DeviceInfoChannelService.java
+2
-0
DeviceInfoChannelServiceImpl.java
...ver/device/service/impl/DeviceInfoChannelServiceImpl.java
+7
-0
DeviceInfoController.java
...com/mx/cneeds/server/device/web/DeviceInfoController.java
+7
-2
No files found.
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoChannelService.java
View file @
dc5f5e01
...
@@ -23,6 +23,8 @@ public interface DeviceInfoChannelService extends IService<DeviceInfoChannelEnti
...
@@ -23,6 +23,8 @@ public interface DeviceInfoChannelService extends IService<DeviceInfoChannelEnti
void
removeDeivceInfoChannelByDeviceIdAndChannelId
(
Long
channelId
,
List
<
Long
>
deviceIds
);
void
removeDeivceInfoChannelByDeviceIdAndChannelId
(
Long
channelId
,
List
<
Long
>
deviceIds
);
void
removeDeivceInfoChannelByDeviceIds
(
List
<
Long
>
deviceIds
);
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByChannelIds
(
List
<
Long
>
channelIds
);
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByChannelIds
(
List
<
Long
>
channelIds
);
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByDeviceIds
(
List
<
Long
>
deviceIds
);
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByDeviceIds
(
List
<
Long
>
deviceIds
);
...
...
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoChannelServiceImpl.java
View file @
dc5f5e01
...
@@ -49,6 +49,13 @@ public class DeviceInfoChannelServiceImpl extends ServiceImpl<DeviceInfoChannelD
...
@@ -49,6 +49,13 @@ public class DeviceInfoChannelServiceImpl extends ServiceImpl<DeviceInfoChannelD
}
}
@Override
@Override
public
void
removeDeivceInfoChannelByDeviceIds
(
List
<
Long
>
deviceIds
){
getBaseMapper
().
delete
(
new
QueryWrapper
<
DeviceInfoChannelEntity
>()
.
in
(
"device_id"
,
deviceIds
));
}
@Override
public
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByChannelIds
(
List
<
Long
>
channelIds
){
public
List
<
DeviceInfoChannelEntity
>
queryDeviceInfoChannelByChannelIds
(
List
<
Long
>
channelIds
){
List
<
DeviceInfoChannelEntity
>
deviceInfoChannelEntities
=
getBaseMapper
().
selectList
(
new
QueryWrapper
<
DeviceInfoChannelEntity
>()
List
<
DeviceInfoChannelEntity
>
deviceInfoChannelEntities
=
getBaseMapper
().
selectList
(
new
QueryWrapper
<
DeviceInfoChannelEntity
>()
.
in
(
"channel_id"
,
channelIds
));
.
in
(
"channel_id"
,
channelIds
));
...
...
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java
View file @
dc5f5e01
...
@@ -262,11 +262,12 @@ public class DeviceInfoController {
...
@@ -262,11 +262,12 @@ public class DeviceInfoController {
* 保存
* 保存
*/
*/
@RequestMapping
(
"/updateDeviceChannelBatch"
)
@RequestMapping
(
"/updateDeviceChannelBatch"
)
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
R
updateDeviceChannelBatch
(
@RequestBody
DevicesDto
devicesDto
){
public
R
updateDeviceChannelBatch
(
@RequestBody
DevicesDto
devicesDto
){
List
<
DeviceInfoEntity
>
deviceInfoEntityList
=
new
LinkedList
<>();
List
<
DeviceInfoEntity
>
deviceInfoEntityList
=
new
LinkedList
<>();
List
<
DeviceInfoChannelEntity
>
deviceChannelEntities
=
new
LinkedList
<>();
List
<
DeviceInfoChannelEntity
>
deviceChannelEntities
=
new
LinkedList
<>();
List
<
Long
>
deviceIds
=
new
ArrayList
<>();
if
(
devicesDto
.
getImeis
()
!=
null
&&
devicesDto
.
getImeis
().
size
()
!=
0
)
{
if
(
devicesDto
.
getImeis
()
!=
null
&&
devicesDto
.
getImeis
().
size
()
!=
0
)
{
...
@@ -285,10 +286,12 @@ public class DeviceInfoController {
...
@@ -285,10 +286,12 @@ public class DeviceInfoController {
entities
.
forEach
(
entity
->
{
entities
.
forEach
(
entity
->
{
if
(
entity
.
getImei
().
equals
(
str
)){
if
(
entity
.
getImei
().
equals
(
str
)){
infoChannel
.
setDeviceId
(
entity
.
getDeviceId
());
infoChannel
.
setDeviceId
(
entity
.
getDeviceId
());
deviceIds
.
add
(
entity
.
getDeviceId
());
}
}
});
});
infoChannel
.
setChannelId
(
channelNum
);
infoChannel
.
setChannelId
(
channelNum
);
deviceChannelEntities
.
add
(
infoChannel
);
deviceChannelEntities
.
add
(
infoChannel
);
});
});
});
});
...
@@ -296,7 +299,9 @@ public class DeviceInfoController {
...
@@ -296,7 +299,9 @@ public class DeviceInfoController {
deviceInfoService
.
updateBatchByImei
(
deviceInfoEntityList
);
deviceInfoService
.
updateBatchByImei
(
deviceInfoEntityList
);
// TODO 把已经增加过的删除
// 删除原来的
deviceInfoChannelService
.
removeDeivceInfoChannelByDeviceIds
(
deviceIds
);
deviceInfoChannelService
.
saveBatch
(
deviceChannelEntities
);
deviceInfoChannelService
.
saveBatch
(
deviceChannelEntities
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
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