Browse Source

Merge branch 'dev_third_data' into dev_temp

dev_shibei_match
sunyuchao 4 years ago
parent
commit
fc7b3763d0
  1. 126
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java
  2. 126
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java
  3. 24
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java
  4. 39
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java
  5. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java
  6. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java
  7. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java
  8. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  9. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java
  10. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java
  11. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java
  12. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  13. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  14. 250
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java
  15. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java
  16. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java
  17. 109
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java
  18. 109
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java
  19. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  20. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  21. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml
  22. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml
  23. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

126
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java

@ -0,0 +1,126 @@
/**
* 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.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 热议中话题机关日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Data
public class FactTopicHotdiscussAgencyDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题状态热议中:hot_discuss
*/
private String status;
/**
* 状态话题数量
*/
private Integer topicCount;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

126
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java

@ -0,0 +1,126 @@
/**
* 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.stats.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 热议中话题网格日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Data
public class FactTopicHotdiscussGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 机关ID
*/
private String agencyId;
/**
* 网格ID 关联网格dm表
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题状态热议中:hot_discuss
*/
private String status;
/**
* 状态话题数量
*/
private Integer topicCount;
/**
* 删除标识
*/
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/stats/topic/form/TopicStatusFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.stats.topic.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author sun
* 热议中话题-网格机关日统计-接口入参
*/
@Data
public class TopicStatusFormDTO implements Serializable {
private static final long serialVersionUID = -4527492073390715391L;
/**
* 客户Id
*/
private String customerId = "";
/**
* 需要执行的日期格式yyyyMMdd
*/
private String dateId = "";
}

39
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java

@ -0,0 +1,39 @@
package com.epmet.dto.stats.topic.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author sun
* 热议中话题-网格机关日统计-接口返参
*/
@Data
public class TopicListResultDTO implements Serializable {
private static final long serialVersionUID = -7427128491727512781L;
/**
* 客户Id
*/
private String customerId;
/**
* 话题Id
*/
private String topicId;
/**
* 网格id
*/
private String gridId;
/**
* 小组Id
*/
private String groupId;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
*/
private String status;
/**
* 是否转为议题0:false1:true
* */
private Boolean shiftIssue;
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java

@ -2,6 +2,8 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO; import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.group.form.GroupTotalFormDTO;
import com.epmet.dto.stats.topic.form.TopicStatusFormDTO;
import com.epmet.service.StatsTopicService; import com.epmet.service.StatsTopicService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -27,4 +29,25 @@ public class StatsTopicController {
statsTopicService.partition(formDTO); statsTopicService.partition(formDTO);
return new Result(); return new Result();
} }
/**
* @Author sun
* @Description 热议中话题-网格日统计
**/
@PostMapping("gridtopicstatus")
public Result gridTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) {
statsTopicService.gridTopicStatus(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 热议中话题-机关日统计
**/
@PostMapping("agencytopicstatus")
public Result agencyTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) {
statsTopicService.agencyTopicStatus(formDTO);
return new Result();
}
} }

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java

@ -0,0 +1,38 @@
/**
* 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.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 热议中话题机关日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Mapper
public interface FactTopicHotdiscussAgencyDailyDao extends BaseDao<FactTopicHotdiscussAgencyDailyEntity> {
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity);
}

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java

@ -0,0 +1,38 @@
/**
* 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.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 热议中话题网格日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Mapper
public interface FactTopicHotdiscussGridDailyDao extends BaseDao<FactTopicHotdiscussGridDailyEntity> {
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity);
}

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

@ -11,6 +11,7 @@ import com.epmet.dto.group.result.TopicContentResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.stats.topic.result.TopicListResultDTO;
import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO;
@ -142,4 +143,10 @@ public interface TopicDao {
List<ScreenProjectImgDataDTO> initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List<ScreenProjectDataDTO> list); List<ScreenProjectImgDataDTO> initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List<ScreenProjectDataDTO> list);
ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId); ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId);
/**
* @Author sun
* @Description 根据客户Id和截止日期查询话题业务数据
**/
List<TopicListResultDTO> selectTopicList(@Param("customerId") String customerId, @Param("dateId") String dateId);
} }

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java

@ -0,0 +1,96 @@
/**
* 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.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 热议中话题机关日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_hotdiscuss_agency_daily")
public class FactTopicHotdiscussAgencyDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 机构ID 关联机关dm表
*/
private String agencyId;
/**
* 父级机关ID
*/
private String pid;
/**
* 统计日期 关联日期dm表
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题状态热议中:hot_discuss
*/
private String status;
/**
* 状态话题数量
*/
private Integer topicCount;
}

96
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java

@ -0,0 +1,96 @@
/**
* 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.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 热议中话题网格日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_topic_hotdiscuss_grid_daily")
public class FactTopicHotdiscussGridDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 机关ID
*/
private String agencyId;
/**
* 网格ID 关联网格dm表
*/
private String gridId;
/**
* 日期ID
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年ID
*/
private String yearId;
/**
* 话题总数
*/
private Integer topicTotal;
/**
* 话题状态热议中:hot_discuss
*/
private String status;
/**
* 状态话题数量
*/
private Integer topicCount;
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java

@ -1,6 +1,7 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.dto.StatsFormDTO; import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.stats.topic.form.TopicStatusFormDTO;
/** /**
* @Description 话题统计Service接口 * @Description 话题统计Service接口
@ -18,4 +19,16 @@ public interface StatsTopicService {
* @date 2020.06.28 14:38 * @date 2020.06.28 14:38
**/ **/
void partition(StatsFormDTO formDTO); void partition(StatsFormDTO formDTO);
/**
* @Author sun
* @Description 热议中话题-网格日统计
**/
void gridTopicStatus(TopicStatusFormDTO formDTO);
/**
* @Author sun
* @Description 热议中话题-机关日统计
**/
void agencyTopicStatus(TopicStatusFormDTO formDTO);
} }

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

@ -7,7 +7,9 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.topic.form.TopicStatusFormDTO;
import com.epmet.service.StatsGroupService; import com.epmet.service.StatsGroupService;
import com.epmet.service.StatsTopicService;
import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.DimCustomerService;
@ -54,6 +56,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
private FactGroupActDailyService factGroupActDailyService; private FactGroupActDailyService factGroupActDailyService;
@Autowired @Autowired
private StatsGroupService statsGroupService; private StatsGroupService statsGroupService;
@Autowired
private StatsTopicService statsTopicService;
@Override @Override
@ -263,6 +267,36 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
} }
}); });
//热议中话题网格、机关日统计
threadPool.submit(() -> {
TopicStatusFormDTO formDTO = new TopicStatusFormDTO();
formDTO.setCustomerId(param.getCustomerId());
if (!isRange) {
formDTO.setDateId(param.getDateId());
try {
statsTopicService.gridTopicStatus(formDTO);
} catch (Exception e) {
log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e);
}
try {
statsTopicService.agencyTopicStatus(formDTO);
} catch (Exception e) {
log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e);
}
} else {
try {
statsTopicService.gridTopicStatus(formDTO);
} catch (Exception e) {
log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e);
}
try {
statsTopicService.agencyTopicStatus(formDTO);
} catch (Exception e) {
log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e);
}
}
});
submitProjectRelationData(param, finalDaysBetween); submitProjectRelationData(param, finalDaysBetween);
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

@ -583,11 +583,11 @@ public class StatsGroupServiceImpl implements StatsGroupService {
FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity(); FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity();
delEntity.setCustomerId(customerId); delEntity.setCustomerId(customerId);
delEntity.setDateId(dimId.getDateId()); delEntity.setDateId(dimId.getDateId());
log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity); factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity);
//5.2:批量保存网格日统计数据 //5.2:批量保存机关日统计数据
log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factGroupTotalAgencyDailyService.insertBatch(list); factGroupTotalAgencyDailyService.insertBatch(list);
} }

250
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java

@ -6,12 +6,15 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ProjectConstant; import com.epmet.constant.ProjectConstant;
import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.StatsFormDTO; import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.form.TopicStatusFormDTO;
import com.epmet.dto.stats.topic.result.TopicListResultDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.entity.stats.*;
import com.epmet.service.StatsTopicService; import com.epmet.service.StatsTopicService;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.DimTopicStatusService;
import com.epmet.service.stats.topic.TopicStatisticalService; import com.epmet.service.stats.topic.TopicStatisticalService;
import com.epmet.service.topic.TopicService; import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
@ -23,7 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @Description 话题统计Service * @Description 话题统计Service
@ -35,21 +40,22 @@ import java.util.*;
public class StatsTopicServiceImpl implements StatsTopicService { public class StatsTopicServiceImpl implements StatsTopicService {
protected static final Logger log = LoggerFactory.getLogger(StatsTopicServiceImpl.class); protected static final Logger log = LoggerFactory.getLogger(StatsTopicServiceImpl.class);
@Autowired @Autowired
private DimCustomerService dimCustomerService; private DimCustomerService dimCustomerService;
@Autowired @Autowired
private DimAgencyService dimAgencyService; private DimAgencyService dimAgencyService;
@Autowired @Autowired
private DimTopicStatusService dimTopicStatusService; private DimTopicStatusService dimTopicStatusService;
@Autowired @Autowired
private TopicService topicService; private TopicService topicService;
@Autowired @Autowired
private TopicStatisticalService topicStatisticalService; private TopicStatisticalService topicStatisticalService;
@Autowired
private DimGridService dimGridService;
@Autowired
private FactTopicHotdiscussGridDailyService factTopicHotdiscussGridDailyService;
@Autowired
private FactTopicHotdiscussAgencyDailyService factTopicHotdiscussAgencyDailyService;
/** /**
* @param formDTO 如果目标日期为空则自动计算为T-1天 * @param formDTO 如果目标日期为空则自动计算为T-1天
@ -122,4 +128,232 @@ public class StatsTopicServiceImpl implements StatsTopicService {
} }
} }
/**
* @Author sun
* @Description 热议中话题-网格日统计
**/
@Override
public void gridTopicStatus(TopicStatusFormDTO formDTO) {
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//入参有客户Id的则按客户Id执行,没有的则全部客户都执行
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) {
log.info("热议中话题网格日统计数据,当前统计的客户Id:" + formDTO.getCustomerId());
gridTopic(formDTO.getCustomerId(), formDTO.getDateId());
} else {
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
do {
//获取有效客户列表
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
try {
log.info("for循环统计热议中话题网格日统计数据,当前统计的客户Id:" + customerId);
//遍历统计每一个客户数据
gridTopic(customerId, formDTO.getDateId());
} catch (Exception e) {
log.error("热议中话题-网格日统计-程序错误,对应客户Id:" + customerId, e);
log.error("Error creating model JSON", e);
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}
}
/**
* @Author sun
* @Description 热议中话题-网格日统计
**/
private void gridTopic(String customerId, String dateId) {
//1:查询各维度表Id,方便使用
Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD);
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询网格维度表数据
log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId);
List<DimGridEntity> dimGridList = dimGridService.getGridListByCustomerId(customerId);
//3.根据客户Id查询客户下有效的话题数据,查询dateId之前的数据
List<TopicListResultDTO> list = topicService.getTopicList(customerId, dateId);
//4.遍历封装数据
List<FactTopicHotdiscussGridDailyEntity> saveList = new ArrayList<>();
dimGridList.forEach(grid->{
FactTopicHotdiscussGridDailyEntity entity = new FactTopicHotdiscussGridDailyEntity();
AtomicInteger total = new AtomicInteger(0);
AtomicInteger num = new AtomicInteger(0);
list.forEach(l->{
if(grid.getId().equals(l.getGridId()) ){
total.addAndGet(1);
if(l.getStatus().equals("discussing") && !l.getShiftIssue()){
num.addAndGet(1);
}
}
});
entity.setCustomerId(customerId);
entity.setAgencyId(grid.getAgencyId());
entity.setGridId(grid.getId());
entity.setDateId(dimId.getDateId());
entity.setWeekId(dimId.getWeekId());
entity.setMonthId(dimId.getMonthId());
entity.setQuarterId(dimId.getQuarterId());
entity.setYearId(dimId.getYearId());
entity.setTopicTotal(total.get());
entity.setStatus("hot_discuss");
entity.setTopicCount(num.get());
saveList.add(entity);
});
//5.批量插入数据库,先删后增的逻辑
if (!CollectionUtils.isEmpty(saveList)) {
//5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据
FactTopicHotdiscussGridDailyEntity delEntity = new FactTopicHotdiscussGridDailyEntity();
delEntity.setCustomerId(customerId);
delEntity.setDateId(dimId.getDateId());
factTopicHotdiscussGridDailyService.delTopicGrid(delEntity);
//5.2:批量保存网格日统计数据
log.info("StatsTopicServiceImpl.gridTopic-批量新增热议中话题网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factTopicHotdiscussGridDailyService.insertBatch(saveList);
}
}
/**
* @Author sun
* @Description 热议中话题-机关日统计
**/
@Override
public void agencyTopicStatus(TopicStatusFormDTO formDTO) {
//入参有日期的则按具体时间执行,没有的则按当前时间前一天执行
if (StringUtils.isBlank(formDTO.getDateId())) {
Date yesterday = DateUtils.addDateDays(new Date(), -1);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
formDTO.setDateId(format.format(yesterday));
}
//入参有客户Id的则按客户Id执行,没有的则全部客户都执行
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) {
log.info("单独统计客户组织下热议中话题日统计数据,当前统计的客户Id:" + formDTO.getCustomerId());
agencyTopic(formDTO.getCustomerId(), formDTO.getDateId());
} else {
int pageNo = 1;
int pageSize = 100;
List<String> customerIdList = null;
do {
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize);
if (!CollectionUtils.isEmpty(customerIdList)) {
for (String customerId : customerIdList) {
try {
log.info("for循环统计机关热议中话题日统计数据,当前统计的客户Id:" + customerId);
//遍历统计每一个客户数据
agencyTopic(customerId, formDTO.getDateId());
} catch (Exception e) {
log.error("热议中话题机关日统计程序错误,对应客户Id:" + customerId, e);
log.error("Error creating model JSON", e);
}
}
}
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize);
}
}
/**
* @Author sun
* @Description 热议中话题-机关日统计数据
**/
private void agencyTopic(String customerId, String dateId) {
//1:查询各维度表Id,方便使用
Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD);
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//2:根据客户Id查询机关维度表数据
log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id查询机关维度数据,对应客户Id:" + customerId);
DimAgencyDTO dimAgencyDTO = new DimAgencyDTO();
dimAgencyDTO.setCustomerId(customerId);
List<DimAgencyDTO> agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO);
//3.根据客户Id查询网格维度表数据
List<DimGridEntity> gridList = dimGridService.getGridListByCustomerId(customerId);
//4..根据客户Id查询客户下有效的话题数据,查询dateId之前的数据
List<TopicListResultDTO> groupList = topicService.getTopicList(customerId, dateId);
List<FactTopicHotdiscussAgencyDailyEntity> list = new ArrayList<>();
//5.遍历组织维度数据分别计算每个组织下话题数据
DimIdGenerator.DimIdBean finalDimId = dimId;
agencyList.forEach(agency->{
FactTopicHotdiscussAgencyDailyEntity entity = new FactTopicHotdiscussAgencyDailyEntity();
//5-1.汇总组织及所有下级组织列表
Map<String, String> map = new HashMap<>();
map.put(agency.getId(), agency.getId());
String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId());
agencyList.forEach(sub -> {
if (sub.getPids().contains(subPids)) {
map.put(sub.getId(), sub.getId());
}
});
//5-2.汇总组织及下级所有的网格列表
List<String> agencyGridList = new ArrayList<>();
gridList.forEach(grid->{
if (map.containsKey(grid.getAgencyId())) {
agencyGridList.add(grid.getId());
}
});
AtomicInteger total = new AtomicInteger(0);
AtomicInteger num = new AtomicInteger(0);
//5-3.根据汇总的网格列表统计对应的群组数据
agencyGridList.forEach(gridId -> {
groupList.forEach(l -> {
if (gridId.equals(l.getGridId())) {
total.addAndGet(1);
if(l.getStatus().equals("discussing") && !l.getShiftIssue()){
num.addAndGet(1);
}
}
});
});
//封装数据
entity.setCustomerId(agency.getCustomerId());
entity.setAgencyId(agency.getId());
entity.setPid(agency.getPid());
entity.setDateId(finalDimId.getDateId());
entity.setWeekId(finalDimId.getWeekId());
entity.setMonthId(finalDimId.getMonthId());
entity.setQuarterId(finalDimId.getQuarterId());
entity.setYearId(finalDimId.getYearId());
entity.setTopicTotal(total.get());
entity.setStatus("hot_discuss");
entity.setTopicCount(num.get());
list.add(entity);
});
//6.批量插入数据库,先删后增的逻辑
if (!CollectionUtils.isEmpty(list)) {
//5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据
FactTopicHotdiscussAgencyDailyEntity delEntity = new FactTopicHotdiscussAgencyDailyEntity();
delEntity.setCustomerId(customerId);
delEntity.setDateId(dimId.getDateId());
log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id、日维度Id批量删除热议中话题机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factTopicHotdiscussAgencyDailyService.delTopicAgency(delEntity);
//5.2:批量保存机关日统计数据
log.info("StatsTopicServiceImpl.agencyTopic-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factTopicHotdiscussAgencyDailyService.insertBatch(list);
}
}
} }

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java

@ -0,0 +1,101 @@
/**
* 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.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO;
import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 热议中话题机关日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
public interface FactTopicHotdiscussAgencyDailyService extends BaseService<FactTopicHotdiscussAgencyDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicHotdiscussAgencyDailyDTO>
* @author generator
* @date 2021-05-17
*/
PageData<FactTopicHotdiscussAgencyDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicHotdiscussAgencyDailyDTO>
* @author generator
* @date 2021-05-17
*/
List<FactTopicHotdiscussAgencyDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicHotdiscussAgencyDailyDTO
* @author generator
* @date 2021-05-17
*/
FactTopicHotdiscussAgencyDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-05-17
*/
void save(FactTopicHotdiscussAgencyDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-05-17
*/
void update(FactTopicHotdiscussAgencyDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-05-17
*/
void delete(String[] ids);
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity);
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java

@ -0,0 +1,101 @@
/**
* 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.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO;
import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity;
import java.util.List;
import java.util.Map;
/**
* 热议中话题网格日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
public interface FactTopicHotdiscussGridDailyService extends BaseService<FactTopicHotdiscussGridDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<FactTopicHotdiscussGridDailyDTO>
* @author generator
* @date 2021-05-17
*/
PageData<FactTopicHotdiscussGridDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<FactTopicHotdiscussGridDailyDTO>
* @author generator
* @date 2021-05-17
*/
List<FactTopicHotdiscussGridDailyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return FactTopicHotdiscussGridDailyDTO
* @author generator
* @date 2021-05-17
*/
FactTopicHotdiscussGridDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-05-17
*/
void save(FactTopicHotdiscussGridDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-05-17
*/
void update(FactTopicHotdiscussGridDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-05-17
*/
void delete(String[] ids);
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity);
}

109
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java

@ -0,0 +1,109 @@
/**
* 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.service.stats.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.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.stats.FactTopicHotdiscussAgencyDailyDao;
import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO;
import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity;
import com.epmet.service.stats.FactTopicHotdiscussAgencyDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 热议中话题机关日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Service
public class FactTopicHotdiscussAgencyDailyServiceImpl extends BaseServiceImpl<FactTopicHotdiscussAgencyDailyDao, FactTopicHotdiscussAgencyDailyEntity> implements FactTopicHotdiscussAgencyDailyService {
@Override
public PageData<FactTopicHotdiscussAgencyDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicHotdiscussAgencyDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicHotdiscussAgencyDailyDTO.class);
}
@Override
public List<FactTopicHotdiscussAgencyDailyDTO> list(Map<String, Object> params) {
List<FactTopicHotdiscussAgencyDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussAgencyDailyDTO.class);
}
private QueryWrapper<FactTopicHotdiscussAgencyDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicHotdiscussAgencyDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicHotdiscussAgencyDailyDTO get(String id) {
FactTopicHotdiscussAgencyDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussAgencyDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicHotdiscussAgencyDailyDTO dto) {
FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicHotdiscussAgencyDailyDTO dto) {
FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
@Override
public void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity) {
baseDao.delTopicAgency(delEntity);
}
}

109
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java

@ -0,0 +1,109 @@
/**
* 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.service.stats.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.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.stats.FactTopicHotdiscussGridDailyDao;
import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO;
import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity;
import com.epmet.service.stats.FactTopicHotdiscussGridDailyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 热议中话题网格日统计表热议中指的没有被关闭屏蔽转议题的话题
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-05-17
*/
@Service
public class FactTopicHotdiscussGridDailyServiceImpl extends BaseServiceImpl<FactTopicHotdiscussGridDailyDao, FactTopicHotdiscussGridDailyEntity> implements FactTopicHotdiscussGridDailyService {
@Override
public PageData<FactTopicHotdiscussGridDailyDTO> page(Map<String, Object> params) {
IPage<FactTopicHotdiscussGridDailyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, FactTopicHotdiscussGridDailyDTO.class);
}
@Override
public List<FactTopicHotdiscussGridDailyDTO> list(Map<String, Object> params) {
List<FactTopicHotdiscussGridDailyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussGridDailyDTO.class);
}
private QueryWrapper<FactTopicHotdiscussGridDailyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<FactTopicHotdiscussGridDailyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public FactTopicHotdiscussGridDailyDTO get(String id) {
FactTopicHotdiscussGridDailyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussGridDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(FactTopicHotdiscussGridDailyDTO dto) {
FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(FactTopicHotdiscussGridDailyDTO dto) {
FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Author sun
* @Description 根据客户Id日维度Id批量物理删除一下可能存在的历史数据
**/
@Override
public void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity) {
baseDao.delTopicGrid(delEntity);
}
}

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

@ -6,6 +6,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.result.TopicListResultDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO;
@ -116,4 +117,10 @@ public interface TopicService {
* @date 2021/4/13 5:39 下午 * @date 2021/4/13 5:39 下午
*/ */
ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType); ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType);
/**
* @Author sun
* @Description 根据客户Id和截止日期查询话题业务数据
**/
List<TopicListResultDTO> getTopicList(String customerId, String dateId);
} }

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

@ -14,6 +14,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.*;
import com.epmet.dto.stats.topic.result.GroupTopicData; import com.epmet.dto.stats.topic.result.GroupTopicData;
import com.epmet.dto.stats.topic.result.TopicListResultDTO;
import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.ResiTopicDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO;
@ -1413,4 +1414,14 @@ public class TopicServiceImpl implements TopicService {
public List<TopicOriginInfoDTO> queryTopicOriginInfoList(String customerId, String dateId) { public List<TopicOriginInfoDTO> queryTopicOriginInfoList(String customerId, String dateId) {
return topicDao.selectListTopicOriginInfo(customerId, dateId); return topicDao.selectListTopicOriginInfo(customerId, dateId);
} }
/**
* @Author sun
* @Description 根据客户Id和截止日期查询话题业务数据
**/
@Override
public List<TopicListResultDTO> getTopicList(String customerId, String dateId) {
return topicDao.selectTopicList(customerId, dateId);
}
} }

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactTopicHotdiscussAgencyDailyDao">
<delete id="delTopicAgency">
DELETE
FROM
fact_topic_hotdiscuss_agency_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
</delete>
</mapper>

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.stats.FactTopicHotdiscussGridDailyDao">
<delete id="delTopicGrid">
DELETE
FROM
fact_topic_hotdiscuss_grid_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
</delete>
</mapper>

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

@ -307,4 +307,23 @@
AND ATTACHMENT_TYPE = 'image' AND ATTACHMENT_TYPE = 'image'
and TOPIC_ID = #{topicId} and TOPIC_ID = #{topicId}
</select> </select>
<select id="selectTopicList" resultType="com.epmet.dto.stats.topic.result.TopicListResultDTO">
SELECT
rt.id AS topicId,
rt.group_id AS groupId,
rt.`status` AS STATUS,
rt.shift_issue AS shiftIssue,
rg.grid_id AS gridId,
rg.customer_id AS customerId
FROM
resi_topic rt
INNER JOIN resi_group rg ON rt.group_id = rg.id
WHERE
rt.del_flag = '0'
AND rg.del_flag = '0'
AND rg.customer_id = #{customerId}
AND DATE_FORMAT(rt.created_time ,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
</select>
</mapper> </mapper>

Loading…
Cancel
Save