|
@@ -0,0 +1,31 @@
|
|
|
|
|
+package com.ydtech.modules.admin.service.impl;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+import com.ydtech.constants.enums.dict.organization.OrganizationSource;
|
|
|
|
|
+import com.ydtech.core.page.HttpResult;
|
|
|
|
|
+import com.ydtech.modules.admin.model.SysDept;
|
|
|
|
|
+import com.ydtech.modules.admin.service.SysDeptService;
|
|
|
|
|
+import com.ydtech.modules.admin.service.SysUserRecruitingService;
|
|
|
|
|
+import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
|
|
+import com.ydtech.utils.StringUtils;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
+
|
|
|
|
|
+@Service
|
|
|
|
|
+@RequiredArgsConstructor
|
|
|
|
|
+public class SysUserRecruitingServiceImpl implements SysUserRecruitingService {
|
|
|
|
|
+
|
|
|
|
|
+ private final SysDeptService sysDeptService;
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public HttpResult<Object> queryType(String deptId) {
|
|
|
|
|
+ SysDept sysDept = sysDeptService.getById(deptId);
|
|
|
|
|
+ // 查询上级机构个代还是出单员
|
|
|
|
|
+ String parentId = sysDept.getParentId();
|
|
|
|
|
+ SysDept sysDeptParent = sysDeptService.getById(parentId);
|
|
|
|
|
+ String managementSource = sysDeptParent.getManagementSource();
|
|
|
|
|
+ AssertionUtils.isFail(StringUtils.isEmpty(managementSource), "此机构暂时不支持增员");
|
|
|
|
|
+ OrganizationSource.Source source = Enum.valueOf(OrganizationSource.Source.class, OrganizationSource.Source.NAME + managementSource);
|
|
|
|
|
+ return HttpResult.ok(source.getDesc(), source.getCode());
|
|
|
|
|
+ }
|
|
|
|
|
+}
|