Commit 28495493 by zzrdark

1.修改删除渠道号 并删除关联的渠道号

2.增加终端log上传的设备版本参数
parent 5d790fe0
......@@ -323,3 +323,7 @@ CREATE TABLE `device_info_channel` (
-- 2020-05-13
ALTER TABLE `cneeds_server`.`device_info`
DROP COLUMN `channel_nums`;
-- 2020-05-14
ALTER TABLE `cneeds_server`.`device_log`
ADD COLUMN `device_version` varchar(255) COMMENT '设备版本号' AFTER `log_accept_id`;
\ No newline at end of file
......@@ -74,4 +74,9 @@ public class DeviceLogEntity implements Serializable {
* 移动端日志文件标识符
*/
private String logAcceptId;
/**
* 设备版本
*/
private String deviceVersion;
}
......@@ -18,6 +18,7 @@
<result property="logfileStatus" column="logfile_status"/>
<result property="repetitionProbability" column="repetition_probability"/>
<result property="logAcceptId" column="log_accept_id"/>
<result property="deviceVersion" column="device_version"/>
</resultMap>
......
......@@ -33,4 +33,9 @@ public class DeviceLogFileDto {
* 文件大小
*/
Long logfileSize;
/**
* 设备版本信息
*/
String deviceVersion;
}
......@@ -21,4 +21,9 @@ public class DeviceLogFileVo {
*/
String logAcceptId;
/**
* 设备版本
*/
String deviceVersion;
}
......@@ -16,5 +16,7 @@ public interface DeviceInfoChannelService extends IService<DeviceInfoChannelEnti
List<DeviceInfoChannelEntity> queryDeviceInfoChannelByDeviceId(Long deviceId);
void removeDeivceInfoChannelByChannelId(List<Long> channelIds);
}
......@@ -22,4 +22,12 @@ public class DeviceInfoChannelServiceImpl extends ServiceImpl<DeviceInfoChannelD
return entities;
}
@Override
public void removeDeivceInfoChannelByChannelId(List<Long> channelIds){
getBaseMapper().delete(
new QueryWrapper<DeviceInfoChannelEntity>()
.in("channel_id",channelIds));
}
}
......@@ -92,9 +92,10 @@ public class DeviceChannelController {
* 删除渠道号
*/
@RequestMapping("/delete")
@Transactional
public R delete(@RequestBody Long[] deviceIds){
deviceChannelService.removeByIds(Arrays.asList(deviceIds));
deviceInfoChannelService.removeDeivceInfoChannelByChannelId(Arrays.asList(deviceIds));
return R.ok();
}
......
......@@ -76,7 +76,11 @@ public class DeviceInfoController {
deviceChannelEntities.forEach(entities -> {
sb.append(entities.getChannelNum()+",");
});
dto.setChannelNums(sb.substring(0,sb.length()-1));
if (sb.length() != 0){
dto.setChannelNums(sb.substring(0,sb.length()-1));
}
}
list.add(dto);
}
......@@ -126,7 +130,9 @@ public class DeviceInfoController {
deviceChannelEntities.forEach(entities -> {
sb.append(entities.getChannelNum()+",");
});
deviceInfoDto.setChannelNums(sb.substring(0,sb.length()-1));
if (sb.length() != 0) {
deviceInfoDto.setChannelNums(sb.substring(0, sb.length() - 1));
}
}
return deviceInfoDto;
}else{
......
......@@ -83,6 +83,7 @@ public class LogUploadController {
deviceLogEntity.setLogfileUrl(dto.getLogfileUrl());
deviceLogEntity.setLogAcceptId(dto.getLogAcceptId());
deviceLogEntity.setLogfileSize(dto.getLogfileSize());
deviceLogEntity.setDeviceVersion(dto.getDeviceVersion());
deviceLogService.deviceUploadLogFile(deviceLogEntity);
}
......
spring:
profiles:
active: dev
active: prod
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