Browse Source

Merge remote-tracking branch 'origin/dev_issue_category' into dev_temp

master
wangchao 4 years ago
parent
commit
cc401bb45f
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
  2. 56
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  5. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java
  6. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  7. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  8. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  9. 182
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java
  10. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  11. 30
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml
  12. 53
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
  13. 12
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据对接.txt
  14. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java

@ -112,5 +112,7 @@ public class ScreenCustomerGridDTO implements Serializable {
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
private String pid;
private String pids;
}

56
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/3/23 下午2:38
* @DESC
*/
@Data
public class CategoryProjectResultDTO implements Serializable {
private static final long serialVersionUID = -5774330825880917524L;
private String pid;
private String pids;
/**
* 组织ID
*/
private String orgId;
/**
* 客户ID
*/
private String customerId;
/**
* 分类码
*/
private String categoryCode;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 分类级别
*/
private Integer level;
/**
* 日期ID
*/
private String dateId;
/**
* 组织级别
*/
private String orgType;
private Boolean status = false;
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -859,4 +859,14 @@ public class DemoController {
originProjectCategoryDailyService.extractProjectCategory(formDTO);
return new Result();
}
@Autowired
private ScreenProjectCategoryOrgDailyService screenProjectCategoryOrgDailyService;
@PostMapping("orgdaily")
public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){
screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId);
return new Result();
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -194,4 +194,13 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
* @date 2021/1/28 下午3:18
*/
List<ScreenProjectGridDailyDTO> selectGridInfoByCustomerId(@Param("customerId") String customerId);
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:03
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(@Param("customerId") String customerId,@Param("level") String level);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java

@ -18,10 +18,13 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目(事件)分类按网格_按天统计
*
@ -39,4 +42,13 @@ public interface ScreenProjectCategoryGridDailyDao extends BaseDao<ScreenProject
* @return int
*/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询分类信息
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 下午2:49
*/
List<CategoryProjectResultDTO> selectCategoryInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("level")String level,@Param("gridIds")List<String> gridIds);
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java

@ -18,10 +18,14 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目(事件)分类按组织_按天统计
*
@ -39,4 +43,26 @@ public interface ScreenProjectCategoryOrgDailyDao extends BaseDao<ScreenProjectC
* @return int
*/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询组织分类信息
* @Param customerId
* @Param dateId
* @Param level 组织级别
* @author zxc
* @date 2021/3/23 下午3:22
*/
List<CategoryProjectResultDTO> selectOrgCategoryInfo(@Param("customerId") String customerId, @Param("dateId") String dateId,@Param("level")String level);
/**
* @Description 查询组织分类信息多客户
* @Param customerId
* @Param dateId
* @Param level
* @Param existsStatus 父客户是否存在
* @author zxc
* @date 2021/3/24 下午2:48
*/
List<CategoryProjectResultDTO> selectOrgCategoryMoreCustomerInfo(@Param("customerIds")List<String> customerIds, @Param("dateId") String dateId,
@Param("level")String level, @Param("customerId")String customerId, @Param("existsStatus")Boolean existsStatus);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
@ -92,4 +93,13 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @date 2020/10/21 2:33 下午
*/
Boolean initBizOrg(CustomerBizOrgFormDTO formDTO);
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:02
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId,String level);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
@ -166,4 +167,16 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public Boolean initBizOrg(CustomerBizOrgFormDTO formDTO) {
return null;
}
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:03
*/
@Override
public List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId, String level) {
return baseDao.selectBelongGridInfo(customerId, level);
}
}

182
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java

@ -26,14 +26,22 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ScreenConstant;
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.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.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +53,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 项目(事件)分类按组织_按天统计
@ -54,10 +63,17 @@ import java.util.Map;
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Slf4j
public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<ScreenProjectCategoryOrgDailyDao, ScreenProjectCategoryOrgDailyEntity> implements ScreenProjectCategoryOrgDailyService {
@Autowired
private CustomerRelationService relationService;
@Autowired
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenProjectCategoryGridDailyDao gridDailyDao;
@Autowired
private ScreenCustomerGridService gridService;
@Override
public PageData<ScreenProjectCategoryOrgDailyDTO> page(Map<String, Object> params) {
@ -147,15 +163,15 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
*/
@Override
public void extractProjectCategoryOrgData(String customerId, String dateId) {
List<ScreenProjectCategoryOrgDailyEntity> needInsert = new ArrayList<>();
// 先查询有无子客户
List<CustomerRelationEntity> relationInfo = relationService.selectSubCustomer(customerId);
if (CollectionUtils.isEmpty(relationInfo)){
needInsert = disposeOneCustomer(customerId, dateId);
// 单客户
disposeOneCustomer(customerId, dateId);
}else {
needInsert = disposeMoreCustomer(customerId,dateId,relationInfo);
// 多客户
disposeMoreCustomer(customerId,dateId,relationInfo);
}
deleteAndInsert(customerId,dateId,needInsert);
}
/**
@ -165,9 +181,75 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
* @author zxc
* @date 2021/3/23 上午10:40
*/
private List<ScreenProjectCategoryOrgDailyEntity> disposeOneCustomer(String customerId, String dateId){
private void disposeOneCustomer(String customerId, String dateId){
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
disposeOneCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
disposeOneCustomerSub(ScreenConstant.STREET,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
disposeOneCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
disposeOneCustomerSub(ScreenConstant.CITY,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
disposeOneCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId);
}
}
}
return new ArrayList<>();
/**
* @Description 单客户处理
* @Param level
* @Param isGrid
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/25 上午10:44
*/
public void disposeOneCustomerSub(String level, Boolean isGrid, String customerId, String dateId){
List<ScreenProjectCategoryOrgDailyEntity> result = new ArrayList<>();
if (isGrid){
// 是社区级别
List<CategoryProjectResultDTO> categoryInfos = gridDailyDao.selectCategoryInfo(customerId, dateId,null,null);
if (!CollectionUtils.isEmpty(categoryInfos)){
result = ConvertUtils.sourceToTarget(categoryInfos, ScreenProjectCategoryOrgDailyEntity.class);
}
}else {
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格
List<String> gridIds = belongGridInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<CategoryProjectResultDTO> categoryProjectGrid = gridDailyDao.selectCategoryInfo(customerId, dateId, level, gridIds);
if (!CollectionUtils.isEmpty(categoryProjectGrid)){
categoryProjectResultDTOS.forEach(agency -> {
categoryProjectGrid.forEach(grid -> {
if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){
agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal());
grid.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(categoryProjectResultDTOS1)) categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
}
deleteAndInsert(customerId,dateId,result);
}
/**
@ -178,9 +260,93 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
* @author zxc
* @date 2021/3/23 上午10:40
*/
private List<ScreenProjectCategoryOrgDailyEntity> disposeMoreCustomer(String customerId, String dateId,List<CustomerRelationEntity> relationInfo){
private void disposeMoreCustomer(String customerId, String dateId,List<CustomerRelationEntity> relationInfo){
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
disposeMoreCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
disposeMoreCustomerSub(ScreenConstant.STREET,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
disposeMoreCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
disposeMoreCustomerSub(ScreenConstant.CITY,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
disposeMoreCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId,relationInfo);
}
}
}
return new ArrayList<>();
private void disposeMoreCustomerSub(String level,Boolean isGrid,String customerId, String dateId, List<CustomerRelationEntity> relationInfo){
List<ScreenProjectCategoryOrgDailyEntity> result = new ArrayList<>();
if (isGrid){
List<CategoryProjectResultDTO> categoryInfos = gridDailyDao.selectCategoryInfo(customerId, dateId,null,null);
if (!CollectionUtils.isEmpty(categoryInfos)){
result = ConvertUtils.sourceToTarget(categoryInfos, ScreenProjectCategoryOrgDailyEntity.class);
}
}else {
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格
List<String> gridIds = belongGridInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<CategoryProjectResultDTO> categoryProjectGrid = gridDailyDao.selectCategoryInfo(customerId, dateId, level, gridIds);
if (!CollectionUtils.isEmpty(categoryProjectGrid)){
categoryProjectResultDTOS.forEach(agency -> {
categoryProjectGrid.forEach(grid -> {
if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){
agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal());
grid.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
if (ScreenConstant.DISTRICT.equals(level)){
// 子级客户ID
List<String> customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList());
// 父客户存在的分类
List<CategoryProjectResultDTO> categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true);
if (!CollectionUtils.isEmpty(categoryProjectExists)){
result.forEach(r -> {
categoryProjectExists.forEach(c -> {
if (r.getCategoryCode().equals(c.getCategoryCode())){
r.setProjectTotal(r.getProjectTotal() + c.getProjectTotal());
c.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectExists.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectFalse = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(categoryProjectFalse)){
List<ScreenProjectCategoryOrgDailyEntity> f = ConvertUtils.sourceToTarget(categoryProjectFalse, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(f);
}
}
// 父客户不存在的分类
List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false);
if (!CollectionUtils.isEmpty(categoryProjectNotExists)){
List<ScreenProjectCategoryOrgDailyEntity> notExists = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(notExists);
}
}
}
deleteAndInsert(customerId,dateId,result);
}
/**

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -359,4 +359,17 @@
AND cg.CUSTOMER_ID = #{customerId}
</select>
<!-- 查询直属网格信息 -->
<select id="selectBelongGridInfo" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
sca.AGENCY_ID AS PID,
sca.PIDS,
scg.*
FROM screen_customer_agency sca
LEFT JOIN screen_customer_grid scg ON scg.PARENT_AGENCY_ID = sca.AGENCY_ID
WHERE sca.`LEVEL` = #{level}
AND scg.DEL_FLAG = 0
AND scg.CUSTOMER_ID = #{customerId}
</select>
</mapper>

30
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml

@ -10,5 +10,35 @@
limit 1000
</delete>
<!-- 查询分类信息 -->
<select id="selectCategoryInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
sg.pid AS orgId,
sca.PID,
sca.pids,
sg.CUSTOMER_ID,
sg.CATEGORY_CODE,
SUM(sg.PROJECT_TOTAL) AS projectTotal,
sg.level,
sg.DATE_ID,
sca.`LEVEL` AS orgType
FROM screen_project_category_grid_daily sg
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sg.PID
WHERE 1=1
AND sg.DEL_FLAG = '0'
<if test="null == level ">
AND sca.`LEVEL` = 'community'
</if>
<if test="null != level and '' != level">
AND sca.`LEVEL` = #{level}
<foreach collection="gridIds" item="gridId" separator=" OR ">
AND sg.GRID_ID = #{gridId}
</foreach>
</if>
AND sg.CUSTOMER_ID = #{customerId}
AND sg.DATE_ID = #{dateId}
GROUP BY sg.CATEGORY_CODE,sca.AGENCY_ID
</select>
</mapper>

53
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -9,4 +9,57 @@
limit 1000
</delete>
<!-- 查询组织分类信息 -->
<select id="selectOrgCategoryInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
IF(sa.pid = '0', sa.ORG_ID,sa.pid) AS orgId,
IFNULL(sca.PID,'0') AS pid,
IFNULL(sca.PIDS,'0') AS pids,
sa.CUSTOMER_ID,
sa.CATEGORY_CODE,
SUM(sa.PROJECT_TOTAL) AS projectTotal,
sa.level,
sa.DATE_ID,
sca.`LEVEL` AS orgType
FROM screen_project_category_org_daily sa
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sa.PID
WHERE sca.`LEVEL` = #{level}
AND sa.DEL_FLAG = '0'
AND sa.CUSTOMER_ID = #{customerId}
AND sa.DATE_ID = #{dateId}
GROUP BY sa.CATEGORY_CODE,sca.AGENCY_ID
</select>
<!-- 查询组织分类信息【多客户】 -->
<select id="selectOrgCategoryMoreCustomerInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
IF(od.pid = '0', od.ORG_ID,od.pid) AS orgId,
IFNULL(sca.PID,'0') AS pid,
IFNULL(sca.PIDS,'0') AS pids,
#{customerId} as customerId,
od.level,
od.CATEGORY_CODE,
SUM(od.PROJECT_TOTAL) AS projectTotal,
#{level} as orgType,
od.DATE_ID
FROM screen_project_category_org_daily od
LEFT JOIN customer_project_category_dict cd ON cd.CATEGORY_CODE = od.CATEGORY_CODE
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = od.PID
WHERE 1=1
AND od.DEL_FLAG = '0'
AND (
<foreach collection="customerIds" item="id" separator=" OR ">od.CUSTOMER_ID = #{id}
</foreach>
)
<if test="existsStatus == true">
AND cd.EPMET_CATEGORY_CODE IS NOT NULL
</if>
<if test="existsStatus == false">
AND cd.EPMET_CATEGORY_CODE IS NULL
</if>
AND od.pid = '0'
AND od.date_id = #{dateId}
GROUP BY od.CATEGORY_CODE,od.pid
</select>
</mapper>

12
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据对接.txt

@ -0,0 +1,12 @@
截止到2021-03-25数据对接外部客户:
1、市北党建
2、安宁e家
3、大美孔村街道
4、e锦水街道(没有自己的大屏)
5、微笑榆山街道(没有自己的大屏)
产品自己的客户上线的大屏:
1、城阳
2、临沂龙湾社区
3、平阴县
孔村、锦水、榆山这三个街道的数据上报时间要早于平阴县计算的时间,目前已经按天上报和按月上报的,让孔村、榆山、锦水调整到2点前推送了。

2
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml

@ -117,7 +117,7 @@
IS_DEFAULT,
(IFNULL(ISSUE_USE_COUNT,0) + IFNULL(PROJECT_USE_COUNT,0)) AS issueUseCount,
IS_DISABLE
FROM ISSUE_PROJECT_CATEGORY_DICT
FROM ISSUE_PROJECT_TAG_DICT
WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND IS_DEFAULT = '0'
</select>

Loading…
Cancel
Save