|
@@ -31,7 +31,7 @@ public class VppArchiveServiceImpl implements VppArchiveService {
|
|
|
private VppFileArchiveMapper vppFileArchiveMapper;
|
|
private VppFileArchiveMapper vppFileArchiveMapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String create(VppFileArchiveRequestVO vo) {
|
|
|
|
|
|
|
+ public Boolean create(VppFileArchiveRequestVO vo) {
|
|
|
String username = SecurityUtils.getUsername();
|
|
String username = SecurityUtils.getUsername();
|
|
|
Integer tenantId = SecurityUtils.getTenantId();
|
|
Integer tenantId = SecurityUtils.getTenantId();
|
|
|
|
|
|
|
@@ -57,24 +57,24 @@ public class VppArchiveServiceImpl implements VppArchiveService {
|
|
|
vppFileArchive.setVersion("V1.0");
|
|
vppFileArchive.setVersion("V1.0");
|
|
|
vppFileArchive.setTenantId(tenantId);
|
|
vppFileArchive.setTenantId(tenantId);
|
|
|
vppFileArchive.setRemark(StringUtils.isNotBlank(vo.getRemark()) ? vo.getRemark() : "");
|
|
vppFileArchive.setRemark(StringUtils.isNotBlank(vo.getRemark()) ? vo.getRemark() : "");
|
|
|
- vppFileArchive.setDelFlag(0);
|
|
|
|
|
|
|
+ vppFileArchive.setDeleteFlag(0);
|
|
|
int insert = vppFileArchiveMapper.insert(vppFileArchive);
|
|
int insert = vppFileArchiveMapper.insert(vppFileArchive);
|
|
|
|
|
|
|
|
- return insert > 0 ? "新增成功!" : "新增失败!";
|
|
|
|
|
|
|
+ return insert > 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public CommonPage<VppFileArchiveResponseVO> page(VppFileArchiveRequestVO vo) {
|
|
|
|
|
- Integer pageNum = vo.getPageNum() != null && vo.getPageNum() > 0 ? vo.getPageNum() : 1;
|
|
|
|
|
- Integer pageSize = vo.getPageSize() != null && vo.getPageSize() > 0 ? vo.getPageSize() : 20;
|
|
|
|
|
|
|
+ public CommonPage<VppFileArchiveResponseVO> page(String archiveName, Integer archiveType, Long siteId, String bizType, Long bizId, Integer pageNum, Integer pageSize) {
|
|
|
IPage<VppFileArchive> page = new Page<>(pageNum, pageSize);
|
|
IPage<VppFileArchive> page = new Page<>(pageNum, pageSize);
|
|
|
|
|
|
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(VppFileArchive::getDelFlag, 0)
|
|
|
|
|
|
|
+ queryWrapper.eq(VppFileArchive::getDeleteFlag, 0)
|
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId())
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId())
|
|
|
- .like(StringUtils.isNotBlank(vo.getArchiveName()), VppFileArchive::getArchiveName, vo.getArchiveName())
|
|
|
|
|
- .eq(vo.getSiteId() != null, VppFileArchive::getSiteId, vo.getSiteId())
|
|
|
|
|
- .eq(vo.getArchiveType() != null, VppFileArchive::getArchiveType, vo.getArchiveType())
|
|
|
|
|
|
|
+ .eq(siteId != null, VppFileArchive::getSiteId, siteId)
|
|
|
|
|
+ .eq(archiveType != null, VppFileArchive::getArchiveType, archiveType)
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(bizType), VppFileArchive::getBizType, bizType)
|
|
|
|
|
+ .eq(bizId != null, VppFileArchive::getBizId, bizId)
|
|
|
|
|
+ .like(StringUtils.isNotBlank(archiveName), VppFileArchive::getArchiveName, archiveName)
|
|
|
.orderByDesc(VppFileArchive::getCreateTime);
|
|
.orderByDesc(VppFileArchive::getCreateTime);
|
|
|
page = vppFileArchiveMapper.selectPage(page, queryWrapper);
|
|
page = vppFileArchiveMapper.selectPage(page, queryWrapper);
|
|
|
|
|
|
|
@@ -105,7 +105,7 @@ public class VppArchiveServiceImpl implements VppArchiveService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String upload(VppFileArchiveRequestVO vo) {
|
|
|
|
|
|
|
+ public Boolean upload(VppFileArchiveRequestVO vo) {
|
|
|
if (vo.getId() == null) {
|
|
if (vo.getId() == null) {
|
|
|
throw new RuntimeException("主键ID不能为空!");
|
|
throw new RuntimeException("主键ID不能为空!");
|
|
|
}
|
|
}
|
|
@@ -113,7 +113,7 @@ public class VppArchiveServiceImpl implements VppArchiveService {
|
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(VppFileArchive::getId, vo.getId())
|
|
queryWrapper.eq(VppFileArchive::getId, vo.getId())
|
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId())
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId())
|
|
|
- .eq(VppFileArchive::getDelFlag, 0);
|
|
|
|
|
|
|
+ .eq(VppFileArchive::getDeleteFlag, 0);
|
|
|
VppFileArchive existingRecord = vppFileArchiveMapper.selectOne(queryWrapper);
|
|
VppFileArchive existingRecord = vppFileArchiveMapper.selectOne(queryWrapper);
|
|
|
|
|
|
|
|
if (existingRecord == null) {
|
|
if (existingRecord == null) {
|
|
@@ -168,20 +168,20 @@ public class VppArchiveServiceImpl implements VppArchiveService {
|
|
|
existingRecord.setUpdatedBy(SecurityUtils.getUsername());
|
|
existingRecord.setUpdatedBy(SecurityUtils.getUsername());
|
|
|
|
|
|
|
|
int update = vppFileArchiveMapper.updateById(existingRecord);
|
|
int update = vppFileArchiveMapper.updateById(existingRecord);
|
|
|
- return update > 0 ? "更新成功!" : "更新失败!";
|
|
|
|
|
|
|
+ return update > 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String delete(Long id) {
|
|
|
|
|
|
|
+ public Boolean delete(Long id) {
|
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<VppFileArchive> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(VppFileArchive::getId, id)
|
|
queryWrapper.eq(VppFileArchive::getId, id)
|
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId());
|
|
.eq(VppFileArchive::getTenantId, SecurityUtils.getTenantId());
|
|
|
VppFileArchive vppFileArchive = vppFileArchiveMapper.selectOne(queryWrapper);
|
|
VppFileArchive vppFileArchive = vppFileArchiveMapper.selectOne(queryWrapper);
|
|
|
- vppFileArchive.setDelFlag(1);
|
|
|
|
|
|
|
+ vppFileArchive.setDeleteFlag(1);
|
|
|
vppFileArchive.setDeletedTime(LocalDateTime.now());
|
|
vppFileArchive.setDeletedTime(LocalDateTime.now());
|
|
|
vppFileArchive.setUpdatedBy(SecurityUtils.getUsername());
|
|
vppFileArchive.setUpdatedBy(SecurityUtils.getUsername());
|
|
|
int i = vppFileArchiveMapper.updateById(vppFileArchive);
|
|
int i = vppFileArchiveMapper.updateById(vppFileArchive);
|
|
|
- return i > 0 ? "删除成功!" : "删除失败!";
|
|
|
|
|
|
|
+ return i > 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|