|
|
|
@ -169,16 +169,20 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
@Override |
|
|
|
public List<TDuckListResultDTO> queryProjectList(TDuckListFormDTO formDTO) { |
|
|
|
List<String> orgIds = new ArrayList<>(); |
|
|
|
// 工作端不需要传orgId
|
|
|
|
if (formDTO.getClient().equals(TDuckConstant.CLIENT_GOV)){ |
|
|
|
// 根据 客户ID 和 人ID 从redis获取信息
|
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |
|
|
|
String pids = staffInfo.getAgencyPIds(); |
|
|
|
String agencyId = staffInfo.getAgencyId(); |
|
|
|
// 来源于 部门
|
|
|
|
if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_DEPT)){ |
|
|
|
List<IdAndNameDTO> deptList = staffInfo.getDeptList(); |
|
|
|
if (CollectionUtils.isEmpty(deptList)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
orgIds = joint(pids,agencyId,deptList); |
|
|
|
// 来源于 网格
|
|
|
|
}else if (staffInfo.getFromOrgType().equals(TDuckConstant.ORG_TYPE_GRID)){ |
|
|
|
List<IdAndNameDTO> gridList = staffInfo.getGridList(); |
|
|
|
if (CollectionUtils.isEmpty(gridList)){ |
|
|
|
@ -192,6 +196,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
}else { |
|
|
|
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); |
|
|
|
customerGridFormDTO.setGridId(formDTO.getOrgId()); |
|
|
|
// 查询网格信息
|
|
|
|
Result<CustomerGridDTO> gridResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); |
|
|
|
if (!gridResult.success()){ |
|
|
|
throw new RenException("查询网格信息失败了..."); |
|
|
|
@ -200,12 +205,14 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
String oneOrg = data.getPids() + ":" + data.getId(); |
|
|
|
orgIds.add(oneOrg); |
|
|
|
} |
|
|
|
// 根据orgIds查询 问卷调查的key
|
|
|
|
List<String> projectKeys = baseDao.selectProjectKey(orgIds); |
|
|
|
if (CollectionUtils.isEmpty(projectKeys)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
PageInfo<TDuckListResultDTO> projectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryProjectList(projectKeys, formDTO.getStatus(), formDTO.getClient())); |
|
|
|
List<TDuckListResultDTO> result = projectPageInfo.getList(); |
|
|
|
// 查询此人已填写过的问卷 并赋值已填写字段
|
|
|
|
List<String> records = visitRecordDao.selectVisitRecordByUserId(formDTO.getUserId()); |
|
|
|
if (!CollectionUtils.isEmpty(records)){ |
|
|
|
for (String r : records) { |
|
|
|
@ -217,6 +224,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl<PrUserProjectDao, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//赋值 orgName
|
|
|
|
result.forEach(r -> { |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), r.getCreatedBy()); |
|
|
|
String orgName = ""; |
|
|
|
|