|
@@ -5,6 +5,9 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.file.entity.FileInfoVo;
|
|
|
+import com.fjhx.file.entity.ObsFile;
|
|
|
+import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.tenant.entity.tenant.dto.BindingMenuDto;
|
|
|
import com.fjhx.tenant.entity.tenant.dto.TenantInfoDto;
|
|
|
import com.fjhx.tenant.entity.tenant.dto.TenantInfoSelectDto;
|
|
@@ -28,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -165,6 +169,11 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
|
|
|
sysRoleService.save(sysRole);
|
|
|
|
|
|
sysRoleService.insertAuthUsers(sysRole.getRoleId(), new Long[]{sysUser.getUserId()});
|
|
|
+
|
|
|
+ List<ObsFile> fileList = tenantInfoDto.getFileList();
|
|
|
+ if (fileList != null) {
|
|
|
+ ObsFileUtil.saveFile(tenantInfoDto.getFileList(), tenantInfoDto.getId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void edit(TenantInfoDto tenantInfoDto) {
|
|
@@ -172,10 +181,16 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
|
|
|
tenantInfoDto.setTenantId(null);
|
|
|
|
|
|
this.updateById(tenantInfoDto);
|
|
|
+
|
|
|
+ List<ObsFile> fileList = tenantInfoDto.getFileList();
|
|
|
+ if (fileList != null) {
|
|
|
+ ObsFileUtil.editFile(tenantInfoDto.getFileList(), tenantInfoDto.getId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void delete(Long id) {
|
|
|
this.removeById(id);
|
|
|
+ ObsFileUtil.removeFile(id);
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
@@ -230,4 +245,19 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoMapper, TenantI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void editLogo(TenantInfoDto tenantInfoDto) {
|
|
|
+ String tenantId = SecurityUtils.getTenantId();
|
|
|
+ TenantInfo tenantInfo = getOne(q -> q.eq(TenantInfo::getTenantId, tenantId));
|
|
|
+ ObsFileUtil.editFile(tenantInfoDto.getFileList(), tenantInfo.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FileInfoVo> getLogo() {
|
|
|
+ String tenantId = SecurityUtils.getTenantId();
|
|
|
+ TenantInfo tenantInfo = getOne(q -> q.eq(TenantInfo::getTenantId, tenantId));
|
|
|
+ Map<Long, List<FileInfoVo>> fileMap = ObsFileUtil.getFileMap(Collections.singletonList(tenantInfo.getId()), 0);
|
|
|
+ return fileMap.get(tenantInfo.getId());
|
|
|
+ }
|
|
|
+
|
|
|
}
|