From f6b29d08e8f7c4db83d5a3c979ddf792e8b60a48 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Wed, 7 Aug 2024 11:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E6=9C=A8=E6=8A=A5=E8=A1=A8=E6=89=93?= =?UTF-8?q?=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 79 +++++++++++-------- .../yudao-module-report-biz/pom.xml | 1 + .../module/system/enums/common/DeptEnum.java | 27 +++++++ .../service/tenant/TenantServiceImpl.java | 20 ++++- yudao-server/pom.xml | 10 +-- 5 files changed, 96 insertions(+), 41 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java diff --git a/pom.xml b/pom.xml index 7676f900..0d2f935c 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ yudao-module-infra yudao-module-bpm - + yudao-module-report @@ -136,36 +136,51 @@ + + + aliyun + aliyun Repository + http://maven.aliyun.com/nexus/content/groups/public + + false + + + + + jeecg + jeecg Repository + http://maven.jeecg.org/nexus/content/repositories/jeecg + + false + + + + + huaweicloud + huawei + https://mirrors.huaweicloud.com/repository/maven/ + + + aliyunmaven + aliyun + https://maven.aliyun.com/repository/public + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + false + + + diff --git a/yudao-module-report/yudao-module-report-biz/pom.xml b/yudao-module-report/yudao-module-report-biz/pom.xml index b2c4d181..69c361c0 100644 --- a/yudao-module-report/yudao-module-report-biz/pom.xml +++ b/yudao-module-report/yudao-module-report-biz/pom.xml @@ -63,6 +63,7 @@ org.jeecgframework.jimureport jimureport-spring-boot-starter + diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java new file mode 100644 index 00000000..4fa8f26c --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/common/DeptEnum.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.system.enums.common; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 性别的枚举值 + * + * @author 芋道源码 + */ +@Getter +@AllArgsConstructor +public enum DeptEnum { + + /** 私人客户 */ + PRIVATE_CUS("私人客户"), + /** 代办客户 */ + AGENT_CUS("代办客户"), + /** 政企客户 */ + GOV_CUS("政企客户"); + + /** + * 名称 + */ + private final String name; + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java index 6eb8a01f..3ca1c97f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/tenant/TenantServiceImpl.java @@ -51,6 +51,7 @@ import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.module.system.enums.common.DeptEnum.*; import static java.util.Collections.singleton; /** @@ -131,7 +132,11 @@ public class TenantServiceImpl implements TenantService { // 修改租户的管理员 tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId)); //创建租户顶级部门 - Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile()); + Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile(),null); + //创建三个客户部门:私人客户、代办客户、政企客户 + createDept(null,PRIVATE_CUS.getName(),null,deptId); + createDept(null,AGENT_CUS.getName(),null,deptId); + createDept(null,GOV_CUS.getName(),null,deptId); //拉取本租户配置的服务套餐对应的角色和权限,存入本租户对应信息 createServiceRole(createReqVO.getPackageId()); }); @@ -158,13 +163,20 @@ public class TenantServiceImpl implements TenantService { } } - private Long createDept(Long userId,String deptName,String phone){ + private Long createDept(Long userId,String deptName,String phone,Long parentId){ DeptSaveReqVO deptSaveReqVO = new DeptSaveReqVO(); deptSaveReqVO.setName(deptName); deptSaveReqVO.setSort(0); - deptSaveReqVO.setPhone(phone); deptSaveReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - deptSaveReqVO.setLeaderUserId(userId); + if(null!=phone){ + deptSaveReqVO.setPhone(phone); + } + if(null!=userId){ + deptSaveReqVO.setLeaderUserId(userId); + } + if(null!=parentId){ + deptSaveReqVO.setParentId(parentId); + } return deptService.createDept(deptSaveReqVO); } diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index 33dea56d..e2cf2bbc 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -51,11 +51,11 @@ - - - - - + + cn.iocoder.boot + yudao-module-report-biz + ${revision} + cn.iocoder.boot