|
|
@ -3,6 +3,7 @@ package com.bellmann.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import com.bellmann.common.base.BasePageQuery; |
|
|
|
import com.bellmann.common.constant.StringUtilsConstants; |
|
|
|
import com.bellmann.common.constant.StringUtilsConstants; |
|
|
|
import com.bellmann.common.enums.DevTypeVerStatusEnum; |
|
|
|
import com.bellmann.common.enums.DevTypeVerStatusEnum; |
|
|
|
import com.bellmann.common.enums.ProvisionFlagEnum; |
|
|
|
import com.bellmann.common.enums.ProvisionFlagEnum; |
|
|
@ -11,6 +12,7 @@ import com.bellmann.common.result.Result; |
|
|
|
import com.bellmann.common.result.ResultCode; |
|
|
|
import com.bellmann.common.result.ResultCode; |
|
|
|
import com.bellmann.converter.DeviceTypeVerConverter; |
|
|
|
import com.bellmann.converter.DeviceTypeVerConverter; |
|
|
|
import com.bellmann.converter.DeviceTypeVerDetailConverter; |
|
|
|
import com.bellmann.converter.DeviceTypeVerDetailConverter; |
|
|
|
|
|
|
|
import com.bellmann.converter.FileRecordConverter; |
|
|
|
import com.bellmann.manger.*; |
|
|
|
import com.bellmann.manger.*; |
|
|
|
import com.bellmann.mapper.DeviceTypeVerMapper; |
|
|
|
import com.bellmann.mapper.DeviceTypeVerMapper; |
|
|
|
import com.bellmann.model.bo.DevTypeVerFileBO; |
|
|
|
import com.bellmann.model.bo.DevTypeVerFileBO; |
|
|
@ -20,8 +22,11 @@ import com.bellmann.model.entity.DeviceTypeVer; |
|
|
|
import com.bellmann.model.entity.DeviceTypeVerDetail; |
|
|
|
import com.bellmann.model.entity.DeviceTypeVerDetail; |
|
|
|
import com.bellmann.model.entity.FileRecord; |
|
|
|
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.query.DeviceTypeToVerQuery; |
|
|
|
import com.bellmann.model.query.DeviceTypeToVerQuery; |
|
|
|
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.security.util.SecurityUtils; |
|
|
|
import com.bellmann.security.util.SecurityUtils; |
|
|
|
import com.bellmann.service.DeviceTypeVerService; |
|
|
|
import com.bellmann.service.DeviceTypeVerService; |
|
|
|
import com.bellmann.service.FileOptionService; |
|
|
|
import com.bellmann.service.FileOptionService; |
|
|
@ -32,6 +37,7 @@ 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.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
@ -57,6 +63,10 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
private final FileOptionService fileOptionService; |
|
|
|
private final FileOptionService fileOptionService; |
|
|
|
|
|
|
|
|
|
|
|
private final DeviceTypeVerDetailConverter deviceTypeVerDetailConverter; |
|
|
|
private final DeviceTypeVerDetailConverter deviceTypeVerDetailConverter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final FileRecordConverter fileRecordConverter; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final DomainManager domainManager; |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Page<DeviceTypeToVerVO> deviceTypeToVerPage(DeviceTypeToVerQuery query) { |
|
|
|
public Page<DeviceTypeToVerVO> deviceTypeToVerPage(DeviceTypeToVerQuery query) { |
|
|
|
int pageNum = query.getPageNum(); |
|
|
|
int pageNum = query.getPageNum(); |
|
|
@ -250,4 +260,58 @@ public class DeviceTypeVerServiceImpl implements DeviceTypeVerService { |
|
|
|
int row2 = deviceTypeVerDetailManager.updateByVerForm(deviceTypeVerDetail); |
|
|
|
int row2 = deviceTypeVerDetailManager.updateByVerForm(deviceTypeVerDetail); |
|
|
|
return row1+row2; |
|
|
|
return row1+row2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Result<String> addVendorProfile(VendorProfileForm form) { |
|
|
|
|
|
|
|
DeviceTypeVer deviceTypeVer = deviceTypeVerMapper.findByTypeAndDevID(form.getTypeAndVerId()); |
|
|
|
|
|
|
|
if (deviceTypeVer==null){ |
|
|
|
|
|
|
|
return Result.failed(ResultCode.DEVICE_TYPE_VER_BINDING_DEVICE_TYPE_IS_NULL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
FileRecord fileRecord = new FileRecord(); |
|
|
|
|
|
|
|
fileRecord.setFileName(form.getFileName()); |
|
|
|
|
|
|
|
fileRecord.setFileType(form.getFileType()); |
|
|
|
|
|
|
|
fileRecord.setFileServId(1L); |
|
|
|
|
|
|
|
fileRecord.setFileUrl(form.getFileUrl()); |
|
|
|
|
|
|
|
fileRecord.setFileDesc(form.getFileDesc()); |
|
|
|
|
|
|
|
fileRecord.setFileCreateTime(new Date()); |
|
|
|
|
|
|
|
fileRecord.setUserName(SecurityUtils.getUsername()); |
|
|
|
|
|
|
|
fileRecordManager.addVendorProfile(fileRecord); |
|
|
|
|
|
|
|
fileDevTypeMapManager.insertFileDevTypeVerMap(fileRecord.getFileId(), form.getTypeAndVerId()); |
|
|
|
|
|
|
|
return Result.success(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<FileRecordVO> listVendorProfile(Long typeAndVerId) { |
|
|
|
|
|
|
|
List<FileRecord> fileRecords = fileRecordManager.listVendorProfile(typeAndVerId); |
|
|
|
|
|
|
|
return fileRecordConverter.entityList2VOList(fileRecords); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@Transactional |
|
|
|
|
|
|
|
public int deleteVendorProfile(Long fileId, Long typeAndVerId) { |
|
|
|
|
|
|
|
FileRecord fileRecord = fileRecordManager.findFileRecordById(fileId); |
|
|
|
|
|
|
|
boolean removed = fileOptionService.removeFile(fileRecord.getFileUrl(), fileRecord.getFileName()); |
|
|
|
|
|
|
|
if (!removed){ |
|
|
|
|
|
|
|
throw new BusinessException(ResultCode.FILE_DELETE_FAIL); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
int i = fileRecordManager.deleteByFileId(fileId); |
|
|
|
|
|
|
|
int i1 = fileDevTypeMapManager.deleteByTypeAndVerId(typeAndVerId, fileId); |
|
|
|
|
|
|
|
return i+i1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Page<String> pageSysDomain(Long typeAndVerId, BasePageQuery pageQuery) { |
|
|
|
|
|
|
|
return domainManager.pageJoinTypeVerByTypeAndVerId(typeAndVerId,pageQuery); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<Long> listVerDomain(Long typeAndVerId) { |
|
|
|
|
|
|
|
return deviceTypeVerDomainManager.listVerDomain(typeAndVerId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public int editVerDomain(Long typeAndVerId, List<Long> list) { |
|
|
|
|
|
|
|
return deviceTypeVerDomainManager.editVerDomain(typeAndVerId,list); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|