|
|
@ -24,8 +24,8 @@ import com.bellmann.model.entity.FileRecord; |
|
|
|
import com.bellmann.model.form.DeviceTypeVerForm; |
|
|
|
import com.bellmann.model.form.DeviceTypeVerForm; |
|
|
|
import com.bellmann.model.form.VendorProfileForm; |
|
|
|
import com.bellmann.model.form.VendorProfileForm; |
|
|
|
import com.bellmann.model.query.DeviceTypeToVerQuery; |
|
|
|
import com.bellmann.model.query.DeviceTypeToVerQuery; |
|
|
|
|
|
|
|
import com.bellmann.model.vo.DeviceServiceVO; |
|
|
|
import com.bellmann.model.vo.DeviceTypeToVerVO; |
|
|
|
import com.bellmann.model.vo.DeviceTypeToVerVO; |
|
|
|
import com.bellmann.model.vo.DomainOption; |
|
|
|
|
|
|
|
import com.bellmann.model.vo.FileRecordVO; |
|
|
|
import com.bellmann.model.vo.FileRecordVO; |
|
|
|
import com.bellmann.security.util.SecurityUtils; |
|
|
|
import com.bellmann.security.util.SecurityUtils; |
|
|
|
import com.bellmann.service.DeviceTypeVerService; |
|
|
|
import com.bellmann.service.DeviceTypeVerService; |
|
|
@ -33,12 +33,15 @@ import com.bellmann.service.FileOptionService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.AsyncResult; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.concurrent.Future; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
@Service |
|
|
@ -67,13 +70,16 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
private final FileRecordConverter fileRecordConverter; |
|
|
|
private final FileRecordConverter fileRecordConverter; |
|
|
|
|
|
|
|
|
|
|
|
private final DomainManager domainManager; |
|
|
|
private final DomainManager domainManager; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ServiceManager serviceManager; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Page<DeviceTypeToVerVO> deviceTypeToVerPage(DeviceTypeToVerQuery query) { |
|
|
|
public Page<DeviceTypeToVerVO> deviceTypeToVerPage(DeviceTypeToVerQuery query) { |
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
int pageSize = query.getPageSize(); |
|
|
|
int pageSize = query.getPageSize(); |
|
|
|
Long devTypeId = query.getDevTypeId(); |
|
|
|
Long devTypeId = query.getDevTypeId(); |
|
|
|
Page<DeviceTypeToVerBO> page = new Page<>(pageNum,pageSize); |
|
|
|
Page<DeviceTypeToVerBO> page = new Page<>(pageNum, pageSize); |
|
|
|
Page<DeviceTypeToVerBO> boPage = deviceTypeVerMapper.deviceTypeToVerPage(page,devTypeId); |
|
|
|
Page<DeviceTypeToVerBO> boPage = deviceTypeVerMapper.deviceTypeToVerPage(page, devTypeId); |
|
|
|
return deviceTypeVerConverter.bo2PageVo(boPage); |
|
|
|
return deviceTypeVerConverter.bo2PageVo(boPage); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -81,14 +87,14 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
public Result<String> updateTypeAndVersionState(Long typeAndVerId) { |
|
|
|
public Result<String> updateTypeAndVersionState(Long typeAndVerId) { |
|
|
|
|
|
|
|
|
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
if (deviceTypeVer==null){ |
|
|
|
if (deviceTypeVer == null) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
//判断状态,如果如果是UN_AUDIT就改为AUDIT
|
|
|
|
//判断状态,如果如果是UN_AUDIT就改为AUDIT
|
|
|
|
if(deviceTypeVer.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.UNAUDITED.getValue())){ |
|
|
|
if (deviceTypeVer.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.UNAUDITED.getValue())) { |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.AUDITED.getValue()); |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.AUDITED.getValue()); |
|
|
|
deviceTypeVer.setAuditTime(LocalDateTime.now()); |
|
|
|
deviceTypeVer.setAuditTime(LocalDateTime.now()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.UNAUDITED.getValue()); |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.UNAUDITED.getValue()); |
|
|
|
deviceTypeVer.setAuditTime(null); |
|
|
|
deviceTypeVer.setAuditTime(null); |
|
|
|
} |
|
|
|
} |
|
|
@ -106,7 +112,7 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Result<String> updateTypeNewSoftState(Long typeAndVerId) { |
|
|
|
public Result<String> updateTypeNewSoftState(Long typeAndVerId) { |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
if (deviceTypeVer==null){ |
|
|
|
if (deviceTypeVer == null) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
//根据软件版本id查询该软件版本对应硬件的全部软件版本id
|
|
|
|
//根据软件版本id查询该软件版本对应硬件的全部软件版本id
|
|
|
@ -128,31 +134,31 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
|
|
|
|
|
|
|
|
//根据devTypeVerId获取源软件版本信息
|
|
|
|
//根据devTypeVerId获取源软件版本信息
|
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
if (deviceTypeVer==null){ |
|
|
|
if (deviceTypeVer == null) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
DevTypeVerFileBO devTypeVerFileBO = deviceTypeVerMapper.findSoftVersionFileInfo( |
|
|
|
DevTypeVerFileBO devTypeVerFileBO = deviceTypeVerMapper.findSoftVersionFileInfo( |
|
|
|
deviceTypeVer.getSoftVer(), |
|
|
|
deviceTypeVer.getSoftVer(), |
|
|
|
deviceTypeVer.getTypeAndVerId() |
|
|
|
deviceTypeVer.getTypeAndVerId() |
|
|
|
); |
|
|
|
); |
|
|
|
if(deviceTypeVer.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.UNAUDITED.getValue())){ |
|
|
|
if (deviceTypeVer.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.UNAUDITED.getValue())) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_UNAUDITED); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_UNAUDITED); |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(devTypeVerFileBO.getFileName())|| StringUtils.isBlank(devTypeVerFileBO.getFileUrl())){ |
|
|
|
if (StringUtils.isBlank(devTypeVerFileBO.getFileName()) || StringUtils.isBlank(devTypeVerFileBO.getFileUrl())) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_FILE_NOT_EXIST); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_FILE_NOT_EXIST); |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceType deviceType = deviceTypeManager.findDeviceTypeById(devTypeId); |
|
|
|
DeviceType deviceType = deviceTypeManager.findDeviceTypeById(devTypeId); |
|
|
|
//根据typeId查询所有需要复制的目标设备类型
|
|
|
|
//根据typeId查询所有需要复制的目标设备类型
|
|
|
|
List<DeviceTypeVer> list = deviceTypeVerMapper.findTargetDeviceType(deviceType,deviceTypeVer.getSoftVer()); |
|
|
|
List<DeviceTypeVer> list = deviceTypeVerMapper.findTargetDeviceType(deviceType, deviceTypeVer.getSoftVer()); |
|
|
|
//根据查询出来的目标设备类型集合,循环复制源软件版本
|
|
|
|
//根据查询出来的目标设备类型集合,循环复制源软件版本
|
|
|
|
for ( DeviceTypeVer obj: list){ |
|
|
|
for (DeviceTypeVer obj : list) { |
|
|
|
if (StringUtils.isBlank(obj.getSoftVer())){ |
|
|
|
if (StringUtils.isBlank(obj.getSoftVer())) { |
|
|
|
//不存在该软件版本,则复制软件版本信息,以及软件版本文件。
|
|
|
|
//不存在该软件版本,则复制软件版本信息,以及软件版本文件。
|
|
|
|
Long cloneDevTypeAndVerId = cloneDeviceTypeVer(deviceTypeVer); |
|
|
|
Long cloneDevTypeAndVerId = cloneDeviceTypeVer(deviceTypeVer); |
|
|
|
devTypeVerFileBO.setTypeAndVerId(cloneDevTypeAndVerId); |
|
|
|
devTypeVerFileBO.setTypeAndVerId(cloneDevTypeAndVerId); |
|
|
|
copyFtpVerFile(devTypeVerFileBO); |
|
|
|
copyFtpVerFile(devTypeVerFileBO); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotBlank(obj.getDevTypeVerStatus())&&obj.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.AUDITED.getValue())){ |
|
|
|
if (StringUtils.isNotBlank(obj.getDevTypeVerStatus()) && obj.getDevTypeVerStatus().equals(DevTypeVerStatusEnum.AUDITED.getValue())) { |
|
|
|
//软件版本状态为已审核,则不复制版本文件。
|
|
|
|
//软件版本状态为已审核,则不复制版本文件。
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -163,26 +169,26 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
|
|
|
|
|
|
|
|
private void copyFtpVerFile(DevTypeVerFileBO devTypeVerFileBO) { |
|
|
|
private void copyFtpVerFile(DevTypeVerFileBO devTypeVerFileBO) { |
|
|
|
FileRecord fileRecord = fileRecordManager.insetDevTypeVerFile(devTypeVerFileBO); |
|
|
|
FileRecord fileRecord = fileRecordManager.insetDevTypeVerFile(devTypeVerFileBO); |
|
|
|
fileDevTypeMapManager.insertFileDevTypeVerMap(fileRecord.getFileId(),devTypeVerFileBO.getTypeAndVerId()); |
|
|
|
fileDevTypeMapManager.insertFileDevTypeVerMap(fileRecord.getFileId(), devTypeVerFileBO.getTypeAndVerId()); |
|
|
|
fileOptionService.copyFile(devTypeVerFileBO.getFileUrl(),devTypeVerFileBO.getFileName(),fileRecord.getFileUrl()); |
|
|
|
fileOptionService.copyFile(devTypeVerFileBO.getFileUrl(), devTypeVerFileBO.getFileName(), fileRecord.getFileUrl()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Long cloneDeviceTypeVer(DeviceTypeVer resource){ |
|
|
|
private Long cloneDeviceTypeVer(DeviceTypeVer resource) { |
|
|
|
DeviceTypeVer deviceTypeVer = new DeviceTypeVer(); |
|
|
|
DeviceTypeVer deviceTypeVer = new DeviceTypeVer(); |
|
|
|
deviceTypeVer.setDevTypeId(resource.getDevTypeId()); |
|
|
|
deviceTypeVer.setDevTypeId(resource.getDevTypeId()); |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.UNAUDITED.getValue()); |
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.UNAUDITED.getValue()); |
|
|
|
if (StringUtils.isEmpty(resource.getSpecVer())){ |
|
|
|
if (StringUtils.isEmpty(resource.getSpecVer())) { |
|
|
|
deviceTypeVer.setSpecVer("null"); |
|
|
|
deviceTypeVer.setSpecVer("null"); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
deviceTypeVer.setSpecVer(resource.getSpecVer()); |
|
|
|
deviceTypeVer.setSpecVer(resource.getSpecVer()); |
|
|
|
} |
|
|
|
} |
|
|
|
deviceTypeVer.setSoftVer(resource.getSoftVer()); |
|
|
|
deviceTypeVer.setSoftVer(resource.getSoftVer()); |
|
|
|
deviceTypeVer.setConnectReqPassword(StringUtilsConstants.STRING_BLANK); |
|
|
|
deviceTypeVer.setConnectReqPassword(StringUtilsConstants.STRING_BLANK); |
|
|
|
deviceTypeVer.setConnectReqUsername(StringUtilsConstants.STRING_BLANK); |
|
|
|
deviceTypeVer.setConnectReqUsername(StringUtilsConstants.STRING_BLANK); |
|
|
|
deviceTypeVer.setDevTypeVerDesc(resource.getDevTypeVerDesc()); |
|
|
|
deviceTypeVer.setDevTypeVerDesc(resource.getDevTypeVerDesc()); |
|
|
|
if(resource.getProvisionFlag().equals("0")){ |
|
|
|
if (resource.getProvisionFlag().equals("0")) { |
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.PPPOE.getValue()); |
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.PPPOE.getValue()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.UN_PROVISION.getValue()); |
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.UN_PROVISION.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
deviceTypeVer.setAcsUrlPassword(StringUtilsConstants.STRING_BLANK); |
|
|
|
deviceTypeVer.setAcsUrlPassword(StringUtilsConstants.STRING_BLANK); |
|
|
@ -198,19 +204,19 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public Result<String> deleteDeviceTypeVersionById(Long typeAndVerId) { |
|
|
|
public Result<String> deleteDeviceTypeVersionById(Long typeAndVerId) { |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(typeAndVerId); |
|
|
|
if (deviceTypeVer==null){ |
|
|
|
if (deviceTypeVer == null) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
if(deviceTypeVer.getTr069VerId()>0){ |
|
|
|
if (deviceTypeVer.getTr069VerId()!=null&& deviceTypeVer.getTr069VerId() > 0) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_EXIST_OR_BINDING); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_EXIST_OR_BINDING); |
|
|
|
} |
|
|
|
} |
|
|
|
Long count = deviceTypeVerMapper.countDevTypeStatic(typeAndVerId); |
|
|
|
Long count = deviceTypeVerMapper.countDevTypeStatic(typeAndVerId); |
|
|
|
if (count>0){ |
|
|
|
if (count > 0) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_EXIST_OR_BINDING); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_EXIST_OR_BINDING); |
|
|
|
} |
|
|
|
} |
|
|
|
int deleteRows = deviceTypeVerDomainManager.deleteByTypeAndVerId(typeAndVerId); |
|
|
|
int deleteRows = deviceTypeVerDomainManager.deleteByTypeAndVerId(typeAndVerId); |
|
|
|
deviceTypeVerMapper.delete( |
|
|
|
deviceTypeVerMapper.delete( |
|
|
|
new LambdaQueryWrapper<DeviceTypeVer>().eq(DeviceTypeVer::getTypeAndVerId,typeAndVerId) |
|
|
|
new LambdaQueryWrapper<DeviceTypeVer>().eq(DeviceTypeVer::getTypeAndVerId, typeAndVerId) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
@ -220,20 +226,20 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public Result<String> deleteDeviceTypeVersionFile(Long typeAndVerId, Long fileId) { |
|
|
|
public Result<String> deleteDeviceTypeVersionFile(Long typeAndVerId, Long fileId) { |
|
|
|
FileRecord fileRecord = fileRecordManager.findFileRecordById(fileId); |
|
|
|
FileRecord fileRecord = fileRecordManager.findFileRecordById(fileId); |
|
|
|
if(fileRecord==null){ |
|
|
|
if (fileRecord == null) { |
|
|
|
return Result.failed(ResultCode.FILE_NOT_EXIST); |
|
|
|
return Result.failed(ResultCode.FILE_NOT_EXIST); |
|
|
|
} |
|
|
|
} |
|
|
|
Long count = fileDevTypeMapManager.countByTypeAndVerId(typeAndVerId,fileId); |
|
|
|
Long count = fileDevTypeMapManager.countByTypeAndVerId(typeAndVerId, fileId); |
|
|
|
if (count!=1L){ |
|
|
|
if (count != 1L) { |
|
|
|
return Result.failed(ResultCode.FILE_NOT_OF_TYPE_VER); |
|
|
|
return Result.failed(ResultCode.FILE_NOT_OF_TYPE_VER); |
|
|
|
} |
|
|
|
} |
|
|
|
int rows = fileDevTypeMapManager.deleteByTypeAndVerId(typeAndVerId,fileId); |
|
|
|
int rows = fileDevTypeMapManager.deleteByTypeAndVerId(typeAndVerId, fileId); |
|
|
|
int deleteRows = fileRecordManager.deleteByFileId(fileId); |
|
|
|
int deleteRows = fileRecordManager.deleteByFileId(fileId); |
|
|
|
if(rows==0&&deleteRows==0){ |
|
|
|
if (rows == 0 && deleteRows == 0) { |
|
|
|
return Result.failed(ResultCode.FILE_DELETE_FAIL); |
|
|
|
return Result.failed(ResultCode.FILE_DELETE_FAIL); |
|
|
|
} |
|
|
|
} |
|
|
|
boolean isSuccess = fileOptionService.removeFile(fileRecord.getFileUrl(),fileRecord.getFileName()); |
|
|
|
boolean isSuccess = fileOptionService.removeFile(fileRecord.getFileUrl(), fileRecord.getFileName()); |
|
|
|
if (!isSuccess){ |
|
|
|
if (!isSuccess) { |
|
|
|
return Result.failed(ResultCode.FILE_DELETE_FAIL); |
|
|
|
return Result.failed(ResultCode.FILE_DELETE_FAIL); |
|
|
|
} |
|
|
|
} |
|
|
|
return Result.success(); |
|
|
|
return Result.success(); |
|
|
@ -242,7 +248,7 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Result<DeviceTypeVerForm> findDevTypeVerEditForm(Long typeAndVerId) { |
|
|
|
public Result<DeviceTypeVerForm> findDevTypeVerEditForm(Long typeAndVerId) { |
|
|
|
DeviceTypeVerForm deviceTypeVerForm = deviceTypeVerMapper.findDevTypeVerEditForm(typeAndVerId); |
|
|
|
DeviceTypeVerForm deviceTypeVerForm = deviceTypeVerMapper.findDevTypeVerEditForm(typeAndVerId); |
|
|
|
if (deviceTypeVerForm==null){ |
|
|
|
if (deviceTypeVerForm == null) { |
|
|
|
return Result.failed(ResultCode.DATA_NOT_FOUND); |
|
|
|
return Result.failed(ResultCode.DATA_NOT_FOUND); |
|
|
|
} |
|
|
|
} |
|
|
|
return Result.success(deviceTypeVerForm); |
|
|
|
return Result.success(deviceTypeVerForm); |
|
|
@ -255,16 +261,16 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
DeviceTypeVerDetail deviceTypeVerDetail = deviceTypeVerDetailConverter.form2Entity(deviceTypeVerForm); |
|
|
|
DeviceTypeVerDetail deviceTypeVerDetail = deviceTypeVerDetailConverter.form2Entity(deviceTypeVerForm); |
|
|
|
int row1 = deviceTypeVerMapper.update(deviceTypeVer, |
|
|
|
int row1 = deviceTypeVerMapper.update(deviceTypeVer, |
|
|
|
new LambdaQueryWrapper<DeviceTypeVer>() |
|
|
|
new LambdaQueryWrapper<DeviceTypeVer>() |
|
|
|
.eq(DeviceTypeVer::getTypeAndVerId,deviceTypeVer.getTypeAndVerId()) |
|
|
|
.eq(DeviceTypeVer::getTypeAndVerId, deviceTypeVer.getTypeAndVerId()) |
|
|
|
); |
|
|
|
); |
|
|
|
int row2 = deviceTypeVerDetailManager.updateByVerForm(deviceTypeVerDetail); |
|
|
|
int row2 = deviceTypeVerDetailManager.updateByVerForm(deviceTypeVerDetail); |
|
|
|
return row1+row2; |
|
|
|
return row1 + row2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Result<String> addVendorProfile(VendorProfileForm form) { |
|
|
|
public Result<String> addVendorProfile(VendorProfileForm form) { |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(form.getTypeAndVerId()); |
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(form.getTypeAndVerId()); |
|
|
|
if (deviceTypeVer==null){ |
|
|
|
if (deviceTypeVer == null) { |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
FileRecord fileRecord = new FileRecord(); |
|
|
|
FileRecord fileRecord = new FileRecord(); |
|
|
@ -291,17 +297,17 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
public int deleteVendorProfile(Long fileId, Long typeAndVerId) { |
|
|
|
public int deleteVendorProfile(Long fileId, Long typeAndVerId) { |
|
|
|
FileRecord fileRecord = fileRecordManager.findFileRecordById(fileId); |
|
|
|
FileRecord fileRecord = fileRecordManager.findFileRecordById(fileId); |
|
|
|
boolean removed = fileOptionService.removeFile(fileRecord.getFileUrl(), fileRecord.getFileName()); |
|
|
|
boolean removed = fileOptionService.removeFile(fileRecord.getFileUrl(), fileRecord.getFileName()); |
|
|
|
if (!removed){ |
|
|
|
if (!removed) { |
|
|
|
throw new BusinessException(ResultCode.FILE_DELETE_FAIL); |
|
|
|
throw new BusinessException(ResultCode.FILE_DELETE_FAIL); |
|
|
|
} |
|
|
|
} |
|
|
|
int i = fileRecordManager.deleteByFileId(fileId); |
|
|
|
int i = fileRecordManager.deleteByFileId(fileId); |
|
|
|
int i1 = fileDevTypeMapManager.deleteByTypeAndVerId(typeAndVerId, fileId); |
|
|
|
int i1 = fileDevTypeMapManager.deleteByTypeAndVerId(typeAndVerId, fileId); |
|
|
|
return i+i1; |
|
|
|
return i + i1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Page<String> pageSysDomain(Long typeAndVerId, BasePageQuery pageQuery) { |
|
|
|
public Page<String> pageSysDomain(Long typeAndVerId, BasePageQuery pageQuery) { |
|
|
|
return domainManager.pageJoinTypeVerByTypeAndVerId(typeAndVerId,pageQuery); |
|
|
|
return domainManager.pageJoinTypeVerByTypeAndVerId(typeAndVerId, pageQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -311,7 +317,35 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int editVerDomain(Long typeAndVerId, List<Long> list) { |
|
|
|
public int editVerDomain(Long typeAndVerId, List<Long> list) { |
|
|
|
return deviceTypeVerDomainManager.editVerDomain(typeAndVerId,list); |
|
|
|
return deviceTypeVerDomainManager.editVerDomain(typeAndVerId, list); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Page<DeviceServiceVO> pageService(Long typeAndVerId, BasePageQuery pageQuery) { |
|
|
|
|
|
|
|
return serviceManager.pageDevVerService(typeAndVerId, pageQuery); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
public int addTypeVer(DeviceTypeVerForm form, Long devTypeId) { |
|
|
|
|
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerConverter.form2Entity(form); |
|
|
|
|
|
|
|
deviceTypeVer.setDevTypeId(devTypeId); |
|
|
|
|
|
|
|
deviceTypeVer.setDevTypeVerStatus(DevTypeVerStatusEnum.UNAUDITED.getValue()); |
|
|
|
|
|
|
|
deviceTypeVer.setAcsUrlPassword(StringUtilsConstants.STRING_BLANK); |
|
|
|
|
|
|
|
deviceTypeVer.setConnectReqUsername(StringUtilsConstants.STRING_BLANK); |
|
|
|
|
|
|
|
deviceTypeVer.setConnectReqPassword(StringUtilsConstants.STRING_BLANK); |
|
|
|
|
|
|
|
String provisionFlag = form.getProvisionFlag(); |
|
|
|
|
|
|
|
if (ProvisionFlagEnum.TR069.getValue().equals(provisionFlag)){ |
|
|
|
|
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.PPPOE.getValue()); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
deviceTypeVer.setProvisionFlag(ProvisionFlagEnum.UN_PROVISION.getValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
deviceTypeVer.setAuditUserName(StringUtilsConstants.STRING_BLANK); |
|
|
|
|
|
|
|
deviceTypeVerMapper.insert(deviceTypeVer); |
|
|
|
|
|
|
|
deviceTypeVerDomainManager.insertDevTypeVerSysDomainMap(deviceTypeVer.getTypeAndVerId()); |
|
|
|
|
|
|
|
deviceTypeVerDetailManager.insertDetailByTypeAndVerId(deviceTypeVer.getTypeAndVerId(),devTypeId); |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|