Browse Source

editStaffInit少的代码

master
yinzuomei 3 years ago
parent
commit
a9db5a1768
  1. 15
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

15
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
@ -49,6 +50,7 @@ import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.StaffRoleEntity;
import com.epmet.entity.UserEntity; import com.epmet.entity.UserEntity;
import com.epmet.feign.AuthFeignClient; import com.epmet.feign.AuthFeignClient;
import com.epmet.feign.GovAccessFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.service.CustomerStaffService; import com.epmet.service.CustomerStaffService;
@ -94,6 +96,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
private GovStaffRoleDao govStaffRoleDao; private GovStaffRoleDao govStaffRoleDao;
@Autowired @Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient; private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private GovAccessFeignClient govAccessFeignClient;
@Override @Override
public PageData<CustomerStaffDTO> page(Map<String, Object> params) { public PageData<CustomerStaffDTO> page(Map<String, Object> params) {
@ -283,7 +287,16 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
} }
})); }));
resultDTO.setRoleList(staffRoleList); resultDTO.setRoleList(staffRoleList);
// 获取新角色
GetStaffExistRoleFormDTO getStaffExistRoleFormDTO = ConvertUtils.sourceToTarget(fromDTO, GetStaffExistRoleFormDTO.class);
Result<List<NewUserRoleResultDTO>> staffExistRole = govAccessFeignClient.getStaffExistRole(getStaffExistRoleFormDTO);
if (!staffExistRole.success()){
throw new EpmetException("getStaffExistRole method is failure");
}
if (!CollectionUtils.isEmpty(staffExistRole.getData())){
List<StaffRoleResultDTO> staffRoleResultDTOS = ConvertUtils.sourceToTarget(staffExistRole.getData(), StaffRoleResultDTO.class);
resultDTO.setNewRoleList(staffRoleResultDTOS);
}
return new Result<StaffInitResultDTO>().ok(resultDTO); return new Result<StaffInitResultDTO>().ok(resultDTO);
} }

Loading…
Cancel
Save