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
eb4daa0e
Commit
eb4daa0e
authored
May 11, 2020
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.渠道号管理
parent
8fb0aca4
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
250 additions
and
0 deletions
+250
-0
DeviceInfoChannelDao.java
...n/java/com/mx/cneeds/server/dao/DeviceInfoChannelDao.java
+1
-0
DeviceChannelDto.java
.../main/java/com/mx/cneeds/common/dto/DeviceChannelDto.java
+37
-0
DeviceInfoChannelDto.java
...n/java/com/mx/cneeds/common/dto/DeviceInfoChannelDto.java
+28
-0
DeviceController.java
...x/cneeds/server/datashow/web/device/DeviceController.java
+3
-0
DeviceChannelService.java
...mx/cneeds/server/device/service/DeviceChannelService.java
+24
-0
DeviceInfoChannelService.java
...needs/server/device/service/DeviceInfoChannelService.java
+17
-0
DeviceChannelServiceImpl.java
.../server/device/service/impl/DeviceChannelServiceImpl.java
+29
-0
DeviceInfoChannelServiceImpl.java
...ver/device/service/impl/DeviceInfoChannelServiceImpl.java
+16
-0
DeviceChannelController.java
.../mx/cneeds/server/device/web/DeviceChannelController.java
+95
-0
No files found.
cneeds-common-data/src/main/java/com/mx/cneeds/server/dao/DeviceInfoChannelDao.java
View file @
eb4daa0e
...
...
@@ -12,4 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
**/
@Mapper
public
interface
DeviceInfoChannelDao
extends
BaseMapper
<
DeviceInfoChannelEntity
>
{
}
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceChannelDto.java
0 → 100644
View file @
eb4daa0e
package
com
.
mx
.
cneeds
.
common
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @ClassName DeviceChannelEntity
* @Author zzrdark
* @Date 2020-05-09 15:28
* @Description TODO
**/
@Data
public
class
DeviceChannelDto
implements
Serializable
{
/**
* 渠道号Id
*/
private
Long
channelId
;
/**
* 渠道号
*/
private
String
channelNum
;
/**
* 品牌
*/
private
String
brand
;
/**
* 更新时间
*/
private
Date
updateTime
;
}
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceInfoChannelDto.java
0 → 100644
View file @
eb4daa0e
package
com
.
mx
.
cneeds
.
common
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @ClassName DeviceInfoChannelEntity
* @Author zzrdark
* @Date 2020-05-09 16:07
* @Description TODO
**/
@Data
public
class
DeviceInfoChannelDto
implements
Serializable
{
private
Long
id
;
/**
* 设备信息表Id
*/
private
Long
deviceId
;
/**
* 渠道号表Id
*/
private
Long
channelId
;
}
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/DeviceController.java
View file @
eb4daa0e
...
...
@@ -202,6 +202,9 @@ public class DeviceController {
public
R
queryDeviceByImei
(
@RequestBody
DeviceInfoDto
dto
){
log
.
debug
(
"queryDeviceByImei: imei:"
+
dto
.
getImei
());
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
if
(
deviceInfoDto
==
null
){
R
.
error
(
ResultCode
.
NOTFOUND_IMEI
,
"没有该imei的设备"
);
}
return
R
.
ok
().
put
(
"data"
,
deviceInfoDto
);
}
...
...
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceChannelService.java
0 → 100644
View file @
eb4daa0e
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.DeviceChannelEntity
;
import
com.mx.cneeds.server.entity.ProductSeriesEntity
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
* @author Mark
* @email sunlightcs@gmail.com
* @date 2020-03-18 14:44:30
*/
public
interface
DeviceChannelService
extends
IService
<
DeviceChannelEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/DeviceInfoChannelService.java
0 → 100644
View file @
eb4daa0e
package
com
.
mx
.
cneeds
.
server
.
device
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.mx.cneeds.server.entity.DeviceInfoChannelEntity
;
/**
*
*
* @author Mark
* @email sunlightcs@gmail.com
* @date 2020-03-18 14:44:30
*/
public
interface
DeviceInfoChannelService
extends
IService
<
DeviceInfoChannelEntity
>
{
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceChannelServiceImpl.java
0 → 100644
View file @
eb4daa0e
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.DeviceChannelDao
;
import
com.mx.cneeds.server.device.service.DeviceChannelService
;
import
com.mx.cneeds.server.entity.DeviceChannelEntity
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
@Service
(
"deviceChannelService"
)
public
class
DeviceChannelServiceImpl
extends
ServiceImpl
<
DeviceChannelDao
,
DeviceChannelEntity
>
implements
DeviceChannelService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
DeviceChannelEntity
>
page
=
this
.
page
(
new
Query
<
DeviceChannelEntity
>().
getPage
(
params
),
new
QueryWrapper
<
DeviceChannelEntity
>()
);
return
new
PageUtils
(
page
);
}
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/service/impl/DeviceInfoChannelServiceImpl.java
0 → 100644
View file @
eb4daa0e
package
com
.
mx
.
cneeds
.
server
.
device
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.mx.cneeds.server.dao.DeviceInfoChannelDao
;
import
com.mx.cneeds.server.device.service.DeviceInfoChannelService
;
import
com.mx.cneeds.server.entity.DeviceInfoChannelEntity
;
import
org.springframework.stereotype.Service
;
@Service
(
"deviceInfoChannelService"
)
public
class
DeviceInfoChannelServiceImpl
extends
ServiceImpl
<
DeviceInfoChannelDao
,
DeviceInfoChannelEntity
>
implements
DeviceInfoChannelService
{
}
cneeds-server-device/src/main/java/com/mx/cneeds/server/device/web/DeviceChannelController.java
0 → 100644
View file @
eb4daa0e
package
com
.
mx
.
cneeds
.
server
.
device
.
web
;
import
com.mx.cneeds.common.dto.DeviceChannelDto
;
import
com.mx.cneeds.common.dto.SeriesDto
;
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.entity.DeviceChannelEntity
;
import
com.mx.cneeds.server.entity.DeviceInfoEntity
;
import
com.mx.cneeds.server.entity.ProductSeriesEntity
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
* @ClassName DeviceChannelController
* @Author zzrdark
* @Date 2020-05-11 17:51
* @Description TODO
**/
@RestController
@RequestMapping
(
"/devicechannel"
)
public
class
DeviceChannelController
{
@Autowired
private
DeviceChannelService
deviceChannelService
;
@Autowired
private
DeviceInfoChannelService
deviceInfoChannelService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
public
PageUtils
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
deviceChannelService
.
queryPage
(
params
);
List
<
SeriesDto
>
list
=
new
ArrayList
<
SeriesDto
>();
for
(
Object
entity
:
page
.
getList
()){
SeriesDto
dto
=
new
SeriesDto
();
ProductSeriesEntity
seriesEntity
=
(
ProductSeriesEntity
)
entity
;
BeanUtils
.
copyProperties
(
seriesEntity
,
dto
);
list
.
add
(
dto
);
}
return
page
;
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
public
R
save
(
@RequestBody
DeviceChannelDto
deviceChannelDto
){
DeviceChannelEntity
deviceChannelEntity
=
new
DeviceChannelEntity
();
BeanUtils
.
copyProperties
(
deviceChannelDto
,
deviceChannelEntity
);
deviceChannelService
.
save
(
deviceChannelEntity
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
public
R
update
(
@RequestBody
DeviceChannelDto
deviceChannelDto
){
ValidatorUtils
.
validateEntity
(
deviceChannelDto
);
DeviceChannelEntity
deviceChannelEntity
=
new
DeviceChannelEntity
();
BeanUtils
.
copyProperties
(
deviceChannelDto
,
deviceChannelEntity
);
deviceChannelService
.
updateById
(
deviceChannelEntity
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
public
R
delete
(
@RequestBody
Long
[]
deviceIds
){
deviceChannelService
.
removeByIds
(
Arrays
.
asList
(
deviceIds
));
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