|
|
@@ -1,8 +1,11 @@
|
|
|
package com.zhongzheng.modules.top.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
+import com.zhongzheng.modules.alioss.bo.OssRequest;
|
|
|
+import com.zhongzheng.modules.alioss.service.OssService;
|
|
|
import com.zhongzheng.modules.top.bo.TopSysTenantRegisterAddBo;
|
|
|
import com.zhongzheng.modules.top.bo.TopSysTenantRegisterEditBo;
|
|
|
import com.zhongzheng.modules.top.bo.TopSysTenantRegisterQueryBo;
|
|
|
@@ -10,6 +13,7 @@ import com.zhongzheng.modules.top.domain.TopSysTenantRegister;
|
|
|
import com.zhongzheng.modules.top.mapper.TopSysTenantRegisterMapper;
|
|
|
import com.zhongzheng.modules.top.service.ITopSysTenantRegisterService;
|
|
|
import com.zhongzheng.modules.top.vo.TopSysTenantRegisterVo;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
@@ -31,6 +35,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
public class TopSysTenantRegisterServiceImpl extends ServiceImpl<TopSysTenantRegisterMapper, TopSysTenantRegister> implements ITopSysTenantRegisterService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private OssService ossService;
|
|
|
+
|
|
|
@Override
|
|
|
public TopSysTenantRegisterVo queryById(Long id){
|
|
|
TopSysTenantRegister db = this.baseMapper.selectById(id);
|
|
|
@@ -80,7 +87,35 @@ public class TopSysTenantRegisterServiceImpl extends ServiceImpl<TopSysTenantReg
|
|
|
|
|
|
@Override
|
|
|
public Boolean insertByAddBo(TopSysTenantRegisterAddBo bo) {
|
|
|
+ if(Validator.isNotEmpty(bo.getLogoUrl())){
|
|
|
+ OssRequest ossRequest = new OssRequest();
|
|
|
+ ossRequest.setImageStatus(6);
|
|
|
+ String ossPath = ossService.uploadBase64(bo.getLogoUrl(),ossRequest);
|
|
|
+ if(Validator.isNotEmpty(ossPath)){
|
|
|
+ bo.setLogoUrl(ossPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(bo.getLogoH5Url())){
|
|
|
+ OssRequest ossRequest = new OssRequest();
|
|
|
+ ossRequest.setImageStatus(6);
|
|
|
+ String ossPath = ossService.uploadBase64(bo.getLogoH5Url(),ossRequest);
|
|
|
+ if(Validator.isNotEmpty(ossPath)){
|
|
|
+ bo.setLogoH5Url(ossPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Validator.isNotEmpty(bo.getLogoSmallUrl())){
|
|
|
+ OssRequest ossRequest = new OssRequest();
|
|
|
+ ossRequest.setImageStatus(6);
|
|
|
+ String ossPath = ossService.uploadBase64(bo.getLogoSmallUrl(),ossRequest);
|
|
|
+ if(Validator.isNotEmpty(ossPath)){
|
|
|
+ bo.setLogoSmallUrl(ossPath);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
TopSysTenantRegister add = BeanUtil.toBean(bo, TopSysTenantRegister.class);
|
|
|
+
|
|
|
validEntityBeforeSave(add);
|
|
|
add.setCreateTime(DateUtils.getNowTime());
|
|
|
add.setUpdateTime(DateUtils.getNowTime());
|