diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index b76386f7b3..e76069a10f 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.20 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.23 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index 8eef96eca6..e177ec9944 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.20 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.21 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 5635559271..25c493667a 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.20 + 0.3.23 com.epmet epmet-cloud @@ -159,8 +159,8 @@ 111 111 - wx9b6102a8ee5add65 - 16fdb68bc2b3e732324ba5d8b8a9b5e2 + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b @@ -196,8 +196,8 @@ 111 111 - wx9b6102a8ee5add65 - 16fdb68bc2b3e732324ba5d8b8a9b5e2 + wx07674c23af51b521 + a2fd0d29b007cbbcf8c8dda8c693d99b wx3d1372029eb816a3 651f02d71ed3f123dfb584b8bf0f4d8b diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index b1ad1b2908..7e11ab328e 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -13,11 +13,13 @@ import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.jwt.JwtTokenProperties; @@ -57,6 +59,8 @@ public class GovLoginServiceImpl implements GovLoginService { private CpUserDetailRedis cpUserDetailRedis; @Autowired private GovOrgFeignClient govOrgFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @param formDTO @@ -70,8 +74,7 @@ public class GovLoginServiceImpl implements GovLoginService { //1、校验手机号是否符合规范 if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); - //TODO 2020-05-21 手机号验证先去掉方便测试 - //throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); } //2、根据手机号校验用户是否存在 Result> customerStaffResult = epmetUserFeignClient.checkCustomerStaff(formDTO.getMobile()); @@ -79,14 +82,17 @@ public class GovLoginServiceImpl implements GovLoginService { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); throw new RenException(customerStaffResult.getCode()); } - //3、发送短信验证码 TODO 2020-05-21 发送验证先去掉方便测试 - /*Result> smsCodeResult = messageFeignClient.sendSmsCaptcha(formDTO.getMobile()); + //3、发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(formDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM); + Result smsCodeResult=epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); if (!smsCodeResult.success()) { logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); throw new RenException(smsCodeResult.getCode()); } //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) - captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().get("code"));*/ + captchaRedis.saveSmsCode(formDTO, smsCodeResult.getData().getCode()); logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); } @@ -109,8 +115,7 @@ public class GovLoginServiceImpl implements GovLoginService { String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile()); if (!formDTO.getSmsCode().equals(rightSmsCode)) { logger.error(String.format("验证码错误code[%s],msg[%s]",EpmetErrorCode.MOBILE_CODE_ERROR.getCode(),EpmetErrorCode.MOBILE_CODE_ERROR.getMsg())); - //TODO 2020-05-21 校验验证码先去掉方便测试 - //throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); } //3、查询用户所有的组织信息 List customerIdList = new ArrayList<>(); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index cf84ae177f..0b1295ab88 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -117,5 +117,5 @@ public interface ServiceConstant { /** * 数据统计 */ - String DATA_STATISTICAL = "data_statistical"; + String DATA_STATISTICAL_SERVER = "data-statistical-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 482ddd52b3..532420581a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -16,10 +16,7 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.List; +import java.util.*; /** * 日期处理工具类 @@ -49,7 +46,7 @@ public class DateUtils { public static final String MONTH_NAME_PATTERN = "yyyy年MM月"; public static final String DATE_PATTERN_YYYY = "yyyy"; public static final String DATE_PATTERN_YYYYMM = "yyyyMM"; - + public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_CHINESE = "chinese"; @@ -367,15 +364,111 @@ public class DateUtils { /** * @return java.lang.String - * @param dateStr yyyyMMdd + * @param dateStr yyyyMMdd返回yyyy.MM.dd yyyyMM返回yyyy/MM * @author yinzuomei * @description 返回yyyy.MM.dd * @Date 2020/6/22 18:38 **/ - public static String getDatePointPattern(String dateStr){ + public static String getxAxisDatePattern(String dateStr,String character){ if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==8){ - return String.valueOf(new StringBuffer(dateStr).insert(4,".").insert(7,".")); + return String.valueOf(new StringBuffer(dateStr).insert(4,character).insert(7,character)); + }else if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==6){ + return String.valueOf(new StringBuffer(dateStr).insert(4,character)); } return dateStr; } + + /** + * @return java.lang.String + * @param beforDay + * @author yinzuomei + * @description 获取当前日期的前n天 返回yyyyMMdd + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNDay(int beforDay){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); + } + + /** + * @return java.lang.String + * @param beforMonth + * @author yinzuomei + * @description 获取当前 月份的前n月 返回yyyyMM + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNMonth(int beforMonth){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, - beforMonth); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * @return java.util.List 返回yyyyMMdd + * @param startTime yyyyMMdd + * @param endTime yyyyMMdd + * @author yinzuomei + * @description 获取两个日期之间所有的日期集合,包含开始结束 + * @Date 2020/6/23 1:26 + **/ + public static List getDaysBetween(String startTime, String endTime){ + // 返回的日期集合 + List days = new ArrayList(); + try{ + Date start = DateUtils.parse(startTime,DateUtils.DATE_PATTERN_YYYYMMDD); + Date end = DateUtils.parse(endTime,DateUtils.DATE_PATTERN_YYYYMMDD); + + Calendar tempStart = Calendar.getInstance(); + tempStart.setTime(start); + + Calendar tempEnd = Calendar.getInstance(); + tempEnd.setTime(end); + // 日期加1(包含结束) + tempEnd.add(Calendar.DATE, +1); + while (tempStart.before(tempEnd)) { + days.add(DateUtils.format(tempStart.getTime(),DateUtils.DATE_PATTERN_YYYYMMDD)); + tempStart.add(Calendar.DAY_OF_YEAR, 1); + } + }catch (Exception e){ + e.printStackTrace(); + } + return days; + } + + /** + * @return java.util.List + * @param minDate yyyMM + * @param maxDate yyyyMM + * @author yinzuomei + * @description 计算两个月份中间所有的月份包含起始 + * @Date 2020/6/23 2:10 + **/ + public static List getMonthBetween(String minDate, String maxDate){ + ArrayList result = new ArrayList(); + try{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");//格式化为年月 + + Calendar min = Calendar.getInstance(); + Calendar max = Calendar.getInstance(); + + min.setTime(sdf.parse(minDate)); + min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1); + + max.setTime(sdf.parse(maxDate)); + max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2); + + Calendar curr = min; + while (curr.before(max)) { + result.add(sdf.format(curr.getTime())); + curr.add(Calendar.MONTH, 1); + } + min = null;max = null;curr = null; + }catch(Exception e){ + e.printStackTrace(); + } + return result; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java index 2aa3e2c964..08a96295ac 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java @@ -46,7 +46,7 @@ public class IdCardNoValidatorUtils { return false; } } else { - logger.info(String.format("身份证号%s最后一位为数字")); + logger.info(String.format("身份证号%s最后一位为数字",idCardNo)); } } if (idCardNo.length() == 18) { diff --git a/epmet-gateway/deploy/docker-compose-test.yml b/epmet-gateway/deploy/docker-compose-test.yml index 6942b0abb9..9ceffc1c63 100644 --- a/epmet-gateway/deploy/docker-compose-test.yml +++ b/epmet-gateway/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.17 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.18 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java index ffd096b2bd..f42d52fb72 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java @@ -34,4 +34,7 @@ public interface UserAnalysisConstant { * 党员 */ String PARTYMEMBER="党员"; + + String DAY_TYPE="day"; + String MONTH_TYPE="month"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java new file mode 100644 index 0000000000..a7f4e87dc5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 9:13 + */ +@Data +public class UserIncrTrendResDTO implements Serializable { + private static final long serialVersionUID = 290620373673325352L; + private Integer regIncr; + private Integer warmIncr; + private Integer partymemberIncr; + private String dateIdOrMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java index d36d7aba03..bfd9b17535 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result.user; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -13,7 +14,7 @@ import java.io.Serializable; @Data public class UserIncrTrendResultDTO implements Serializable { /** - * 日期如果按日查询返回yyyy-MM-dd,如果按月返回yyyy-MM + * 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM */ private String date; @@ -27,4 +28,7 @@ public class UserIncrTrendResultDTO implements Serializable { */ private Integer value; + // yyyyMMdd yyyyMM + @JsonIgnore + private String dateOrMonthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java deleted file mode 100644 index 8aa0274eab..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章发布数量【机关】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactArticlePublishedAgencyDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java deleted file mode 100644 index 63dcdf8194..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章发布数量【部门】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactArticlePublishedDepartmentDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布文章单位所属机关ID 发布文章单位所属机关ID - */ - private String agencyId; - - /** - * 部门ID - */ - private String departmentId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java deleted file mode 100644 index ef9441018c..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章发布数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactArticlePublishedGridDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布单位所属机关ID 发布单位所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java similarity index 57% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java index 7b4277b25e..9357d45f2d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java @@ -15,19 +15,47 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedGridDailyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章发布数量【网格】日统计表 + * 文章发表数量—下级机关统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactArticlePublishedGridDailyDao extends BaseDao { - +@Data +public class FactPublishedAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关名称 + */ + private String name; + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级机关Id + */ + private String pid; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java similarity index 61% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java index c4c74294b6..02eb3446a7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java @@ -15,19 +15,39 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedDepartmentDailyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章发布数量【部门】日统计表 + * 文章发表数量—下级机关统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { - +@Data +public class FactPublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 累计发文总数 + */ + private Integer publishedTotal; + + /** + * 发布中的文章总数 + */ + private Integer publishingTotal; + + /** + * 数据截止日期 + */ + private String dateName; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java new file mode 100644 index 0000000000..11aa1e2cea --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java @@ -0,0 +1,62 @@ +/** + * 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.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 文章发表数量—直属部门统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactPublishedDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 部门Id + */ + private String departmentId; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java similarity index 57% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java index f07422bba4..909deb2ba4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java @@ -15,19 +15,48 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedAgencyDailyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章引用标签阅读数量【机关】日统计表 + * 文章发表数量—直属部门统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactTagViewedAgencyDailyDao extends BaseDao { - +@Data +public class FactPublishedGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java index 766a95393a..1d91a3287a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java @@ -24,7 +24,7 @@ import java.util.Date; /** - * 文章引用标签阅读数量【机关】日统计表 + * 文章引用标签阅读数量【机关】统计表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java deleted file mode 100644 index f9bb58d4ed..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java deleted file mode 100644 index 9e66642afb..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyMonthlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java deleted file mode 100644 index b5e845f6f8..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyQuarterlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java deleted file mode 100644 index 9f420f6b37..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyYearlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java deleted file mode 100644 index d34da43745..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java deleted file mode 100644 index a1c6e3209d..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridMonthlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java deleted file mode 100644 index 10b049d10f..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridQuarterlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java deleted file mode 100644 index 2864b508de..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridYearlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java index 2d79a95762..56d31b9d17 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java @@ -23,11 +23,13 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.publicity.dto.form.TagFormDTO; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.publicity.dto.result.*; import com.epmet.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -53,8 +55,8 @@ public class PublicityController { * @Description 宣传能力—工作端—当前机关累计发文和当前发文 **/ @PostMapping("summaryinfo") - public Result summaryInfo(@LoginUser TokenDto tokenDto) { - return new Result().ok(publicityService.summaryInfo(tokenDto)); + public Result summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(publicityService.summaryInfo(tokenDto)); } /** @@ -91,4 +93,40 @@ public class PublicityController { return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); } + /** + * @param tokenDto 登录者token + * @Description 获取下级机关发文数 + * @author jyy + */ + @PostMapping("subagency/publishedarticle") + public Result> subagencyPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subagencyPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取直属部门发文数 + * @author jyy + */ + @PostMapping("department/publishedarticle") + public Result> departmentPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.departmentPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取指数网格发文数 + * @author jyy + */ + @PostMapping("subgrid/publishedarticle") + public Result> subgridPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subgridPublishedarticle(tokenDto, type)); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java deleted file mode 100644 index 6f1c09e7db..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedAgencyDailyEntity; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - * 文章发布数量【机关】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactArticlePublishedAgencyDailyDao extends BaseDao { - - /** - * @Description 宣传能力—工作端—当前机关累计发文和当前发文 - * @param agencyId - * @author jyy - */ - FactArticlePublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java deleted file mode 100644 index c7e6d8dd9b..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 文章引用标签阅读数量【机关】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagUsedAgencyMonthlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java deleted file mode 100644 index da999eb748..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 文章引用标签阅读数量【机关】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagUsedAgencyYearlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java deleted file mode 100644 index 4b9f72873a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 文章引用标签阅读数量【机关】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedAgencyMonthlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java deleted file mode 100644 index 5ba0a377ed..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 文章引用标签阅读数量【机关】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedAgencyQuarterlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java deleted file mode 100644 index db124cb121..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * 文章引用标签阅读数量【机关】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedAgencyYearlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java deleted file mode 100644 index e616dbd156..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridMonthlyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章引用标签阅读数量【网格】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedGridMonthlyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java deleted file mode 100644 index a83964bb1e..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridQuarterlyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章引用标签阅读数量【网格】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedGridQuarterlyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java new file mode 100644 index 0000000000..33801156b9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java @@ -0,0 +1,145 @@ +/** + * 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.publicity; + +import com.epmet.publicity.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface PublicityDao { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param agencyId 机关id + * @author jyy + */ + FactPublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); + + /** + * @Description 当月———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———下级机发文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级机发文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级机发文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级部门文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级部门文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级部门文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubDepartPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级网格文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级网格文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级网格文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java index 2fd8c6b3c8..feba486e41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -3,6 +3,7 @@ package com.epmet.dao.user; import com.epmet.dto.DimAgencyDTO; import com.epmet.dto.DimGridDTO; +import com.epmet.dto.result.user.UserIncrTrendResDTO; import com.epmet.dto.result.user.UserSubAgencyResDTO; import com.epmet.dto.result.user.UserSubGridResDTO; import com.epmet.dto.result.user.UserSummaryInfoResultDTO; @@ -95,4 +96,40 @@ public interface UserAnalysisDao { * @Date 2020/6/23 0:18 **/ List selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectRegDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectRegMonthIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java deleted file mode 100644 index 673699742d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_agency_daily") -public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java deleted file mode 100644 index 2a67346010..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_department_daily") -public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布文章单位所属机关ID 发布文章单位所属机关ID - */ - private String agencyId; - - /** - * 部门ID - */ - private String departmentId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java deleted file mode 100644 index 743724c2ab..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_grid_daily") -public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布单位所属机关ID 发布单位所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java deleted file mode 100644 index fb3d59a1ca..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_daily") -public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java deleted file mode 100644 index 35cac8e93f..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_monthly") -public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java deleted file mode 100644 index 318cfc19f4..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_quarterly") -public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java deleted file mode 100644 index 5680665c68..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_yearly") -public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java deleted file mode 100644 index 878f9d3428..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_daily") -public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java deleted file mode 100644 index 75243cc1cc..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_quarterly") -public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java deleted file mode 100644 index 9842520a5b..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_yearly") -public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java index 64fc2d99e0..4271cbe29e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.issue.impl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; @@ -13,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; @@ -167,6 +170,7 @@ public class IssueServiceImpl implements IssueService { } private String toRatio(BigDecimal data) { - return data.stripTrailingZeros().toString().concat("%"); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString().concat("%"); } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 35769c0a39..1d8871803d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -16,6 +16,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; @@ -43,8 +46,14 @@ public class ProjectServiceImpl implements ProjectService { //2:根据agencyId查询项目统计数据 ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); if (null != resultDTO) { - resultDTO.setPendingRatio(resultDTO.getPendingRatioInt().stripTrailingZeros().toString() + "%"); - resultDTO.setClosedRatio(resultDTO.getClosedRatioInt().stripTrailingZeros().toString() + "%"); + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); + //四舍五入保留小数点后四位 + BigDecimal pendingRatio = resultDTO.getPendingRatioInt().setScale(4, RoundingMode.HALF_UP); + //将小数转成百分比 + resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); + resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); } return resultDTO; } @@ -62,8 +71,12 @@ public class ProjectServiceImpl implements ProjectService { //2:根据agencyId查询各状态统计数据 resultList = projectDao.selectSummaryInfo(agencyId); if (null != resultList && resultList.size() > NumConstant.ZERO) { + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); resultList.forEach(sum -> { - sum.setRatio(sum.getRatioInt().stripTrailingZeros().toString() + "%"); + //先四舍五入保留四位小数再把小数转成百分比 + sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); }); } return resultList; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java index 5d3ee0c762..9eccb5b29f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java @@ -18,9 +18,12 @@ package com.epmet.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.publicity.dto.result.*; +import org.apache.commons.lang3.StringUtils; +import java.util.Date; import java.util.List; /** @@ -36,7 +39,7 @@ public interface PublicityService { * @param tokenDto * @author jyy */ - FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); + FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); /** * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 @@ -52,5 +55,24 @@ public interface PublicityService { */ public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + public List subagencyPublishedarticle(TokenDto tokenDto, String type) ; + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + public List departmentPublishedarticle(TokenDto tokenDto, String type); + + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + public List subgridPublishedarticle(TokenDto tokenDto, String type); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index fecabf3eaf..10f19b3ea0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -19,24 +19,17 @@ package com.epmet.service.publicity.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dao.publicity.FactArticlePublishedAgencyDailyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyMonthlyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyQuarterlyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyYearlyDao; +import com.epmet.dao.publicity.PublicityDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; - -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.publicity.dto.result.*; import com.epmet.service.publicity.PublicityService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.Date; import java.util.List; @@ -48,15 +41,8 @@ import java.util.List; */ @Service public class PublicityServiceImpl implements PublicityService { - - @Autowired - private FactArticlePublishedAgencyDailyDao factArticlePublishedAgencyDailyDao;//机关每日发文 @Autowired - private FactTagViewedAgencyMonthlyDao factTagViewedAgencyMonthlyDao;//机关-每月-阅读 - @Autowired - private FactTagViewedAgencyQuarterlyDao factTagViewedAgencyQuarterlyDao;//机关-每季度-阅读 - @Autowired - private FactTagViewedAgencyYearlyDao factTagViewedAgencyYearlyDao;//机关-每年-阅读 + private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -66,15 +52,16 @@ public class PublicityServiceImpl implements PublicityService { * @author jyy */ @Override - public FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { + public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); - return factArticlePublishedAgencyDailyDao.summaryInfo(agencyId); + agencyId="b9e295f8c1906a0d1c5e0b313afcda3f"; + return publicityDao.summaryInfo(agencyId); } /** * @param tokenDto,formDTO - * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @Description 宣传能力—工作端-获取阅读最多的分类数据 * @author jyy */ @Override @@ -87,26 +74,23 @@ public class PublicityServiceImpl implements PublicityService { if (StringUtils.equals("month", type)) {//当月 String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); - return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); - return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 - - return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); } else { return null; } - - } /** - * @param tokenDto,pageSize,type - * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @param tokenDto pageSize type + * @Description 宣传能力—工作端-获取发表最多的分类数据 * @author jyy */ @Override @@ -119,21 +103,105 @@ public class PublicityServiceImpl implements PublicityService { if (StringUtils.equals("month", type)) {//当月 String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); - return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); - return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + } + + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + @Override + public List subagencyPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "1041fe5e8499dbd8add314291d2f6da4"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubAgencyPublishedYear(agencyId, yearId); + + } else { + return null; + } + } - return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + @Override + public List departmentPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubDepartPublishedYear(agencyId, yearId); } else { return null; } + } + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + @Override + public List subgridPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubGridPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubGridPublishedYear(agencyId, yearId); + } else { + return null; + } } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 9b8dace788..128cdf183c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -158,8 +158,9 @@ public class TopicServiceImpl implements TopicService { String agencyId = this.getLoginUserDetails(tokenDto); List topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); - int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED; - String ratio = String.valueOf(i) + TopicConstant.RATIO; + Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); + String ratio; + ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : (shiftedCount.getShiftedIssueCount() / collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); result.setName(TopicConstant.SHIFTED); result.setRatio(ratio); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index dbc4d20f2e..655b6febae 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -89,7 +89,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); } if(null!=userSummaryInfoResultDTO){ - userSummaryInfoResultDTO.setCurrentDate(DateUtils.getDatePointPattern(userSummaryInfoResultDTO.getCurrentDate())); + userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); @@ -295,6 +295,131 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { **/ @Override public List incrTrend(UserIncrTrendFormDTO formDTO) { - return null; + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + List dimList = this.initUserIncrTrendResultDTO(formDTO.getType()); + if(CollectionUtils.isEmpty(dimList)){ + logger.error("横坐标初始失败"); + return new ArrayList<>(); + } + List list=new ArrayList<>(); + if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //注册用户数、日 + list=userAnalysisDao.selectRegDayIncr(myAgencyId); + } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //注册用户数、月 + list=userAnalysisDao.selectRegMonthIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //参与用户数、日 + list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //参与用户数、月 + list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); + } else { + logger.error("参数错误"); + return new ArrayList<>(); + } + for(UserIncrTrendResultDTO dim:dimList){ + boolean flag=false; + for(UserIncrTrendResDTO userIncrTrendResDTO:list){ + if(dim.getDateOrMonthId().equals(userIncrTrendResDTO.getDateIdOrMonthId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + switch(dim.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dim.setValue(userIncrTrendResDTO.getRegIncr()); + break; + case UserAnalysisConstant.WARMHEARTED: + dim.setValue(userIncrTrendResDTO.getWarmIncr()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dim.setValue(userIncrTrendResDTO.getPartymemberIncr()); + break; + default: + break; + } + + } + } + if(!flag){ + logger.error(String.format("机关id%s缺少记录dateOrMonthId=%s",myAgencyId,dim.getDateOrMonthId())); + } + } + return dimList; + } + + private List initUserIncrTrendResultDTO(String type) { + List list=new ArrayList<>(); + if(UserAnalysisConstant.DAY_TYPE.equals(type)){ + List dateIdList= DateUtils.getDaysBetween(DateUtils.getBeforeNDay(90), + DateUtils.getBeforeNDay(1)); + for(String dateId:dateIdList){ + String date=DateUtils.getxAxisDatePattern(dateId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(dateId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(dateId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(dateId); + list.add(resi); + list.add(warm); + list.add(party); + } + }else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){ + List monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12), + DateUtils.getBeforeNMonth(1)); + for(String monthId:monthList){ + String date=DateUtils.getxAxisDatePattern(monthId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(monthId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(monthId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(monthId); + list.add(resi); + list.add(warm); + list.add(party); + } + } + return list; } + + + /*public static void main(String[] args) { +// System.out.println("前一天"+DateUtils.getBeforeNDay(1)); +// System.out.println("前90天"+DateUtils.getBeforeNDay(90)); + List list= DateUtils.getDaysBetween("201912","202005"); + for(String m:list){ + System.out.println(m); + } +// System.out.println(list.size()); + System.out.println("上个月"+DateUtils.getBeforeNMonth(1)); + System.out.println("前8个月"+DateUtils.getBeforeNMonth(8)); + + }*/ + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index cde009a097..ad10364cb5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -137,8 +137,13 @@ - - + + + + + + + @@ -151,7 +156,13 @@ - + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml index b9b83d0f2f..bb9e3b4747 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -33,8 +33,9 @@ INNER JOIN dim_agency da ON fiad.AGENCY_ID = da.ID WHERE fiad.DEL_FLAG = '0' - AND PID = #{agencyId} + AND fiad.PID = #{agencyId} GROUP BY AGENCY_ID + ORDER BY fiad.ISSUE_TOTAL DESC - SELECT - article_total_count AS publishedTotal, - article_published_count AS publishingTotal, - DATE_FORMAT( date_id, '%Y-%m-%d' ) AS dateName - FROM fact_article_published_agency_daily - AND agency_id = #{agencyId} - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml deleted file mode 100644 index 9ea91a5f1a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml deleted file mode 100644 index a38deee2c2..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml deleted file mode 100644 index f4806e8e40..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml deleted file mode 100644 index 9c10faf1b1..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml deleted file mode 100644 index 3384db1368..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml deleted file mode 100644 index 9800e7e6d8..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml deleted file mode 100644 index 937da74e63..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml deleted file mode 100644 index 5ff395280d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml deleted file mode 100644 index e0b274080d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml deleted file mode 100644 index 0c7fa42162..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml deleted file mode 100644 index dab09fcbc0..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml deleted file mode 100644 index e54d037353..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml deleted file mode 100644 index 347c54204a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml new file mode 100644 index 0000000000..ccd4fb657e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index f00dc28baf..408cf17e61 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -146,4 +146,74 @@ AND m.DATE_ID = #{dateId} AND m.AGENCY_ID = #{agencyId} + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java index 255b463cdb..f7eccf24b1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -29,4 +29,8 @@ public interface GroupConstant { String CITY = "city"; String PROVINCE = "province"; + String ERRORGRIDDAILY = "groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; + + String ERRORAGENCYDAILY = "groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java new file mode 100644 index 0000000000..4c2f1033c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/23 13:54 + */ +@Data +public class GridIdListByCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = -4170349451726088582L; + + /** + * 网格ID + */ + private String GridId; + + /** + * 机关ID + */ + private String agencyId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java index 73045ccb3c..b0ff888330 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java @@ -18,6 +18,10 @@ public class MonthProjectListFormDTO implements Serializable { * 客户Id */ private String customerId; + /** + * 月维度Id + */ + private String monthId; /** * 机关Id @@ -29,14 +33,4 @@ public class MonthProjectListFormDTO implements Serializable { */ private String gridId; - /** - * 起始时间 - */ - private Date startTime; - - /** - * 结束时间 - */ - private Date endTime; - } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java index ec57f7d823..9596c7a2a2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java @@ -44,6 +44,11 @@ public class ArticleGridPublishedSummaryDTO implements Serializable { * 发布文章总数 */ private Integer articleTotalCount; + + /** + * 今日发布文章数 + */ + private Integer publishedCount; /** * 状态为发布中的文章总数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java similarity index 78% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 01c9953043..b19cd277b5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -1,8 +1,8 @@ -package feign; +package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import feign.impl.DataStatisticalOpenFeignClientFallBack; +import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.PostMapping; * @date: 2020/6/22 17:39 * @author: jianjun liu */ -@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class) +@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class) public interface DataStatisticalOpenFeignClient { /** @@ -104,4 +104,28 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statsgroup/groupagencymonthly") Result groupAgencyMonthly(); + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:34 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/statsissue/issuestats") + Result agencyGridIssueStats(); + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/agencyprojectstats") + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/gridprojectstats") + Result gridProjectStats(); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java similarity index 70% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 1ccec983eb..336020e353 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -1,9 +1,9 @@ -package feign.impl; +package com.epmet.feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import feign.DataStatisticalOpenFeignClient; +import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; /** @@ -25,7 +25,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result articleSummaryDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob"); } /** @@ -37,7 +37,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagUsedDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob"); } /** @@ -48,7 +48,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagUsedMonthlyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob"); } /** @@ -59,7 +59,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagUsedQuarterlyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob"); } /** @@ -70,7 +70,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagViewedDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob"); } /** @@ -81,7 +81,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagViewedMonthlyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob"); } /** @@ -92,21 +92,44 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp */ @Override public Result tagViewedQuarterlyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob"); } @Override public Result groupGridDaily() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily"); } @Override public Result groupAgencyDaily() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily"); } @Override public Result groupAgencyMonthly() { - return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly"); + } + + @Override + public Result agencyGridIssueStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats"); + } + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats"); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java index e67b29c4b8..0b1bd0eb47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -3,7 +3,9 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsProjectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 数据统计-项目 @@ -18,11 +20,21 @@ public class StatsProjectController { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ - @PostMapping("projectstats") - public Result agencyGridProjectStats() { - statsProjectService.agencyGridProjectStats(); + @PostMapping("agencyprojectstats") + public Result agencyProjectStats() { + statsProjectService.agencyProjectStats(); + return new Result(); + } + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + @PostMapping("gridprojectstats") + public Result gridProjectStats() { + statsProjectService.gridProjectStats(); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 846dde48e8..faccf553a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -57,5 +58,5 @@ public interface CustomerGridDao extends BaseDao { * @param dateId * @author zxc */ - List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); + List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java index be302f14a7..c6ee47eb10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactIssueAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 议题数量(按日) @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueAgencyDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java index acaf6e5d1b..6f9933bf1a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -42,5 +42,14 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao */ List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java index 7249383370..595131257d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactIssueGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 网格议题数量(按日) @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueGridDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 2e9c335661..502363d1b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -42,4 +42,14 @@ public interface FactIssueGridMonthlyDao extends BaseDao */ List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ 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 index df01214d40..8ad5156de5 100644 --- 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 @@ -23,7 +23,6 @@ import com.epmet.entity.voice.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import java.util.Date; import java.util.List; /** @@ -43,15 +42,14 @@ public interface ArticleDao extends BaseDao { * @param publisherType * @return */ - List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); + List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") String publishDate, @Param("publisherType") String publisherType); /** * desc:根据客户Id 和发布时间 获取文章数据 * * @param customerId * @param publishDate - * @param publisherType * @return */ - List getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); + List getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") String publishDate); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java similarity index 76% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java index 524f2dafe0..30c8117e51 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleOperateRecordDao.java @@ -15,19 +15,19 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridDailyEntity; +import com.epmet.entity.voice.ArticleOperateRecordEntity; import org.apache.ibatis.annotations.Mapper; /** - * 文章引用标签阅读数量【网格】日统计表 + * 文章操作记录表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 + * @since v1.0.0 2020-06-17 */ @Mapper -public interface FactTagViewedGridDailyDao extends BaseDao { +public interface ArticleOperateRecordDao extends BaseDao { } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java index 631f21fa49..1bd71f4989 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java @@ -55,6 +55,11 @@ public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { */ private Integer articleTotalCount; + /** + * 今日发布文章数 + */ + private Integer publishedCount; + /** * 当前发文数量 当前未下线的文章数量 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java index 96e8ae407f..114dd2d8d8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java @@ -55,6 +55,11 @@ public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { */ private Integer articleTotalCount; + /** + * 今日发布文章数 + */ + private Integer publishedCount; + /** * 当前发文数量 当前未下线的文章数量 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java index 94d209d414..d1cd23de07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java @@ -55,6 +55,11 @@ public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { */ private Integer articleTotalCount; + /** + * 今日发布文章数 + */ + private Integer publishedCount; + /** * 当前发文数量 当前未下线的文章数量 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java similarity index 62% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java index eeae33a44a..3efa67d17f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleOperateRecordEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.publicity; +package com.epmet.entity.voice; import com.baomidou.mybatisplus.annotation.TableName; @@ -26,51 +26,51 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 文章引用标签阅读数量【网格】月统计表 + * 文章操作记录表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 + * @since v1.0.0 2020-06-17 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_monthly") -public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { +@TableName("article_operate_record") +public class ArticleOperateRecordEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; /** - * 客户ID 客户ID + * 客户ID */ private String customerId; /** - * 文章发布所属机关ID 文章发布所属机关ID + * 文章ID */ - private String agencyId; + private String articleId; /** - * 网格ID + * 网格ID,下线文章时,多个以英文:隔开 */ - private String gridId; + private String gridIds; /** - * 标签ID 标签ID + * 执行人 xx街道-xx中心-姓名 */ - private String tagId; + private String opUser; /** - * 标签名称 标签名称 + * 操作内容 操作内容,eg:重新编辑文章; */ - private String tagName; + private String content; /** - * 文章引用标签阅读数 文章引用标签阅读数 + * 操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settop;下线文章:offline;修改文章发布范围:updatepublishrange */ - private Integer tagReadCount; + private String opType; /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + * 操作时间 */ - private String monthId; + private Date opTime; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java index 996d4c6e7d..739e69a780 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -8,7 +8,13 @@ public interface StatsProjectService { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ - void agencyGridProjectStats(); + void agencyProjectStats(); + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + void gridProjectStats(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index be00cca1dd..a6d61a756e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,7 +1,6 @@ package com.epmet.service.group; import com.epmet.dto.group.result.*; -import com.epmet.entity.stats.DimGridEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -18,7 +17,7 @@ public interface GroupDataService { * @param customerId * @author zxc */ - List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); + List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); /** * @Description 获取同级机关下网格下的小组数量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 0aa22e72ec..1cdc3acdcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -36,7 +36,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @author zxc */ @Override - public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { + public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { List result = new ArrayList<>(); if (gridsInfo.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -46,7 +46,7 @@ public class GroupDataServiceImpl implements GroupDataService { GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); - dailyResult.setGridId(grid.getId()); + dailyResult.setGridId(grid.getGridId()); dailyResult.setCustomerId(customerId); result.add(dailyResult); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index ff97cf767b..90404da3be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -104,7 +104,7 @@ public class StatsDimServiceImpl implements StatsDimService { lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_AGENCY); } - Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsEndTime = new Date(); Date statsStartTime = null; if (lastExecRecord.getExecTime() != null) { statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); @@ -126,7 +126,7 @@ public class StatsDimServiceImpl implements StatsDimService { lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_CUSTOMER); } - Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsEndTime = new Date(); Date statsStartTime = null; if (lastExecRecord.getExecTime() != null) { statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); @@ -145,7 +145,7 @@ public class StatsDimServiceImpl implements StatsDimService { lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT); } - Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsEndTime = new Date(); Date statsStartTime = null; if (lastExecRecord.getExecTime() != null) { statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 03828f3352..67647f3f32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,18 +1,19 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; -import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,7 @@ import java.util.stream.Collectors; * @CreateTime 2020/6/16 14:14 */ @Service +@Slf4j public class StatsGroupServiceImpl implements StatsGroupService { @Autowired @@ -58,17 +60,26 @@ public class StatsGroupServiceImpl implements StatsGroupService { public void groupGridDaily(Date date) { Integer pageNo = NumConstant.ONE; Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - List gridsInfo = dimGridService.getGridListByCustomerId(customerId); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); - }); + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() != NumConstant.ZERO){ + customerIds.forEach(customerId -> { + try { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + +// List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); + + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + } catch (Exception e) { + log.error(GroupConstant.ERRORGRIDDAILY+customerId,e); + } + }); + } + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); } /** @@ -79,17 +90,22 @@ public class StatsGroupServiceImpl implements StatsGroupService { public void groupAgencyDaily(Date date) { Integer pageNo = NumConstant.ONE; Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - customerIds.forEach(customerId -> { - - List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); - }); + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize); + if (customerIds.size() != NumConstant.ZERO){ + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + customerIds.forEach(customerId -> { + try { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + } catch (Exception e) { + log.error(GroupConstant.ERRORAGENCYDAILY+customerId,e); + } + }); + } + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); } /** @@ -136,12 +152,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); // TODO 1. 机关下有多少网格 - List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(0); if (customerGridIdList.size() != NumConstant.ZERO){ customerGridIdList.forEach(gridId -> { allGrid.forEach(allAgencyGrid -> { - if (gridId.equals(allAgencyGrid)){ + if (gridId.getGridId().equals(allAgencyGrid)){ gridSize.updateAndGet(v -> v + NumConstant.ONE); } }); @@ -258,6 +274,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { /** * @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId + * 如果有自定义时间,根据自定义时间获取时间维度 + * 没有自定义时间,默认获取前一天的时间维度 * @param * @author zxc */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 6da113060e..fd6ffe7b88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -96,6 +96,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { String dateString = DateUtils.format(date); DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyDailyService.deleteByCustomerId(customerId, dimId.getDateId()); //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 @@ -110,8 +114,6 @@ public class StatsIssueServiceImpl implements StatsIssueService { List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); //已结案项目增量 List projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString); - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); List list = new ArrayList<>(); for (DimAgencyDTO agency : agencyList) { @@ -149,7 +151,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { list.add(entity); } //批量插入 - factIssueAgencyDailyService.insertBatch(list); + factIssueAgencyDailyService.saveList(list); } @Override @@ -157,6 +159,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { String dateString = DateUtils.format(date); DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 @@ -165,11 +171,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); //已结案项目统计 List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //统计机关下议题各个指标月度增量 List issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId()); - List list = new ArrayList<>(); for (DimAgencyDTO agency : agencyList) { FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId); @@ -215,7 +218,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { list.add(monthly); } //批量插入 - factIssueAgencyMonthlyService.insertBatch(list); + factIssueAgencyMonthlyService.saveList(list); } @Override @@ -225,6 +228,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { dimAgencyDTO.setCustomerId(customerId); //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridDailyService.deleteByCustomerId(customerId, dimId.getDateId()); //获取客户下所有网格数据 List gridList = dimGridService.getGridListByCustomerId(customerId); //获取网格下议题各种状态的数目统计 @@ -241,6 +246,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); //已结案项目增量 List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); Map unResolveMap = new HashMap<>(); Map resolveIncMap = new HashMap<>(); @@ -313,7 +319,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); list.add(entity); } - factIssueGridDailyService.insertBatch(list); + factIssueGridDailyService.saveList(list); } @Override @@ -323,6 +329,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { dimAgencyDTO.setCustomerId(customerId); //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); //获取客户下所有网格数据 List gridList = dimGridService.getGridListByCustomerId(customerId); //获取网格下议题各种状态的数目统计 @@ -383,12 +391,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setClosedCaseResolvedTotal(resolve); monthly.setClosedCaseUnresolvedTotal(unResolve); if(total > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolve); BigDecimal unresolved = new BigDecimal(unResolve); BigDecimal closed = new BigDecimal(total); - monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } //各指标增量统计 @@ -413,7 +420,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setGridId(grid.getId()); list.add(monthly); } - factIssueGridMonthlyService.insertBatch(list); + factIssueGridMonthlyService.saveList(list); } /** @@ -443,12 +450,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseResolvedIncr(resolveInc); entity.setClosedCaseUnresolvedIncr(unResolveInc); if(total != NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolve); BigDecimal unresolved = new BigDecimal(unResolve); BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -513,12 +519,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); if(entity.getClosedTotal() > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -597,14 +602,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedTotal(closedCount); entity.setIssueTotal(issueTotal); if (NumConstant.ZERO != issueTotal) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal voting = new BigDecimal(votingCount); BigDecimal shift = new BigDecimal(shiftCount); BigDecimal closed = new BigDecimal(closedCount); BigDecimal total = new BigDecimal(issueTotal); - entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -676,12 +680,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseUnresolvedTotal(unresolvedCount); entity.setClosedCaseTotal(total); if (total > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -763,14 +766,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedTotal(closedCount); entity.setIssueTotal(issueTotal); if (NumConstant.ZERO != issueTotal) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal voting = new BigDecimal(votingCount); BigDecimal shift = new BigDecimal(shiftCount); BigDecimal closed = new BigDecimal(closedCount); BigDecimal total = new BigDecimal(issueTotal); - entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -806,12 +808,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); if (entity.getClosedTotal() > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index 3525e45f97..1e5cac4aac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -14,8 +14,9 @@ import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -34,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Service public class StatsProjectServiceImpl implements StatsProjectService { + protected static final Logger log = LoggerFactory.getLogger(StatsProjectServiceImpl.class); @Autowired private DimCustomerService dimCustomerService; @Autowired @@ -57,10 +59,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ @Override - public void agencyGridProjectStats() { + public void agencyProjectStats() { int pageNo = 1; int pageSize = 100; List customerIdList = null; @@ -68,8 +70,13 @@ public class StatsProjectServiceImpl implements StatsProjectService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - //遍历统计每一个客户数据 - customerStats(customerId); + try { + //遍历统计每一个客户数据 + customerAgencyStats(customerId); + } catch (Exception e) { + log.error("项目-机关-数据统计程序错误,对应客户Id:"+customerId, e); + log.error("Error creating model JSON", e); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -77,11 +84,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { /** * @Author sun - * @Description 一个客户一个线程, 分别统计机关/网格日/月数据 + * @Description 分别统计机关日/月数据 **/ - @Async - public void customerStats(String customerId) { - Date date = new Date(); + public void customerAgencyStats(String customerId) { + Date date = yesterDay(); //1:查询各维度表Id,方便使用 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); @@ -90,39 +96,25 @@ public class StatsProjectServiceImpl implements StatsProjectService { dimAgencyDTO.setCustomerId(customerId); List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); - //3:根据客户Id查询网格维度表数据 - List dimGridList = dimGridService.getGridListByCustomerId(customerId); - - //4:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); projectEntity.setStatus(ProjectConstant.CLOSED); List projectList = projectService.getProjectList(projectEntity); - //5:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) List processList = projectProcessService.getProcessList(projectEntity); - //6:机关层级日月统计 + //5:机关层级日月统计 if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { - //6.1:执行机关日数据统计 + //5.1:执行机关日数据统计 agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); - //6.2:执行机关月数据统计 - if (Calendar.getInstance().get(Calendar.DATE) == 1) { + //5.2:执行机关月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { agencyMonthProjectStats(customerId, dimId, dimAgencyList); - } - } - - //7:网格层级日月统计 - if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { - //7.1:执行网格日数据统计 - gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); - - //7.2:执行网格月数据统计 - if (Calendar.getInstance().get(Calendar.DATE) == 1) { - gridMonthProjectStats(customerId, dimId, dimGridList); - } + //} } } @@ -138,7 +130,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectDateEntityList = new ArrayList<>(); //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(2); + numberFormat.setMaximumFractionDigits(6); //1:遍历机关维度数据,统计每个机关各项指标数 for (DimAgencyDTO agency : dimAgencyList) { @@ -232,12 +224,12 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue()); agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); if (projectTotal.intValue() > NumConstant.ZERO) { - agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); - agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); } if (closedTotal.intValue() > NumConstant.ZERO) { - agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); - agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } agencyDailyEntity.setProjectIncr(projectIncr.intValue()); agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); @@ -276,8 +268,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { //1:获取昨天日期所在月份的起始日期和结束日期 MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); formDTO.setCustomerId(customerId); - formDTO.setStartTime(getMonthBegin(date)); - formDTO.setEndTime(getMonthEnd(date)); + formDTO.setMonthId(dimId.getMonthId()); //2:遍历机关维度数据,分别统计每个组织月数据 for (DimAgencyDTO agency : dimAgencyList) { @@ -342,6 +333,65 @@ public class StatsProjectServiceImpl implements StatsProjectService { } + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @Override + public void gridProjectStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerGridStats(customerId); + } 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 分别统计网格日/月数据 + **/ + public void customerGridStats(String customerId) { + Date date = yesterDay(); + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(customerId); + projectEntity.setCreatedTime(date); + projectEntity.setStatus(ProjectConstant.CLOSED); + List projectList = projectService.getProjectList(projectEntity); + + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + List processList = projectProcessService.getProcessList(projectEntity); + + //5:网格层级日月统计 + if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { + //5.1:执行网格日数据统计 + gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); + + //5.2:执行网格月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { + gridMonthProjectStats(customerId, dimId, dimGridList); + //} + } + + } /** * @param customerId * @return @@ -354,7 +404,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List gridDateEntityList = new ArrayList<>(); //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(2); + numberFormat.setMaximumFractionDigits(6); //1:根据客户Id查询议题库已转项目的网格项目关系数据 List gridProjectList = issueService.getGridProjectList(customerId); @@ -448,12 +498,12 @@ public class StatsProjectServiceImpl implements StatsProjectService { gridDailyEntity.setResolvedTotal(resolvedTotal.intValue()); gridDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); if (projectTotal.intValue() > NumConstant.ZERO) { - gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); - gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); } if (closedTotal.intValue() > NumConstant.ZERO) { - gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); - gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } gridDailyEntity.setProjectIncr(projectIncr.intValue()); gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); @@ -489,15 +539,14 @@ public class StatsProjectServiceImpl implements StatsProjectService { //批量月数据新增对象 List monthlyEntityList = new ArrayList<>(); - //1:获取昨天日期所在月份的起始日期和结束日期 + //1:查询客户网格月份内日统计数据 MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); formDTO.setCustomerId(customerId); - formDTO.setStartTime(getMonthBegin(yesterDay())); - formDTO.setEndTime(getMonthEnd(yesterDay())); + formDTO.setMonthId(dimId.getMonthId()); //2:遍历网格维度数据,分别统计每个网格月数据 for (DimGridEntity grid : dimGridList) { - //2.1:查询上一月网格日统计数据,按时间倒序 + //2.1:查询当前月网格日统计数据,按时间倒序 formDTO.setGridId(grid.getId()); List projectDailyList = factGridProjectDailyService.getMonthProjectList(formDTO); @@ -575,46 +624,4 @@ public class StatsProjectServiceImpl implements StatsProjectService { return date; } - /** - * @Author sun - * @Description 获取指定日期所在月份开始的时间 - **/ - public Date getMonthBegin(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - //设置为1号,当前日期既为本月第一天 - c.set(Calendar.DAY_OF_MONTH, 1); - //将小时至0 - c.set(Calendar.HOUR_OF_DAY, 0); - //将分钟至0 - c.set(Calendar.MINUTE, 0); - //将秒至0 - c.set(Calendar.SECOND, 0); - //将毫秒至0 - c.set(Calendar.MILLISECOND, 0); - //获取本月第一天的时间 - return c.getTime(); - } - - /** - * @Author sun - * @Description 获取指定日期所在月份结束的时间 - **/ - public Date getMonthEnd(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - //设置为当月最后一天 - c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH)); - //将小时至23 - c.set(Calendar.HOUR_OF_DAY, 23); - //将分钟至59 - c.set(Calendar.MINUTE, 59); - //将秒至59 - c.set(Calendar.SECOND, 59); - //将毫秒至999 - c.set(Calendar.MILLISECOND, 999); - //获取本月最后一天的时间 - return c.getTime(); - } - } \ No newline at end of file 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 index 19d89bbe11..e21c1e1488 100644 --- 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 @@ -14,6 +14,7 @@ import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; +import com.epmet.service.voice.ArticleOperateRecordService; import com.epmet.service.voice.ArticleService; import com.epmet.service.voice.ArticleTagsService; import com.epmet.service.voice.ArticleVisitRecordService; @@ -55,6 +56,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticleVisitRecordService articleVisitRecordService; @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Autowired private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @@ -107,27 +110,26 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { public Boolean articleSummaryDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { - //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + //查询的是昨天及以前的数据 + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN); } else { - statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); int pageNo = 1; int pageSize = 100; List customerIdList = null; + String statsDateStr = DateUtils.format(statsDate); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - Date finalStatsDate = statsDate; - try { //key:所在机关Id Map agencySummaryMap = new HashMap<>(); - statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); - statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); - statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedGridDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); + statsPublishedDepartmentDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); + statsPublishedAgencyDaily(statsDateStr, dimIdBean, customerId, agencySummaryMap); } catch (Exception e) { log.error("articlePublishedCountDayStats exception", e); } @@ -157,10 +159,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - executorService.submit(() -> { + //executorService.submit(() -> { //统计 statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); - }); + //}); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -334,7 +336,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { return true; } - private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + private void statsPublishedDepartmentDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有客户 List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); if (CollectionUtils.isEmpty(departmentDTOList)) { @@ -345,7 +347,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, statsDate); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { @@ -356,6 +358,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); //同一个机关下数据累加 buildAgencySummaryData(agencySummaryMap, summaryDTO); } @@ -381,10 +384,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { summary.setPublisherId(summaryDTO.getPublisherId()); summary.setArticleTotalCount(summaryDTO.getArticleTotalCount()); summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + summary.setPublishedCount(summaryDTO.getPublishedCount()); result.put(summaryDTO.getPublisherId(), summaryDTO); } else { publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount() + summaryDTO.getArticlePublishedCount()); publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount() + summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setPublishedCount(publishedSummaryDTO.getPublishedCount() + summaryDTO.getPublishedCount()); } } @@ -396,7 +401,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId * @param agencySummaryMap */ - private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + private void statsPublishedGridDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { @@ -404,29 +409,34 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { return; } executorService.submit(() -> { - //转换为 需要插入的Entity - Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntity == null) { - log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); - continue; + try { + //转换为 需要插入的Entity + Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntity == null) { + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + continue; + } + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntity.setPublishedCount(summaryDTO.getPublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } + boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + } catch (Exception e) { + log.error("statsPublishedGridDaily exception customerId:{},statsDate:{}", customerId, statsDate); } - boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); }); } - private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有机关 List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); if (CollectionUtils.isEmpty(agencyDTOList)) { @@ -434,6 +444,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { return; } executorService.submit(() -> { + try { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 @@ -449,6 +460,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); //同一个机关下数据累加 //buildAgencySummaryData(agencySummaryMap, summaryDTO); @@ -459,6 +471,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { selfDaily.setAgencyId(summaryDTO.getAgencyId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); selfDaily.setArticleTotalCount(summaryDTO.getArticleTotalCount()); selfDaily.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + selfDaily.setPublishedCount(summaryDTO.getPublishedCount()); haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); } } @@ -479,7 +492,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(haveDataAgencyDailySelfMap)) { agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); } + log.debug("statsPublishedAgencyDaily insert:{}",JSON.toJSONString(agencyDailyEntityMap.values())); boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + } catch (Exception e) { + e.printStackTrace(); + log.error("statsPublishedAgencyDaily exception,customer:{}",customerId); + } }); } @@ -492,77 +510,85 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { - //1.业务数据来源 发布时间为统计时间的 - // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 - // 1.1查出今天所有的文章标签 根据网格Id - // 1.2 - //获取所有网格 - List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); - if (CollectionUtils.isEmpty(agencyDTOList)) { - log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); - return; - } - //转换为 需要插入的Entity - Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); - //转换为 需要插入的Entity key gridId_tagId - Map tagUsedGridDailyMap = new HashMap<>(); - Map tagUsedDeptDailyMap = new HashMap<>(); - Map tagUsedAgencyDailyMap = new HashMap<>(); - Map tagUsedAgencyDailySelfMap = new HashMap<>(); - //获取当天的业务数据 - //1获取文章及机关id,网格Id - List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, statsDate); - if (CollectionUtils.isEmpty(publishedArticleList)) { - return; - } - //KEY 文章Id - Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o)); - Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); - Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); - //2 获取文章标签 - List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); - if (CollectionUtils.isEmpty(articleTagsList)) { - log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList)); - return; - } - //tagId - for (ArticleTagsEntity tagEntity : articleTagsList) { - ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); - if (articleEntity == null) { - log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + try { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有网格 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId()); - convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); - switch (articleEntity.getPublisherType()) { - case ProjectConstant.PUBLISHER_TYPE_GRID: - convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); - break; - case ProjectConstant.PUBLISHER_TYPE_DEPT: - convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); - break; - case ProjectConstant.PUBLISHER_TYPE_AGENCY: - convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); - break; + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagUsedGridDailyMap = new HashMap<>(); + Map tagUsedDeptDailyMap = new HashMap<>(); + Map tagUsedAgencyDailyMap = new HashMap<>(); + Map tagUsedAgencyDailySelfMap = new HashMap<>(); + //获取当天的业务数据 + //1获取文章及机关id,网格Id + List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, DateUtils.format(statsDate)); + if (CollectionUtils.isEmpty(publishedArticleList)) { + return; + } + //KEY 文章Id + Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o)); + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + //2 获取文章标签 + List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(articleTagsList)) { + log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList)); + return; + } + //tagId + for (ArticleTagsEntity tagEntity : articleTagsList) { + ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); + if (articleEntity == null) { + log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + return; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId()); + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + switch (articleEntity.getPublisherType()) { + case ProjectConstant.PUBLISHER_TYPE_GRID: + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_DEPT: + convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_AGENCY: + convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); + break; + } } - } - factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); - factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); - //向上级机关递归添加 数据 - Map finalTagUsedAgencyDailyMap = new HashMap<>(); - finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); - for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; - FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); - if (dimAgencyEntity == null) { - log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); - continue; + factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); + factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); + for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; + FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)){ + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); } - setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } catch (Exception e) { + e.printStackTrace(); + //log.error(); } - factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } /** @@ -610,7 +636,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (CollectionUtils.isEmpty(articleTagsList)) { continue; } - ArticleEntity articleEntity = articleService.selectById(viewedSummaryDTO.getArticleId()); + ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); if (articleEntity == null) { continue; } @@ -850,6 +876,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount() + agencySummary.getArticlePublishedCount()); + parentAgency.setPublishedCount(parentAgency.getPublishedCount() + agencySummary.getPublishedCount()); pid = parentAgency.getPid(); if (!NumConstant.ZERO_STR.equals(pid)) { setPublishedData2ParentAgency(agencyDailyEntityMap, agencySummary, parentAgency); @@ -872,6 +899,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(dimGridEntity.getId()); entity.setArticleTotalCount(0); entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); result.put(dimGridEntity.getId(), entity); }); return result; @@ -893,6 +921,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setDepartmentId(dimGridEntity.getId()); entity.setArticleTotalCount(0); entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); result.put(dimGridEntity.getId(), entity); }); return result; @@ -914,6 +943,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(dimGridEntity.getId()); entity.setArticleTotalCount(0); entity.setArticlePublishedCount(0); + entity.setPublishedCount(0); result.put(dimGridEntity.getId(), entity); }); return result; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index cd82c81628..00b46e8b75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -2,6 +2,7 @@ package com.epmet.service.org; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; @@ -30,5 +31,5 @@ public interface CustomerGridService { * @param dateId * @author zxc */ - List getCustomerGridIdList(String customerId,String dateId); + List getCustomerGridIdList(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index d3e7a51087..fc95a3de29 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.CustomerGridDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; +import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +43,7 @@ public class CustomerGridServiceImpl implements CustomerGridService { * @author zxc */ @Override - public List getCustomerGridIdList(String customerId, String dateId) { + public List getCustomerGridIdList(String customerId, String dateId) { return customerGridDao.getCustomerGridIdList(customerId, dateId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java index 40f9c9e472..9334a5637c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java @@ -92,4 +92,23 @@ public interface FactIssueAgencyDailyService extends BaseService list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java index ebd176bb4e..b388e8ee58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -102,4 +102,23 @@ public interface FactIssueAgencyMonthlyService extends BaseService */ List getAgencyMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java index 58beae9049..786f71ac90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java @@ -92,4 +92,23 @@ public interface FactIssueGridDailyService extends BaseService list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index 302c320653..a40b8c7236 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -102,4 +102,23 @@ public interface FactIssueGridMonthlyService extends BaseService */ List getGridMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index 48d8bbe0f7..9068ca2bdb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.stats.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; @@ -47,6 +48,7 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< } int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + log.debug("deleteAndInsertBatch insert customerId:{},values:{}", customerId, JSON.toJSONString(values)); this.insertBatch(values, 100); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java index b43614cc43..e6007e90d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java @@ -97,4 +97,16 @@ public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java index 47db53b737..7215ecb179 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -103,4 +103,16 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java index feebc25a82..063e2ef8c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -97,4 +97,16 @@ public class FactIssueGridDailyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 1c084b836a..d3b0468011 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -102,4 +102,16 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java similarity index 67% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java index 39abffa211..3a63203083 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleOperateRecordService.java @@ -15,19 +15,17 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.service.voice; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridYearlyEntity; -import org.apache.ibatis.annotations.Mapper; +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleOperateRecordEntity; /** - * 文章引用标签阅读数量【网格】年度统计表 + * 文章操作记录表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 + * @since v1.0.0 2020-06-17 */ -@Mapper -public interface FactTagViewedGridYearlyDao extends BaseDao { - +public interface ArticleOperateRecordService 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/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java index 5477d54cd2..ce6025a17a 100644 --- 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 @@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; -import java.util.Date; import java.util.List; /** @@ -40,27 +39,29 @@ public interface ArticleService extends BaseService { * @param publishDate * @return */ - List getAllDepartmentPublishedCount(String customerId, Date publishDate); + List getAllDepartmentPublishedCount(String customerId, String publishDate); /** * desc:根据客户id、发布时间 获取文章总数 * @param customerId * @param publishDate * @return */ - List getAllAgencyPublishedCount(String customerId, Date publishDate); + List getAllAgencyPublishedCount(String customerId, String publishDate); /** * desc:根据客户id、发布时间 获取文章总数 * @param customerId * @param publishDate * @return */ - List getAllGridPublishedCount(String customerId, Date publishDate); + List getAllGridPublishedCount(String customerId, String publishDate); /** * desc:根据客户id,发布时间 获取文章数据 * @param customerId - * @param statsDate + * @param publishDate * @return */ - List getPublishedArticleByPublishTime(String customerId, Date statsDate); + List getPublishedArticleByPublishTime(String customerId, String publishDate); + + ArticleEntity selectArticleById(String articleId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java similarity index 51% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java index 62655117ab..f1d464824f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleOperateRecordServiceImpl.java @@ -15,26 +15,26 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.service.voice.impl; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; +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.ArticleOperateRecordDao; +import com.epmet.entity.voice.ArticleOperateRecordEntity; +import com.epmet.service.voice.ArticleOperateRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; /** - * 文章引用标签阅读数量【机关】季度统计表 + * 文章操作记录表 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 + * @since v1.0.0 2020-06-17 */ -@Mapper -public interface FactTagUsedAgencyQuarterlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleOperateRecordServiceImpl extends BaseServiceImpl implements ArticleOperateRecordService { + } \ 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 index 08ce42e396..2a9bd8d17e 100644 --- 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 @@ -30,7 +30,6 @@ import com.epmet.service.voice.ArticleService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import java.util.Date; import java.util.List; /** @@ -44,19 +43,19 @@ import java.util.List; public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { @Override - public List getAllDepartmentPublishedCount(String customerId, Date publishDate) { + public List getAllDepartmentPublishedCount(String customerId, String publishDate) { checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_DEPT); } @Override - public List getAllAgencyPublishedCount(String customerId, Date publishDate) { + public List getAllAgencyPublishedCount(String customerId, String publishDate) { checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_AGENCY); } @Override - public List getAllGridPublishedCount(String customerId, Date publishDate) { + public List getAllGridPublishedCount(String customerId, String publishDate) { checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); } @@ -64,13 +63,21 @@ public class ArticleServiceImpl extends BaseServiceImpl getPublishedArticleByPublishTime(String customerId, Date publishDate) { + public List getPublishedArticleByPublishTime(String customerId, String publishDate) { checkParam(customerId, publishDate); - return baseDao.getPublishedArticleByDay(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); + return baseDao.getPublishedArticleByDay(customerId,publishDate); } - private void checkParam(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null) { + @Override + public ArticleEntity selectArticleById(String articleId) { + if (StringUtils.isBlank(articleId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.selectById(articleId); + } + + private void checkParam(String customerId, String publishDate) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(publishDate)) { throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index cd25dce6a9..81f9cb98f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -25,10 +25,11 @@ SET FOREIGN_KEY_CHECKS = 0; DROP TABLE IF EXISTS `fact_article_published_agency_daily`; CREATE TABLE `fact_article_published_agency_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', @@ -50,10 +51,11 @@ CREATE TABLE `fact_article_published_agency_daily` ( DROP TABLE IF EXISTS `fact_article_published_department_daily`; CREATE TABLE `fact_article_published_department_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', @@ -75,10 +77,11 @@ CREATE TABLE `fact_article_published_department_daily` ( DROP TABLE IF EXISTS `fact_article_published_grid_daily`; CREATE TABLE `fact_article_published_grid_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布单位所属机关ID 发布单位所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布单位所属机关ID 发布单位所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '今日发布文章数', `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', @@ -93,17 +96,16 @@ CREATE TABLE `fact_article_published_grid_daily` ( `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; - -- ---------------------------- -- Table structure for fact_tag_used_agency_daily -- ---------------------------- DROP TABLE IF EXISTS `fact_tag_used_agency_daily`; CREATE TABLE `fact_tag_used_agency_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', @@ -126,10 +128,10 @@ CREATE TABLE `fact_tag_used_agency_daily` ( DROP TABLE IF EXISTS `fact_tag_used_agency_monthly`; CREATE TABLE `fact_tag_used_agency_monthly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', @@ -150,11 +152,11 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( DROP TABLE IF EXISTS `fact_tag_used_agency_quarterly`; CREATE TABLE `fact_tag_used_agency_quarterly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', - `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -173,10 +175,10 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( DROP TABLE IF EXISTS `fact_tag_used_agency_yearly`; CREATE TABLE `fact_tag_used_agency_yearly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -195,11 +197,11 @@ CREATE TABLE `fact_tag_used_agency_yearly` ( DROP TABLE IF EXISTS `fact_tag_used_department_daily`; CREATE TABLE `fact_tag_used_department_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID', - `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', @@ -222,10 +224,10 @@ CREATE TABLE `fact_tag_used_department_daily` ( DROP TABLE IF EXISTS `fact_tag_used_department_monthly`; CREATE TABLE `fact_tag_used_department_monthly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', @@ -246,11 +248,11 @@ CREATE TABLE `fact_tag_used_department_monthly` ( DROP TABLE IF EXISTS `fact_tag_used_department_quarterly`; CREATE TABLE `fact_tag_used_department_quarterly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', - `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -269,10 +271,10 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( DROP TABLE IF EXISTS `fact_tag_used_department_yearly`; CREATE TABLE `fact_tag_used_department_yearly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -291,10 +293,10 @@ CREATE TABLE `fact_tag_used_department_yearly` ( DROP TABLE IF EXISTS `fact_tag_used_grid_daily`; CREATE TABLE `fact_tag_used_grid_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', @@ -317,10 +319,10 @@ CREATE TABLE `fact_tag_used_grid_daily` ( DROP TABLE IF EXISTS `fact_tag_used_grid_monthly`; CREATE TABLE `fact_tag_used_grid_monthly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', @@ -341,11 +343,11 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( DROP TABLE IF EXISTS `fact_tag_used_grid_quarterly`; CREATE TABLE `fact_tag_used_grid_quarterly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', - `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -364,10 +366,10 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( DROP TABLE IF EXISTS `fact_tag_used_grid_yearly`; CREATE TABLE `fact_tag_used_grid_yearly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -386,10 +388,10 @@ CREATE TABLE `fact_tag_used_grid_yearly` ( DROP TABLE IF EXISTS `fact_tag_viewed_agency_daily`; CREATE TABLE `fact_tag_viewed_agency_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', @@ -412,10 +414,10 @@ CREATE TABLE `fact_tag_viewed_agency_daily` ( DROP TABLE IF EXISTS `fact_tag_viewed_agency_monthly`; CREATE TABLE `fact_tag_viewed_agency_monthly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', @@ -436,10 +438,10 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( DROP TABLE IF EXISTS `fact_tag_viewed_agency_quarterly`; CREATE TABLE `fact_tag_viewed_agency_quarterly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', @@ -459,10 +461,10 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( DROP TABLE IF EXISTS `fact_tag_viewed_agency_yearly`; CREATE TABLE `fact_tag_viewed_agency_yearly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', @@ -481,10 +483,10 @@ CREATE TABLE `fact_tag_viewed_agency_yearly` ( DROP TABLE IF EXISTS `fact_tag_viewed_grid_daily`; CREATE TABLE `fact_tag_viewed_grid_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', @@ -507,10 +509,10 @@ CREATE TABLE `fact_tag_viewed_grid_daily` ( DROP TABLE IF EXISTS `fact_tag_viewed_grid_monthly`; CREATE TABLE `fact_tag_viewed_grid_monthly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', @@ -531,10 +533,10 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( DROP TABLE IF EXISTS `fact_tag_viewed_grid_quarterly`; CREATE TABLE `fact_tag_viewed_grid_quarterly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', @@ -554,10 +556,10 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( DROP TABLE IF EXISTS `fact_tag_viewed_grid_yearly`; CREATE TABLE `fact_tag_viewed_grid_yearly` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', - `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', - `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', - `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', - `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 0eb2f74b45..6a5253e473 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -36,9 +36,10 @@ - SELECT - id AS gridId + id AS gridId, + pid AS agencyId FROM customer_grid WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml index c9adcc2f29..eb6fc087bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -12,11 +12,7 @@ del_flag = '0' AND customer_id = #{customerId} AND agency_id = #{agencyId} - AND ( - DATE_FORMAT(created_time, "%Y-%m-%d") - BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") - AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") - ) + AND month_id = #{monthId} ORDER BY created_time DESC,project_total DESC diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml index 4dc999bba0..3f386bf7ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml @@ -12,11 +12,7 @@ del_flag = '0' AND customer_id = #{customerId} AND grid_id = #{gridId} - AND ( - DATE_FORMAT(created_time, "%Y-%m-%d") - BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") - AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") - ) + AND month_id = #{monthId} ORDER BY created_time DESC,project_total DESC diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml index 59d538fe2f..20262ed8d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml @@ -45,6 +45,9 @@ + + DELETE FROM fact_issue_agency_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index f6bdd808cb..430abbd36c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -43,6 +43,9 @@ + + DELETE FROM fact_issue_agency_monthly WHERE CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + SELECT 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 index a5fca9a9dc..0ecf25fb1b 100644 --- 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 @@ -34,12 +34,21 @@ ORG_ID AS agencyId, PUBLISHER_ID, count(ID) articleTotalCount, - sum( CASE STATUS_FLAG WHEN 'published' THEN 1 ELSE 0 END ) articlePublishedCount + sum( + CASE + WHEN STATUS_FLAG = 'published' THEN 1 + WHEN STATUS_FLAG = 'offline' AND date_format(OFF_LINE_TIME,'%Y-%m-%d') = #{publishDate,jdbcType=VARCHAR} THEN 1 + ELSE 0 END ) articlePublishedCount, + sum( + CASE PUBLISH_DATE + WHEN #{publishDate,jdbcType=VARCHAR} THEN 1 + ELSE 0 END + ) publishedCount FROM article WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND PUBLISH_DATE + AND PUBLISH_DATE AND DEL_FLAG = 0 AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} GROUP BY @@ -56,11 +65,10 @@ FROM article WHERE - PUBLISH_DATE = #{publishDate,jdbcType=TIMESTAMP} + PUBLISH_DATE = #{publishDate,jdbcType=VARCHAR} AND DEL_FLAG = 0 AND TAGS IS NOT NULL - AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR - AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} + AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml new file mode 100644 index 0000000000..3f2966b179 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleOperateRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml index 6fa78a1a12..c56d2e0cfd 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.7 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.9 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index f589819cb1..295e3985c4 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.7 + 0.3.9 com.epmet epmet-job diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java new file mode 100644 index 0000000000..23590743e6 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:38 + */ +public interface StatsIssueService { + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:39 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + Result agencyGridIssueStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java new file mode 100644 index 0000000000..473f8c798b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +public interface StatsProjectService { + + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + Result gridProjectStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index babf60f42b..4aec7898dd 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -2,13 +2,15 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsGroupService; -import feign.DataStatisticalOpenFeignClient; +import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; /** * @Author zxc * @CreateTime 2020/6/22 14:13 */ +@Service public class StatsGroupServiceImpl implements StatsGroupService { @Autowired diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java new file mode 100644 index 0000000000..a6415241cf --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:40 + */ +@Service +public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result agencyGridIssueStats() { + return dataStatisticalOpenFeignClient.agencyGridIssueStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java new file mode 100644 index 0000000000..0fb06aa23c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -0,0 +1,36 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +@Service +public class StatsProjectServiceImpl implements StatsProjectService { + + @Autowired + private DataStatisticalOpenFeignClient statsPublicityFeignClient; + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return statsPublicityFeignClient.agencyProjectStats(); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return statsPublicityFeignClient.gridProjectStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java index 6abfabaaa7..40368b169b 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java @@ -2,7 +2,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsPublicityTaskService; -import feign.DataStatisticalOpenFeignClient; +import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java index 2d850980a4..ef5b147ac8 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; /** * desc:标签被使用次数 日统计定时任务 */ -@Component("publicityTagUsedDailyStatsjob") +@Component("publicityTagUsedDailyStatsTask") public class PublicityTagUsedDailyStatsTask implements ITask { private Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java index df99756776..c0a7862b90 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java @@ -10,7 +10,7 @@ import org.springframework.stereotype.Component; /** * desc:标签被使用次数 【月、季、年】统计定时任务 */ -@Component("publicityTagUsedMonthlyStatsjob") +@Component("publicityTagUsedMonthlyStatsTask") public class PublicityTagUsedMonthlyStatsTask implements ITask { private Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java new file mode 100644 index 0000000000..a9a816139c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagUsedQuarterlyAndYearlyStatsTask") +public class PublicityTagUsedQuarterlyAndYearlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedQuarterlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java new file mode 100644 index 0000000000..15f52608bd --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagViewedQuarterlyAndYearlyhlyStatsTask") +public class PublicityTagViewedQuarterlyAndYearlyhlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagViewedMonthlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java index 99f2d1739a..695b4aae18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -24,7 +24,7 @@ public class StatsGroupAgencyDailyTask implements ITask { @Override public void run(String params) { logger.debug("StatsGroupAgencyDailyTask定时任务正在执行,参数为:{}", params); - Result result = statsGroupService.groupGridDaily(); + Result result = statsGroupService.groupAgencyDaily(); if (result.success()){ logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行成功"); }else { diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java index 675c63ea88..780ba44f18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java @@ -25,7 +25,7 @@ public class StatsGroupGridDailyTask implements ITask { @Override public void run(String params) { logger.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); - Result result = statsGroupService.groupAgencyDaily(); + Result result = statsGroupService.groupGridDaily(); if (result.success()){ logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); }else { diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java new file mode 100644 index 0000000000..20448d11d2 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.logging.Log; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:36 + */ +@Slf4j +@Component("statsIssueTask") +public class StatsIssueTask implements ITask { + @Autowired + private StatsIssueService statsIssueService; + + @Override + public void run(String params) { + log.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsIssueService.agencyGridIssueStats(); + if (result.success()){ + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java new file mode 100644 index 0000000000..fcb09dae46 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description 数据统计-项目-机关日月统计任务 + * @Author sun + */ +@Component("statsProjectAgencyTask") +public class StatsProjectAgencyTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectAgencyTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.agencyProjectStats(); + if (result.success()){ + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java new file mode 100644 index 0000000000..293aa82380 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java @@ -0,0 +1,35 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【网格-日】 + * + */ +@Component("statsProjectGridTask") +public class StatsProjectGridTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectGridTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.gridProjectStats(); + if (result.success()){ + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java new file mode 100644 index 0000000000..3bfac0e8f7 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java @@ -0,0 +1,30 @@ +package com.epmet.constant; + +/** + * 短信模板编码常亮 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 21:30 + */ +public interface SmsTemplateConstant { + + /** + * 登录确认验证码 + */ + String LGOIN_CONFIRM="SMS_150731396"; + + /** + * 用户注册验证码 + */ + String USER_REGISTER="SMS_150731394"; + + /** + * 信息变更验证码 + */ + String CHANGE_INFO="SMS_150731392"; + + /** + * 修改密码验证码 + */ + String CHANGE_PASSWORD = "SMS_150731393"; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java index 91eff10e8b..d698373e9f 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/SysSmsDTO.java @@ -54,5 +54,8 @@ public class SysSmsDTO implements Serializable { @ApiModelProperty(value = "参数列表") private String params; - + /** + * 短信模板编码 来源于SmsTemplateConstant + */ + private String aliyunTemplateCode; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java new file mode 100644 index 0000000000..97aaa8549b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendVerificationCodeFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 根据手机号、短信模板编码,发送短信 验证码 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 20:58 + */ +@Data +public class SendVerificationCodeFormDTO implements Serializable { + private static final long serialVersionUID = 8894395590639206399L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String mobile; + + /** + * 场景: + */ + @NotBlank(message = "短信模板编码不能为空", groups = {AddUserInternalGroup.class}) + private String aliyunTemplateCode; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.java new file mode 100644 index 0000000000..2442da7cb1 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendVerificationCodeResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 短信验证码 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 21:37 + */ +@Data +public class SendVerificationCodeResultDTO implements Serializable { + /** + * 短信验证码 + */ + private String code; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index ba775e2546..76ac6ca878 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -1,5 +1,12 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; @@ -7,11 +14,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.SysSmsDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -44,4 +47,23 @@ public interface EpmetMessageOpenFeignClient { **/ @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result saveUserMessage(@RequestBody UserMessageFormDTO formDto); + + /** + * @param + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 20:56 + **/ + @PostMapping(value = "message/sms/sendVerificationCode", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendVerificationCode(@RequestBody SendVerificationCodeFormDTO formDTO); + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 热心居民申请给网格长们发送消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessageList(List msgList); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index a3f4dbbbc1..3cc5a5c5eb 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -1,13 +1,16 @@ package com.epmet.feign.fallback; -import org.springframework.stereotype.Component; - import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -32,4 +35,14 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig public Result saveUserMessage(UserMessageFormDTO formDto) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto); } + + @Override + public Result sendVerificationCode(SendVerificationCodeFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendVerificationCode", formDTO); + } + + @Override + public Result saveUserMessageList(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml index c54e0d1d6c..c5e1c7579d 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.18 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.22 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml index c3f64d1553..104ba801e6 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.18 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.19 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index eec5a6951a..cf6938d147 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.18 + 0.3.22 com.epmet epmet-message diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java index 008429520d..0a0f534a0a 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java @@ -9,7 +9,6 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -17,6 +16,8 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.enums.PlatformEnum; import com.epmet.remote.ParamsRemoteService; import com.epmet.service.SysSmsService; @@ -31,7 +32,6 @@ import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.Arrays; -import java.util.HashMap; import java.util.Map; /** @@ -76,7 +76,6 @@ public class SmsController { @PostMapping("saveConfig") @ApiOperation("保存配置短信") -// @LogOperation("保存配置短信") public Result saveConfig(@RequestBody SmsConfig config){ //校验类型 ValidatorUtils.validateEntity(config); @@ -96,19 +95,17 @@ public class SmsController { @PostMapping("send") @ApiOperation("发送短信") -// @LogOperation("发送短信") @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机好号", paramType = "query", required = true, dataType="String"), @ApiImplicitParam(name = "params", value = "参数", paramType = "query", required = true, dataType="String") }) public Result send(@RequestBody SysSmsDTO sysSmsDTO){ - sysSmsService.send(sysSmsDTO.getMobile(), sysSmsDTO.getParams()); + sysSmsService.send(sysSmsDTO); return new Result(); } @DeleteMapping @ApiOperation("删除") -// @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ sysSmsService.deleteBatchIds(Arrays.asList(ids)); @@ -121,7 +118,6 @@ public class SmsController { */ @GetMapping("captcha/{mobile}") @ApiOperation("发送短信验证码") - //@LogOperation("发送短信验证码") @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", paramType = "query", required = true, dataType="String") }) @@ -129,4 +125,18 @@ public class SmsController { Result result = sysSmsService.sendSmsCaptcha(mobile); return result; } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 21:05 + **/ + @PostMapping("sendVerificationCode") + public Result sendVerificationCode(@RequestBody SendVerificationCodeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,SendVerificationCodeFormDTO.AddUserShowGroup.class,SendVerificationCodeFormDTO.AddUserInternalGroup.class); + SendVerificationCodeResultDTO resultDTO=sysSmsService.sendVerificationCode(formDTO); + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java index 79c7cddd1c..1e67125423 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java @@ -12,6 +12,8 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; import java.util.LinkedHashMap; @@ -28,10 +30,9 @@ public interface SysSmsService extends BaseService { /** * 发送短信 - * @param mobile 手机号 - * @param params 短信参数 + * @param sysSmsDTO :mobile 手机号 params短信参数 aliyunTemplateCode:短信模板 */ - void send(String mobile, String params); + void send(SysSmsDTO sysSmsDTO); /** * 保存短信发送记录 @@ -48,5 +49,14 @@ public interface SysSmsService extends BaseService { * @return */ Result sendSmsCaptcha(String mobile); + + /** + * @return java.util.HashMap + * @param formDTO + * @author yinzuomei + * @description 发送短信验证码(区分场景) + * @Date 2020/6/23 21:07 + **/ + SendVerificationCodeResultDTO sendVerificationCode(SendVerificationCodeFormDTO formDTO); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java index 9dc94b7a2d..2f8600641e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -20,6 +20,8 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; import com.epmet.exception.ModuleErrorCode; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -67,10 +69,10 @@ public class SysSmsServiceImpl extends BaseServiceImpl } @Override - public void send(String mobile, String params) { + public void send(SysSmsDTO sysSmsDTO) { LinkedHashMap map; try { - map = JSON.parseObject(params, LinkedHashMap.class); + map = JSON.parseObject(sysSmsDTO.getParams(), LinkedHashMap.class); }catch (Exception e){ throw new RenException(ErrorCode.JSON_FORMAT_ERROR); } @@ -80,9 +82,12 @@ public class SysSmsServiceImpl extends BaseServiceImpl if(service == null){ throw new RenException(ModuleErrorCode.SMS_CONFIG); } - //发送短信 - service.sendSms(mobile, map); + if(StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())){ + service.sendSmsByAliyunTemplateCode(sysSmsDTO.getMobile(), map,sysSmsDTO.getAliyunTemplateCode()); + }else{ + service.sendSms(sysSmsDTO.getMobile(), map); + } } @Override @@ -141,4 +146,34 @@ public class SysSmsServiceImpl extends BaseServiceImpl } return new Result().error(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); } + + @Override + public SendVerificationCodeResultDTO sendVerificationCode(SendVerificationCodeFormDTO formDTO) { + SendVerificationCodeResultDTO data = new SendVerificationCodeResultDTO(); + Integer code = (int) ((Math.random() * 9 + 1) * 100000); + String codeStr = String.valueOf(code); + HashMap map = new HashMap<>(); + map.put("code", codeStr); + + try { + String paramJson = new ObjectMapper().writeValueAsString(map); + + SysSmsDTO sysSmsDTO = new SysSmsDTO(); + sysSmsDTO.setMobile(formDTO.getMobile()); + sysSmsDTO.setParams(paramJson); + sysSmsDTO.setAliyunTemplateCode(formDTO.getAliyunTemplateCode()); + Result result = epmetMessageOpenFeignClient.send(sysSmsDTO); + if (result != null && result.success()) { + data.setCode(codeStr); + } else { + logger.error(String.format("短信验证码发送失败,手机号:%s。code:%d,msg:%s", formDTO.getMobile(), result.getCode(), result.getMsg())); + throw new RenException(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error(String.format("短信验证码发送失败,手机号:%s。errorMessage:%s", formDTO.getMobile(), e.getMessage())); + throw new RenException(EpmetErrorCode.MESSAGE_SMS_SEND_ERROR.getCode()); + } + return data; + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java index a29130457b..e1a07530fb 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AbstractSmsService.java @@ -37,4 +37,17 @@ public abstract class AbstractSmsService { * @param template 短信模板 */ public abstract void sendSms(String mobile, LinkedHashMap params, String signName, String template); + + /** + * @return void + * @param mobile 手机号 + * @param params 参数 + * @param aliyunTemplateCode 短息模板编码 + * @author yinzuomei + * @description + * @Date 2020/6/23 21:27 + **/ + public abstract void sendSmsByAliyunTemplateCode(String mobile, + LinkedHashMap params, + String aliyunTemplateCode); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java index 7c97eb11ad..9ec5c16cd5 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/AliyunSmsService.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.enums.PlatformEnum; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.SysSmsService; +import org.apache.commons.lang3.StringUtils; import java.util.LinkedHashMap; @@ -108,4 +109,13 @@ public class AliyunSmsService extends AbstractSmsService { throw new RenException(ModuleErrorCode.SEND_SMS_ERROR, response.getMessage()); } } + + @Override + public void sendSmsByAliyunTemplateCode(String mobile, LinkedHashMap params,String aliyunTemplateCode) { + if(StringUtils.isNotBlank(aliyunTemplateCode)){ + this.sendSms(mobile, params, config.getAliyunSignName(), aliyunTemplateCode); + return; + } + this.sendSms(mobile, params, config.getAliyunSignName(), config.getAliyunTemplateCode()); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java index 7c16e641dd..a3e33d6557 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/sms/QcloudSmsService.java @@ -17,6 +17,7 @@ import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.enums.PlatformEnum; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.SysSmsService; +import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -67,4 +68,13 @@ public class QcloudSmsService extends AbstractSmsService { throw new RenException(ModuleErrorCode.SEND_SMS_ERROR, result.errMsg); } } + + @Override + public void sendSmsByAliyunTemplateCode(String mobile, LinkedHashMap params,String aliyunTemplateCode) { + if(StringUtils.isNotBlank(aliyunTemplateCode)){ + this.sendSms(mobile, params, config.getAliyunSignName(), aliyunTemplateCode); + return; + } + this.sendSms(mobile, params, config.getAliyunSignName(), config.getAliyunTemplateCode()); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql index 924dc9256e..7a51a3f595 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.1__DDL.sql @@ -1,5 +1 @@ -CREATE TABLE `demo_t` ( - `device_id` bigint(11) NOT NULL AUTO_INCREMENT, - `device_name` varchar(20) NOT NULL, - PRIMARY KEY (`device_id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4; \ No newline at end of file +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.2__DML.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.2__DML.sql deleted file mode 100644 index eabf69bf99..0000000000 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.2__DML.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO demo_t (device_name) VALUES ('a'); -INSERT INTO demo_t (device_name) VALUES ('b'); \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml index 8780612264..e037bc1878 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.32 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-access-server:0.3.34 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml index 1d19b6beac..fa2fe5a092 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-access-server:0.3.29 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-access-server:0.3.34 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 93a1bd00f9..a70f4f33f0 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.32 + 0.3.34 gov-access com.epmet diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.1__init.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql deleted file mode 100644 index ecd68455d3..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V2__DemoSql.sql +++ /dev/null @@ -1,4 +0,0 @@ --- CREATE TABLE epmet_gov_access.device_t ( --- device_id bigint(11) primary KEY auto_increment, --- device_name varchar(20) NOT NULL --- ) \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql deleted file mode 100644 index 9f2eec699a..0000000000 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/epmet_gov_access.sql +++ /dev/null @@ -1,119 +0,0 @@ -/* - Date: 22/04/2020 12:13:38 -*/ - --- SET NAMES utf8mb4; --- #SET FOREIGN_KEY_CHECKS = 0; - -CREATE DATABASE `epmet_gov_access` DEFAULT CHARACTER SET utf8mb4; - --- DROP TABLE IF EXISTS `permission_scope`; -CREATE TABLE `operation_scope` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id', - `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围key', - `SCOPE_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围名称', - `SCOPE_INDEX` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围序号', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限范围表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for resource_ope --- ---------------------------- --- DROP TABLE IF EXISTS `operation`; -CREATE TABLE `operation` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `OPERATION_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作简介', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '操作类型表' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for role_operation --- ---------------------------- --- DROP TABLE IF EXISTS `role_operation`; -CREATE TABLE `role_operation` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作key', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能进行那些操作' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Table structure for role_scope --- ---------------------------- --- DROP TABLE IF EXISTS `role_scope`; -CREATE TABLE `role_scope` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作Key', - `SCOPE_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '范围Key', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL COMMENT '是否删除,0:未删除,1:已删除', - `REVISION` int(10) NULL DEFAULT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者id', - `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者id', - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '角色能操作哪些范围' ROW_FORMAT = Dynamic; - --- SET FOREIGN_KEY_CHECKS = 1; - --- 2020.04.29 wxz -CREATE TABLE `access_setting` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `ROLE_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色ID', - `OPERATION_KEY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作key', - `SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', - `SETTING_VALUE` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置值', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE, - UNIQUE INDEX `uni_access_setting_role_key_opt`(`ROLE_ID`, `OPERATION_KEY`, `SETTING_KEY`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置' ROW_FORMAT = Dynamic; - - -CREATE TABLE `access_setting_options` ( - `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', - `SETTING_KEY` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置KEY', - `SETTING_NAME` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '配置name', - `BRIEF` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '简介', - `DEL_FLAG` tinyint(1) NULL DEFAULT NULL, - `REVISION` int(10) NULL DEFAULT NULL, - `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `CREATED_TIME` datetime(0) NULL DEFAULT NULL, - `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `UPDATED_TIME` datetime(0) NULL DEFAULT NULL, - PRIMARY KEY (`ID`) USING BTREE, - UNIQUE INDEX `uni_access_setting_opts`(`SETTING_KEY`) USING BTREE COMMENT '配置KEY不能重复' -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权限配置选项' ROW_FORMAT = Dynamic; - --- ---------------------------- --- Records of access_setting_options --- ---------------------------- -INSERT INTO `access_setting_options` VALUES ('1', 'I_CREATED', '我发起的', '我发起的条件过滤。ON为开启,OFF为关闭', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('2', 'I_PART', '我参与的', '我参与的条件过滤', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('3', 'IN_GRID', '网格内', '网格内', 0, 0, NULL, NULL, NULL, NULL); -INSERT INTO `access_setting_options` VALUES ('4', 'IN_DEPARTMENT', '部门内', '部门内', 0, 0, NULL, NULL, NULL, NULL); diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml index 6c11640127..09cd9117d5 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-mine-server:0.3.27 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-mine-server:0.3.29 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index 57f13f3fc7..777d8bafbb 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.67 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.69 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml index a08cd1f375..c716cc0239 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.56 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.57 ports: - "8105:8105" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml index 75870071a0..464e41c8e3 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.55 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.57 ports: - "8105:8105" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 3e684e0f72..91548839b7 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.56 + 0.3.57 gov-voice com.epmet diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__add_gridIds.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__add_gridIds.sql deleted file mode 100644 index 09b724ce63..0000000000 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__add_gridIds.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `epmet_gov_voice`.`article_operate_record` -ADD COLUMN `GRID_IDS` varchar(1024) NULL DEFAULT NULL COMMENT '网格ID,下线文章时,多个以英文:隔开' AFTER `ARTICLE_ID`, -MODIFY COLUMN `OP_TYPE` varchar(32) NOT NULL COMMENT '操作类型 发布文章:publish;取消文章置顶:canceltop;设置置顶:settop;下线文章:offline;修改文章发布范围:updatepublishrange' AFTER `CONTENT`; \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml index c700a7b085..b59f1fb9b1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.50 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.53 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml index 4eaf11b7e0..344f01b1f1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.50 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.51 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index b7715679a3..383b4a14fe 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.50 + 0.3.53 com.epmet resi-partymember diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java index b49ca7552f..5957ee1fb0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberAuthRecordDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.PartymemberAuthRecordEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 党员认证记录表 * @@ -37,5 +39,5 @@ public interface PartymemberAuthRecordDao extends BaseDao selectByPartyMemberBaseInfoId(String partymemberBaseInfoId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index a51cc29d90..61d8f0a5f4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -10,19 +10,14 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyMemberConstant; import com.epmet.constant.PartyMemberMessageConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.StaffRoleFormDTO; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.result.AgencyAndStaffsResultDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; -import com.epmet.dto.result.UserResiInfoResultDTO; -import com.epmet.modules.feign.EpmetMessageFeignClient; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.feign.ResiGroupFeignClient; @@ -48,6 +43,7 @@ import com.epmet.resi.partymember.dto.partymember.result.AuditingDetailResultDTO import com.epmet.resi.partymember.dto.partymember.result.AutoFailedDetailResultDTO; import com.epmet.resi.partymember.dto.partymember.result.RejectedDetailResultDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -85,7 +81,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService @Autowired private PartymemberRegisterRelationService partymemberRegisterRelationService; @Autowired - private EpmetMessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired @@ -150,17 +146,21 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService if (null != partyMemberInfoResult) { return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode()); } - //TODO 方便测试屏蔽短信验证码 - /*//生成短信验证码 - Map message = (Map) messageFeignClient.sendSmsCaptcha(fromDTO.getMobile()).getData(); - if (null == message) { + //生成短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(fromDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER); + Result sendVerificationCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if(!sendVerificationCodeResult.success()|| + null==sendVerificationCodeResult.getData() + || StringUtils.isBlank(sendVerificationCodeResult.getData().getCode())){ return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); } //删除旧验证码 partyMemberInfoRedis.deleteUserMobileCodeByPattern(fromDTO.getUserId(), fromDTO.getMobile()); //将验证码存入Redis - partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code"));*/ + partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), sendVerificationCodeResult.getData().getCode()); //将访问记录更新到热心居民申请行为记录表 saveOrUpdateVisit(fromDTO.getVisitId(), null, PartyMemberConstant.OPERATE_OPERATE_SMS_CODE); @@ -618,7 +618,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userMessageFormDTO.setMessageContent(messageContent); userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); //保存消息 - return messageFeignClient.saveUserMessage(userMessageFormDTO); + return epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); } /** @@ -673,7 +673,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService }); }); if (msgList.size() > NumConstant.ZERO) { - result = messageFeignClient.saveUserMessageList(msgList); + result = epmetMessageOpenFeignClient.saveUserMessageList(msgList); } return result; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index ae51f2cc19..35e890d7b7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -441,10 +441,10 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl entityList = partymemberAuthRecordDao.selectByPartyMemberBaseInfoId(partyMemberId); + if (null != entityList&&entityList.size()>0) { partyMemberBaseInfoDetailResultDTO.setStatus(Boolean.TRUE); - partyMemberBaseInfoDetailResultDTO.setActiveDesc(entity.getAuthDesc()); + partyMemberBaseInfoDetailResultDTO.setActiveDesc(entityList.get(0).getAuthDesc()); } else { partyMemberBaseInfoDetailResultDTO.setStatus(Boolean.FALSE); partyMemberBaseInfoDetailResultDTO.setActiveDesc(""); @@ -456,8 +456,8 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl entityList = partymemberAuthRecordDao.selectByPartyMemberBaseInfoId(formDTO.getPartyMemberId()); + if (null != entityList&&entityList.size()>0) { throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_MEMBER.getCode()); } this.deleteById(formDTO.getPartyMemberId()); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.2__partybranch.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.2__partybranch.sql deleted file mode 100644 index a91d0feea2..0000000000 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.2__partybranch.sql +++ /dev/null @@ -1,31 +0,0 @@ -CREATE TABLE `partymember_auth_record` ( - `ID` varchar(64) NOT NULL COMMENT '主键', - `PARTYMEMBER_BASE_INFO_ID` varchar(64) NOT NULL COMMENT 'partymember_base_info.id', - `USER_ID` varchar(64) NOT NULL COMMENT '认证居民id', - `AUTH_TIME` datetime NOT NULL COMMENT '认证时间(和partymember_info表时间一致)', - `GRID_ID` varchar(64) NOT NULL COMMENT '认证网格id', - `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '认证客户id', - `AUTH_DESC` varchar(255) NOT NULL COMMENT '认证的描述:账户于2020年10月30号在海泊桥社区-第一网格激活', - `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', - `REVISION` int(10) NOT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', - `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', - `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党员认证记录表'; - - - -CREATE TABLE `party_branch_members` ( - `ID` varchar(64) NOT NULL COMMENT '主键', - `BRANCH_ID` varchar(64) NOT NULL COMMENT '党支部id,customer_party_branch.id', - `PARTYMEMBER_BASE_INFO_ID` varchar(64) NOT NULL COMMENT '党员库表主键,partymember_base_info.id', - `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', - `REVISION` int(10) NOT NULL COMMENT '乐观锁', - `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', - `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', - `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', - `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', - PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='党支部党员关系表'; \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml index f61badbc80..7bb2065080 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberAuthRecordDao.xml @@ -25,5 +25,6 @@ select * from partymember_auth_record where DEL_FLAG='0' and PARTYMEMBER_BASE_INFO_ID=#{partymemberBaseInfoId} + order by CREATED_TIME desc \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index b7aa868f90..1b2ea4f5ee 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -25,33 +25,54 @@ SELECT * FROM - partymember_base_info + partymember_base_info pbi WHERE - CUSTOMER_ID = #{customerId} - AND ID_CARD = #{idCard} - AND DEL_FLAG = 0 + pbi.CUSTOMER_ID = #{customerId} + AND pbi.ID_CARD = #{idCard} + AND pbi.DEL_FLAG = 0 + AND NOT EXISTS (SELECT + * + FROM + partymember_auth_record m + WHERE + pbi.id=m.PARTYMEMBER_BASE_INFO_ID + and m.del_flag='0') diff --git a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme index 7cb6399fe1..d5a2826ed9 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/readme +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/readme @@ -1,4 +1,8 @@ #访问openApi 需要向redis中 添加白名单 sadd epmet:openapi:scan:whitelist "客户端ip地址" #eg: -sadd epmet:openapi:scan:whitelist "\"192.168.1.1\"" \ No newline at end of file +sadd epmet:openapi:scan:whitelist "\"192.168.1.1\"" + +#于洋家的ip +27.219.156.47 +116.179.32.197(可以删除了) \ No newline at end of file diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 1b546e9355..4ed23e2498 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.60 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.61 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 5c9f3966ff..accb7bf5f3 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.59 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.60 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 7da3cceed3..153d33f2e2 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.60 + 0.3.61 com.epmet epmet-user @@ -82,6 +82,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index d831b34e14..5901ddd950 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -26,19 +26,18 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.UserResiInfoDao; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserRoleDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.form.VerificationCodeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserResiInfoEntity; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.redis.UserResiInfoRedis; import com.epmet.service.RegisterRelationService; import com.epmet.service.UserResiInfoService; @@ -77,7 +76,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -202,25 +201,25 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl map = (Map) result.getData(); - if (null == map || null == map.get("code")) { + //3:调用短信服务 生成验证码发送短信 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER); + Result result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getCode())){ return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); } //4:删除缓存中可能存在的旧验证码 userResiInfoRedis.deleteOldUserMobileCode(verificationCodeFormDTO.getUserId(), verificationCodeFormDTO.getMobile()); //5:将验证码存入redis - userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),map.get("code").toString());*/ - return result; + userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),result.getData().getCode()); + return new Result(); } @Override