diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrUserProjectResultDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrUserProjectResultDao.java index 15ae5f7c3a..eac14a49b8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrUserProjectResultDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrUserProjectResultDao.java @@ -3,6 +3,9 @@ package com.epmet.dataaggre.dao.epmettduck; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dataaggre.entity.epmettduck.PrUserProjectResultEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 项目表单项 @@ -12,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface PrUserProjectResultDao extends BaseDao { - + + List selectFillRecordByUserId(@Param("userId")String userId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrVistRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrVistRecordDao.java index 279884c678..5714df590e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrVistRecordDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmettduck/PrVistRecordDao.java @@ -16,6 +16,6 @@ import java.util.List; @Mapper public interface PrVistRecordDao extends BaseDao { - List selectVisitRecordByUserId(@Param("userId")String userId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java index 89f03e8545..5d22f94772 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java @@ -38,6 +38,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.TDuckConstant; import com.epmet.dataaggre.dao.epmettduck.PrUserProjectDao; +import com.epmet.dataaggre.dao.epmettduck.PrUserProjectResultDao; import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao; import com.epmet.dataaggre.dto.epmettduck.PrPublishRangeDTO; import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; @@ -85,7 +86,7 @@ import java.util.stream.Stream; public class PrUserProjectServiceImpl extends BaseServiceImpl implements PrUserProjectService { @Autowired - private PrVistRecordDao visitRecordDao; + private PrUserProjectResultDao prUserProjectResultDao; @Resource private PrPublishRangeService prPublishRangeService; @Resource @@ -169,16 +170,20 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl queryProjectList(TDuckListFormDTO formDTO) { List 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 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 gridList = staffInfo.getGridList(); if (CollectionUtils.isEmpty(gridList)){ @@ -192,6 +197,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl gridResult = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if (!gridResult.success()){ throw new RenException("查询网格信息失败了..."); @@ -200,13 +206,15 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl projectKeys = baseDao.selectProjectKey(orgIds); if (CollectionUtils.isEmpty(projectKeys)){ return new ArrayList<>(); } PageInfo projectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryProjectList(projectKeys, formDTO.getStatus(), formDTO.getClient())); List result = projectPageInfo.getList(); - List records = visitRecordDao.selectVisitRecordByUserId(formDTO.getUserId()); + // 查询此人已填写过的问卷 并赋值已填写字段 + List records = prUserProjectResultDao.selectFillRecordByUserId(formDTO.getUserId()); if (!CollectionUtils.isEmpty(records)){ for (String r : records) { for (TDuckListResultDTO t : result) { @@ -217,6 +225,7 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), r.getCreatedBy()); String orgName = ""; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml index 21518172dc..76fc783368 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrUserProjectResultDao.xml @@ -3,4 +3,9 @@ + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml index 77f2f5c68a..8ea675b0e9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmettduck/PrVistRecordDao.xml @@ -3,10 +3,4 @@ - - \ No newline at end of file