浏览代码

'租户管理-系统配置-移动端登录页配置修改接口、移动端-登录页-样式配置查询接口和优化移动端-手机号验证码登录接口'

james 2 年之前
父节点
当前提交
a16f1b7770

+ 46 - 7
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/controller/web/SysMobileTenantConfigController.java

@@ -2,13 +2,11 @@ package com.usky.system.controller.web;
 
 
 import com.usky.common.core.bean.ApiResult;
+import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.domain.SysMobileTenantConfig;
 import com.usky.system.service.SysMobileTenantConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
@@ -27,15 +25,56 @@ public class SysMobileTenantConfigController {
     @Autowired
     private SysMobileTenantConfigService sysMobileTenantConfigService;
 
+
     /**
-     * 移动端-登录配置查询
+     * 移动端-登录页-样式配置查询
+     *
      * @param url 域名
+     */
+    @GetMapping("getAppTenantConfig")
+    public ApiResult<List<SysMobileTenantConfig>> getAppTenantConfig(@RequestParam String url){
+        return ApiResult.success(sysMobileTenantConfigService.getAppTenantConfig(url));
+    }
+
+
+    /**
+     * 租户管理-系统配置-移动端登录页配置查询
+     *
+     * @param tenantId 租户ID
      * @return
      */
     @GetMapping("/getMobileTenantConfig")
-    public ApiResult<List<SysMobileTenantConfig>> getMobileTenantConfig(@RequestParam String url) {
-        return ApiResult.success(sysMobileTenantConfigService.getMobileTenantConfig(url));
+    public ApiResult<List<SysMobileTenantConfig>> getMobileTenantConfig(@RequestParam Integer tenantId) {
+        return ApiResult.success(sysMobileTenantConfigService.getMobileTenantConfig(tenantId));
+    }
+
+    /**
+     * 租户管理-系统配置-移动端登录页配置新增
+     *
+     * @param sysMobileTenantConfig
+     * @return
+     */
+    @PostMapping("addMobileTenantConfig")
+    public ApiResult<Void> addMobileTenantConfig(@RequestBody SysMobileTenantConfig sysMobileTenantConfig){
+        sysMobileTenantConfigService.addMobileTenantConfig(sysMobileTenantConfig);
+        return ApiResult.success();
     }
 
+    /**
+     * 租户管理-系统配置-移动端登录页配置修改
+     *
+     * @param sysMobileTenantConfig
+     * @return
+     */
+    @PostMapping("updateMobileTenantConfig")
+    public ApiResult<Void> updateMobileTenantConfig(@RequestBody SysMobileTenantConfig sysMobileTenantConfig){
+        sysMobileTenantConfigService.updateMobileTenantConfig(sysMobileTenantConfig);
+        return ApiResult.success();
+    }
 }
 
+
+
+
+
+

+ 4 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/mapper/SysMobileTenantConfigMapper.java

@@ -2,6 +2,9 @@ package com.usky.system.mapper;
 
 import com.usky.system.domain.SysMobileTenantConfig;
 import com.usky.common.mybatis.core.CrudMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -12,5 +15,5 @@ import com.usky.common.mybatis.core.CrudMapper;
  * @since 2022-08-09
  */
 public interface SysMobileTenantConfigMapper extends CrudMapper<SysMobileTenantConfig> {
-
+    List<SysMobileTenantConfig> getAppTenantConfig(@Param("url") String url);
 }

+ 27 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/SysMobileTenantConfigService.java

@@ -15,9 +15,34 @@ import java.util.List;
  */
 public interface SysMobileTenantConfigService extends CrudService<SysMobileTenantConfig> {
     /**
-     * 移动端-登录配置查询
+     * 移动端-登录页-样式配置查询
+     *
      * @param url 域名
      * @return
      */
-    List<SysMobileTenantConfig> getMobileTenantConfig(String url);
+    List<SysMobileTenantConfig> getAppTenantConfig(String url);
+
+    /**
+     * 租户管理-系统配置-移动端登录页配置查询
+     *
+     * @param tenantId 租户Id
+     * @return
+     */
+    List<SysMobileTenantConfig> getMobileTenantConfig(Integer tenantId);
+
+    /**
+     * 租户管理-系统配置-移动端登录页配置新增
+     *
+     * @param sysMobileTenantConfig
+     * @return
+     */
+    void addMobileTenantConfig(SysMobileTenantConfig sysMobileTenantConfig);
+
+    /**
+     * 租户管理-系统配置-移动端登录页配置修改
+     *
+     * @param sysMobileTenantConfig
+     * @return
+     */
+    void updateMobileTenantConfig(SysMobileTenantConfig sysMobileTenantConfig);
 }

+ 28 - 2
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/SysMobileTenantConfigServiceImpl.java

@@ -1,13 +1,18 @@
 package com.usky.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.mybatis.core.AbstractCrudService;
+import com.usky.common.security.utils.SecurityUtils;
 import com.usky.system.domain.SysMobileTenantConfig;
+import com.usky.system.mapper.SysMobileRoleMenuMapper;
 import com.usky.system.mapper.SysMobileTenantConfigMapper;
 import com.usky.system.service.SysMobileTenantConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -21,12 +26,33 @@ import java.util.List;
 @Service
 public class SysMobileTenantConfigServiceImpl extends AbstractCrudService<SysMobileTenantConfigMapper, SysMobileTenantConfig> implements SysMobileTenantConfigService {
 
+
+    @Override
+    public List<SysMobileTenantConfig> getAppTenantConfig(String url){
+        List<SysMobileTenantConfig> list = baseMapper.getAppTenantConfig(url);
+        return list;
+    }
+
     @Override
-    public List<SysMobileTenantConfig> getMobileTenantConfig(String url) {
+    public List<SysMobileTenantConfig> getMobileTenantConfig(Integer tenantId) {
         LambdaQueryWrapper<SysMobileTenantConfig> query = Wrappers.lambdaQuery();
-        query.eq(SysMobileTenantConfig::getLoginDomain, url);
+        query.eq(SysMobileTenantConfig::getTenantId, tenantId);
         List<SysMobileTenantConfig> list = this.list(query);
         return list;
     }
 
+    @Override
+    public void addMobileTenantConfig(SysMobileTenantConfig sysMobileTenantConfig){
+        sysMobileTenantConfig.setCreateBy(SecurityUtils.getUsername());
+        sysMobileTenantConfig.setCreateTime(LocalDateTime.now());
+        this.save(sysMobileTenantConfig);
+    }
+
+    @Override
+    public void updateMobileTenantConfig(SysMobileTenantConfig sysMobileTenantConfig){
+        sysMobileTenantConfig.setCreateBy(SecurityUtils.getUsername());
+        sysMobileTenantConfig.setCreateTime(LocalDateTime.now());
+        this.updateById(sysMobileTenantConfig);
+    }
+
 }

+ 12 - 0
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysMobileTenantConfigMapper.xml

@@ -22,4 +22,16 @@
         <result column="update_time" property="updateTime" />
     </resultMap>
 
+    <select id="getAppTenantConfig" resultMap="BaseResultMap">
+        select
+        b.*
+        from
+        sys_tenant AS a
+        JOIN sys_mobile_tenant_config AS b ON a.id = b.tenant_id
+        <where>
+            a.status = 0
+            and a.domain = #{url}
+        </where>
+    </select>
+
 </mapper>

+ 6 - 2
base-modules/service-system/service-system-biz/src/main/resources/mapper/system/SysUserMapper.xml

@@ -283,7 +283,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<select id="selectUserData" resultMap="SysUserResult">
 		select * from sys_user
-		where user_name = #{userName}
+		where
+		del_flag=0 and status=0
+		and user_name = #{userName}
 		<if test="tenantId != null and tenantId != 0">
 			and tenant_id = #{tenantId}
 		</if>
@@ -291,7 +293,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 	<select id="selectUserDataOne" resultMap="SysUserResult">
 		select * from sys_user
-		where  phonenumber = #{phone}
+		where
+		del_flag=0 and status=0
+		and phonenumber = #{phone}
 		<if test="tenantId != null and tenantId != 0">
 			and tenant_id = #{tenantId}
 		</if>