浏览代码

fix tenant

he2802 2 年之前
父节点
当前提交
79fcc0bb78

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/bo/TopSysTenantRegisterAddBo.java

@@ -89,6 +89,7 @@ public class TopSysTenantRegisterAddBo {
     private String logoSmallUrl;
     /** 密钥 */
     @ApiModelProperty("密钥")
+    @NotBlank(message = "密码不能为空")
     private String password;
     /** 页脚备案号 */
     @ApiModelProperty("页脚备案号")

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/service/ITopSysTenantRegisterService.java

@@ -51,5 +51,4 @@ public interface ITopSysTenantRegisterService extends IService<TopSysTenantRegis
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
-	Boolean test(TopSysTenantRegisterAddBo bo);
 }

+ 4 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/service/impl/TopSysTenantRegisterServiceImpl.java

@@ -101,6 +101,9 @@ public class TopSysTenantRegisterServiceImpl extends ServiceImpl<TopSysTenantReg
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean insertByAddBo(TopSysTenantRegisterAddBo bo) {
+        if(Validator.isEmpty(bo.getPassword())){
+            throw new CustomException("密码不能为空");
+        }
         int count = count(new LambdaQueryWrapper<TopSysTenantRegister>().eq(TopSysTenantRegister::getTenantName, bo.getTenantName()));
         if (count > 0){
             throw new CustomException("该机构名已开通");
@@ -175,20 +178,5 @@ public class TopSysTenantRegisterServiceImpl extends ServiceImpl<TopSysTenantReg
         return this.removeByIds(ids);
     }
 
-    @Override
-    public Boolean test(TopSysTenantRegisterAddBo bo) {
-        TopSysTenantRegisterVo vo = queryById(3L);
-        SysTenantAdminBo adminBo = new SysTenantAdminBo();
-        adminBo.setTenantName(vo.getTenantName());
-        adminBo.setPassword(vo.getPassword());
-        adminBo.setHostPc(vo.getHostPc());
-        adminBo.setHostH5(vo.getHostH5());
-        adminBo.setHostLive(vo.getHostLive());
-        Long newTenantId = iSysTenantService.createTenantAdmin(adminBo);
-        System.out.println(newTenantId);
-        TopSysTenantRegisterAddBo bo1 = BeanUtil.toBean(vo, TopSysTenantRegisterAddBo.class);
-        bo1.setTenantId(newTenantId);
-        iSysWebService.createTenantConfig(bo1);
-        return null;
-    }
+
 }