ソースを参照

提交accountInfo和staff相关功能

master
梁超 3ヶ月前
コミット
0cae38d9b5

+ 1
- 1
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/system/StaffManager.java ファイルの表示



String setStatus(StaffSetStatusRequestDTO dto) throws ManagerException; String setStatus(StaffSetStatusRequestDTO dto) throws ManagerException;


Pagination changeLogPage(StaffChangeLogPageRequestDTO dto) throws ManagerException;
Pagination changeLogPage(StaffChangeLogPageRequestDTO dto);


List<SystemTypeRoleVo> getSystemTypeAndRole(GetSystemTypeAndRoleRequestDTO dto) throws ManagerException; List<SystemTypeRoleVo> getSystemTypeAndRole(GetSystemTypeAndRoleRequestDTO dto) throws ManagerException;



+ 6
- 9
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/system/StaffManagerImpl.java ファイルの表示

import cn.com.taiji.common.manager.ManagerException; import cn.com.taiji.common.manager.ManagerException;
import cn.com.taiji.common.manager.net.http.ServiceHandleException; import cn.com.taiji.common.manager.net.http.ServiceHandleException;
import cn.com.taiji.common.model.dao.Pagination; 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.QtkAgency;
import cn.com.taiji.core.entity.basic.QtkServiceHall; import cn.com.taiji.core.entity.basic.QtkServiceHall;
import cn.com.taiji.core.entity.dict.basic.SourceType; import cn.com.taiji.core.entity.dict.basic.SourceType;
import cn.com.taiji.userw.repo.jpa.request.system.StaffPageRequest; import cn.com.taiji.userw.repo.jpa.request.system.StaffPageRequest;
import cn.com.taiji.userw.tools.DictTypeUtil; import cn.com.taiji.userw.tools.DictTypeUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.springframework.beans.BeanUtils;
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.util.StringUtils; import org.springframework.util.StringUtils;
if (dto.getIdentityType() != null && dto.getIdentityType().trim().isEmpty() && !dictTypeUtil.checkLegalById(staffIdentityTypeId, dto.getIdentityType())) if (dto.getIdentityType() != null && dto.getIdentityType().trim().isEmpty() && !dictTypeUtil.checkLegalById(staffIdentityTypeId, dto.getIdentityType()))
throw new ManagerException("传入的员工身份标识不合规,请前往字典管理进行核实!"); throw new ManagerException("传入的员工身份标识不合规,请前往字典管理进行核实!");
StaffPageRequest queryRequest = new StaffPageRequest(); StaffPageRequest queryRequest = new StaffPageRequest();
BeanTools.copyProperties(dto, queryRequest);
copyProperties(dto, queryRequest);
//渠道迷糊查出id //渠道迷糊查出id
if (!hasText(dto.getAgencyName())) { if (!hasText(dto.getAgencyName())) {
List<String> agencyIds = agencyRepo.listByName(dto.getAgencyName()); List<String> agencyIds = agencyRepo.listByName(dto.getAgencyName());




@Override @Override
public Pagination changeLogPage(StaffChangeLogPageRequestDTO dto) throws ManagerException {
public Pagination changeLogPage(StaffChangeLogPageRequestDTO dto) {
StaffChangeLogPageRequest request = new StaffChangeLogPageRequest(); StaffChangeLogPageRequest request = new StaffChangeLogPageRequest();
copyProperties(dto, request); copyProperties(dto, request);
return staffChangeLogRepo.page(request).convertResult(data -> { return staffChangeLogRepo.page(request).convertResult(data -> {
//7、设置该员工的所分配系统角色 //7、设置该员工的所分配系统角色


List<AccountUserRole> accountUserRoleList = new ArrayList<>(); List<AccountUserRole> accountUserRoleList = new ArrayList<>();
int i = 0;
for (UserRole userRole : userRoleList) { for (UserRole userRole : userRoleList) {
AccountUserRole accountUserRole = new AccountUserRole(); AccountUserRole accountUserRole = new AccountUserRole();
accountUserRole.setRoleId(userRole.getId()); accountUserRole.setRoleId(userRole.getId());


private StaffVo conver(Staff staff) { private StaffVo conver(Staff staff) {
StaffVo staffVo = new StaffVo(); StaffVo staffVo = new StaffVo();
BeanTools.copyProperties(staff, staffVo);
copyProperties(staff, staffVo);
QtkAgency agency = agencyRepo.findByAgencyId(staffVo.getAgencyId()); QtkAgency agency = agencyRepo.findByAgencyId(staffVo.getAgencyId());
if (agency != null) staffVo.setAgencyName(agency.getName());//设置所属渠道名称 if (agency != null) staffVo.setAgencyName(agency.getName());//设置所属渠道名称
QtkServiceHall serviceHall = qtkServiceHallRepo.findByServiceHallId(staffVo.getServiceHallId()); QtkServiceHall serviceHall = qtkServiceHallRepo.findByServiceHallId(staffVo.getServiceHallId());
} }
//3、找到员工,在该系统来源方中所分配的所有系统角色 //3、找到员工,在该系统来源方中所分配的所有系统角色
List<AccountUserRole> list = accountUserRoleRepo.getListByOpenIdAndLoginSource(accountInfo.getOpenId(), loginSource); List<AccountUserRole> list = accountUserRoleRepo.getListByOpenIdAndLoginSource(accountInfo.getOpenId(), loginSource);
if (list.size() > 0) {
if (!isEmpty(list)) {
//3、清空该员工账号对应的所有系统角色 //3、清空该员工账号对应的所有系统角色
accountUserRoleRepo.deleteAll(list); accountUserRoleRepo.deleteAll(list);
} }
public StaffListResponseDTO staffList(StaffListRequestDTO dto) { public StaffListResponseDTO staffList(StaffListRequestDTO dto) {
List<Staff> allStaff = staffRepo.findAll(); List<Staff> allStaff = staffRepo.findAll();
List<StaffSimpleVo> data = Lists.newArrayList(); List<StaffSimpleVo> data = Lists.newArrayList();
if (allStaff != null && allStaff.size() > 0) {
if (!isEmpty(allStaff)) {
for (Staff staff : allStaff) { for (Staff staff : allStaff) {
//不展示 普通用户专属员工 //不展示 普通用户专属员工
if (!commonStaffId.equals(staff.getId())) { if (!commonStaffId.equals(staff.getId())) {
StaffSimpleVo vo = new StaffSimpleVo(); StaffSimpleVo vo = new StaffSimpleVo();
BeanUtils.copyProperties(staff, vo);
copyProperties(staff, vo);
//设置员工的openId //设置员工的openId
if (!StringUtils.hasText(staff.getOpenId())) { if (!StringUtils.hasText(staff.getOpenId())) {
vo.setOpenId(accountInfoRepo.getOpenIdByStaffId(staff.getStaffId())); vo.setOpenId(accountInfoRepo.getOpenIdByStaffId(staff.getStaffId()));

読み込み中…
キャンセル
保存