Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

hym 4 anni fa
parent
commit
431230174c

+ 4 - 1
user_auth/src/main/java/com/huaxu/controller/UserController.java

@@ -16,6 +16,7 @@ import com.huaxu.util.UserUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.web.bind.annotation.*;
@@ -120,8 +121,10 @@ public class UserController {
     @RequestMapping(value = "insertRegister", method = RequestMethod.POST)
     @ApiOperation(value = "插入注册申请")
     public AjaxMessage<Integer> insertRegister(@ApiParam(value = "注册申请信息", required = true) @RequestBody User user) {
+        if(StringUtils.isEmpty(user.getUsername())||StringUtils.isEmpty(user.getPhone())||StringUtils.isEmpty(user.getUserType())) {
+            return new AjaxMessage<>(ResultStatus.PARAM_ERROR);
+        }
         int result = userService.insertRegister(user);
-
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
 

+ 1 - 1
user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java

@@ -174,7 +174,7 @@ public class TenantServiceImpl implements TenantService {
         userEntity.setStatus(1);
         userEntity.setPhone(tenantDto.getPhone());
         userEntity.setUsername(tenantDto.getUserName());
-        userEntity.setUserType("1");//租户系统管理员
+        userEntity.setUserType("-999");//租户系统管理员
         userEntity.setRoleId(role.getId().longValue()); //赋值角色
         userEntity.setCompanyOrgId(org.getId().longValue());//公司
         userEntity.setDeptOrgId(org.getId().longValue());//机构

+ 2 - 0
user_center/src/main/resources/mapper/DictMapper.xml

@@ -59,6 +59,7 @@
                 and PARENT_DICT_ID in (select ID from uims_dict where DICT_CODE=#{parentDictCode})
             </if>
             and STATUS =1
+            and DICT_CODE!='-999'
         </where>
         order by DICT_NAME,DICT_VALUE
     </select>
@@ -173,6 +174,7 @@
                 and PARENT_DICT_ID IS NULL
             </if>
             and STATUS =1
+            and DICT_CODE!='-999'
         </where>
         order by DICT_NAME,DICT_VALUE
     </select>

+ 2 - 1
user_center/src/main/resources/mapper/TenantMapper.xml

@@ -17,7 +17,7 @@
     </sql>
 
     <sql id="tenantJoins">
-        left join uims_user u on t.code=u.TENANT_ID and u.USER_TYPE='1' and u.status =1
+        left join uims_user u on t.code=u.TENANT_ID and u.USER_TYPE='-999' and u.status =1
         left join (
 			select d.DICT_CODE,d.DICT_VALUE
 			from uims_dict p
@@ -149,6 +149,7 @@
                 and t.TENANT_NAME like concat('%',#{tenantDto.tenantName},'%')
             </if>
         </where>
+        order by t.dateCreate desc
     </select>
 
     <!-- 生成租户菜单 -->