Commit 0c3416ec by zzrdark

1.Log上传增加设备信息

2.增加 渠道号管理 修改接口
3.增加 渠道号统计页面
parent 28495493
......@@ -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;
}
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;
}
......@@ -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);
}
......@@ -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();
}
}
......@@ -94,7 +94,6 @@ public class LogController {
deviceInfoDtos.forEach(deviceInfoDto -> {
if (deviceLogDto.getDeviceId().equals(deviceInfoDto.getDeviceId()) ){
deviceLogDto.setSeriesNum(deviceInfoDto.getSeriesNum());
deviceLogDto.setDeviceVersion(deviceInfoDto.getDeviceVersion());
}
});
});
......
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-datashow
server:
......
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);
}
}
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-device
......
......@@ -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;
......
spring:
profiles:
active: prod
active: dev
application:
name: cneeds-server-logupload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment