|
@@ -20,11 +20,16 @@ import com.persagy.fm.saas.account.constant.enums.AccountTypeEnum;
|
|
import com.persagy.fm.saas.account.model.dto.AddSaasAccountDTO;
|
|
import com.persagy.fm.saas.account.model.dto.AddSaasAccountDTO;
|
|
import com.persagy.fm.saas.account.model.dto.PageQuerySaasAccountDTO;
|
|
import com.persagy.fm.saas.account.model.dto.PageQuerySaasAccountDTO;
|
|
import com.persagy.fm.saas.account.model.vo.SaasAccountListItemVO;
|
|
import com.persagy.fm.saas.account.model.vo.SaasAccountListItemVO;
|
|
|
|
+import com.persagy.fm.saas.accountrole.client.SaasAccountRoleClient;
|
|
|
|
+import com.persagy.fm.saas.accountrole.constant.enums.AccountRoleTypeEnum;
|
|
|
|
+import com.persagy.fm.saas.accountrole.model.dto.AddSaasAccountRoleDTO;
|
|
import com.persagy.fm.workresume.model.dto.AddWorkResumeDTO;
|
|
import com.persagy.fm.workresume.model.dto.AddWorkResumeDTO;
|
|
import com.persagy.fm.workresume.service.IWorkResumeService;
|
|
import com.persagy.fm.workresume.service.IWorkResumeService;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -44,6 +49,8 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
private SaasAccountClient saasAccountClient;
|
|
private SaasAccountClient saasAccountClient;
|
|
@Autowired
|
|
@Autowired
|
|
private PersonMapper personMapper;
|
|
private PersonMapper personMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SaasAccountRoleClient saasAccountRoleClient;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 创建人员
|
|
* 创建人员
|
|
@@ -66,15 +73,65 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
// 账号关联项目
|
|
// 账号关联项目
|
|
// TODO: 2021/3/23
|
|
// TODO: 2021/3/23
|
|
// 账号关联角色
|
|
// 账号关联角色
|
|
- // TODO: 2021/3/23
|
|
|
|
|
|
+ saveAccountRole(accountId, addPersonDTO.getMainDuty(),
|
|
|
|
+ addPersonDTO.getOtherDuties(), addPersonDTO.getOtherRoles());
|
|
return person.getId();
|
|
return person.getId();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 账号关联角色
|
|
|
|
+ *
|
|
|
|
+ * @param accountId 账号id
|
|
|
|
+ * @param mainDuty 主岗id
|
|
|
|
+ * @param otherDuties 副岗id列表
|
|
|
|
+ * @param otherRoles 其他角色列表
|
|
|
|
+ * @author lixing
|
|
|
|
+ * @version V1.0 2021/3/26 11:41 上午
|
|
|
|
+ */
|
|
|
|
+ private void saveAccountRole(
|
|
|
|
+ String accountId, String mainDuty,
|
|
|
|
+ List<String> otherDuties, List<String> otherRoles) {
|
|
|
|
+ // 保存主岗
|
|
|
|
+ if (StringUtils.isNotBlank(mainDuty)) {
|
|
|
|
+ saveAccountRole(accountId, mainDuty, AccountRoleTypeEnum.MAIN_DUTY.getType());
|
|
|
|
+ }
|
|
|
|
+ // 保存副岗
|
|
|
|
+ if (!CollectionUtils.isEmpty(otherDuties)) {
|
|
|
|
+ for (String otherDuty : otherDuties) {
|
|
|
|
+ saveAccountRole(accountId, otherDuty, AccountRoleTypeEnum.OTHER_DUTY.getType());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 保存其他角色
|
|
|
|
+ if (!CollectionUtils.isEmpty(otherRoles)) {
|
|
|
|
+ for (String otherRole : otherRoles) {
|
|
|
|
+ saveAccountRole(accountId, otherRole, AccountRoleTypeEnum.SYS_ROLE.getType());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 账号关联角色
|
|
|
|
+ *
|
|
|
|
+ * @param accountId 账号id
|
|
|
|
+ * @param roleId 角色id
|
|
|
|
+ * @param accountRoleType 关联类型
|
|
|
|
+ * @author lixing
|
|
|
|
+ * @version V1.0 2021/3/26 11:42 上午
|
|
|
|
+ */
|
|
|
|
+ private void saveAccountRole(String accountId, String roleId, String accountRoleType) {
|
|
|
|
+ AddSaasAccountRoleDTO mainDutyDTO = new AddSaasAccountRoleDTO();
|
|
|
|
+ mainDutyDTO.setDefaultValue();
|
|
|
|
+ mainDutyDTO.setAccountId(accountId);
|
|
|
|
+ mainDutyDTO.setRoleId(roleId);
|
|
|
|
+ mainDutyDTO.setCasType(accountRoleType);
|
|
|
|
+ saasAccountRoleClient.createSaasAccountRole(mainDutyDTO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 保存人员的工作信息
|
|
* 保存人员的工作信息
|
|
*
|
|
*
|
|
* @param addPersonDTO 创建人员入参
|
|
* @param addPersonDTO 创建人员入参
|
|
- * @param personId 人员id
|
|
|
|
|
|
+ * @param personId 人员id
|
|
* @author lixing
|
|
* @author lixing
|
|
* @version V1.0 2021/3/23 4:23 下午
|
|
* @version V1.0 2021/3/23 4:23 下午
|
|
*/
|
|
*/
|
|
@@ -92,7 +149,7 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
* 保存人员信息到数据库
|
|
* 保存人员信息到数据库
|
|
*
|
|
*
|
|
* @param addPersonDTO 创建人员入参
|
|
* @param addPersonDTO 创建人员入参
|
|
- * @param accountId 账号id
|
|
|
|
|
|
+ * @param accountId 账号id
|
|
* @return 保存后的人员对象
|
|
* @return 保存后的人员对象
|
|
* @author lixing
|
|
* @author lixing
|
|
* @version V1.0 2021/3/23 4:06 下午
|
|
* @version V1.0 2021/3/23 4:06 下午
|
|
@@ -155,7 +212,7 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
*
|
|
*
|
|
* @param addPersonDTO
|
|
* @param addPersonDTO
|
|
* @return void
|
|
* @return void
|
|
- * @exception
|
|
|
|
|
|
+ * @throws
|
|
* @author lixing
|
|
* @author lixing
|
|
* @version V1.0 2021/3/22 9:53 上午
|
|
* @version V1.0 2021/3/22 9:53 上午
|
|
*/
|
|
*/
|
|
@@ -261,9 +318,9 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
|
-// public void resetPassWord(Long personId) {
|
|
|
|
-// }
|
|
|
|
|
|
+ // @Override
|
|
|
|
+ // public void resetPassWord(Long personId) {
|
|
|
|
+ // }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void disablePerson(Long personId) {
|
|
public void disablePerson(Long personId) {
|
|
@@ -290,4 +347,9 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
// TODO: 2021/3/22 快速查询人名
|
|
// TODO: 2021/3/22 快速查询人名
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void enablePerson(Long personId) {
|
|
|
|
+ // TODO: 2021/3/26 解禁人员
|
|
|
|
+ }
|
|
}
|
|
}
|