Commit 28495493 by zzrdark

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

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