diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index f759f036b9..8e526e2a73 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index b972365b19..47a18e3a72 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -6,5 +6,6 @@ public interface DataSourceConstant { String STATS = "stats"; String GOV_ISSUE = "govIssue"; String GOV_PROJECT = "govProject"; + String GOV_VOICE = "govVoice"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java new file mode 100644 index 0000000000..138ae7efec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:文章总数 统计返回结果 dto + * + * @author liujianjun + * @date 2020/6/17 16:43 + */ +@Data +public class ArticleGridPublishedSummaryDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布文章总数 + */ + private Integer publishedCount; + /** + * 状态为发布中的文章总数 + */ + private Integer publishingCount; +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a69f4c06b4..3a323fce2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -122,6 +122,12 @@ epmet_gov_project_user EpmEt-db-UsEr + + + + epmet_gov_voice_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -180,6 +186,12 @@ epmet_gov_project_user EpmEt-db-UsEr + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java new file mode 100644 index 0000000000..a8860b0cff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java @@ -0,0 +1,29 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsDemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.concurrent.ExecutorService; + +/** + * desc:宣传能力controller + */ +@RequestMapping("publicity") +@RestController +public class PublicityController { + + @Autowired + private StatsDemoService demoService; + + @Autowired + private ExecutorService executorService; + + @PostMapping(value = "publicitySummaryStatsjob") + public Result publicitySummaryStatsjob(){ + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java index 5a8a5351ce..66ea22ad59 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.DimCustomerEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 客户维度 * @@ -29,5 +31,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DimCustomerDao extends BaseDao { - + + /** + * desc: 分页获取客户id + * + * @param pageNo + * @param offset + * return: List + * @date: 2020/6/17 16:33 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(Integer pageNo, int offset); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java new file mode 100644 index 0000000000..4609722502 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.ArticleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java new file mode 100644 index 0000000000..13b47c66b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticlePublishRangeDao extends BaseDao { + + /** + * desc:查询网格发布文章总数及状态为发布中的文章总数 + * + * @param customerId + * @param createDate + * @return + */ + List selectByCreatedDate(@Param("customerId") String customerId, @Param("createDate") Date createDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java new file mode 100644 index 0000000000..98d9beb507 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +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 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article") +public class ArticleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 1是;0否; + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合,顿号隔开 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java new file mode 100644 index 0000000000..1aac103337 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +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 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_publish_range") +public class ArticlePublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String publishStatus; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java new file mode 100644 index 0000000000..e861ab90fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + + +public interface StatsPublicityService { + /** + * desc: 统计宣传能力的汇总信息 + * + * return: + * @date: 2020/6/17 16:11 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean publicitySummary(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index 59c2907d10..ef4d1d6167 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -28,6 +28,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { @Autowired private DemoDataStatsService demoDataStatsService; + @Override public void testList() { List agencies = demoGovOrgService.listAllEntities(); List issues = demoIssueService.listAllEntities(); @@ -36,6 +37,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { //该service不加事务 //@Transactional(rollbackFor = Exception.class) + @Override public void testTx() { demoDataStatsService.testTx(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java new file mode 100644 index 0000000000..844d11d04c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -0,0 +1,68 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.service.StatsPublicityService; +import com.epmet.service.stats.*; +import com.epmet.service.voice.ArticlePublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * desc: 宣传能力数据统计 service + * + * @date: 2020/6/17 16:08 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Service +public class StatsPublicityServiceImpl implements StatsPublicityService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimDateService dimDateService; + @Autowired + private DimWeekService dimWeekService; + @Autowired + private DimMonthService dimMonthService; + @Autowired + private DimQuarterService dimQuarterService; + @Autowired + private DimYearService dimYearService; + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private ArticlePublishRangeService articlePublishRangeService; + + @Override + public Boolean publicitySummary() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + customerIdList.forEach(customerId -> { + + }); + } + + } while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize); + return null; + } + + private String statsPublishArticle(String customerId, Date statsDate) { + //1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ; + // 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数 + + List articleCount = articlePublishRangeService.selectByCreatedDate(customerId, statsDate == null ? DateUtils.addDateDays(new Date(), -1) : statsDate); + + return null; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java index dc19f54861..96eabb77ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java @@ -92,4 +92,16 @@ public interface DimCustomerService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + /** + * desc: 分页获取 客户id + * + * @param pageNo + * @param pageSize + * return: List + * @date: 2020/6/17 16:26 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index 4b66ed3e11..1b8bf1e474 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -20,15 +20,17 @@ 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.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dto.stats.DimCustomerDTO; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +45,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@Slf4j public class DimCustomerServiceImpl extends BaseServiceImpl implements DimCustomerService { @Override @@ -97,4 +100,13 @@ public class DimCustomerServiceImpl extends BaseServiceImpl selectCustomerIdPage(Integer pageNo, Integer pageSize) { + if (pageNo ==null || pageNo <1 || pageSize == null || pageSize < 0){ + log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}",pageNo,pageSize); + throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(),EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg()); + } + return baseDao.selectCustomerIdPage(pageNo,(pageNo-1)*pageSize); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java new file mode 100644 index 0000000000..0f6ac51535 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticlePublishRangeService extends BaseService { + + /** + * desc: 根据客户Id 、创建日期查询 发布范围数据 + * + * @param customerId + * @param createDate + * return: + * @date: 2020/6/17 16:59 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectByCreatedDate(String customerId, Date createDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java new file mode 100644 index 0000000000..366e167ad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleEntity; + +/** + * desc: 数据统计文章service + * + * return: + * @date: 2020/6/17 15:28 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +public interface ArticleService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java new file mode 100644 index 0000000000..47b2e194ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticlePublishRangeDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import com.epmet.service.voice.ArticlePublishRangeService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + + @Override + public List selectByCreatedDate(String customerId, Date createDate) { + return baseDao.selectByCreatedDate(customerId,createDate); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..f1a788fc30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleDao; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.service.voice.ArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { + @Autowired + private ArticleDao articleDao; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 4d0a2dce64..16f8408da1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -135,6 +135,11 @@ dynamic: url: @datasource.druid.project.url@ username: @datasource.druid.project.username@ password: @datasource.druid.project.password@ + govVoice: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.voice.url@ + username: @datasource.druid.voice.username@ + password: @datasource.druid.voice.password@ thread: # 线程池配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml index ed01bed0da..6cc8b750fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -4,6 +4,7 @@ - - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml new file mode 100644 index 0000000000..d411b3513e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml new file mode 100644 index 0000000000..19691045f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file