浏览代码

feat:“增加营销经理账号类型"

soobin 9 月之前
父节点
当前提交
88f70d6dee

+ 6 - 11
src/main/java/com/szwl/controller/TAdminController.java

@@ -154,19 +154,17 @@ public class TAdminController {
         param.setAdminId(null);
         LambdaQueryWrapper<TAdmin> query = Wrappers.lambdaQuery();
         query.eq(TAdmin::getUsername, param.getUsername());
-//        List<TAdmin> list = tAdminService.list(query);
         TAdmin admin = tAdminService.getOne(query);
         if (admin != null) {
             return R.fail(ResponseCodesEnum.A0201);
         }
         TAdmin entity = BeanUtil.copyProperties(param, TAdmin.class);
         entity.setParentId(parentId);
-        if (parentId.toString().equals("1")) {
-            entity.setType(1);
+        if (param.getType() != null) {
+            entity.setType(param.getType());
         } else {
             entity.setType(3);
         }
-//        entity.setParentId(34l);
         entity.setIsAdmined(false);
         entity.setCreateDate(now);
         entity.setModifyDate(now);
@@ -175,13 +173,13 @@ public class TAdminController {
         entity.setLoginFailureCount(0);
         entity.setEmail(param.getEmail());
         entity.setPhone(param.getPhone());
-        entity.setCompanyType(param.getCompanyType());  // 公司平台
+        entity.setCompanyType(param.getCompanyType());
         //获取父账号信息
         TAdmin parentAdmin = tAdminService.getById(parentId);
         entity.setIfForeign(parentAdmin.getIfForeign());
         tAdminService.save(entity);
         String ifForeign = parentAdmin.getIfForeign();
-        if ("1".equals(ifForeign)) { // 海外子账户,新建一个 Airwallex 钱包账户
+        if ("1".equals(ifForeign)) {
             TAirwallexWallet wallet = new TAirwallexWallet();
             wallet.setAdminId(entity.getId());
             payFeign.saveAirwallexWallet(wallet);
@@ -359,7 +357,7 @@ public class TAdminController {
         }
         if (StringUtils.isNotEmpty(adminId)) {
             if (adminId.equals("18")) {
-                query.eq(TAdmin::getType, "1");
+                query.eq(TAdmin::getType, "1").or().eq(TAdmin::getType, "4");
             } else {
                 query.eq(TAdmin::getType, "3");
             }
@@ -411,9 +409,6 @@ public class TAdminController {
                         } else {
                             roleName.append(sysRole.getRoleName());
                         }
-//                    addLoginUserParam.setRoleName(roleName);
-//                    List<String> list2 = Arrays.asList(sysRole.getMenuCodesJson().split(","));
-//                    addLoginUserParam.setRoleList(list2);
                     }
 
                 }
@@ -451,7 +446,7 @@ public class TAdminController {
             if (admin == null) {
                 return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
             }
-            if (admin.getType() != 1) {
+            if (admin.getType() != 4) {
                 return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
             }
         }

+ 3 - 0
src/main/java/com/szwl/model/param/AddLoginUserParam.java

@@ -51,4 +51,7 @@ public class AddLoginUserParam {
 
     @ApiModelProperty("公司平台,0或空为申泽,1为七云")
     private String companyType;
+
+    @ApiModelProperty("账户类型,1:公司账号,2:商户,3:子账号,4:营销经理")
+    private Integer type;
 }