diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java index 0406fb26f2..b80df7b7ff 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -108,4 +108,11 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { */ private Date updatedTime; + private String orgId; + + /** + * 用在 项目分类 org 统计中,记录本记录是否被计数 + */ + private Boolean status = false; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java index 010004d7ba..911b73b479 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java @@ -43,4 +43,12 @@ public interface FactOriginProjectCategoryDailyDao extends BaseDao selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId); + + /** + * @Description 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 + * @Param orgIds + * @author zxc + * @date 2021/4/13 下午4:36 + */ + List selectListProjectCategoryByOrg(@Param("orgIds")List orgIds,@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java index 1a0a27eda9..2da14685eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java @@ -47,4 +47,12 @@ public interface FactOriginProjectCategoryDailyService extends BaseService selectListProjectCategoryGridDailyDTO(String customerId); + + /** + * @Description 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 + * @Param orgIds + * @author zxc + * @date 2021/4/13 下午4:36 + */ + List selectListProjectCategoryByOrg(List orgIds,String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java index c97322b4b4..6e3f7abb90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.service.Issue.IssueProjectCategoryDictService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import com.epmet.service.project.ProjectService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -119,4 +120,18 @@ public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl list=baseDao.selectListProjectCategoryGridDailyDTO(customerId); return list; } + + /** + * @Description 查询客户下,组织直接立项的,各项目分类下的项目数量【筛选组织创建的项目,fact_origin_project_main_daily表gridId为空】 + * @Param orgIds + * @author zxc + * @date 2021/4/13 下午4:36 + */ + @Override + public List selectListProjectCategoryByOrg(List orgIds,String customerId) { + if (!CollectionUtils.isEmpty(orgIds)){ + return new ArrayList<>(); + } + return baseDao.selectListProjectCategoryByOrg(orgIds,customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index 8dbbe72d73..f61487abe0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -31,12 +31,14 @@ import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao; import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; +import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; import com.epmet.dto.screen.result.CategoryProjectResultDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.crm.CustomerRelationEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService; @@ -74,6 +76,8 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl page(Map params) { @@ -194,23 +198,23 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel)); if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){ // 社区级别 - disposeOneCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId); + disposeOneCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.STREET)){ // 街道级别 - disposeOneCustomerSub(ScreenConstant.STREET,false,customerId,dateId); + disposeOneCustomerSub(ScreenConstant.STREET,false,customerId,dateId,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){ // 区级 - disposeOneCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId); + disposeOneCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.CITY)){ // 市级 - disposeOneCustomerSub(ScreenConstant.CITY,false,customerId,dateId); + disposeOneCustomerSub(ScreenConstant.CITY,false,customerId,dateId,agencyIdList); } if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){ // 省级 - disposeOneCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId); + disposeOneCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId,agencyIdList); } } } @@ -224,7 +228,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl agencyIdList){ List result = new ArrayList<>(); if (isGrid){ // 是社区级别 @@ -255,6 +259,34 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); + List screenProjectCategory = factOriginProjectCategoryDailyService.selectListProjectCategoryByOrg(orgIds,customerId); + if (!CollectionUtils.isEmpty(result)){ + if (!CollectionUtils.isEmpty(screenProjectCategory)){ + result.forEach(r -> { + screenProjectCategory.forEach(pc -> { + if (r.getOrgId().equals(pc.getOrgId()) && r.getCategoryCode().equals(pc.getCategoryCode())){ + pc.setStatus(true); + r.setProjectTotal(r.getProjectTotal() + pc.getProjectTotal()); + } + }); + }); + Map> groupByStatus = screenProjectCategory.stream().collect(Collectors.groupingBy(ScreenProjectCategoryGridDailyDTO::getStatus)); + List screenProjectCategoryNoCal = groupByStatus.get(false); + if (!CollectionUtils.isEmpty(screenProjectCategoryNoCal)){ + List noCalCategory = ConvertUtils.sourceToTarget(screenProjectCategoryNoCal, ScreenProjectCategoryOrgDailyEntity.class); + result.addAll(noCalCategory); + } + } + }else { + if (!CollectionUtils.isEmpty(screenProjectCategory)){ + result = ConvertUtils.sourceToTarget(screenProjectCategory, ScreenProjectCategoryOrgDailyEntity.class); + } + } + if (!CollectionUtils.isEmpty(result)){ + result.forEach(r -> {r.setOrgType(level);r.setDateId(dateId);}); + } deleteAndInsert(customerId,dateId,result); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml index 03ea9ab75c..a2aa82a555 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml @@ -63,4 +63,46 @@ p.AGENCY_ID, P.PIDS + + +