|
|
@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -31,23 +30,8 @@ import com.epmet.constant.UserConstant; |
|
|
|
import com.epmet.constant.UserRoleConstant; |
|
|
|
import com.epmet.dao.CustomerStaffDao; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.CustomerGridFormDTO; |
|
|
|
import com.epmet.dto.CustomerStaffDTO; |
|
|
|
import com.epmet.dto.CustomerStaffGridDTO; |
|
|
|
import com.epmet.dto.GovStaffRoleDTO; |
|
|
|
import com.epmet.dto.StaffGridListDTO; |
|
|
|
import com.epmet.dto.StaffRoleDTO; |
|
|
|
import com.epmet.dto.form.CustomerStaffFormDTO; |
|
|
|
import com.epmet.dto.form.StaffInfoFromDTO; |
|
|
|
import com.epmet.dto.form.StaffSubmitFromDTO; |
|
|
|
import com.epmet.dto.form.DepartmentInStaffFormDTO; |
|
|
|
import com.epmet.dto.form.StaffRoleFormDTO; |
|
|
|
import com.epmet.dto.form.StaffsInAgencyFromDTO; |
|
|
|
import com.epmet.dto.result.StaffDetailResultDTO; |
|
|
|
import com.epmet.dto.result.DepartInStaffListResultDTO; |
|
|
|
import com.epmet.dto.result.StaffInfoResultDTO; |
|
|
|
import com.epmet.dto.result.StaffInitResultDTO; |
|
|
|
import com.epmet.dto.result.StaffRoleResultDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.CustomerStaffEntity; |
|
|
|
import com.epmet.entity.GovStaffRoleEntity; |
|
|
|
import com.epmet.entity.StaffRoleEntity; |
|
|
@ -351,16 +335,21 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
|
return gridStaffCountDTOResult; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<DepartInStaffListResultDTO>> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { |
|
|
|
//1:根据userId集合查询人员基本信息
|
|
|
|
List<DepartInStaffListResultDTO> list = baseDao.selectDepartmentStaffList(formDTO); |
|
|
|
//2:根据部门Id查询部门下是领导角色的用户
|
|
|
|
StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); |
|
|
|
staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); |
|
|
|
staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); |
|
|
|
|
|
|
|
return new Result<List<DepartInStaffListResultDTO>>().ok(list); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public Result<List<DepartInStaffListResultDTO>> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { |
|
|
|
//1:根据userId集合查询人员基本信息
|
|
|
|
List<DepartInStaffListResultDTO> staffList = baseDao.selectDepartmentStaffList(formDTO); |
|
|
|
//2:根据部门Id查询部门下是领导角色的用户
|
|
|
|
StaffRoleFormDTO staffRoleFormDTO = new StaffRoleFormDTO(); |
|
|
|
staffRoleFormDTO.setOrgId(formDTO.getDepartmentId()); |
|
|
|
staffRoleFormDTO.setRoleKey(UserRoleConstant.DEPT_LEADER); |
|
|
|
List<GovStaffRoleResultDTO> staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getDepartmentId()); |
|
|
|
staffRoleDTOS.forEach(roleDto -> { |
|
|
|
staffList.stream().filter(staffDto -> |
|
|
|
roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> |
|
|
|
result.setRoleName(roleDto.getRoleName())); |
|
|
|
}); |
|
|
|
return new Result<List<DepartInStaffListResultDTO>>().ok(staffList); |
|
|
|
} |
|
|
|
|
|
|
|
} |