|
|
@ -848,8 +848,12 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
public ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result) { |
|
|
|
|
|
|
|
//1.查找对应的所属关系,通过最近一次登陆的网格,通过网格查找对应的机关和客户
|
|
|
|
ExtStaffInfoResultDTO orgInfo = |
|
|
|
baseDao.selectAgencyAndGridInfoExt(result.getGridId()); |
|
|
|
ExtStaffInfoResultDTO orgInfo; |
|
|
|
if(StringUtils.isNotBlank(result.getGridId())){ |
|
|
|
orgInfo = baseDao.selectAgencyAndGridInfoExt(result.getGridId()); |
|
|
|
}else{ |
|
|
|
orgInfo = baseDao.selectAgencyInfoWhenGridIdIsNull(result.getUserId()); |
|
|
|
} |
|
|
|
mergeObject(orgInfo,result); |
|
|
|
//2.查找客户名称
|
|
|
|
CustomerDTO customerParam = new CustomerDTO(); |
|
|
@ -881,22 +885,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
@Override |
|
|
|
public ExtStaffPermissionResultDTO staffPermissionExt(String staffId) { |
|
|
|
|
|
|
|
//1.通过staffId去user服务查询最近一次登陆的agencyId
|
|
|
|
Result<String> agency = |
|
|
|
epmetUserOpenFeignClient.latestAgency(staffId); |
|
|
|
if(agency.success() && StringUtils.isNotBlank(agency.getData())){ |
|
|
|
//2.根据此agencyId查询数据权限
|
|
|
|
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getData()); |
|
|
|
return res; |
|
|
|
}else{ |
|
|
|
logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员最近一次登陆的Agency信息,用户Id:{}",staffId); |
|
|
|
|
|
|
|
CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId); |
|
|
|
if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ |
|
|
|
logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员所属的机关信息,用户Id:{}",staffId); |
|
|
|
ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO(); |
|
|
|
checkFieldAndSetDefault(emptyResult); |
|
|
|
return emptyResult; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getAgencyId()); |
|
|
|
return res; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|