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
d9cd3586
Commit
d9cd3586
authored
Jul 27, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.add 设备导出表
2.add 设备导出模块查询
parent
9ff2da9c
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
198 additions
and
29 deletions
+198
-29
cneeds_server.sql
cneeds-common-data/db/cneeds_server.sql
+10
-0
DeviceInfoExportDao.java
...in/java/com/mx/cneeds/server/dao/DeviceInfoExportDao.java
+13
-0
DeviceInfoExportEntity.java
...a/com/mx/cneeds/server/entity/DeviceInfoExportEntity.java
+30
-0
DeviceInfoExportDao.xml
...on-data/src/main/resources/mapper/DeviceInfoExportDao.xml
+16
-0
DeviceInfoExportDto.java
...in/java/com/mx/cneeds/common/dto/DeviceInfoExportDto.java
+25
-0
application.yml
...s-server-authorization/src/main/resources/application.yml
+1
-1
LogFlieController.java
.../cneeds/server/datashow/web/device/LogFlieController.java
+1
-9
GlobalExceptionHandler.java
...ds/server/datashow/web/system/GlobalExceptionHandler.java
+1
-2
application.yml
cneeds-server-datashow/src/main/resources/application.yml
+1
-1
DeviceInfoExportService.java
...cneeds/server/device/service/DeviceInfoExportService.java
+22
-0
DeviceInfoExportServiceImpl.java
...rver/device/service/impl/DeviceInfoExportServiceImpl.java
+42
-0
DeviceInfoController.java
...com/mx/cneeds/server/device/web/DeviceInfoController.java
+33
-13
application.yml
cneeds-server-device/src/main/resources/application.yml
+1
-1
application.yml
cneeds-server-logupload/src/main/resources/application.yml
+1
-1
application.yml
cneeds-server-user/src/main/resources/application.yml
+1
-1
No files found.
cneeds-common-data/db/cneeds_server.sql
View file @
d9cd3586
...
...
@@ -361,3 +361,12 @@ MODIFY COLUMN `active_status` varchar(50) CHARACTER SET utf8 COLLATE utf8_genera
MODIFY
COLUMN
`channel_rules`
int
(
255
)
DEFAULT
1
COMMENT
'0:白名单,1:黑名单'
AFTER
`channel_nums_message`
,
MODIFY
COLUMN
`ca_certificate_status`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
-
1
COMMENT
'ca证书状态 -1 未下载,0 已下载 类型:非量产 1 已下载 类型:量产,2 已下载 类型:非量产,未验证 3 已下载 类型:量产,未验证'
AFTER
`sn`
;
-- 2020-07-27
CREATE
TABLE
`device_info_export`
(
`device_info_export_id`
bigint
(
20
)
NOT
NULL
COMMENT
'主键'
,
`name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'名字'
,
`filepath`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'路径'
,
`status`
int
(
10
)
DEFAULT
NULL
COMMENT
'状态:0未完成,1完成'
,
`update_time`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`device_info_export_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
\ No newline at end of file
cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/DeviceInfoExportDao.java
0 → 100644
View file @
d9cd3586
package
com
.
mx
.
cneeds
.
server
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.mx.cneeds.server.entity.DeviceInfoExportEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @Author zzrdark
*/
@Mapper
public
interface
DeviceInfoExportDao
extends
BaseMapper
<
DeviceInfoExportEntity
>
{
}
cneeds-common-data/src/main/java/com/mx/cneeds/server/entity/DeviceInfoExportEntity.java
0 → 100644
View file @
d9cd3586
package
com
.
mx
.
cneeds
.
server
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName DeviceInfoExport
* @Author zzrdark
* @Date 2020-07-27 15:59
* @Description TODO
**/
@Data
@TableName
(
"device_info_export"
)
public
class
DeviceInfoExportEntity
{
@TableId
private
Long
deviceInfoExportId
;
private
String
name
;
private
String
filepath
;
private
Integer
status
;
private
Date
updateTime
;
}
cneeds-common-data/src/main/resources/mapper/DeviceInfoExportDao.xml
0 → 100644
View file @
d9cd3586
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.mx.cneeds.server.dao.DeviceInfoExportDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.mx.cneeds.server.entity.DeviceInfoExportEntity"
id=
"deviceInfoExportMap"
>
<result
property=
"deviceInfoExportId"
column=
"device_info_export_id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"filepath"
column=
"filepath"
/>
<result
property=
"updateTime"
column=
"status"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
</mapper>
\ No newline at end of file
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceInfoExportDto.java
0 → 100644
View file @
d9cd3586
package
com
.
mx
.
cneeds
.
common
.
dto
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName DeviceInfoExportDto
* @Author zzrdark
* @Date 2020-07-27 16:42
* @Description TODO
**/
@Data
public
class
DeviceInfoExportDto
{
private
Long
deviceInfoExportId
;
private
String
name
;
private
String
filepath
;
private
Integer
status
;
private
Date
updateTime
;
}
cneeds-server-authorization/src/main/resources/application.yml
View file @
d9cd3586
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-authorization
server
:
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/LogFlieController.java
View file @
d9cd3586
...
...
@@ -63,7 +63,6 @@ public class LogFlieController {
@PostMapping
(
"/logfile/wechatDeviceLogUpload"
)
@ResponseBody
public
R
wechatUploadLog
(
@RequestBody
WechatDeviceLogVo
vo
)
throws
IOException
{
log
.
debug
(
vo
.
toString
());
WechatDeviceLogDto
dto
=
new
WechatDeviceLogDto
();
BeanUtils
.
copyProperties
(
vo
,
dto
);
...
...
@@ -96,7 +95,6 @@ public class LogFlieController {
@PostMapping
(
"/logfile/wechatUploadLogFile"
)
@ResponseBody
public
R
wechatUploadLogFile
(
String
logAcceptId
,
MultipartFile
file
)
throws
IOException
{
log
.
debug
(
"wechatUploadLogFile: "
+
logAcceptId
+
" file : "
+
(
file
==
null
?
"空"
:
"不为空"
));
StringBuffer
dir
=
new
StringBuffer
(
FilePath
.
LogFilePath
);
dir
.
append
(
logAcceptId
);
if
(
logAcceptId
==
null
||
file
==
null
)
{
...
...
@@ -110,28 +108,24 @@ public class LogFlieController {
.
locationUrl
(
locationUrl
)
.
logAcceptId
(
logAcceptId
).
build
();
log
.
debug
(
dto
.
toString
());
logFileClient
.
wechatUploadAloneFile
(
dto
);
return
R
.
ok
();
}
@PostMapping
(
"/logfile/proDeviceUploadLogFile"
)
@ResponseBody
public
R
proDeviceUploadLogFile
(
DeviceLogFileVo
vo
){
public
R
proDeviceUploadLogFile
(
DeviceLogFileVo
vo
)
{
DeviceLogFileDto
dto
=
new
DeviceLogFileDto
();
BeanUtils
.
copyProperties
(
vo
,
dto
);
log
.
debug
(
vo
.
toString
());
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
if
(
deviceInfoDto
==
null
){
// log.debug("ResultCode: "+ResultCode.NOTFOUND_IMEI);
return
R
.
error
(
ResultCode
.
NOTFOUND_IMEI
,
"没有该imei"
);
}
DeviceLogDto
deviceLogDto
=
logFileClient
.
queryLogFileByLogAcceptId
(
vo
.
getLogAcceptId
());
if
(
deviceLogDto
==
null
){
// log.debug("ResultCode: "+ResultCode.NOTFOUNDLOG);
return
R
.
error
(
ResultCode
.
NOTFOUNDLOG
,
"没找到对应的Log日志信息"
);
}
return
R
.
ok
();
...
...
@@ -147,13 +141,11 @@ public class LogFlieController {
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
if
(
deviceInfoDto
==
null
){
// log.debug("ResultCode: "+ResultCode.NOTFOUND_IMEI);
return
R
.
error
(
ResultCode
.
NOTFOUND_IMEI
,
"没有该imei"
);
}
DeviceLogDto
deviceLogDto
=
logFileClient
.
queryLogFileByLogAcceptId
(
vo
.
getLogAcceptId
());
if
(
deviceLogDto
==
null
){
// log.debug("ResultCode: "+ResultCode.NOTFOUNDLOG);
return
R
.
error
(
ResultCode
.
NOTFOUNDLOG
,
"没找到对应的Log日志信息"
);
}
...
...
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/system/GlobalExceptionHandler.java
View file @
d9cd3586
...
...
@@ -21,8 +21,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler
(
value
=
Exception
.
class
)
@ResponseBody
public
R
exceptionHandler
(
HttpServletRequest
req
,
Exception
e
){
log
.
error
(
"Exception Message: "
+
e
.
toString
());
e
.
printStackTrace
();
log
.
error
(
"Exception Message: "
+
e
.
getMessage
(),
e
);
return
R
.
error
(
ResultCode
.
NOTFOUND_EEROR
,
"系统未知异常"
);
}
...
...
cneeds-server-datashow/src/main/resources/application.yml
View file @
d9cd3586
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-datashow
server
:
...
...
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoExportService.java
0 → 100644
View file @
d9cd3586
package
com
.
mx
.
cneeds
.
server
.
device
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.mx.cneeds.common.pager.PageUtils
;
import
com.mx.cneeds.server.entity.DeviceInfoExportEntity
;
import
java.util.Map
;
/**
* @ClassName DeviceInfoExportService
* @Author zzrdark
* @Date 2020-07-27 16:54
* @Description TODO
**/
public
interface
DeviceInfoExportService
extends
IService
<
DeviceInfoExportEntity
>
{
/**
* 查询
* @param params
* @return
*/
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoExportServiceImpl.java
0 → 100644
View file @
d9cd3586
package
com
.
mx
.
cneeds
.
server
.
device
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mx.cneeds.common.pager.PageUtils
;
import
com.mx.cneeds.common.pager.Query
;
import
com.mx.cneeds.server.dao.DeviceInfoExportDao
;
import
com.mx.cneeds.server.device.service.DeviceInfoExportService
;
import
com.mx.cneeds.server.entity.DeviceChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoExportEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
/**
* @ClassName DeviceInfoExportServiceImpl
* @Author zzrdark
* @Date 2020-07-27 16:59
* @Description TODO
**/
@Service
(
"deviceInfoExportService"
)
public
class
DeviceInfoExportServiceImpl
extends
ServiceImpl
<
DeviceInfoExportDao
,
DeviceInfoExportEntity
>
implements
DeviceInfoExportService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
QueryWrapper
<
DeviceInfoExportEntity
>
queryWrapper
=
new
QueryWrapper
<>();
/*String channelNum = (String) params.get("channelNum");
if (channelNum != null && !"".equals(channelNum)){
queryWrapper.eq("channel_num",channelNum);
}*/
IPage
<
DeviceInfoExportEntity
>
page
=
this
.
page
(
new
Query
<
DeviceInfoExportEntity
>().
getPage
(
params
),
queryWrapper
);
return
new
PageUtils
(
page
);
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceInfoController.java
View file @
d9cd3586
...
...
@@ -2,21 +2,12 @@ package com.mx.cneeds.server.device.web;
import
java.util.*
;
import
com.mx.cneeds.common.dto.DeviceChannelDto
;
import
com.mx.cneeds.common.dto.DeviceInfoDto
;
import
com.mx.cneeds.common.dto.DevicesDto
;
import
com.mx.cneeds.common.dto.UploadDeviceChannelExcelDto
;
import
com.mx.cneeds.common.dto.*
;
import
com.mx.cneeds.common.pager.PageUtils
;
import
com.mx.cneeds.common.result.R
;
import
com.mx.cneeds.common.validator.ValidatorUtils
;
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.device.service.ProductSeriesService
;
import
com.mx.cneeds.server.entity.DeviceChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
com.mx.cneeds.server.entity.ProductSeriesEntity
;
import
com.mx.cneeds.server.device.service.*
;
import
com.mx.cneeds.server.entity.*
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -50,6 +41,9 @@ public class DeviceInfoController {
@Autowired
private
ProductSeriesService
productSeriesService
;
@Autowired
private
DeviceInfoExportService
deviceInfoExportService
;
/**
* 列表
*/
...
...
@@ -272,6 +266,7 @@ public class DeviceInfoController {
}
/**
* 批量保存渠道号
* 保存
*/
@RequestMapping
(
"/updateDeviceChannelBatch"
)
...
...
@@ -319,6 +314,10 @@ public class DeviceInfoController {
return
R
.
ok
();
}
/**
* 批量上传 渠道号和设备
* @param dto
*/
@RequestMapping
(
"/uploadDeivceChannelExcel"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
uploadDeivceChannelExcel
(
@RequestBody
UploadDeviceChannelExcelDto
dto
){
...
...
@@ -369,6 +368,10 @@ public class DeviceInfoController {
deviceInfoChannelService
.
saveBatch
(
deviceInfoChannelEntityList
);
}
/**
* 批量上传设备
* @param dto
*/
@RequestMapping
(
"/uploadDeivceExcel"
)
public
void
uploadDeivceExcel
(
@RequestBody
UploadDeviceChannelExcelDto
dto
){
...
...
@@ -398,5 +401,22 @@ public class DeviceInfoController {
deviceInfoService
.
saveBatch
(
list
);
}
/**
* 设备信息导出表的查询
* @param params
* @return
*/
@RequestMapping
(
"/deviceInfoExportList"
)
public
PageUtils
deviceInfoExportList
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
deviceInfoExportService
.
queryPage
(
params
);
List
<
DeviceInfoExportDto
>
list
=
new
ArrayList
<
DeviceInfoExportDto
>();
for
(
Object
entity
:
page
.
getList
()){
DeviceInfoExportDto
dto
=
new
DeviceInfoExportDto
();
DeviceInfoExportEntity
deviceChannelEntity
=
(
DeviceInfoExportEntity
)
entity
;
BeanUtils
.
copyProperties
(
deviceChannelEntity
,
dto
);
list
.
add
(
dto
);
}
page
.
setList
(
list
);
return
page
;
}
}
cneeds-server-device/src/main/resources/application.yml
View file @
d9cd3586
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-device
...
...
cneeds-server-logupload/src/main/resources/application.yml
View file @
d9cd3586
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-logupload
...
...
cneeds-server-user/src/main/resources/application.yml
View file @
d9cd3586
spring
:
profiles
:
active
:
prod
active
:
dev
application
:
name
:
cneeds-server-user
...
...
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