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
0c3416ec
Commit
0c3416ec
authored
May 19, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.Log上传增加设备信息
2.增加 渠道号管理 修改接口 3.增加 渠道号统计页面
parent
28495493
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
135 additions
and
4 deletions
+135
-4
DeviceInfoDto.java
...src/main/java/com/mx/cneeds/common/dto/DeviceInfoDto.java
+5
-0
DeviceInfoVo.java
...o/src/main/java/com/mx/cneeds/common/vo/DeviceInfoVo.java
+87
-0
DeviceClient.java
...va/com/mx/cneeds/server/datashow/client/DeviceClient.java
+3
-0
DeviceController.java
...x/cneeds/server/datashow/web/device/DeviceController.java
+8
-0
LogController.java
...m/mx/cneeds/server/datashow/web/device/LogController.java
+0
-1
application.yml
cneeds-server-datashow/src/main/resources/application.yml
+1
-1
DeviceChannelController.java
.../mx/cneeds/server/device/web/DeviceChannelController.java
+25
-0
application.yml
cneeds-server-device/src/main/resources/application.yml
+1
-1
LogUploadController.java
...m/mx/cneeds/server/logupload/web/LogUploadController.java
+4
-0
application.yml
cneeds-server-logupload/src/main/resources/application.yml
+1
-1
No files found.
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceInfoDto.java
View file @
0c3416ec
...
...
@@ -3,6 +3,7 @@ package com.mx.cneeds.common.dto;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @ClassName DeviceDto
...
...
@@ -78,5 +79,9 @@ public class DeviceInfoDto {
*/
private
String
seriesNum
;
/**
* 渠道号Ids
*/
private
List
<
Long
>
channelIds
;
}
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/vo/DeviceInfoVo.java
0 → 100644
View file @
0c3416ec
package
com
.
mx
.
cneeds
.
common
.
vo
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @ClassName DeviceDto
* @Author zzrdark
* @Date 2020-03-25 18:51
* @Description TODO
**/
@Data
public
class
DeviceInfoVo
{
/**
* 设备id
*/
private
Long
deviceId
;
/**
*
*/
private
Long
deptId
;
/**
* imei
*/
private
String
imei
;
/**
* iccid
*/
private
String
iccid
;
/**
* 状态0未激活,1已激活
*/
private
String
status
;
/**
* 设备版本
*/
private
String
deviceVersion
;
/**
* 产品系列
*/
private
Long
seriesId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 激活时间
*/
private
Date
activeTime
;
/**
* 渠道号
*/
private
String
channelNums
;
/**
* 渠道号提示信息
*/
private
String
channelNumsMessage
;
/**
* 0:白名单,1:黑名单
*/
private
Integer
channelRules
;
/**
* 产品系列号
*/
private
String
seriesNum
;
/**
* 渠道号Ids
*/
private
List
<
Long
>
channelIds
;
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/client/DeviceClient.java
View file @
0c3416ec
...
...
@@ -93,4 +93,7 @@ public interface DeviceClient {
@PostMapping
(
"/device/devicechannel/deleteSettingDeviceChannel"
)
void
deleteSettingDeviceChannel
(
@RequestBody
Long
deviceId
);
@PostMapping
(
"/device/devicechannel/updateSettingDeviceChannel"
)
void
updateSettingDeviceChannel
(
@RequestBody
DeviceInfoDto
dto
);
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/DeviceController.java
View file @
0c3416ec
...
...
@@ -280,4 +280,12 @@ public class DeviceController {
return
R
.
ok
();
}
@PostMapping
(
"/deviceChannel/updateSettingDeviceChannel"
)
public
R
updateSettingDeviceChannel
(
DeviceInfoVo
vo
){
DeviceInfoDto
dto
=
new
DeviceInfoDto
();
BeanUtils
.
copyProperties
(
vo
,
dto
);
deviceClient
.
updateSettingDeviceChannel
(
dto
);
return
R
.
ok
();
}
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/LogController.java
View file @
0c3416ec
...
...
@@ -94,7 +94,6 @@ public class LogController {
deviceInfoDtos
.
forEach
(
deviceInfoDto
->
{
if
(
deviceLogDto
.
getDeviceId
().
equals
(
deviceInfoDto
.
getDeviceId
())
){
deviceLogDto
.
setSeriesNum
(
deviceInfoDto
.
getSeriesNum
());
deviceLogDto
.
setDeviceVersion
(
deviceInfoDto
.
getDeviceVersion
());
}
});
});
...
...
cneeds-server-datashow/src/main/resources/application.yml
View file @
0c3416ec
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-datashow
server
:
...
...
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceChannelController.java
View file @
0c3416ec
package
com
.
mx
.
cneeds
.
server
.
device
.
web
;
import
com.mx.cneeds.common.dto.DeviceChannelDto
;
import
com.mx.cneeds.common.dto.DeviceInfoDto
;
import
com.mx.cneeds.common.dto.SeriesDto
;
import
com.mx.cneeds.common.pager.PageUtils
;
import
com.mx.cneeds.common.result.R
;
...
...
@@ -9,6 +10,7 @@ import com.mx.cneeds.server.device.service.DeviceChannelService;
import
com.mx.cneeds.server.device.service.DeviceInfoChannelService
;
import
com.mx.cneeds.server.device.service.DeviceInfoService
;
import
com.mx.cneeds.server.entity.DeviceChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -140,4 +142,27 @@ public class DeviceChannelController {
stringObjectHashMap
.
put
(
"device_id"
,
deviceId
);
deviceInfoChannelService
.
removeByMap
(
stringObjectHashMap
);
}
@RequestMapping
(
"/updateSettingDeviceChannel"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateSettingDeviceChannel
(
@RequestBody
DeviceInfoDto
deviceInfoDto
){
HashMap
<
String
,
Object
>
stringObjectHashMap
=
new
HashMap
<>();
stringObjectHashMap
.
put
(
"device_id"
,
deviceInfoDto
.
getDeviceId
());
deviceInfoChannelService
.
removeByMap
(
stringObjectHashMap
);
List
<
DeviceInfoChannelEntity
>
deviceInfoChannelEntities
=
new
LinkedList
<>();
for
(
Long
channelId
:
deviceInfoDto
.
getChannelIds
()){
DeviceInfoChannelEntity
deviceInfoChannelEntity
=
new
DeviceInfoChannelEntity
();
deviceInfoChannelEntity
.
setChannelId
(
channelId
);
deviceInfoChannelEntity
.
setDeviceId
(
deviceInfoDto
.
getDeviceId
());
deviceInfoChannelEntities
.
add
(
deviceInfoChannelEntity
);
}
deviceInfoChannelService
.
saveBatch
(
deviceInfoChannelEntities
);
DeviceInfoEntity
deviceInfoEntity
=
new
DeviceInfoEntity
();
deviceInfoEntity
.
setDeviceId
(
deviceInfoDto
.
getDeviceId
());
deviceInfoEntity
.
setChannelRules
(
deviceInfoDto
.
getChannelRules
());
deviceInfoEntity
.
setChannelNumsMessage
(
deviceInfoDto
.
getChannelNumsMessage
());
deviceInfoService
.
updateById
(
deviceInfoEntity
);
}
}
cneeds-server-device/src/main/resources/application.yml
View file @
0c3416ec
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-device
...
...
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/web/LogUploadController.java
View file @
0c3416ec
...
...
@@ -70,6 +70,10 @@ public class LogUploadController {
@RequestMapping
(
"/queryLogFileByLogAcceptId"
)
public
DeviceLogDto
queryLogFileByLogAcceptId
(
@RequestBody
String
logAcceptId
){
DeviceLogEntity
deviceLogEntity
=
deviceLogService
.
queryOneBylogAcceptId
(
logAcceptId
);
if
(
deviceLogEntity
==
null
){
return
null
;
}
DeviceLogDto
dto
=
new
DeviceLogDto
();
BeanUtils
.
copyProperties
(
deviceLogEntity
,
dto
);
return
dto
;
...
...
cneeds-server-logupload/src/main/resources/application.yml
View file @
0c3416ec
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-logupload
...
...
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