Browse Source

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

master
wangchao 5 years ago
parent
commit
7266407d98
  1. 106
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java
  2. 97
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java
  3. 122
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java
  4. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java
  5. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  6. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java
  7. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java
  8. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  9. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  10. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  11. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java
  12. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java
  13. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java
  14. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java
  15. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  16. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  17. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  18. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  19. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  20. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  21. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  22. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  23. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  24. 73
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  25. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java
  26. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  27. 160
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  28. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
  29. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java
  30. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java
  31. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java
  32. 58
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  33. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java
  34. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java
  35. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java
  36. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  37. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  38. 98
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  39. 56
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  40. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  41. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  42. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  43. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  44. 35
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  45. 20
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  46. 118
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  47. 40
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml
  48. 58
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml
  49. 59
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml
  50. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
  51. 29
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  52. 114
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  53. 30
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml
  54. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

106
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.issue;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectCategoryDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id, 产品默认default
*/
private String customerId;
/**
* 上级分类ID 顶级此列存储0
*/
private String pid;
/**
* 所有上级分类ID用逗号分开
*/
private String pids;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 分类类别1,2,3,4....
*/
private String categoryType;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

97
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java

@ -0,0 +1,97 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-25
*/
@Data
public class ProjectCategoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 来源网格id
*/
private String gridId;
/**
* 项目id
*/
private String projectId;
/**
* 分类id
*/
private String categoryId;
/**
* 分类对应的所有上级,英文逗号隔开
*/
private String categoryPids;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

122
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 项目人员关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Data
public class ProjectStaffDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 项目ID
*/
private String projectId;
/**
* 项目处理进展ID
*/
private String processId;
/**
* 客户ID
*/
private String customerId;
/**
* 机关ID
*/
private String orgId;
/**
* 部门ID
*/
private String departmentId;
/**
* 网格ID
*/
private String gridId;
/**
* 所属机关11:22:33
*/
private String orgIdPath;
/**
* 人员ID
*/
private String staffId;
/**
* 部门名
*/
private String departmentName;
/**
* 是否处理未处理unhandled已处理handle
*/
private String isHandle;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

24
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.project.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 客户项目超期相关参数
* @ClassName ProjectExceedParamsResultDTO
* @Auth wangc
* @Date 2021-03-05 17:02
*/
@Data
public class ProjectExceedParamsResultDTO implements Serializable {
private static final long serialVersionUID = 7621539816482416776L;
private Integer defaultExceedLimit;
private Integer defaultAbout2ExceedLimit;
private Integer exceedLimit;
private Integer about2ExceedLimit;
}

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

@ -169,4 +169,6 @@ public class ScreenProjectDataDTO implements Serializable {
*/
private String allParentIds;
private String topicId;
}

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

@ -88,4 +88,6 @@ public class ScreenProjectImgDataDTO implements Serializable {
*/
private Date updatedTime;
private String topicId;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java

@ -19,7 +19,9 @@ package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.epmet.dto.project.ProjectStaffDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@ -141,6 +143,8 @@ public class ScreenProjectProcessDTO implements Serializable {
/**
* 数据截止日期
*/
private String DataEndTime;
private String dataEndTime;
private List<ProjectStaffDTO> points;
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -273,4 +274,19 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @date 2021/2/1 上午9:25
*/
List<ClosedIncrResultDTO> selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -83,4 +84,13 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description
* @param list
* @return java.util.List<com.epmet.dto.form.CostDayFormDTO>
* @author wangc
* @date 2021.03.05 15:12
*/
List<CostDayFormDTO> selectProjectNodeStartStopTime(@Param("list")List<String> list);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -18,7 +18,8 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -36,4 +37,11 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId);
int checkIfExisted(@Param("customerId") String customerId);
List<ScreenProjectDataDTO> selectPending(ScreenProjectDataDTO param);
void insertBatch(@Param("list") List<ScreenProjectDataDTO> list);
void updateBatch(@Param("list") List<ScreenProjectDataDTO> list,@Param("dateId") String dateId);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java

@ -18,8 +18,12 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-项目数据图片
@ -30,4 +34,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenProjectImgDataDao extends BaseDao<ScreenProjectImgDataEntity> {
void deleteByProjectIds(@Param("list") List<String> list);
void insertBatch(@Param("list") List<ScreenProjectImgDataDTO> list);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java

@ -18,8 +18,12 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-项目数据处理节点附件表
@ -30,4 +34,8 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenProjectProcessAttachmentDao extends BaseDao<ScreenProjectProcessAttachmentEntity> {
void deleteByProcessId(@Param("list") List<String> list);
void insertBatch(@Param("list")List<ScreenProjectProcessAttachmentDTO> list);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java

@ -18,10 +18,13 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-项目数据项目处理进展表
*
@ -32,4 +35,8 @@ import org.apache.ibatis.annotations.Param;
public interface ScreenProjectProcessDao extends BaseDao<ScreenProjectProcessEntity> {
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
int countByCustomerId(@Param("customerId") String customerId);
void insertBatch(@Param("list") List<ScreenProjectProcessDTO> list);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java

@ -5,15 +5,13 @@ import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.issue.*;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
@Mapper
public interface StatsIssueDao extends BaseDao<IssueEntity> {
@ -181,4 +179,6 @@ public interface StatsIssueDao extends BaseDao<IssueEntity> {
* @date 2020/9/27 1:22 下午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<IssueProjectCategoryDictDTO> selectCategory(@Param("customerId") String customerId, @Param("ids") Set<String> set);
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -20,7 +20,10 @@ package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectCategoryDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,5 +106,31 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/
String selectParameterValueByKey(@Param("customerId") String customerId);
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
List<ProjectExceedParamsResultDTO> selectProjectExceedParams(@Param("customerId") String customerId);
/**
* @Description 批量查询项目信息
* @param ids
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:32
*/
List<ProjectEntity> batchSelectProjectInfo(@Param("ids")List<String> ids);
/**
* @Description 查询项目的分类信息
* @param list
* @return java.util.List<com.epmet.dto.project.ProjectCategoryDTO>
* @author wangc
* @date 2021.03.08 23:44
*/
List<ProjectCategoryDTO> selectProjectCategory(@Param("list")List<String> list);
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -18,12 +18,14 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectProcessDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
@ -153,4 +155,28 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectLatestOperation(@Param("list") List<String> list,@Param("customerId") String customerId);
/**
* @Description 查找指定日期结案的项目
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.ProjectProcessDTO>
* @author wangc
* @date 2021.03.09 10:49
*/
List<ProjectProcessDTO> selectClosedProjectOnAppointedDay(@Param("customerId") String customerId, @Param("dateId") String dateId);
List<ProjectProcessDTO> selectClosedProjectByProjectIds(@Param("list")List<String> list);
/**
* @Description 统计新增项目节点以及被流转到的指向部门
* @param customerId
* @param dateId
* @param dataEndTime
* @return java.util.List<com.epmet.dto.screen.ScreenProjectProcessDTO>
* @author wangc
* @date 2021.03.09 16:25
*/
List<ScreenProjectProcessDTO> selectProjectProcessAndDirection(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("dataEndTime")String dataEndTime );
List<ScreenProjectProcessAttachmentDTO> selectProcessAttachment(@Param("list")List<String> list);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -8,6 +8,8 @@ package com.epmet.dao.topic;
*/
import com.epmet.dto.group.result.TopicContentResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
@ -117,4 +119,23 @@ public interface TopicDao {
* @date 2020.09.28 16:28
*/
List<TopicContentResultDTO> selectTopicContent(@Param("list") List<ProjectSourceMapFormDTO> list);
/**
* @Description 根据话题Id查询大屏项目的相关信息
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:13
*/
List<ScreenProjectDataDTO> selectScreenProjectData(@Param("list") List<ScreenProjectDataDTO> list);
/**
* @Description 初始化指定项目的图片
* @param customerId
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectImgDataDTO>
* @author wangc
* @date 2021.03.09 14:19
*/
List<ScreenProjectImgDataDTO> initNewScreenProjectImgData(@Param("customerId")String customerId,@Param("list") List<ScreenProjectDataDTO> list);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -2,6 +2,7 @@ package com.epmet.dao.user;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import org.apache.ibatis.annotations.Mapper;
@ -131,4 +132,14 @@ public interface UserDao {
* @date 2020.09.25 13:54
**/
List<ScreenPartyUserRankDataEntity> selectRegisteredUserByCustomerId(@Param("customerId") String customerId);
/**
* @Description 获取大屏项目相关信息 联系人
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:16
*/
List<ScreenProjectDataDTO> selectScreenProjectData(@Param("list") List<ScreenProjectDataDTO> list);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -11,6 +11,8 @@ import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.entity.issue.IssueEntity;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author zhaoqifeng
@ -172,4 +174,13 @@ public interface IssueService {
* @date 2020/9/27 11:20 上午
*/
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String monthId);
/**
* @Description 查找项目的分类名称 -相连
* @param param
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2021.03.09 00:23
*/
Map<String,String> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -1,22 +1,24 @@
package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.issue.*;
import com.epmet.entity.issue.IssueEntity;
import com.epmet.service.Issue.IssueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* @author zhaoqifeng
@ -143,4 +145,19 @@ public class IssueServiceImpl implements IssueService {
public List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String dateId) {
return statsIssueDao.selectIssueVoteStatis(customerId, dateId);
}
@Override
public Map<String, String> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId) {
Map<String, String> map = new HashMap<>();
param.forEach((projectId,categoryIds) -> {
List<IssueProjectCategoryDictDTO> categories = statsIssueDao.selectCategory(customerId, categoryIds);
if(!CollectionUtils.isEmpty(categories)){
StringBuilder str = new StringBuilder();
categories.forEach(category -> {str.append(category.getCategoryName()).append("-");});
map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.TWO));
}
});
return map;
}
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import java.math.BigDecimal;

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -319,4 +320,24 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @date 2021/2/1 上午9:24
*/
List<ClosedIncrResultDTO> selectClosedIncr(String customerId, String monthId);
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param rows
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit);
void computerIfExceed(List<ScreenProjectDataDTO> list,Integer exceedLimit,Integer about2exceedLimit);
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java

@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
import com.epmet.dto.extract.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import org.apache.commons.lang3.StringUtils;

73
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -25,27 +25,33 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.TransferRightRatioResultDTO;
import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* 项目主表_日统计
@ -57,6 +63,10 @@ import java.util.Map;
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactOriginProjectMainDailyDao, FactOriginProjectMainDailyEntity> implements FactOriginProjectMainDailyService {
@Autowired
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao periodDao;
@Override
public PageData<FactOriginProjectMainDailyDTO> page(Map<String, Object> params) {
IPage<FactOriginProjectMainDailyEntity> page = baseDao.selectPage(
@ -358,4 +368,59 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
return new ArrayList<>();
}
/**
* @Description 初始化screen_project_data数据
* 如果是dateId不为空则查询前一天的数据
* 否则全查适用于首次初始化的场景
*
* 这是只查询指定天新增的项目对于需要更新状态的项目对历史数据流转中的项目进行遍历查询
* @param customerId
* @param rows
* @param dateId
* @param exceedLimit 超期上线
* @param about2exceedLimit 即将超期参数
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.04 22:56
*/
@Override
public List<ScreenProjectDataDTO> initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) {
boolean ifYesterday = true;
if(!StringUtils.equals(DateUtils.getBeforeNDay(NumConstant.ONE),dateId)){
ifYesterday = false;
}
List<ScreenProjectDataDTO> projects = baseDao.initNewScreenProjectData(customerId, rows == NumConstant.ZERO && ifYesterday ? "" : dateId, dateId);
//如果不是昨天立项
if(!CollectionUtils.isEmpty(projects) && !ifYesterday)
computerIfExceed(projects,exceedLimit,about2exceedLimit);
return projects;
}
@Override
public void computerIfExceed(List<ScreenProjectDataDTO> list,Integer exceedLimit,Integer about2exceedLimit){
if(CollectionUtils.isEmpty(list)) return;
Result<List<CostDayResultDTO>> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())));
if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){
//key : projectId
Map<String,List<CostDayResultDTO>> projectPeriodMap
= costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId));
list.stream().map(o -> {
List<CostDayResultDTO> days = projectPeriodMap.get(o.getProjectId());
if(!CollectionUtils.isEmpty(days)){
Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays();
//事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期
if(max > exceedLimit)
o.setProjectLevel(NumConstant.ONE);
else if(max >= about2exceedLimit)
o.setProjectLevel(NumConstant.TWO);
}
return null;
});
}
}
}

27
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java

@ -0,0 +1,27 @@
package com.epmet.service.evaluationindex.extract.toscreen;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
/**
* @Description
* screen_project_data
* screen_project_process_attachment
* screen_project_img_data
* screen_project_process这四个表定时整理数据
* @author wangc
* @date 2021.03.04 13:38
*/
public interface ScreenProjectSettleService {
/**
* @Description 抽取项目数据到screen_project_*
* @param param
* @return void
* @author wangc
* @date 2021.03.04 23:09
*/
void extractScreenData(ScreenCentralZoneDataFormDTO param);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -66,6 +66,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private ScreenProjectGridDailyService screenProjectGridDailyService;
@Autowired
private ScreenProjectOrgDailyService screenProjectOrgDailyService;
@Autowired
private ScreenProjectSettleServiceImpl screenProjectSettleService;
/**
* @param extractOriginFormDTO
@ -195,6 +197,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
}catch (Exception e){
log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e);
}
try{
//大屏项目数据抽取_按天抽取
screenProjectSettleService.extractScreenData(param);
}catch (Exception e){
log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e);
}
log.info("===== extractDaily method end ======");
}

160
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java

@ -0,0 +1,160 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.Issue.IssueService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService;
import com.epmet.service.evaluationindex.screen.ScreenProjectDataService;
import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description
* @ClassName ScreenProjectSettleServiceImpl
* @Auth wangc
* @Date 2021-03-04 23:10
*/
public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService {
@Autowired
private ScreenProjectDataService targetDbService;
@Autowired
private FactOriginProjectMainDailyService originMainService;
@Autowired
private ProjectService projectService;
@Autowired
private ProjectProcessService processService;
@Autowired
private TopicService topicService;
@Autowired
private UserService userService;
@Autowired
private IssueService issueService;
@Autowired
private ScreenProjectProcessService targetProcessService;
@Autowired
private ScreenProjectImgDataService targetImgService;
@Autowired
private ScreenProjectProcessAttachmentService targetAttachmentService;
/**
* @Description 抽取项目数据到screen_project_*
* @param param
* @return void
* @author wangc
* @date 2021.03.04 23:09
*/
@Override
@Transactional
public void extractScreenData(ScreenCentralZoneDataFormDTO param) {
int rows = targetDbService.checkIfExisted(param.getCustomerId());
List<ProjectExceedParamsResultDTO> exceedParams = projectService.getProjectExceedParams(param.getCustomerId());
Integer exceedLimit = NumConstant.FIVE;
Integer about2ExceedLimit = NumConstant.FIVE;
if(!CollectionUtils.isEmpty(exceedParams)){
for(ProjectExceedParamsResultDTO ex :exceedParams){
if(null != ex.getDefaultExceedLimit()){
exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit();
}
if(null != ex.getDefaultAbout2ExceedLimit()){
about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit();
}
}
}
//因为即将超期提醒时间(天)就是即将超期期限,在表中存储的是超期前多少天
//所以这里要换算成滞留日
about2ExceedLimit = exceedLimit >= about2ExceedLimit ? exceedLimit - about2ExceedLimit : exceedLimit;
List<ScreenProjectDataDTO> metaData =
originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit);
if(!CollectionUtils.isEmpty(metaData)) {
List<ProjectEntity> info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(info)){
metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(),
nature.getId())).map(projectInfo -> {
meta.setProjectCreateTime(projectInfo.getCreatedTime());
meta.setProjectTitle(projectInfo.getTitle());
return null;
}));
}
topicService.fillScreenProjectData(metaData);
//metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData);
userService.fillScreenProjectData(metaData);
//metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData);
}
ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO();
orientCase.setCustomerId(param.getCustomerId());
//待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel
List<ScreenProjectDataDTO> orientData =
targetDbService.getPending(orientCase);
// 给metaData和orientData赋上分类信息
List<String> projectIds =
Optional.ofNullable(metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())).orElse(new ArrayList<>());
projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()));
Map<String, Set<String>> categoryMap = projectService.getProjectCategory(projectIds);
if(!CollectionUtils.isEmpty(categoryMap)){
Map<String, String> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId());
if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){
metaData.forEach(meta -> {
meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId()));
});
orientData.forEach(orient -> {
orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId()));
});
}
}
//重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily
originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit);
processService.updateProjectCloseTime(metaData);
//更新结案时间和结案状态
processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId());
//FIXME release here
targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData);
if(!CollectionUtils.isEmpty(metaData)){
List<ScreenProjectImgDataDTO> imgs = topicService.buildNewScreenProjectImgData(metaData);
if(CollectionUtils.isEmpty(imgs)){
//FIXME release here
targetImgService.insertBatch(imgs);
}
}
//
List<ScreenProjectProcessDTO> processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId()));
if(!CollectionUtils.isEmpty(processes)){
//FIXME release here
targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId());
List<ScreenProjectProcessAttachmentDTO> attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList()));
if(!CollectionUtils.isEmpty(attachments)){
//FIXME release here
targetAttachmentService.insertBatch(attachments);
}
}
}
}

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java

@ -96,4 +96,32 @@ public interface ScreenProjectDataService extends BaseService<ScreenProjectDataE
void delete(String[] ids);
void collect(String customerId, ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param);
/**
* @Description 查询是否存在客户的数据
* @param customerId
* @return int
* @author wangc
* @date 2021.03.04 23:35
*/
int checkIfExisted(String customerId);
/**
* @Description 获取客户下已经入库而且未结案的数据集
* @param
* @return
* @author wangc
* @date 2021.03.08 09:32
*/
List<ScreenProjectDataDTO> getPending(ScreenProjectDataDTO param);
/**
* @Description collect或更新
* @param
* @return void
* @author wangc
* @date 2021.03.09 17:36
*/
void insertOrUpdateBatch(String customerId,String dateId,List<ScreenProjectDataDTO> meta,List<ScreenProjectDataDTO> orient);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java

@ -93,4 +93,6 @@ public interface ScreenProjectImgDataService extends BaseService<ScreenProjectIm
*/
void delete(String[] ids);
void insertBatch(List<ScreenProjectImgDataDTO> list);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java

@ -92,4 +92,6 @@ public interface ScreenProjectProcessAttachmentService extends BaseService<Scree
* @date 2021-02-23
*/
void delete(String[] ids);
void insertBatch(List<ScreenProjectProcessAttachmentDTO> list);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java

@ -96,4 +96,8 @@ public interface ScreenProjectProcessService extends BaseService<ScreenProjectPr
void delete(String[] ids);
void collect(String customerId, ScreenCollFormDTO<ScreenProjectProcessFormDTO> param);
boolean checkIfHistoricalDataExists(String customerId);
void insertBatch(List<ScreenProjectProcessDTO> list,String customerId,String dateId);
}

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

@ -32,12 +32,12 @@ import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.*;
import com.epmet.service.evaluationindex.screen.*;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.text.ParseException;
@ -222,4 +222,58 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
});
}
/**
* @Description 查询是否存在客户的数据
* @param customerId
* @return int
* @author wangc
* @date 2021.03.04 23:35
*/
@Override
public int checkIfExisted(String customerId) {
return baseDao.checkIfExisted(customerId);
}
/**
* @Description 获取客户下已经入库而且未结案的数据集
* @param
* @return j
* @author wangc
* @date 2021.03.08 09:32
*/
@Override
public List<ScreenProjectDataDTO> getPending(ScreenProjectDataDTO param) {
return baseDao.selectPending(param);
}
/**
* @Description collect或更新
* @param
* @return void
* @author wangc
* @date 2021.03.09 17:36
*/
@Override
public void insertOrUpdateBatch(String customerId, String dateId, List<ScreenProjectDataDTO> meta, List<ScreenProjectDataDTO> orient) {
//内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据
//就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为
//库中无数据,范围性删除无意义,只是针对在数据库有历史数据的情况下,保证对同一天进行反
//复采集时数不会重复
if(!CollectionUtils.isEmpty(meta)){
int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,dateId);
while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId);
}
List<List<ScreenProjectDataDTO>> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED);
partition.forEach(part -> baseDao.insertBatch(part));
}
if(!CollectionUtils.isEmpty(orient)){
List<List<ScreenProjectDataDTO>> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED);
partition.forEach(part -> baseDao.updateBatch(part,dateId));
}
}
}

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

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -27,6 +28,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 中央区-项目数据图片
@ -96,4 +99,11 @@ public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl<ScreenProje
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void insertBatch(List<ScreenProjectImgDataDTO> list) {
baseDao.deleteByProjectIds(list.stream().map(ScreenProjectImgDataDTO::getProjectId).distinct().collect(Collectors.toList()));
List<List<ScreenProjectImgDataDTO>> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED);
partition.forEach(part -> baseDao.insertBatch(list));
}
}

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

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -27,6 +28,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenProjectProcessAttachmentDao;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -34,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 中央区-项目数据处理节点附件表
@ -95,4 +98,11 @@ public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl<S
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public void insertBatch(List<ScreenProjectProcessAttachmentDTO> list) {
baseDao.deleteByProcessId(list.stream().map(ScreenProjectProcessAttachmentDTO::getProcessId).distinct().collect(Collectors.toList()));
List<List<ScreenProjectProcessAttachmentDTO>> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED);
partition.forEach(part -> baseDao.insertBatch(part));
}
}

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

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -34,6 +35,7 @@ import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -153,4 +155,22 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje
}
@Override
public boolean checkIfHistoricalDataExists(String customerId) {
return baseDao.countByCustomerId(customerId) > NumConstant.ZERO;
}
@Override
public void insertBatch(List<ScreenProjectProcessDTO> list,String customerId,String dateId) {
int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId);
while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, dateId);
}
List<List<ScreenProjectProcessDTO>> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED);
partition.forEach(part -> {
baseDao.insertBatch(part);
});
}
}

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -22,6 +22,9 @@ import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
@ -124,4 +127,43 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
* @date 2020.09.28 14:44
*/
Map<String,ProjectLatestOperationResultDTO> getLatestOperation(List<String> list, String customerId);
/**
* @Description 查询指定日期关闭的项目 然后将状态由pending改为closed_case并加上结案时间
* @param list
* @param dateId
* @return void
* @author wangc
* @date 2021.03.09 09:54
*/
void updateProjectStatus(List<ScreenProjectDataDTO> list, String dateId,String customerId);
/**
* @Description 查询指定日期关闭的项目 然后将状态由pending改为closed_case并加上结案时间
* @param list
* @return void
* @author wangc
* @date 2021.03.09 09:54
*/
void updateProjectCloseTime(List<ScreenProjectDataDTO> list);
/**
* @Description 构建大屏项目进展数据
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.screen.ScreenProjectProcessDTO>
* @author wangc
* @date 2021.03.09 14:49
*/
List<ScreenProjectProcessDTO> buildNewScreenProjectProcessData(String customerId,String dateId,boolean ifRanged);
/**
* @Description 构建节点附件数据
* @param processIds
* @return java.util.List<com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO>
* @author wangc
* @date 2021.03.09 16:56
*/
List<ScreenProjectProcessAttachmentDTO> buildProcessAttachmentData(List<String> processIds);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -22,9 +22,14 @@ import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 项目表
@ -109,4 +114,33 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @date 2020.11.06 14:14
*/
Integer getOvertimeProjectByParameter(String customerId);
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
List<ProjectExceedParamsResultDTO> getProjectExceedParams(@Param("customerId") String customerId);
/**
* @Description 获取项目相关信息
* @param projectIds
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:28
*/
List<ProjectEntity> getProjectInfo(List<String> projectIds);
/**
* @Description 获取项目的所有标签名称 -连接
* @param projectIds
* @return java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
* @author wangc
* @date 2021.03.08 23:46
*/
Map<String,Set<String>> getProjectCategory(List<String> projectIds);
}

98
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -21,15 +21,21 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.dto.ProjectProcessDTO;
import com.epmet.dto.form.CommonStaffIdFormDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.ProjectStaffDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.dto.screen.ScreenProjectProcessDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.entity.project.ProjectProcessEntity;
import com.epmet.service.project.ProjectProcessService;
@ -38,6 +44,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@ -125,4 +132,95 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,o->o,(a,n)-> a));
}
}
/**
* @Description 查询指定日期关闭的项目 然后将状态由pending改为closed_case并加上结案时间
* @param list
* @param dateId
* @return void
* @author wangc
* @date 2021.03.09 09:54
*/
@Override
public void updateProjectStatus(List<ScreenProjectDataDTO> list,String dateId,String customerId) {
if(CollectionUtils.isEmpty(list)) return;
List<ProjectProcessDTO> closedInfo = baseDao.selectClosedProjectOnAppointedDay(customerId, dateId);
if(CollectionUtils.isEmpty(closedInfo)) return;
list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map(
merge -> {
target.setProjectStatusCode("closed_case");
target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN));
return null;
}
));
}
/**
* @Description 查询指定日期关闭的项目 然后将状态由pending改为closed_case并加上结案时间
* @param list
* @return void
* @author wangc
* @date 2021.03.09 09:54
*/
@Override
public void updateProjectCloseTime(List<ScreenProjectDataDTO> list) {
if(CollectionUtils.isEmpty(list)) return;
List<ProjectProcessDTO> closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()));
if(CollectionUtils.isEmpty(closedInfo)) return;
list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map(
merge -> {
//target.setProjectStatusCode("closed_case");
target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN));
return null;
}
));
}
/**
* @Description 构建大屏项目进展数据
*
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.screen.ScreenProjectProcessDTO>
* @author wangc
* @date 2021.03.09 14:49
*/
@Override
public List<ScreenProjectProcessDTO> buildNewScreenProjectProcessData(String customerId, String dateId, boolean ifRanged) {
List<ScreenProjectProcessDTO> processes = baseDao.selectProjectProcessAndDirection(customerId, ifRanged ? null : dateId, dateId);
if(CollectionUtils.isEmpty(processes)) return null;
processes.stream().filter(process -> StringUtils.equalsAny(process.getOperation(),
"close","return","transfer")).map(target -> {
List<ProjectStaffDTO> points = target.getPoints();
if(!CollectionUtils.isEmpty(points)){
List<String> orgIds = points.stream().map(ProjectStaffDTO::getOrgId).distinct().collect(Collectors.toList());
List<String> names = points.stream().map(ProjectStaffDTO::getDepartmentName).distinct().collect(Collectors.toList());
StringBuilder builder1 = new StringBuilder();
orgIds.forEach(orgId -> builder1.append(orgId).append(","));
StringBuilder builder2 = new StringBuilder();
names.forEach(name -> builder2.append(name).append(","));
target.setTransferDeptIds(builder1.substring(NumConstant.ZERO,builder1.length() - NumConstant.TWO));
target.setTransferDeptName(builder2.substring(NumConstant.ZERO,builder2.length() - NumConstant.TWO));
}
return null;
});
return processes;
}
/**
* @Description 构建节点附件数据
* @param processIds
* @return java.util.List<com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO>
* @author wangc
* @date 2021.03.09 16:56
*/
@Override
public List<ScreenProjectProcessAttachmentDTO> buildProcessAttachmentData(List<String> processIds) {
return baseDao.selectProcessAttachment(processIds);
}
}

56
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -24,13 +24,21 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectCategoryDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 项目表
@ -97,4 +105,52 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter);
}
/**
* @Description 查找客户项目超期参数
*
* @param customerId
* @return java.util.List<com.epmet.dto.project.result.ProjectExceedParamsResultDTO>
* @author wangc
* @date 2021.03.05 17:52
*/
@Override
public List<ProjectExceedParamsResultDTO> getProjectExceedParams(String customerId) {
return baseDao.selectProjectExceedParams(customerId);
}
/**
* @Description 获取项目相关信息
* @param projectIds
* @return java.util.List<com.epmet.entity.project.ProjectEntity>
* @author wangc
* @date 2021.03.08 10:28
*/
@Override
public List<ProjectEntity> getProjectInfo(List<String> projectIds) {
return baseDao.batchSelectProjectInfo(projectIds);
}
/**
* @Description 获取项目的所有标签名称 -连接
* @param projectIds
* @return java.util.Map<java.lang.String,java.util.Set<java.lang.String>>
* @author wangc
* @date 2021.03.08 10:28
*/
@Override
public Map<String, Set<String>> getProjectCategory(List<String> projectIds) {
if(CollectionUtils.isEmpty(projectIds)) return null;
List<ProjectCategoryDTO> categories = baseDao.selectProjectCategory(projectIds);
if(CollectionUtils.isEmpty(categories)) return null;
Map<String, Set<String>> map = new HashMap<>();
Map<String, List<ProjectCategoryDTO>> projectMap = categories.stream().collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId));
projectMap.forEach((k,v) -> {
Set<String> categoryIds = v.stream().map(ProjectCategoryDTO::getCategoryId).collect(Collectors.toSet());
map.put(k,categoryIds);
});
return map;
}
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java

@ -2,12 +2,15 @@ package com.epmet.service.topic;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity;
import com.epmet.util.DimIdGenerator;
import java.util.Date;
@ -83,4 +86,23 @@ public interface TopicService {
* @date 2020.09.28 16:28
*/
Map<String,String> getTopicContent(List<ProjectSourceMapFormDTO> list);
/**
* @Description 获取大屏项目相关信息
*
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:16
*/
List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list);
/**
* @Description 构建新增的大屏项目图片数据
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectImgDataDTO>
* @author wangc
* @date 2021.03.09 13:59
*/
List<ScreenProjectImgDataDTO> buildNewScreenProjectImgData(List<ScreenProjectDataDTO> list);
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -7,6 +7,8 @@ import com.epmet.dao.topic.TopicDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.group.result.TopicContentResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*;
@ -183,6 +185,51 @@ public class TopicServiceImpl implements TopicService {
return result;
}
/**
* @Description 获取大屏项目相关信息
*
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:16
*/
@Override
public List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list) {
List<ScreenProjectDataDTO> collection = topicDao.selectScreenProjectData(list);
if(!CollectionUtils.isEmpty(collection)){
list.stream().flatMap(target -> collection.stream().filter(
res -> StringUtils.equals(target.getTopicId(),res.getTopicId())
).map(merge -> {
target.setLatitude(merge.getLatitude());
target.setLongitude(merge.getLongitude());
target.setProjectContent(merge.getProjectContent());
target.setProjectAddress(merge.getProjectAddress());
return null;
}));
}
return collection;
}
/**
* @Description 构建新增的大屏项目图片数据
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectImgDataDTO>
* @author wangc
* @date 2021.03.09 13:59
*/
@Override
public List<ScreenProjectImgDataDTO> buildNewScreenProjectImgData(List<ScreenProjectDataDTO> list) {
List<ScreenProjectImgDataDTO> imgs = topicDao.initNewScreenProjectImgData(list.get(NumConstant.ZERO).getCustomerId(), list);
if(CollectionUtils.isEmpty(imgs)) return null;
imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map(
match -> {
img.setProjectId(match.getProjectId());
return null;
}
));
return imgs;
}
/**
* @Description 初始化机关-所有下级网格Map
* @param pid - 固定一个机关Id

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -2,6 +2,7 @@ package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
import com.epmet.util.DimIdGenerator;
@ -75,4 +76,13 @@ public interface UserService {
* @date 2020.09.25 13:54
**/
List<ScreenPartyUserRankDataEntity> getRegisteredUserList(String customerId);
/**
* @Description 获取大屏项目相关信息 联系人
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:16
*/
List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list);
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
@ -728,4 +729,24 @@ public class UserServiceImpl implements UserService {
return userList;
}
/**
* @Description 获取大屏项目相关信息 联系人
* @param list
* @return java.util.List<com.epmet.dto.screen.ScreenProjectDataDTO>
* @author wangc
* @date 2021.03.08 17:16
*/
@Override
public List<ScreenProjectDataDTO> fillScreenProjectData(List<ScreenProjectDataDTO> list) {
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(list);
if(!CollectionUtils.isEmpty(collection)){
list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId()))
.map(merge -> {
target.setLinkName(merge.getLinkName());
target.setLinkMobile(merge.getLinkMobile());
return null;}));
}
return collection;
}
}

35
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -534,4 +534,39 @@
AND PROJECT_STATUS = 'closed'
GROUP BY GRID_ID
</select>
<!-- 查询指定日期立项的项目 -->
<select id="initNewScreenProjectData" resultType="com.epmet.dto.screen.ScreenProjectDataDTO">
SELECT
data.CUSTOMER_ID,
'grid' as orgType,
data.GRID_ID as orgId,
data.AGENCY_ID as parentId,
agency.AGENCY_NAME as orgName,
data.ID as projectId,
data.TOPIC_CREATOR_ID as linkName,
IF(data.PROJECT_STATUS = 'closed','closed_case',data.PROJECT_STATUS) as projectStatusCode,
3 as projectLevel,
IF(data.PIDS IS NULL || TRIM(data.PIDS) = '',data.AGENCY_ID,CONCAT(REPLACE(data.PIDS,':',','),',',data.AGENCY_ID)) as allParentIds,
data.TOPIC_ID,
#{dataEndTime} as dataEndTime
FROM `fact_origin_project_main_daily` data
LEFT JOIN DIM_AGENCY agency on data.agency_id = agency.id
WHERE
data.DEL_FLAG = '0'
AND
data.CUSTOMER_ID = #{customerId}
<choose>
<when test='null != dateId and "" != dateId'>
AND data.DATE_ID = #{dateId}
</when>
<otherwise>
AND CAST(data.DATE_ID AS SIGNED) <![CDATA[ <= ]]> CAST(#{dataEndTime} AS SIGNED)
</otherwise>
</choose>
</select>
</mapper>

20
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -140,4 +140,24 @@
GROUP BY
fp.ORG_ID
</select>
<select id="selectProjectNodeStartStopTime" resultType="com.epmet.dto.form.CostDayFormDTO">
SELECT
period.PROJECT_ID AS id,
period.INFORMED_DATE AS startDate,
IFNULL( period.HANDLED_DATE, IFNULL(STR_TO_DATE(node.DATE_ID,'%Y%m%d'),NOW( )) ) AS endDate
FROM
`fact_origin_project_org_period_daily` period
LEFT JOIN
`fact_origin_project_log_daily` node
ON period.PROJECT_ID = node.PROJECT_ID AND node.DEL_FLAG = '0'
AND node.ACTION_CODE = 'close' AND node.IS_ACTIVE = 1
WHERE
period.DEL_FLAG = '0'
<foreach collection="list" item="projectId" open="AND (" separator=" or " close=" )">
period.PROJECT_ID = #{projectId}
</foreach>
</select>
</mapper>

118
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -40,4 +40,122 @@
limit 1000
</delete>
<select id="checkIfExisted" resultType="int">
select count(id) from screen_project_data
where del_flag = '0' and customer_id = #{customerId}
</select>
<select id="selectPending" parameterType="com.epmet.dto.screen.ScreenProjectDataDTO"
resultType="com.epmet.dto.screen.ScreenProjectDataDTO" >
select *
from screen_project_data
where del_flag = '0'
and customerId = #{customerId}
and project_status_code = 'pending'
<if test='null != projectLevel and "" != projectLevel'>
and project_level = #{projectLevel}
</if>
</select>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO screen_project_data
(
id,
customer_id,
org_type,
org_id,
parent_id,
org_name,
project_id,
project_title,
project_create_time,
link_name,
link_mobile,
project_content,
project_level,
project_address,
all_category_name,
longitude,
latitude,
close_case_time,
data_end_time,
all_parent_ids,
project_status_code,
revision,
created_by,
created_time,
updated_by,
updated_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.orgType},
#{item.orgId},
#{item.parentId},
#{item.orgName},
#{item.projectId},
#{item.projectTitle},
#{item.projectCreateTime},
#{item.linkName},
#{item.linkMobile},
#{item.projectContent},
#{item.projectLevel},
#{item.projectAddress},
#{item.allCategoryName},
#{item.longitude},
#{item.latitude},
#{item.closeCaseTime},
#{item.dataEndTime},
#{item.allParentIds},
#{item.projectStatusCode},
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
<update id="updateBatch" parameterType="java.util.List">
update screen_project_data
<trim prefix="set" suffixOverrides=",">
<trim prefix="PROJECT_STATUS_CODE= case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.projectStatusCode!=null">
when PROJECT_ID=#{i.projectId} then #{i.projectStatusCode}
</if>
</foreach>
</trim>
<trim prefix=" CLOSE_CASE_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.closeCaseTime!=null">
when PROJECT_ID=#{i.projectId} then #{i.closeCaseTime}
</if>
</foreach>
</trim>
<trim prefix="ALL_CATEGORY_NAME =case" suffix="end," >
<foreach collection="list" item="i" index="index">
when PROJECT_ID=#{i.projectId} then #{i.allCategoryName}
</foreach>
</trim>
<trim prefix="PROJECT_LEVEL =case" suffix="end," >
<foreach collection="list" item="i" index="index">
<if test="i.projectLevel!=null">
when PROJECT_ID=#{i.projectId} then #{i.projectLevel}
</if>
</foreach>
</trim>
</trim>
DATA_END_TIME = #{dataEndTime},
updated_time = now()
where
<foreach collection="list" separator="or" item="i" index="index" >
PROJECT_ID=#{i.projectId}
</foreach>
</update>
</mapper>

40
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml

@ -18,4 +18,44 @@
</resultMap>
<delete id="deleteByProjectIds">
delete from screen_project_img_data
<where>
<foreach collection="list" item="projectId" separator=" or ">
PROJECT_ID = #{projectId}
</foreach>
</where>
</delete>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO screen_project_img_data
(
id,
customer_id,
project_id,
project_img_url,
sort,
revision,
created_by,
created_time,
updated_by,
updated_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.projectId},
#{item.projectImgUrl},
#{item.sort},
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
</mapper>

58
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml

@ -26,5 +26,63 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByProcessId" parameterType="java.util.List">
delete from screen_project_process_attachment
<where>
<foreach collection="list" item="processId" separator=" or ">
PROCESS_ID = #{processId}
</foreach>
</where>
</delete>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO screen_project_process_attachment
(
id,
attachment_id,
customer_id,
project_id,
process_id,
file_place,
file_name,
attachment_name,
attachment_size,
attachment_format,
attachment_type,
attachment_url,
sort,
duration,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.attachmentId},
#{item.customerId},
#{item.projectId},
#{item.processId},
#{item.filePlace},
#{item.fileName},
#{item.attachmentName},
#{item.attachmentSize},
#{item.attachmentFormat},
#{item.attachmentType},
#{item.attachmentUrl},
#{item.sort},
#{item.duration},
'0',
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
</mapper>

59
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml

@ -6,8 +6,65 @@
<delete id="deleteByDateIdAndCustomerId">
delete from screen_project_process
where customer_id = #{customerId}
and DATA_END_TIME = #{dateId}
and DATA_END_TIME = #{ }
limit 1000
</delete>
<select id="countByCustomerId" resultType="int">
select count(id) from `screen_project_process`
where del_flag = '0' and customer_id = #{customerId}
</select>
<insert id="insertBatch" parameterType="java.util.List">
INSERT INTO screen_project_process
(
id,
customer_id,
process_id,
project_id,
transfer_dept_ids,
transfer_dept_name,
handler_name,
handler_id,
handler_type,
org_id_path,
operation,
public_reply,
internal_remark,
process_time,
data_end_time,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.processId},
#{item.projectId},
#{item.transferDeptName},
#{item.transferDeptIds},
#{item.handlerName},
#{item.handlerId},
#{item.handlerType},
#{item.orgIdPath},
#{item.operation},
#{item.publicReply},
#{item.internalRemark},
#{item.processTime},
#{item.dataEndTime},
'0',
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
</mapper>

34
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -287,4 +287,38 @@
AND DATE_FORMAT(ivd.CREATED_TIME,'%Y%m%d') = #{dateId}
</select>
<select id="selectCategory" resultType="com.epmet.dto.issue.IssueProjectCategoryDictDTO">
SELECT
*
FROM (
SELECT
*
FROM issue_project_category_dict
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<foreach collection="ids" item="id" open="AND (" separator=" OR " close=")">
id = #{id}
</foreach>
UNION
SELECT
*
FROM issue_project_category_dict outter
WHERE outter.DEL_FLAG = '0'
AND outter.CUSTOMER_ID = 'default'
<foreach collection="ids" item="id" open="AND (" separator=" OR " close=")">
outter.id = #{id}
</foreach>
AND NOT EXIST (
SELECT * FROM issue_project_category_dict WHERE del_flag = '0' AND
customer_id = #{customerId} and id = outter.id
)
) temp
order by temp.category_type,temp.sort
</select>
</mapper>

29
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -106,4 +106,33 @@
and PARAMETER_KEY ='detention_days'
</select>
<select id="selectProjectExceedParams" resultType="com.epmet.dto.project.result.ProjectExceedParamsResultDTO">
select
IF(customer_id = 'default' <![CDATA[&&]]> PARAMETER_KEY = 'detention_days',PARAMETER_VALUE,null) as defaultExceedLimit,
IF(customer_id = 'default' <![CDATA[&&]]> PARAMETER_KEY = 'remind_time',PARAMETER_VALUE,null) as defaultAbout2ExceedLimit,
IF(customer_id = #{customerId} <![CDATA[&&]]> PARAMETER_KEY = 'detention_days',PARAMETER_VALUE,null) as exceedLimit,
IF(customer_id = #{customerId} <![CDATA[&&]]> PARAMETER_KEY = 'remind_time',PARAMETER_VALUE,null) as about2ExceedLimit
from `customer_project_parameter` where del_flag = '0' and (customer_id = 'default' or customer_id = #{customerId}
)and (PARAMETER_KEY = 'detention_days' OR PARAMETER_KEY = 'remind_time')
</select>
<select id="batchSelectProjectInfo" resultType="com.epmet.entity.project.ProjectEntity">
select * from project
where del_flag = '0'
<if test="null != ids and ids.size() > 0">
<foreach collection="ids" item="id" open=" AND (" separator=" OR " close=" )">
id = #{id}
</foreach>
</if>
</select>
<select id="selectProjectCategory" resultType="com.epmet.dto.project.ProjectCategoryDTO">
select * from
`project_category`
where del_flag = '0'
<foreach collection="list" item="id" open="AND (" separator=" OR " close=" )">
project_id = #{id}
</foreach>
</select>
</mapper>

114
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -311,4 +311,118 @@
</if>
</select>
<select id="selectClosedProjectOnAppointedDay" resultType="com.epmet.dto.ProjectProcessDTO">
SELECT
project_id,
created_time
FROM
`project_process`
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND operation = 'close'
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
<select id="selectClosedProjectByProjectIds" resultType="com.epmet.dto.ProjectProcessDTO">
SELECT
project_id,
created_time
FROM
`project_process`
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND operation = 'close'
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
project_id = #{projectId}
</foreach>
</select>
<resultMap id="processDirectionMap" type="com.epmet.dto.screen.ScreenProjectProcessDTO">
<result column="customer_id" property="customerId" />
<result column="processId" property="processId" />
<result column="project_id" property="projectId" />
<result column="handlerName" property="handlerName" />
<result column="handlerId" property="handlerId" />
<result column="handlerType" property="handlerType" />
<result column="org_id_path" property="orgIdPath" />
<result column="operation" property="operation" />
<result column="public_reply" property="publicReply" />
<result column="internal_remark" property="internalRemark" />
<result column="processTime" property="processTime" />
<result column="dataEndTime" property="dataEndTime" />
<collection property="points" ofType="com.epmet.dto.project.ProjectStaffDTO">
<result column="orgId" property="orgId"/>
<result column="DEPARTMENT_NAME" property="departmentName"/>
</collection>
</resultMap>
<select id="selectProjectProcessAndDirection" resultMap="processDirectionMap">
SELECT
process.project_id,
process.customer_id,
process.id as processId,
process.DEPARTMENT_NAME as handlerName,
CASE WHEN process.DEPARTMENT_ID IS NOT NULL <![CDATA[&&]]> trim(process.DEPARTMENT_ID) <![CDATA[<>]]> '' THEN process.DEPARTMENT_ID
WHEN process.GRID_ID IS NOT NULL <![CDATA[&&]]> trim(process.GRID_ID) <![CDATA[<>]]> '' THEN process.GRID_ID
ELSE process.AGENCY_ID END as handlerId,
CASE WHEN process.DEPARTMENT_ID IS NOT NULL <![CDATA[&&]]> trim(process.DEPARTMENT_ID) <![CDATA[<>]]> '' THEN 'department'
WHEN process.GRID_ID IS NOT NULL <![CDATA[&&]]> trim(process.GRID_ID) <![CDATA[<>]]> '' THEN 'grid'
ELSE 'agency' END as handlerType,
process.ORG_ID_PATH,
process.OPERATION,
process.PUBLIC_REPLY,
process.INTERNAL_REMARK,
process.CREATED_TIME as processTime,
#{dataEndTime} as dataEndTime,
staff.DEPARTMENT_NAME,
CASE WHEN staff.DEPARTMENT_ID IS NOT NULL <![CDATA[&&]]> trim(staff.DEPARTMENT_ID) <![CDATA[<>]]> '' THEN staff.DEPARTMENT_ID
WHEN staff.GRID_ID IS NOT NULL <![CDATA[&&]]> trim(staff.GRID_ID) <![CDATA[<>]]> '' THEN staff.GRID_ID
ELSE staff.ORG_ID END as orgId
FROM `project_process` process
left join `project_staff` staff on staff.PROCESS_ID = process.ID and staff.DEL_FLAG = '0'
where process.del_flag = '0' and process.customer_id = #{customerId}
<choose>
<when test='null != dateId and "" != dateId'>
AND DATE_FORMAT(process.created_time, '%Y%m%d') = #{dateId}
</when>
<otherwise>
AND CAST(DATE_FORMAT(process.created_time, '%Y%m%d') AS SIGNED) <![CDATA[ <= ]]> CAST(#{dataEndTime} AS SIGNED)
</otherwise>
</choose>
</select>
<select id="selectProcessAttachment" resultType="com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO">
SELECT
ID AS attachementId,
CUSTOMER_ID,
PROJECT_ID,
PROCESS_ID,
FILE_PLACE,
FILE_NAME,
ATTACHMENT_NAME,
ATTACHMENT_SIZE,
ATTACHMENT_FORMAT,
ATTACHMENT_TYPE,
ATTACHMENT_URL,
SORT,
DURATION
FROM
`project_process_attachment`
WHERE
del_flag = '0'
AND ( ( FILE_PLACE = 'public' AND STATUS IN ( 'auto_passed', 'approved' ) ) OR FILE_PLACE = 'internal' )
<foreach collection="list" item="processId" open="AND ( " separator=" OR " close=" )">
PROCESS_ID = #{processId}
</foreach>
</select>
</mapper>

30
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

@ -242,4 +242,34 @@
ID = #{item.sourceId}
</foreach>
</select>
<select id="selectScreenProjectData" resultType="com.epmet.dto.screen.ScreenProjectDataDTO">
SELECT
ID as topicId,
TOPIC_CONTENT as projectContent,
ADDRESS as projectAddress,
LONGITUDE,
DIMENSION as latitude
FROM RESI_TOPIC
WHERE DEL_FLAG = '0'
<foreach collection="list" item="project" open="AND (" separator=" OR " close=" )">
ID = #{project.topicId}
</foreach>
</select>
<select id="initNewScreenProjectImgData" resultType="com.epmet.dto.screen.ScreenProjectImgDataDTO">
SELECT
#{customerId} as customerId,
ATTACHMENT_URL AS projectImgUrl,
SORT ,
TOPIC_ID
FROM
`resi_topic_attachment`
WHERE
del_flag = '0'
AND ATTACHMENT_TYPE = 'image'
<foreach collection="list" item="project" open="AND ( " separator=" OR " close=" )">
TOPIC_ID = #{project.topicId}
</foreach>
</select>
</mapper>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -514,4 +514,20 @@
AND register.CUSTOMER_ID = #{customerId}
AND register.FIRST_REGISTER = '1'
</select>
<select id="selectScreenProjectData" resultType="com.epmet.dto.screen.ScreenProjectDataDTO">
SELECT
CONCAT( STREET, '-', SURNAME, CASE WHEN GENDER = '1' THEN '先生' WHEN GENDER = '2' THEN '女士' ELSE '先生/女士' END ) AS linkName,
MOBILE AS linkMobile,
USER_ID as topicId
FROM
user_base_info
WHERE
del_flag = '0'
<foreach collection="list" item="project" open="AND (" separator=" OR " close=")">
user_id = #{project.linkName}
</foreach>
</select>
</mapper>

Loading…
Cancel
Save