|
@ -11,12 +11,14 @@ import com.epmet.commons.tools.redis.RedisKeys; |
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.dataaggre.constant.TDuckConstant; |
|
|
import com.epmet.dataaggre.dto.epmettduck.result.PermissionValidateResultDTO; |
|
|
import com.epmet.dataaggre.dto.epmettduck.result.PermissionValidateResultDTO; |
|
|
import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity; |
|
|
import com.epmet.dataaggre.entity.epmettduck.PrPublishRangeEntity; |
|
|
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; |
|
|
import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; |
|
|
import com.epmet.dataaggre.service.QuestionnaireService; |
|
|
import com.epmet.dataaggre.service.QuestionnaireService; |
|
|
import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; |
|
|
import com.epmet.dataaggre.service.epmettduck.PrPublishRangeService; |
|
|
import com.epmet.dataaggre.service.epmettduck.PrUserProjectService; |
|
|
import com.epmet.dataaggre.service.epmettduck.PrUserProjectService; |
|
|
|
|
|
import com.epmet.dto.CustomerAgencyDTO; |
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
import com.epmet.dto.form.CustomerGridFormDTO; |
|
|
import com.epmet.dto.form.CustomerGridFormDTO; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
@ -88,6 +90,43 @@ public class QuestionnaireServiceImpl implements QuestionnaireService, ResultDat |
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public PermissionValidateResultDTO resiPermissionValidate(String projectKey, String userId, String orgId, String orgType) { |
|
|
|
|
|
PrUserProjectEntity project = prUserProjectService.getProjectEntityBykey(projectKey); |
|
|
|
|
|
if (project == null || !AppClientConstant.APP_RESI.equals(project.getClient())) { |
|
|
|
|
|
// 工作端只能看到发布到居民端的
|
|
|
|
|
|
log.warn("【调查问卷】居民端无法查看发布到工作端的调查问卷,staffId:{}, projectKey:{}", userId, projectKey); |
|
|
|
|
|
return generateValidateResult(userId, projectKey, false); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String gridIdPath = null; |
|
|
|
|
|
|
|
|
|
|
|
if(TDuckConstant.ORG_TYPE_AGENCY.equals(orgType)) { |
|
|
|
|
|
CustomerAgencyDTO customerAgency = govOrgOpenFeignClient.getAgencyById(orgId).getData(); |
|
|
|
|
|
|
|
|
|
|
|
if (customerAgency == null) { |
|
|
|
|
|
throw new RenException("查询组织信息失败了..."); |
|
|
|
|
|
} |
|
|
|
|
|
gridIdPath = customerAgency.getPids() + ":" + customerAgency.getId(); |
|
|
|
|
|
} else { |
|
|
|
|
|
CustomerGridFormDTO form = new CustomerGridFormDTO(); |
|
|
|
|
|
form.setGridId(orgId); |
|
|
|
|
|
Result<CustomerGridDTO> gridInfoResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); |
|
|
|
|
|
CustomerGridDTO gridInfo = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【调查问卷】校验访问权限,查询网格信息失败", null); |
|
|
|
|
|
// 网格父级ID列表:网格ID(拼接起来,冒号分割)
|
|
|
|
|
|
gridIdPath = gridInfo.getPids().concat(":").concat(gridInfo.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
List<PrPublishRangeEntity> publishRangeEntity = prPublishRangeService.getPublishRangeEntity(projectKey); |
|
|
|
|
|
PermissionValidateResultDTO r = new PermissionValidateResultDTO(); |
|
|
|
|
|
for (PrPublishRangeEntity rangeEntity : publishRangeEntity) { |
|
|
|
|
|
if (gridIdPath.contains(rangeEntity.getOrgIds())) { |
|
|
|
|
|
return generateValidateResult(userId, projectKey, true); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
r.setPermitted(false); |
|
|
|
|
|
return r; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PermissionValidateResultDTO govPermissionValidate(String projectKey, String staffId, String customerId) { |
|
|
public PermissionValidateResultDTO govPermissionValidate(String projectKey, String staffId, String customerId) { |
|
|
PrUserProjectEntity project = prUserProjectService.getProjectEntityBykey(projectKey); |
|
|
PrUserProjectEntity project = prUserProjectService.getProjectEntityBykey(projectKey); |
|
|