|
|
@@ -3,7 +3,6 @@ package cn.com.taiji.userw.manager.system; |
|
|
|
import cn.com.taiji.common.manager.ManagerException; |
|
|
|
import cn.com.taiji.common.manager.net.http.ServiceHandleException; |
|
|
|
import cn.com.taiji.common.model.dao.Pagination; |
|
|
|
import cn.com.taiji.common.pub.BeanTools; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkAgency; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServiceHall; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.SourceType; |
|
|
@@ -32,7 +31,6 @@ import cn.com.taiji.userw.repo.jpa.request.system.StaffChangeLogPageRequest; |
|
|
|
import cn.com.taiji.userw.repo.jpa.request.system.StaffPageRequest; |
|
|
|
import cn.com.taiji.userw.tools.DictTypeUtil; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
@@ -97,7 +95,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
if (dto.getIdentityType() != null && dto.getIdentityType().trim().isEmpty() && !dictTypeUtil.checkLegalById(staffIdentityTypeId, dto.getIdentityType())) |
|
|
|
throw new ManagerException("传入的员工身份标识不合规,请前往字典管理进行核实!"); |
|
|
|
StaffPageRequest queryRequest = new StaffPageRequest(); |
|
|
|
BeanTools.copyProperties(dto, queryRequest); |
|
|
|
copyProperties(dto, queryRequest); |
|
|
|
//渠道迷糊查出id |
|
|
|
if (!hasText(dto.getAgencyName())) { |
|
|
|
List<String> agencyIds = agencyRepo.listByName(dto.getAgencyName()); |
|
|
@@ -216,7 +214,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Pagination changeLogPage(StaffChangeLogPageRequestDTO dto) throws ManagerException { |
|
|
|
public Pagination changeLogPage(StaffChangeLogPageRequestDTO dto) { |
|
|
|
StaffChangeLogPageRequest request = new StaffChangeLogPageRequest(); |
|
|
|
copyProperties(dto, request); |
|
|
|
return staffChangeLogRepo.page(request).convertResult(data -> { |
|
|
@@ -378,7 +376,6 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
//7、设置该员工的所分配系统角色 |
|
|
|
|
|
|
|
List<AccountUserRole> accountUserRoleList = new ArrayList<>(); |
|
|
|
int i = 0; |
|
|
|
for (UserRole userRole : userRoleList) { |
|
|
|
AccountUserRole accountUserRole = new AccountUserRole(); |
|
|
|
accountUserRole.setRoleId(userRole.getId()); |
|
|
@@ -497,7 +494,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
|
|
|
|
private StaffVo conver(Staff staff) { |
|
|
|
StaffVo staffVo = new StaffVo(); |
|
|
|
BeanTools.copyProperties(staff, staffVo); |
|
|
|
copyProperties(staff, staffVo); |
|
|
|
QtkAgency agency = agencyRepo.findByAgencyId(staffVo.getAgencyId()); |
|
|
|
if (agency != null) staffVo.setAgencyName(agency.getName());//设置所属渠道名称 |
|
|
|
QtkServiceHall serviceHall = qtkServiceHallRepo.findByServiceHallId(staffVo.getServiceHallId()); |
|
|
@@ -544,7 +541,7 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
} |
|
|
|
//3、找到员工,在该系统来源方中所分配的所有系统角色 |
|
|
|
List<AccountUserRole> list = accountUserRoleRepo.getListByOpenIdAndLoginSource(accountInfo.getOpenId(), loginSource); |
|
|
|
if (list.size() > 0) { |
|
|
|
if (!isEmpty(list)) { |
|
|
|
//3、清空该员工账号对应的所有系统角色 |
|
|
|
accountUserRoleRepo.deleteAll(list); |
|
|
|
} |
|
|
@@ -555,12 +552,12 @@ public class StaffManagerImpl extends RedisCacheManager implements StaffManager |
|
|
|
public StaffListResponseDTO staffList(StaffListRequestDTO dto) { |
|
|
|
List<Staff> allStaff = staffRepo.findAll(); |
|
|
|
List<StaffSimpleVo> data = Lists.newArrayList(); |
|
|
|
if (allStaff != null && allStaff.size() > 0) { |
|
|
|
if (!isEmpty(allStaff)) { |
|
|
|
for (Staff staff : allStaff) { |
|
|
|
//不展示 普通用户专属员工 |
|
|
|
if (!commonStaffId.equals(staff.getId())) { |
|
|
|
StaffSimpleVo vo = new StaffSimpleVo(); |
|
|
|
BeanUtils.copyProperties(staff, vo); |
|
|
|
copyProperties(staff, vo); |
|
|
|
//设置员工的openId |
|
|
|
if (!StringUtils.hasText(staff.getOpenId())) { |
|
|
|
vo.setOpenId(accountInfoRepo.getOpenIdByStaffId(staff.getStaffId())); |