|
|
@ -7,6 +7,7 @@ import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.CustomerStaffAgencyDao; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
@ -14,6 +15,7 @@ import com.epmet.entity.CustomerAgencyEntity; |
|
|
|
import com.epmet.entity.CustomerStaffAgencyEntity; |
|
|
|
import com.epmet.feign.*; |
|
|
|
import com.epmet.service.*; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -51,6 +53,8 @@ public class StaffServiceImpl implements StaffService { |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
@Autowired |
|
|
|
private CustomerStaffAgencyDao customerStaffAgencyDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { |
|
|
@ -274,4 +278,27 @@ public class StaffServiceImpl implements StaffService { |
|
|
|
public Result<BasicInfoResultDTO> staffBasicInfo(StaffBasicInfoFromDTO fromDTO) { |
|
|
|
return epmetUserOpenFeignClient.getStaffBasicInfo(fromDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询工作人员名字 |
|
|
|
* @Param userId |
|
|
|
* @author zxc |
|
|
|
* @date 2021/8/4 3:38 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public String staffName(String userId) { |
|
|
|
// 查询所属组织名字
|
|
|
|
String agencyName = customerStaffAgencyDao.selectStaffBelongAgency(userId); |
|
|
|
if (StringUtils.isEmpty(agencyName)){ |
|
|
|
throw new RenException("查询工作人员所属组织名称为空"); |
|
|
|
} |
|
|
|
StaffBasicInfoFromDTO formDTO = new StaffBasicInfoFromDTO(); |
|
|
|
formDTO.setStaffId(userId); |
|
|
|
Result<BasicInfoResultDTO> staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(formDTO); |
|
|
|
if (!staffBasicInfo.success()){ |
|
|
|
throw new RenException("查询工作人员姓名失败"); |
|
|
|
} |
|
|
|
String result = agencyName.concat(staffBasicInfo.getData().getRealName()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|