From 61c6dd54e12d73904722ce700ed6006f862e741f Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Jun 2020 21:28:34 +0800 Subject: [PATCH 001/137] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1tas?= =?UTF-8?q?k=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/PublicityTagUsedDailyStatsTask.java | 2 +- .../PublicityTagUsedMonthlyStatsTask.java | 2 +- ...ityTagUsedQuarterlyAndYearlyStatsTask.java | 31 +++++++++++++++++++ ...gViewedQuarterlyAndYearlyhlyStatsTask.java | 31 +++++++++++++++++++ .../src/main/resources/readme | 6 +++- 5 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedQuarterlyAndYearlyStatsTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedQuarterlyAndYearlyhlyStatsTask.java 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-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 From 88639cbfc0baf8bb5cdb188ff65cc3bca344e30b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Jun 2020 22:53:52 +0800 Subject: [PATCH 002/137] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GovLoginServiceImpl.java | 3 +-- .../impl/PartyMemberConfirmServiceImpl.java | 6 ++--- .../service/impl/UserResiInfoServiceImpl.java | 27 +++++++++---------- 3 files changed, 17 insertions(+), 19 deletions(-) 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 45e34e282e..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 @@ -115,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-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..a06d5b460b 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 @@ -57,6 +57,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** * 党员认证 @@ -150,8 +151,7 @@ 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) { return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); @@ -160,7 +160,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService partyMemberInfoRedis.deleteUserMobileCodeByPattern(fromDTO.getUserId(), fromDTO.getMobile()); //将验证码存入Redis - partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code"));*/ + partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code")); //将访问记录更新到热心居民申请行为记录表 saveOrUpdateVisit(fromDTO.getVisitId(), null, PartyMemberConstant.OPERATE_OPERATE_SMS_CODE); 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 From 8bf5c0e9dad9baa6d8c52cfe98f54aa6373d84bf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Jun 2020 23:43:05 +0800 Subject: [PATCH 003/137] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=85=9A=E5=91=98?= =?UTF-8?q?=E3=80=81=E6=B3=A8=E5=86=8C=E5=B1=85=E6=B0=91=E3=80=81=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=AF=E7=99=BB=E5=BD=95=EF=BC=8C=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/EpmetMessageOpenFeignClient.java | 11 +++++++ .../EpmetMessageOpenFeignClientFallback.java | 6 ++++ .../impl/PartyMemberConfirmServiceImpl.java | 32 +++++++++---------- epmet-user/epmet-user-server/pom.xml | 6 ++++ 4 files changed, 39 insertions(+), 16 deletions(-) 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 9d0a60fbf1..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 @@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -55,4 +57,13 @@ public interface EpmetMessageOpenFeignClient { **/ @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 6bd8c16bb8..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 @@ -10,6 +10,8 @@ import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -39,4 +41,8 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig 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/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 a06d5b460b..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; @@ -57,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.Map; /** * 党员认证 @@ -86,7 +81,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService @Autowired private PartymemberRegisterRelationService partymemberRegisterRelationService; @Autowired - private EpmetMessageFeignClient messageFeignClient; + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired @@ -152,15 +147,20 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode()); } //生成短信验证码 - 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-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 7da3cceed3..05a73042f7 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -82,6 +82,12 @@ 2.0.0 compile + + com.epmet + epmet-message-client + 2.0.0 + compile + From 16d40c73adf8d506585ee3e9578032a28f14b694 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Jun 2020 23:46:34 +0800 Subject: [PATCH 004/137] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8F=91=E5=B8=83130=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-dev.yml | 2 +- epmet-auth/pom.xml | 2 +- .../epmet-message-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-message/epmet-message-server/pom.xml | 2 +- .../resi-partymember-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-partymember/resi-partymember-server/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index bbc475fc6f..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.22 + 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/pom.xml b/epmet-auth/pom.xml index fd3c252986..25c493667a 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.22 + 0.3.23 com.epmet epmet-cloud 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 adc35709b2..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.21 + 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/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 01a6bc6f5f..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.21 + 0.3.22 com.epmet epmet-message 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 9aa9529d34..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.52 + 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/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 58cfd05402..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.52 + 0.3.53 com.epmet resi-partymember 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/pom.xml b/epmet-user/epmet-user-server/pom.xml index 05a73042f7..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 From 091842a56c64ef39a19a606e4cad3966c2b053f8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Jun 2020 00:26:15 +0800 Subject: [PATCH 005/137] =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 347c3c808c..be99941c33 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,12 @@ - - + + + + + + @@ -151,7 +155,12 @@ - + + + + + + From 6e73722d18b6f695765183cb6884817db2983738 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Jun 2020 09:06:59 +0800 Subject: [PATCH 006/137] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/src/main/resources/logback-spring.xml | 2 ++ 1 file changed, 2 insertions(+) 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 be99941c33..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 @@ -143,6 +143,7 @@ + @@ -161,6 +162,7 @@ + From 57bb9278f23d5d42681d92ec8f6f4773e6b92642 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 09:17:34 +0800 Subject: [PATCH 007/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/issue/IssueDao.xml | 2 ++ 1 file changed, 2 insertions(+) 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 19e81a0cb5..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 @@ -35,6 +35,7 @@ WHERE fiad.DEL_FLAG = '0' AND fiad.PID = #{agencyId} GROUP BY AGENCY_ID + ORDER BY fiad.ISSUE_TOTAL DESC + - - - - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..796804c0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml @@ -0,0 +1,84 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_daily + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..1d85661ddd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml @@ -0,0 +1,78 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_monthly + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml new file mode 100644 index 0000000000..d509a646bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml @@ -0,0 +1,87 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..e9232f4a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml @@ -0,0 +1,77 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_monthly + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml new file mode 100644 index 0000000000..f8f4a16a84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml @@ -0,0 +1,95 @@ + + + + + + + INSERT INTO fact_topic_status_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml new file mode 100644 index 0000000000..dc61db8665 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml @@ -0,0 +1,86 @@ + + + + + + + INSERT INTO fact_topic_status_agency_monthly + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml new file mode 100644 index 0000000000..b60c3bffaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_status_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..d12e0d8c11 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml new file mode 100644 index 0000000000..537a46cebb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml new file mode 100644 index 0000000000..b41b6f89dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_participation_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..7215527ed6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_participation_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml new file mode 100644 index 0000000000..575cea1844 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -0,0 +1,111 @@ + + + + + + + INSERT INTO fact_participation_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml new file mode 100644 index 0000000000..cfe17cd854 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_participation_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml new file mode 100644 index 0000000000..185a97da77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_reg_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..aa8548ff1c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_reg_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml new file mode 100644 index 0000000000..f8d85b7ab9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_reg_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_daily + WHERE + DATE_ID = #{dateId} + + AND CUSTOMER_ID = #{customerId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml new file mode 100644 index 0000000000..f5f66265fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -0,0 +1,110 @@ + + + + + + + INSERT INTO fact_reg_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..10bf5cd05b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 91dc279ec1..1b6f925c97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -30,7 +30,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -42,7 +42,16 @@ REGISTER_RELATION WHERE DEL_FLAG = '0' - AND REGISTER = '1' + + + + AND PARTICIPATION = '1' + + + + AND REGISTER = '1' + + GRID_ID = #{gridId} @@ -80,7 +89,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -112,7 +121,7 @@ - + AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -138,7 +147,7 @@ urole.USER_ID = #{incrUserId} - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -158,7 +167,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -189,7 +198,7 @@ - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -211,7 +220,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -310,14 +319,7 @@ urole.GRID_ID = #{gridId} - - - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) - - - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) - - + AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '热心居民' From f3a330b437efb32061a16f526358606eb0390c48 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Jun 2020 10:39:07 +0800 Subject: [PATCH 011/137] =?UTF-8?q?pom=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index af7cc94e2b..8bd8f152a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -159,7 +159,7 @@ 6379 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b From 512687903465293d48b6145db1df68b49742a71f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 12:11:10 +0800 Subject: [PATCH 012/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/issue/impl/IssueServiceImpl.java | 82 +++++++++++++------ .../main/resources/mapper/issue/IssueDao.xml | 2 +- .../java/com/epmet/DataStatsApplication.java | 2 + 3 files changed, 61 insertions(+), 25 deletions(-) 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 4271cbe29e..207a7f9c30 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 @@ -2,6 +2,7 @@ package com.epmet.service.issue.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; @@ -17,6 +18,7 @@ import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -35,15 +37,29 @@ public class IssueServiceImpl implements IssueService { IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); String agencyId = getAgencyId(tokenDto); IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); - result.setAgencyId(agencyId); - result.setDateName(data.getDateName()); - result.setIssueTotal(data.getIssueTotal()); - result.setVotingTotal(data.getVotingTotal()); - result.setShiftProjectTotal(data.getShiftProjectTotal()); - result.setClosedTotal(data.getClosedTotal()); - result.setVotingRatio(toRatio(data.getVotingPercent())); - result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); - result.setClosedRatio(toRatio(data.getClosedPercent())); + if (null == data) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + result.setAgencyId(agencyId); + result.setDateName(DateUtils.format(date, "yyyy.MM.dd")); + result.setIssueTotal(NumConstant.ZERO); + result.setVotingTotal(NumConstant.ZERO); + result.setShiftProjectTotal(NumConstant.ZERO); + result.setClosedTotal(NumConstant.ZERO); + result.setVotingRatio("0%"); + result.setShiftProjectRatio("0%"); + result.setClosedRatio("0%"); + } else { + result.setAgencyId(agencyId); + result.setDateName(data.getDateName()); + result.setIssueTotal(data.getIssueTotal()); + result.setVotingTotal(data.getVotingTotal()); + result.setShiftProjectTotal(data.getShiftProjectTotal()); + result.setClosedTotal(data.getClosedTotal()); + result.setVotingRatio(toRatio(data.getVotingPercent())); + result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); + result.setClosedRatio(toRatio(data.getClosedPercent())); + } return result; } @@ -52,21 +68,39 @@ public class IssueServiceImpl implements IssueService { List list = new ArrayList<>(); String agencyId = getAgencyId(tokenDto); IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); - IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); - voting.setName(IssueConstant.VOTING_NAME); - voting.setValue(data.getVotingTotal()); - voting.setRatio(toRatio(data.getVotingPercent())); - list.add(voting); - IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); - shift.setName(IssueConstant.SHIFT_NAME); - shift.setValue(data.getShiftProjectTotal()); - shift.setRatio(toRatio(data.getShiftProjectPercent())); - list.add(shift); - IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); - closed.setName(IssueConstant.CLOSED_NAME); - closed.setValue(data.getClosedTotal()); - closed.setRatio(toRatio(data.getClosedPercent())); - list.add(closed); + if (null == data) { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(NumConstant.ZERO); + voting.setRatio("0%"); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(NumConstant.ZERO); + shift.setRatio("0%"); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(NumConstant.ZERO); + closed.setRatio("0%"); + list.add(closed); + } else { + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + voting.setRatio(toRatio(data.getVotingPercent())); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + shift.setRatio(toRatio(data.getShiftProjectPercent())); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + closed.setRatio(toRatio(data.getClosedPercent())); + list.add(closed); + } return list; } 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 bb9e3b4747..468f4c7a89 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 @@ -13,7 +13,7 @@ CLOSED_TOTAL, CLOSED_PERCENT, MAX(DATE_ID) AS DATE_ID, - DATE_FORMAT(DATE_ID, '%Y.%m.%d') AS DATE_NAME + DATE_FORMAT(MAX(DATE_ID), '%Y.%m.%d') AS DATE_NAME FROM fact_issue_agency_daily fiad WHERE DEL_FLAG = '0' diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index 7da757a418..ad4e2110fa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -3,8 +3,10 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) +@EnableAsync public class DataStatsApplication { public static void main(String[] args) { From d68e45c608f1308131173cfc2954322b9600132d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 12:15:48 +0800 Subject: [PATCH 013/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/issue/constant/IssueConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java index 88d4f44c78..52488ea582 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -6,8 +6,8 @@ package com.epmet.issue.constant; * @date 2020/6/22 14:07 */ public interface IssueConstant { - String MONTH = "month"; - String DATE = "date"; + String MONTH = "monthly"; + String DATE = "daily"; String VOTING_NAME = "表决中"; String SHIFT_NAME = "已转项目"; String CLOSED_NAME = "已关闭"; From 1c0f29595efd3acb8ce191fae5ff4cfbe7d340e5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Jun 2020 12:31:26 +0800 Subject: [PATCH 014/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/user/UserIncrTrendFormDTO.java | 9 ++- .../dto/form/user/UserSubAgencyFormDTO.java | 7 +- .../dto/form/user/UserSubGridFormDTO.java | 8 ++- .../dto/form/user/UserSummaryInfoFormDTO.java | 5 +- .../result/user/UserSummaryInfoResultDTO.java | 2 +- .../user/UserAnalysisController.java | 8 +-- .../com/epmet/dao/user/UserAnalysisDao.java | 8 +-- .../user/impl/UserAnalysisServiceImpl.java | 17 +++-- .../resources/mapper/user/UserAnalysisDao.xml | 64 ++++++++++--------- 9 files changed, 72 insertions(+), 56 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java index f4496d0199..7f888a0b0d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java @@ -13,15 +13,18 @@ import java.io.Serializable; */ @Data public class UserIncrTrendFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + /** * reg:注册居民 parti:参与用户,如果值为null,默认为reg */ - @NotBlank(message = "regOrPartiFlag不能为空") - private String regOrPartiFlag; + @NotBlank(message = "regOrPatiFlag不能为空", groups = {AddUserInternalGroup.class}) + private String regOrPatiFlag; /** * day:日维度 | month:月维度 | (周、季、年)… */ - @NotBlank(message = "type不能为空") + @NotBlank(message = "type不能为空", groups = {AddUserInternalGroup.class}) private String type; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java index 43d089e01a..0532ac521a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java @@ -14,12 +14,15 @@ import java.io.Serializable; @Data public class UserSubAgencyFormDTO implements Serializable { private static final long serialVersionUID = -4558978951554887536L; + public interface AddUserInternalGroup { + } + /** * reg:注册居民 parti:参与用户,如果值为null,默认为reg */ - @NotBlank(message = "regOrPartiFlag不能为空") + @NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) private String regOrPartiFlag; - @NotBlank(message = "查询日期不能为空") + @NotBlank(message = "查询日期不能为空",groups = {AddUserInternalGroup.class}) private String dateId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java index c9bc20b734..f0f8303642 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java @@ -14,12 +14,16 @@ import java.io.Serializable; @Data public class UserSubGridFormDTO implements Serializable { private static final long serialVersionUID = -1815903503939673149L; + + public interface AddUserInternalGroup { + } + /** * reg:注册居民 parti:参与用户,如果值为null,默认为reg */ - @NotBlank(message = "regOrPartiFlag不能为空") + @NotBlank(message = "regOrPartiFlag不能为空", groups = {AddUserInternalGroup.class}) private String regOrPartiFlag; - @NotBlank(message = "查询日期不能为空") + @NotBlank(message = "查询日期不能为空", groups = {AddUserInternalGroup.class}) private String dateId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java index 9b8bed1c07..047d909ee2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java @@ -14,10 +14,11 @@ import java.io.Serializable; @Data public class UserSummaryInfoFormDTO implements Serializable { private static final long serialVersionUID = -1802471335671321322L; - + public interface AddUserInternalGroup { + } /** * reg:注册居民 parti:参与用户,如果值为null,默认为reg */ - @NotBlank(message = "regOrPartiFlag不能为空") + @NotBlank(message = "regOrPartiFlag不能为空",groups = {AddUserInternalGroup.class}) private String regOrPartiFlag; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java index ccbcb009ed..a72096446c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java @@ -19,7 +19,7 @@ public class UserSummaryInfoResultDTO implements Serializable { * 数据更新至yyyy.MM.dd */ private String currentDate; - + private String dateId; /** * 注册居民数 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java index da00a281d0..3cfae5cf86 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -40,7 +40,7 @@ public class UserAnalysisController { **/ @PostMapping("summaryinfo") public Result summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO,UserSummaryInfoFormDTO.AddUserInternalGroup.class); UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); return new Result().ok(userSummaryInfoResultDTO); } @@ -54,7 +54,7 @@ public class UserAnalysisController { **/ @PostMapping("subagency") public Result> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO,UserSubAgencyFormDTO.AddUserInternalGroup.class); List userSubAgencyResultDTO = userService.subAgency(formDTO); return new Result>().ok(userSubAgencyResultDTO); } @@ -68,7 +68,7 @@ public class UserAnalysisController { **/ @PostMapping("subgrid") public Result> subGrid(@RequestBody UserSubGridFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, UserSubGridFormDTO.AddUserInternalGroup.class); List userSubGridResultDTO = userService.subGrid(formDTO); return new Result>().ok(userSubGridResultDTO); } @@ -82,7 +82,7 @@ public class UserAnalysisController { **/ @PostMapping("incrtrend") public Result> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, UserIncrTrendFormDTO.AddUserInternalGroup.class); List userIncrTrendResultDTO = userService.incrTrend(formDTO); return new Result>().ok(userIncrTrendResultDTO); } 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 feba486e41..7b72652ea8 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 @@ -101,7 +101,7 @@ public interface UserAnalysisDao { * @return java.util.List * @param myAgencyId * @author yinzuomei - * @description + * @description 注册用户:机关、日增量折现图 近90天 * @Date 2020/6/23 11:24 **/ List selectRegDayIncr(@Param("agencyId")String myAgencyId); @@ -110,7 +110,7 @@ public interface UserAnalysisDao { * @return java.util.List * @param myAgencyId * @author yinzuomei - * @description + * @description 注册用户:机关、月增量折线图 近12个月包含当前月 * @Date 2020/6/23 11:24 **/ List selectRegMonthIncr(@Param("agencyId")String myAgencyId); @@ -119,7 +119,7 @@ public interface UserAnalysisDao { * @return java.util.List * @param myAgencyId * @author yinzuomei - * @description + * @description 参与用户:机关、日增量折线图 近90天 * @Date 2020/6/23 11:24 **/ List selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId); @@ -128,7 +128,7 @@ public interface UserAnalysisDao { * @return java.util.List * @param myAgencyId * @author yinzuomei - * @description + * @description 参与用户:机关、月增量插线图 近12个月 包含当前月 * @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/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 655b6febae..677668e0c5 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 @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -46,7 +47,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private UserAnalysisDao userAnalysisDao; - + DecimalFormat decimalFormat = new DecimalFormat("0.00"); /** * @return java.lang.String * @param @@ -91,8 +92,10 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { if(null!=userSummaryInfoResultDTO){ userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 - userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); - userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); + String partyMemberProStr=decimalFormat.format(userSummaryInfoResultDTO.getPartymemberProportionValue()); + userSummaryInfoResultDTO.setPartymemberProportion(partyMemberProStr.concat("%")); + String warmProStr=decimalFormat.format(userSummaryInfoResultDTO.getWarmHeartedProportionValue()); + userSummaryInfoResultDTO.setWarmHeartedProportion(warmProStr.concat("%")); } logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); return userSummaryInfoResultDTO; @@ -303,16 +306,16 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { return new ArrayList<>(); } List list=new ArrayList<>(); - if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { //注册用户数、日 list=userAnalysisDao.selectRegDayIncr(myAgencyId); - } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { //注册用户数、月 list=userAnalysisDao.selectRegMonthIncr(myAgencyId); - } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { //参与用户数、日 list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); - } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPatiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { //参与用户数、月 list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); } else { 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 408cf17e61..6f559931fb 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 @@ -33,12 +33,13 @@ SELECT m.id, m.DATE_ID AS currentDate, + m.DATE_ID AS dateId, m.REG_TOTAL AS regTotal, 0 AS partiTotal, m.PARTYMEMBER_TOTAL AS partymemberTotal, - m.PARTYMEMBER_PROPORTION*100 AS partymemberProportion, + m.PARTYMEMBER_PROPORTION*100 AS partymemberProportionValue, m.WARM_HEARTED_TOTAL AS warmHeartedTotal, - m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportion + m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportionValue FROM fact_reg_user_agency_daily m WHERE @@ -55,12 +56,13 @@ SELECT m.id, m.DATE_ID AS currentDate, + m.DATE_ID AS dateId, m.REG_TOTAL AS regTotal, 0 AS partiTotal, m.PARTYMEMBER_TOTAL AS partymemberTotal, - m.PARTYMEMBER_PROPORTION*100 AS partymemberProportion, + m.PARTYMEMBER_PROPORTION*100 AS partymemberProportionValue, m.WARM_HEARTED_TOTAL AS warmHeartedTotal, - m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportion + m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportionValue FROM fact_participation_user_agency_daily m WHERE @@ -75,42 +77,42 @@ @@ -147,7 +149,7 @@ AND m.AGENCY_ID = #{agencyId} - + - + - + - + @@ -42,16 +41,15 @@ WHEN topic_status_id = 'hidden' THEN '已屏蔽' WHEN topic_status_id = 'closed' THEN '已关闭' ELSE '无' END) AS name, - CONCAT(topic_proportion,'%') AS ratio + CONCAT(topic_proportion * 100,'%') AS ratio FROM fact_topic_status_agency_daily WHERE del_flag = '0' AND agency_id = #{agencyId} - GROUP BY - topic_status_id ORDER BY date_id DESC + LIMIT 3 @@ -80,10 +78,7 @@ LEFT JOIN dim_agency da ON da.id = ftsad.agency_id AND da.del_flag = '0' WHERE ftsad.del_flag = '0' - GROUP BY - ftsad.topic_status_id - ORDER BY - ftsad.date_id DESC + AND ftsad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_status_agency_daily WHERE del_flag = '0') @@ -98,8 +93,7 @@ LEFT JOIN dim_agency da ON da.id = ftiad.agency_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' - GROUP BY ftiad.agency_id - ORDER BY ftiad.date_id DESC + AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_agency_daily WHERE del_flag = '0') @@ -128,10 +122,7 @@ LEFT JOIN dim_grid dg ON dg.id = ftsad.grid_id AND dg.del_flag = '0' WHERE ftsad.del_flag = '0' - GROUP BY - ftsad.topic_status_id - ORDER BY - ftsad.date_id DESC + AND ftsad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_status_grid_daily WHERE del_flag = '0') @@ -146,8 +137,7 @@ LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' - GROUP BY ftiad.grid_id - ORDER BY ftiad.date_id DESC + AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_grid_daily WHERE del_flag = '0') From 5056331d76551609c47cd8981182b2b43bce5d17 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 24 Jun 2020 14:43:06 +0800 Subject: [PATCH 022/137] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=BB=B4=E5=BA=A6=E6=97=B6=E5=80=99=EF=BC=8Clast=5Fex?= =?UTF-8?q?ec=5Ftime=E7=9A=84exec=5Ftime=E4=B8=BAnow=E7=9A=84bug=EF=BC=8C?= =?UTF-8?q?=E5=88=9D=E6=AC=A1=E5=88=9B=E5=BB=BA=E6=97=B6=E5=80=99=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E4=B8=BAnull=EF=BC=8Cinit=E4=B9=8B=E5=90=8E=E6=94=B9?= =?UTF-8?q?=E4=B8=BAnow=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/stats/impl/LastExecRecordServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java index 5fe4e6f924..ba6e33d157 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java @@ -25,9 +25,7 @@ public class LastExecRecordServiceImpl implements LastExecRecordService { */ @Override public LastExecRecordEntity createLastExecRecord(String statsSubject) { - Date now = new Date(); LastExecRecordEntity entity = new LastExecRecordEntity(); - entity.setExecTime(now); entity.setSubject(statsSubject); entity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); entity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); From 0e61ae249b8afb622f0262cc1beff9869fa92c11 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 24 Jun 2020 14:48:11 +0800 Subject: [PATCH 023/137] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E7=BB=B4=E5=BA=A6=E6=97=B6=E5=80=99=EF=BC=8Clast=5Fex?= =?UTF-8?q?ec=5Ftime=E7=9A=84exec=5Ftime=E4=B8=BAnow=E7=9A=84bug=EF=BC=8C?= =?UTF-8?q?=E5=88=9D=E6=AC=A1=E5=88=9B=E5=BB=BA=E6=97=B6=E5=80=99=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E4=B8=BAnull=EF=BC=8Cinit=E4=B9=8B=E5=90=8E=E6=94=B9?= =?UTF-8?q?=E4=B8=BAnow=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/stats/impl/LastExecRecordServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java index 5fe4e6f924..ba6e33d157 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java @@ -25,9 +25,7 @@ public class LastExecRecordServiceImpl implements LastExecRecordService { */ @Override public LastExecRecordEntity createLastExecRecord(String statsSubject) { - Date now = new Date(); LastExecRecordEntity entity = new LastExecRecordEntity(); - entity.setExecTime(now); entity.setSubject(statsSubject); entity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); entity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); From dbf10bd3de825047c510e9e9d7c6c8c5856244c5 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 24 Jun 2020 14:48:43 +0800 Subject: [PATCH 024/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index f49b9ac74d..738ce59964 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.2 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.3 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index defb93920d..ece13a9d61 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.2 + 0.3.3 data-statistical com.epmet From 63eeb606a46ba618392468cbba84674fd7224dad Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 24 Jun 2020 14:57:19 +0800 Subject: [PATCH 025/137] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 128cdf183c..0859bd2632 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 @@ -160,7 +160,7 @@ public class TopicServiceImpl implements TopicService { TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); 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; + ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float)shiftedCount.getShiftedIssueCount() / (float)collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); result.setName(TopicConstant.SHIFTED); result.setRatio(ratio); From 7dc9c33a30e03bb266d5f151d414b590d71c733a Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Jun 2020 14:57:47 +0800 Subject: [PATCH 026/137] =?UTF-8?q?=E7=BB=84=E4=BA=8B=E5=AE=9E=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E8=AF=9D=E9=A2=98=E4=BA=8B=E5=AE=9E=E8=A1=A8=E3=80=81?= =?UTF-8?q?=E8=AF=9D=E9=A2=98=E7=8A=B6=E6=80=81=E7=BB=B4=E5=BA=A6=E8=A1=A8?= =?UTF-8?q?sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/data_statistical.sql | 399 ++++++++++++++++++ 1 file changed, 399 insertions(+) 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 81f9cb98f1..25b7b1e955 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 @@ -572,5 +572,404 @@ CREATE TABLE `fact_tag_viewed_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for fact_group_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_group_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '统计月份ID 关联月份dim表', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '统计季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '统计年份ID', + `GRID_TOTAL` int(11) DEFAULT NULL COMMENT '网格数 截至到月末的机关下网格数', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组数 截止到月末的新增数(该月内所有的新增数字之和)', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '机关下网格组内总人数 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT NULL COMMENT '小组平均人数 月末一天的平均数', + `GROUP_MEDIAN` int(11) DEFAULT NULL COMMENT '小组中位数 月末一天的中位数(人)', + `GROUP_INCR` int(11) DEFAULT NULL COMMENT '小组增量', + `GROUP_MEMBER_MAX_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最大数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '成员最多小组ID', + `GROUP_MEMBER_MIN_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最小数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '成员最少小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-机关月统计数据'; + + + + + +-- ---------------------------- +-- Table structure for fact_group_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_group_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `GRID_TOTAL` int(11) DEFAULT '0' COMMENT '网格数 当前网格下的网格数', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '小组数', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT '0' COMMENT '网格下所有组内总人数 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT '0' COMMENT '小组平均人数', + `GROUP_MEDIAN` int(11) DEFAULT '0' COMMENT '小组中位数 截至统计日期,小组人数依次由小到大排开取中位数', + `GROUP_INCR` int(11) DEFAULT '0' COMMENT '小组增量', + `GROUP_MEMBER_MAX_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最大数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最多成员小组ID', + `GROUP_MEMBER_MIN_COUNT` int(11) DEFAULT NULL COMMENT '小组成员最小数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最少成员小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-网格日统计数据'; + + + + +-- ---------------------------- +-- Table structure for fact_group_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_group_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_group_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GRID_TOTAL` int(11) DEFAULT '0' COMMENT '网格总数 截至统计日期', + `GROUP_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '网格小组数(包含所有下级机关的网格小组) 截至统计日期', + `GROUP_MEMBER_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '机关下网格小组人数总计 不去重', + `GROUP_MEMBER_AVG_COUNT` int(11) DEFAULT '0' COMMENT '小组平均人数 截至统计日期', + `GROUP_MEDIAN` int(11) DEFAULT '0' COMMENT '小组中位数 截至统计日期,小组人数依次由小到大排开取中位数', + `GROUP_INCR` int(11) DEFAULT '0' COMMENT '当天小组增量', + `GROUP_MEMBER_MAX_COUNT` varchar(32) DEFAULT NULL COMMENT '小组最大成员数', + `MAX_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最多成员小组ID', + `GROUP_MEMBER_MIN_COUNT` varchar(32) DEFAULT NULL COMMENT '小组最小成员数', + `MIN_MEMBER_GROUP_ID` varchar(32) DEFAULT NULL COMMENT '最少成员小组ID', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组-机关日统计数据'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_status_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) NOT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态ID 关联dim_topic_status表\n讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量 指定状态的话题数量', + `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态百分比 指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_INCREMENT` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的状态话题的增加数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-机关日统计数据表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_status_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '统计月份 关联月度dm表', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID 关联季度dm表', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID 关联年度dm表', + `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量', + `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态占比 月末一天 \n指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的话题状态增加数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-机关月统计数据表'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_status_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_status_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_status_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID 关联网格dm表', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_STATUS_ID` varchar(32) DEFAULT NULL COMMENT '话题状态ID 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '话题数量', + `TOPIC_PROPORTION` decimal(4,2) DEFAULT NULL COMMENT '话题状态占比 指定状态话题数/话题总数\n总数在topic_total_grid_daily中', + `TOPIC_INCREMENT` int(11) DEFAULT '0' COMMENT '话题增量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='状态话题-网格日统计数据表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_total_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_total_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_total_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `TOPIC_INCR` int(11) DEFAULT '0' COMMENT '话题增量', + `HIDDEN_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '屏蔽话题数', + `ISSUE_TOTAL_COUNT` int(11) DEFAULT '0' COMMENT '已转议题数', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题总数-机关日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_total_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_total_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_total_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) DEFAULT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) DEFAULT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) DEFAULT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) DEFAULT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总量', + `TOPIC_INCR` int(11) DEFAULT NULL COMMENT '话题增量', + `HIDDEN_TOTAL_COUNT` int(11) DEFAULT NULL COMMENT '屏蔽话题数量', + `ISSUE_TOTAL_COUNT` int(11) DEFAULT NULL COMMENT '已转议题数量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL DEFAULT '0' COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL DEFAULT '0' COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题总数-网格日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_agency_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL DEFAULT '' COMMENT '客户Id', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '已转议题数量', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '已转议题当日增量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-机关日统计数据表'; + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_agency_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_agency_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '已转议题总量', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '已转议题增量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-机关月统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_grid_daily;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_INCR` int(11) DEFAULT '0' COMMENT '新增转议题数', + `ISSUE_TOTAL` int(11) DEFAULT '0' COMMENT '转议题总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`,`CUSTOMER_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-网格日统计表'; + + + + + + +-- ---------------------------- +-- Table structure for fact_topic_issue_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS fact_topic_issue_grid_monthly;;/*SkipError*/ +CREATE TABLE `fact_topic_issue_grid_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `ISSUE_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '已转议题增量', + `ISSUE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '已转议题总量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转议题话题-网格月统计表'; + + + + +-- ---------------------------- +-- Table structure for dim_topic_status +-- ---------------------------- +DROP TABLE IF EXISTS dim_topic_status;;/*SkipError*/ +CREATE TABLE dim_topic_status( + ID VARCHAR(32) NOT NULL COMMENT '唯一标识 话题状态ID"discussing"、"hidden"、"closed"' , + STATUS_DESC VARCHAR(32) NOT NULL COMMENT '状态描述 讨论中 已屏蔽 已关闭' , + DEL_FLAG VARCHAR(32) NOT NULL DEFAULT 0 COMMENT '删除标识' , + REVISION INT NOT NULL DEFAULT 0 COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '话题状态维度表 ';; + +ALTER TABLE dim_topic_status COMMENT '话题状态维度表';; + + + SET FOREIGN_KEY_CHECKS = 1; From 96d5cf8f1c649b6ad10b96d437e1098aebacb6af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Jun 2020 15:02:04 +0800 Subject: [PATCH 027/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/impl/UserAnalysisServiceImpl.java | 27 +++++++++++++++++-- .../resources/mapper/user/UserAnalysisDao.xml | 2 ++ 2 files changed, 27 insertions(+), 2 deletions(-) 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 677668e0c5..8a4e5924e9 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 @@ -136,6 +136,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { if(dimInitResultDto.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ flag=true; //居民、热心居民、党员总数,用于排序 + if(null==userSubAgencyResDTO.getPartymemberTotal()){ + userSubAgencyResDTO.setPartymemberTotal(0); + } + if(null==userSubAgencyResDTO.getWarmHeartedTotal()){ + userSubAgencyResDTO.setWarmHeartedTotal(0); + } + if(null==userSubAgencyResDTO.getResiTotal()){ + userSubAgencyResDTO.setResiTotal(0); + } dimInitResultDto.setTotal(userSubAgencyResDTO.getPartymemberTotal() +userSubAgencyResDTO.getWarmHeartedTotal() +userSubAgencyResDTO.getResiTotal()); @@ -152,6 +161,8 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { default: break; } + logger.info(String.format("找到当前机关(agencyId=%s,agencyName=%s)对应的数据,当前循环",dimInitResultDto.getAgencyId(),dimInitResultDto.getName())); + break; } } if(!flag){ @@ -229,6 +240,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { if(dimInitResultDto.getGridId().equals(userSubGridResDTO.getGridId())){ flag=true; //居民、热心居民、党员总数,用于排序 + if(null==userSubGridResDTO.getPartymemberTotal()){ + userSubGridResDTO.setPartymemberTotal(0); + } + if(null==userSubGridResDTO.getWarmHeartedTotal()){ + userSubGridResDTO.setWarmHeartedTotal(0); + } + if(null==userSubGridResDTO.getResiTotal()){ + userSubGridResDTO.setResiTotal(0); + } dimInitResultDto.setTotal(userSubGridResDTO.getPartymemberTotal() +userSubGridResDTO.getWarmHeartedTotal() +userSubGridResDTO.getResiTotal()); @@ -246,6 +266,8 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { break; } } + logger.info(String.format("找到当前网格(gridId=%s,gridName=%s)对应的数据,当前循环",dimInitResultDto.getGridId(),dimInitResultDto.getName())); + break; } if(!flag){ logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); @@ -341,7 +363,8 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { default: break; } - + logger.info(String.format("找到当前日期(dateorMonthId=%s)对应的数据,跳出当前循环",dim.getDateOrMonthId())); + break; } } if(!flag){ @@ -382,7 +405,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { } }else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){ List monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12), - DateUtils.getBeforeNMonth(1)); + DateUtils.getBeforeNMonth(0)); for(String monthId:monthList){ String date=DateUtils.getxAxisDatePattern(monthId,"/"); //居民 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 6f559931fb..0d593b8379 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 @@ -92,6 +92,7 @@ ) WHERE da.DEL_FLAG = '0' AND da.PID =#{agencyId} + and da.AGENCY_DIM_TYPE='all' order by m.REG_TOTAL desc @@ -113,6 +114,7 @@ ) WHERE da.DEL_FLAG = '0' AND da.PID =#{agencyId} + and da.AGENCY_DIM_TYPE='all' order by m.REG_TOTAL desc From 532e5dcf1e1766933cf15a51be77fa0fdac0985c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Jun 2020 15:04:42 +0800 Subject: [PATCH 028/137] datareport0.3.4 --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index aff27c6e10..a0810897a2 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.3 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.4 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 797ef55a62..9ffe6d34d7 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.3 + 0.3.4 data-report-server From 95e23b5ce43f9200cdd7ba3c2a46765bec3a0c54 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 24 Jun 2020 15:19:21 +0800 Subject: [PATCH 029/137] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDao.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index e2d08c35a2..84f000a53c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -14,6 +14,8 @@ FROM fact_group_agency_daily WHERE del_flag = '0' AND agency_id = #{agencyId} + ORDER BY date_id DESC + LIMIT 1 From 96ee5f3a7a26a17b76619b6855397709756d5e2e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Jun 2020 15:29:27 +0800 Subject: [PATCH 030/137] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=80=BB=E6=95=B0=20?= =?UTF-8?q?=E5=80=92=E5=BA=8F=E5=8F=96=E7=AC=AC=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/DingTalkTextMsg.java | 88 ++++ .../tools/utils/HttpClientManager.java | 36 +- .../mapper/publicity/PublicityDao.xml | 2 +- .../com/epmet/constant/ProjectConstant.java | 5 + .../impl/StatsPublicityServiceImpl.java | 454 +++++++++++------- .../src/main/resources/logback-spring.xml | 1 - 6 files changed, 398 insertions(+), 188 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java new file mode 100644 index 0000000000..b548bad87f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java @@ -0,0 +1,88 @@ +package com.epmet.commons.tools.dto.form; + +import com.alibaba.fastjson.JSON; +import lombok.Data; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc: 钉钉文本消息参数 实体类 + * date: 2019/2/20 11:00 + * @author: jianjun liu + * email:liujianjun@yunzongnet.com + */ +public class DingTalkTextMsg { + + /** + * 消息接收者 + */ + private String receiver; + /** + * 发送内容 + */ + private String content; + + /** + * at的群成员手机号 + */ + private List atMobiles; + + /** + * 是否at所有人 + */ + private boolean isAtAll; + + public String getReceiver() { + return receiver; + } + + public void setReceiver(String receiver) { + this.receiver = receiver; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public List getAtMobiles() { + return atMobiles; + } + + public void setAtMobiles(List atMobiles) { + this.atMobiles = atMobiles; + } + + public boolean isAtAll() { + return isAtAll; + } + + public void setAtAll(boolean atAll) { + isAtAll = atAll; + } + + public String getMsgContent() { + Map items = new HashMap<>(); + items.put("msgtype", "text"); + + Map textContent = new HashMap<>(); + textContent.put("content", getContent()); + items.put("text", textContent); + + Map atItems = new HashMap<>(); + if (!CollectionUtils.isEmpty(atMobiles)) { + atItems.put("atMobiles", atMobiles); + } + if (isAtAll) { + atItems.put("isAtAll", isAtAll); + } + items.put("at", atItems); + return JSON.toJSONString(items); + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 20790e1d6a..2cfaed7588 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -1,10 +1,13 @@ package com.epmet.commons.tools.utils; + import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; @@ -20,10 +23,12 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; -import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; import java.io.IOException; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -115,6 +120,35 @@ public class HttpClientManager { } + /** + * desc: 发送钉钉群消息 简版 + * param: url,jsonStrParam + * return: Result + * + * @author: jianjun liu + */ + public Result sendAlarmMsg(String content) { + Long timestamp = System.currentTimeMillis(); + String url = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c"; + String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19"; + + try { + String stringToSign = timestamp + "\n" + secret; + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setContent(content); + url = url.concat("×tamp="+timestamp+"&sign="+sign); + String jsonStrParam = msg.getMsgContent(); + return sendPostByJSON(url, jsonStrParam); + } catch (Exception e) { + e.printStackTrace(); + } + return new Result().error(); + } + /** * desc: 发送get请求 * param:url, params 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 index ccd4fb657e..cd536caa30 100644 --- 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 @@ -10,7 +10,7 @@ article_published_count AS publishingTotal, DATE_FORMAT( date_id, '%Y.%m.%d' ) AS dateName FROM fact_article_published_agency_daily - where agency_id = #{agencyId} + where agency_id = #{agencyId} order by DATE_ID desc limit 1 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 96461ec01a..af55207d6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -43,4 +43,9 @@ public interface ProjectConstant { */ String PUBLISHER_TYPE_GRID = "grid"; + /** + * 执行失败钉钉消息模版 + */ + String EXE_FAILED_MSG = "定时任务【%s】执行失败,客户ID:%s,统计时间:%s,异常信息:%s"; + } 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 e21c1e1488..ea5cfa6843 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 @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; @@ -160,8 +161,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; //executorService.submit(() -> { - //统计 - statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); + //统计 + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); //}); } } @@ -218,10 +219,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - //executorService.submit(() -> { //统计 statsTagViewedDaily(finalStatsDate, dimIdBean, customerId); - //}); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -245,13 +244,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - executorService.submit(() -> { - try { - statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); - } catch (Exception e) { - log.error("statsTagViewedMonthly exception", e); - } - }); + try { + statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); + } catch (Exception e) { + log.error("statsTagViewedMonthly exception", e); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -343,7 +340,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(() -> { + + try { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 @@ -364,7 +362,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); - }); + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计部门纬度文章总数", customerId, statsDate, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } + } + } /** @@ -394,7 +400,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } /** - * desc:按日统计 网格纬度的 文章总数数据 + * desc:按日统计 文章总数数据 * * @param statsDate * @param dimIdBean @@ -408,31 +414,37 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(() -> { - 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); + + 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); } - 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()); + } catch (Exception e) { + log.error("statsPublishedGridDaily exception customerId:{},statsDate:{}", customerId, statsDate); + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计网格纬度文章总数", customerId, statsDate, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } + } + } @@ -443,7 +455,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(() -> { try { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); @@ -492,18 +503,22 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(haveDataAgencyDailySelfMap)) { agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); } - log.debug("statsPublishedAgencyDaily insert:{}",JSON.toJSONString(agencyDailyEntityMap.values())); + 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); + log.error("statsPublishedAgencyDaily exception,customer:{}", customerId); + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计部门纬度文章总数", customerId, statsDate, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } - }); - } /** - * desc:按日统计 网格纬度的 标签被使用的次数 + * desc:按日统计 标签被使用的次数 * * @param statsDate * @param dimIdBean @@ -581,13 +596,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); } - if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)){ + if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) { finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); } factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } catch (Exception e) { - e.printStackTrace(); - //log.error(); + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计标签被使用次数", customerId, statsDate, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -599,88 +618,98 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { - //1.业务数据来源 发布时间为统计时间的 - // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 - // 1.1查出今天所有的文章标签 根据网格Id - // 1.2 - //获取所有机关 用于后面想上级添加数据 - List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); - if (CollectionUtils.isEmpty(agencyDTOList)) { - log.debug("statsTagViewedDaily customerId:{} have any agency", customerId); - return; - } - - List dimGridList = dimGridService.getGridListByCustomerId(customerId); - if (CollectionUtils.isEmpty(dimGridList)) { - log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); - return; - } - Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); - //转换为 需要插入的Entity - Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); - //转换为 需要插入的Entity key gridId_tagId - Map tagViewedGridDailyMap = new HashMap<>(); - Map tagViewedAgencyDailyMap = new HashMap<>(); - Map tagViewedAgencyDailySelfMap = new HashMap<>(); - //获取当天的业务数据 - //1获取今天文章的阅读记录数 - Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); - Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); - List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); - if (CollectionUtils.isEmpty(visitRecordList)) { - return; - } - - for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { - List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); - if (CollectionUtils.isEmpty(articleTagsList)) { - continue; + try { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有机关 用于后面想上级添加数据 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.debug("statsTagViewedDaily customerId:{} have any agency", customerId); + return; } - ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); - if (articleEntity == null) { - continue; + + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(dimGridList)) { + log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); + return; } - boolean isAgencyPublished = false; - if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { - isAgencyPublished = true; + Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagViewedGridDailyMap = new HashMap<>(); + Map tagViewedAgencyDailyMap = new HashMap<>(); + Map tagViewedAgencyDailySelfMap = new HashMap<>(); + //获取当天的业务数据 + //1获取今天文章的阅读记录数 + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(visitRecordList)) { + return; } - String gridId = viewedSummaryDTO.getGridId(); - DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); - if (dimGridEntity == null) { - log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); - continue; - } - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); - for (ArticleTagsEntity articleTag : articleTagsList) { - convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); - convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); - if (isAgencyPublished) { - convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { + List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsList)) { + continue; + } + ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); + if (articleEntity == null) { + continue; + } + boolean isAgencyPublished = false; + if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { + isAgencyPublished = true; + } + String gridId = viewedSummaryDTO.getGridId(); + DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); + + if (dimGridEntity == null) { + log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); + continue; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); + for (ArticleTagsEntity articleTag : articleTagsList) { + convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + if (isAgencyPublished) { + convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + } } } - } - factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); + factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); - //向上级机关递归添加 数据 - Map finalTagUsedAgencyDailyMap = new HashMap<>(); - finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); - for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); - FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); - if (dimAgencyEntity == null) { + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); + for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { - log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); - continue; + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); } - setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); - } - if (!CollectionUtils.isEmpty(tagViewedAgencyDailySelfMap)) { - finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap); + if (!CollectionUtils.isEmpty(tagViewedAgencyDailySelfMap)) { + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap); + } + factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按日统计标签被查看次数", customerId, statsDate, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } + } - factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } /** @@ -690,20 +719,29 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedMonthly(String monthId, String customerId) { - List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); - if (!CollectionUtils.isEmpty(gridDailyList)) { - List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); - factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); - } - List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); - if (!CollectionUtils.isEmpty(deptDailyList)) { - List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); - factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); - } - List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); - if (!CollectionUtils.isEmpty(agencyDailyList)) { - List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); - factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + try { + List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); + factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(deptDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); + factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被使用次数", customerId, monthId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -714,16 +752,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedMonthly(String monthId, String customerId) { - List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); - if (!CollectionUtils.isEmpty(gridDailyList)) { - List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); - factTagViewedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); - } + try { + List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); + factTagViewedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } - List agencyDailyList = factTagViewedAgencyDailyService.getTagViewedCountByMonth(customerId, monthId); - if (!CollectionUtils.isEmpty(agencyDailyList)) { - List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); - factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + List agencyDailyList = factTagViewedAgencyDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); + factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按月统计标签被查看次数", customerId, monthId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -734,20 +781,29 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); - if (!CollectionUtils.isEmpty(gridMonthlyList)) { - List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); - factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); - } - List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); - if (!CollectionUtils.isEmpty(deptMonthlyList)) { - List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); - factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, deptQuarterlyList); - } - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); - if (!CollectionUtils.isEmpty(agencyMonthlyList)) { - List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); - factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + try { + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); + factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, deptQuarterlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被使用次数", customerId, quarterId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -758,16 +814,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); - if (!CollectionUtils.isEmpty(gridMonthlyList)) { - List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); - factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); - } + try { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); + factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } - List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); - if (!CollectionUtils.isEmpty(agencyMonthlyList)) { - List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); - factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); + factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按季统计标签被查看次数", customerId, quarterId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -778,20 +843,29 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedYearly(String yearId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); - if (!CollectionUtils.isEmpty(gridMonthlyList)) { - List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); - factTagUsedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); - } - List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); - if (!CollectionUtils.isEmpty(deptMonthlyList)) { - List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); - factTagUsedDepartmentYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); - } - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); - if (!CollectionUtils.isEmpty(agencyMonthlyList)) { - List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); - factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + try { + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); + factTagUsedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); + factTagUsedDepartmentYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); + factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被使用次数", customerId, yearId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } @@ -802,15 +876,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedYearly(String yearId, String customerId) { - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); - if (!CollectionUtils.isEmpty(gridMonthlyList)) { - List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); - factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); - } - List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); - if (!CollectionUtils.isEmpty(agencyMonthlyList)) { - List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); - factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + + try { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); + factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); + factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + } catch (Exception e) { + try { + String content = String.format(ProjectConstant.EXE_FAILED_MSG, "按年统计标签被查看次数", customerId, yearId, e.getMessage()); + HttpClientManager.getInstance().sendAlarmMsg(content); + } catch (Exception ex) { + log.error("sendAlarmMsg exception", e); + } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index ae47a96fcd..99ccda0d9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -138,7 +138,6 @@ - From 7183e231dd6f3196ee8aee078406faff29ed11c8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Jun 2020 15:33:26 +0800 Subject: [PATCH 031/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index a0810897a2..8f4a3b3254 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.4 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.5 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 9ffe6d34d7..a818e16cf5 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.4 + 0.3.5 data-report-server From f610d04595bd24ffea14f516f1e3b67c154c0953 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 24 Jun 2020 15:40:01 +0800 Subject: [PATCH 032/137] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE,=E8=AF=9D=E9=A2=98=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDao.xml | 4 +++- .../src/main/resources/mapper/topic/TopicDao.xml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index 84f000a53c..607fc0819c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -74,6 +74,7 @@ AND agency_id = #{agencyId} ORDER BY date_id DESC + LIMIT 90 @@ -83,12 +84,13 @@ group_incr AS value, '小组数量' AS type FROM - fact_group_agency_daily + fact_group_agency_monthly WHERE del_flag = '0' AND agency_id = #{agencyId} ORDER BY month_id DESC + LIMIT 12 \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 6945fb4baa..169227cff9 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -156,6 +156,7 @@ AND agency_id = #{agencyId} ORDER BY date_id DESC + LIMIT 270 @@ -187,6 +188,7 @@ AND agency_id = #{agencyId} ORDER BY month_id DESC + LIMIT 36 From 38b54b5189dcf1d57b4d915b2590460d1ffe883c Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Jun 2020 17:16:20 +0800 Subject: [PATCH 042/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsIssueServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 fd6ffe7b88..ab38ff305a 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 @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IssueConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; @@ -18,6 +19,7 @@ import com.epmet.service.StatsIssueService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -33,6 +35,7 @@ import java.util.stream.Collectors; * @dscription * @date 2020/6/17 16:51 */ +@Slf4j @Service public class StatsIssueServiceImpl implements StatsIssueService { @Autowired @@ -60,11 +63,17 @@ public class StatsIssueServiceImpl implements StatsIssueService { int pageSize = 100; List customerIdList = null; do { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { //遍历统计每一个客户数据 - customerStats(customerId); + try { + customerStats(customerId, date); + } catch(Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date), e.getMessage())); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -77,10 +86,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { * @param customerId * @return void */ - @Async - public void customerStats(String customerId) { - //获取当前日期前一天 - Date date = DateUtils.getBeforeDay(new Date()); + private void customerStats(String customerId, Date date) { //机关议题日统计 saveIssueAgencyDaily(customerId, date); //机关议题月统计 From ab5d8fabbd0ecb2346623c3cc9abd3dec2c7a66b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 24 Jun 2020 17:21:19 +0800 Subject: [PATCH 043/137] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/project/ProjectDao.xml | 2 +- .../service/impl/StatsProjectServiceImpl.java | 58 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index f61c01dedb..5f78474374 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -159,7 +159,7 @@ ) ) a ORDER BY - a.project_total DESC + a.project_total DESC, a.type ASC From dee26b5f135b7145bae4109f1c702ccbccad6c6a Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sun, 28 Jun 2020 09:54:25 +0800 Subject: [PATCH 056/137] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=9B=B4=E5=B1=9E=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDao.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index 380a0b598e..6bee70e94b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -42,8 +42,7 @@ AND da.del_flag = '0' WHERE fgad.del_flag = '0' - GROUP BY fgad.agency_id - ORDER BY fgad.date_id desc + AND fgad.date_id = (SELECT MAX(date_id) FROM fact_group_agency_daily WHERE del_flag = '0') From 26dc73b7b03df485bb74af47060ea93ed13fe7c4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 12:47:16 +0800 Subject: [PATCH 057/137] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B4=E5=B1=9E?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E3=80=81=E7=9B=B4=E5=B1=9E=E6=9C=BA=E5=85=B3?= =?UTF-8?q?=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/impl/UserAnalysisServiceImpl.java | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) 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 9e02c60af2..da03803515 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 @@ -28,9 +28,9 @@ import org.springframework.util.CollectionUtils; import java.text.DecimalFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.Comparator; import java.util.List; -import java.util.stream.Collectors; /** * 组织能力用户相关接口 @@ -169,10 +169,23 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { logger.error(String.format("各机关注册用户数缺少记录:date_id=%s,agencyId=%s",formDTO.getDateId(),dimInitResultDto.getAgencyId())); } } + logger.info("排序前"); + for(UserSubAgencyResultDTO m:dimList){ + logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); + } //返回集合按照total降序排序 - List returnList = dimList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) - .collect(Collectors.toList()); - return returnList; + Collections.sort(dimList, new Comparator() { + @Override + public int compare(UserSubAgencyResultDTO o1, UserSubAgencyResultDTO o2) { + int i=o2.getTotal()-o1.getTotal();//降序 + return i; + } + }); + logger.info("排序后"); + for(UserSubAgencyResultDTO m:dimList){ + logger.info("机关名:"+m.getName()+",总数="+m.getTotal()); + } + return dimList; } private List initUserSubAgencyResultDTO(String myAgencyId) { @@ -273,10 +286,23 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); } } + logger.info("排序前"); + for(UserSubGridResultDTO m:dimList){ + logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); + } //返回集合按照total降序排序 - List returnList = dimList.stream().sorted(Comparator.comparing(UserSubGridResultDTO::getTotal)) - .collect(Collectors.toList()); - return returnList; + Collections.sort(dimList, new Comparator() { + @Override + public int compare(UserSubGridResultDTO o1, UserSubGridResultDTO o2) { + int i=o2.getTotal()-o1.getTotal();//降序 + return i; + } + }); + logger.info("排序后"); + for(UserSubGridResultDTO m:dimList){ + logger.info("网格名:"+m.getName()+",总数="+m.getTotal()); + } + return dimList; } private List initUserSubGridResultDTO(String myAgencyId) { From e28732d20688d2b885e04e3703849abb25695709 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 12:49:19 +0800 Subject: [PATCH 058/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1=EF=BC=9Ad?= =?UTF-8?q?atareport0.3.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index d9df4ec6ab..7382b031d5 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.6 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.7 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 8cfd6b8fda..e67c1b6c1c 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.6 + 0.3.7 data-report-server From 201bbdd94a5437ab52210c56ea54a4e5a3e54c5b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 13:34:09 +0800 Subject: [PATCH 059/137] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8A=98=E7=BA=BF?= =?UTF-8?q?=E5=9B=BE=E6=97=A5=E5=A2=9E=E9=87=8F=E8=BF=94=E5=9B=9E=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9=E4=B8=BAMM/dd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/user/impl/UserAnalysisServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 da03803515..5265749de5 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 @@ -425,7 +425,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { for(UserIncrTrendResDTO userIncrTrendResDTO:list){ String date=""; if(UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())){ - date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"."); + date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); }else if(UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())){ date=DateUtils.getxAxisDatePattern(userIncrTrendResDTO.getDateIdOrMonthId(),"/"); } From 4d0b24d11794084ac53d4a7a8108f82e1619ff3f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 13:35:41 +0800 Subject: [PATCH 060/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1=EF=BC=9Ad?= =?UTF-8?q?atareport0.3.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 7382b031d5..2258dd43cf 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.7 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.8 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index e67c1b6c1c..a03e16e222 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.7 + 0.3.8 data-report-server From a7c16d2ae630408edacbb3c1200ac178e10b4ff8 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sun, 28 Jun 2020 13:47:08 +0800 Subject: [PATCH 061/137] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84,?= =?UTF-8?q?=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/TopicSubAgencyResultDTO.java | 7 +++++ .../dto/result/TopicSubGridResultDTO.java | 7 +++++ .../service/group/impl/GroupServiceImpl.java | 5 +++- .../service/topic/impl/TopicServiceImpl.java | 30 +++++++++++++++---- .../main/resources/mapper/group/GroupDao.xml | 3 +- 5 files changed, 45 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java index 87dd107010..3b599a64ff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.topic.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -32,4 +33,10 @@ public class TopicSubAgencyResultDTO implements Serializable { * 机关Id */ private String agencyId; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java index 64cad1615c..d319e2c128 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.topic.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -32,4 +33,10 @@ public class TopicSubGridResultDTO implements Serializable { * 网格Id */ private String gridId; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java index 80a5624e3b..1c72f584fc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java @@ -15,7 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; /** * @Author zxc @@ -60,7 +62,8 @@ public class GroupServiceImpl implements GroupService { } }); }); - return result; + //倒序 + return result.stream().sorted(Comparator.comparing(GroupSubAgencyResultDTO::getValue).reversed()).collect(Collectors.toList()); } return new ArrayList<>(); } 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 0859bd2632..ad8d8e7eee 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 @@ -14,9 +14,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -94,6 +92,7 @@ public class TopicServiceImpl implements TopicService { public List topicSubGrid(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); List result = new ArrayList<>(); + List resultAll = new ArrayList<>(); List subGridIdList = topicDao.getSubGridIdList(agencyId); if (subGridIdList.size() != NumConstant.ZERO){ List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); @@ -110,7 +109,17 @@ public class TopicServiceImpl implements TopicService { } }); }); - return result; + Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubGridResultDTO::getGridId)); + Set>> entries = collect.entrySet(); + entries.forEach(entry -> { + List value = entry.getValue(); + Integer sort = value.stream().collect(Collectors.summingInt(TopicSubGridResultDTO::getValue)); + value.forEach(v -> { + v.setSort(sort); + resultAll.add(v); + }); + }); + return resultAll.stream().sorted(Comparator.comparing(TopicSubGridResultDTO::getSort).reversed()).collect(Collectors.toList()); } return new ArrayList<>(); } @@ -124,6 +133,7 @@ public class TopicServiceImpl implements TopicService { public List topicSubAgency(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); List result = new ArrayList<>(); + List resultAll = new ArrayList<>(); List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); //存在下级机关 if (subAgencyIdList.size() != NumConstant.ZERO){ @@ -142,7 +152,17 @@ public class TopicServiceImpl implements TopicService { } }); }); - return result; + Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubAgencyResultDTO::getAgencyId)); + Set>> entries = collect.entrySet(); + entries.forEach(entry -> { + List value = entry.getValue(); + Integer sort = value.stream().collect(Collectors.summingInt(TopicSubAgencyResultDTO::getValue)); + value.forEach(v -> { + v.setSort(sort); + resultAll.add(v); + }); + }); + return resultAll.stream().sorted(Comparator.comparing(TopicSubAgencyResultDTO::getSort).reversed()).collect(Collectors.toList()); } //不存在 return new ArrayList<>(); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index 6bee70e94b..47b42695ee 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -59,6 +59,7 @@ fggd.del_flag = '0' AND fggd.agency_id = #{agencyId} AND fggd.date_id = (SELECT MAX(date_id) FROM fact_group_grid_daily WHERE del_flag = '0') + ORDER BY value DESC @@ -89,7 +90,7 @@ del_flag = '0' AND agency_id = #{agencyId} ORDER BY - month_id DESC + month_id DESC, value DESC LIMIT 12 From 2caacd536de147d4effbe29ab7c4c388010fc923 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Sun, 28 Jun 2020 14:14:57 +0800 Subject: [PATCH 062/137] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--N?= =?UTF-8?q?EI=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/FactTagAgencyDTO.java | 2 +- .../data-report/data-report-server/pom.xml | 2 +- .../mapper/publicity/PublicityDao.xml | 21 +++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) 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 1d91a3287a..35cbbc0390 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 @@ -47,7 +47,7 @@ public class FactTagAgencyDTO implements Serializable { /** * 固定值:文章数量 */ - private String type="文章数量"; + private String type="阅读次数"; /** * 机关Id diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index a818e16cf5..c4c1073c33 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -112,7 +112,7 @@ 123456 - true + false 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b 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 index cd536caa30..c7d032eb43 100644 --- 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 @@ -24,7 +24,7 @@ where agency_id = #{agencyId} AND month_id = #{monthId} GROUP BY TAG_ID - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -39,7 +39,7 @@ where agency_id = #{agencyId} AND quarter_id = #{quarterId} GROUP BY TAG_ID - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -54,7 +54,7 @@ where agency_id = #{agencyId} AND year_id = #{yearId} GROUP BY tag_id - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -69,7 +69,7 @@ where agency_id = #{agencyId} AND month_id = #{monthId} GROUP BY TAG_ID - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -84,7 +84,7 @@ where agency_id = #{agencyId} AND quarter_id = #{quarterId} GROUP BY TAG_ID - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -99,7 +99,7 @@ where agency_id = #{agencyId} AND year_id = #{yearId} GROUP BY tag_id - ORDER BY value DESC + ORDER BY value DESC ,tagId ASC LIMIT #{pageSize} @@ -118,6 +118,7 @@ AND pub.PID =#{agencyId} AND pub.month_id=#{monthId} GROUP BY pub.agency_id + ORDER BY value DESC,agencyId ASC @@ -136,6 +137,7 @@ AND pub.PID =#{agencyId} AND pub.quarter_id=#{quarterId} GROUP BY pub.agency_id + ORDER BY value DESC,agencyId ASC @@ -153,6 +155,7 @@ AND pub.PID =#{agencyId} AND pub.year_id=#{yearId} GROUP BY pub.agency_id + ORDER BY value DESC,agencyId ASC @@ -170,6 +173,7 @@ AND pub.agency_id =#{agencyId} AND pub.month_id=#{monthId} GROUP BY pub.department_id + ORDER BY value DESC,departmentId ASC @@ -188,6 +192,7 @@ AND pub.agency_id =#{agencyId} AND pub.quarter_id=#{quarterId} GROUP BY pub.department_id + ORDER BY value DESC,departmentId ASC @@ -205,6 +210,7 @@ AND pub.agency_id =#{agencyId} AND pub.year_id=#{yearId} GROUP BY pub.department_id + ORDER BY value DESC,departmentId ASC @@ -222,6 +228,7 @@ AND pub.agency_id = #{agencyId} AND pub.month_id=#{monthId} GROUP BY pub.grid_id + ORDER BY value DESC,gridId ASC @@ -240,6 +247,7 @@ AND pub.agency_id = #{agencyId} AND pub.quarter_id=#{quarterId} GROUP BY pub.grid_id + ORDER BY value DESC,gridId ASC @@ -257,6 +265,7 @@ AND pub.agency_id = #{agencyId} AND pub.year_id = #{yearId} GROUP BY pub.grid_id + ORDER BY value DESC,gridId ASC \ No newline at end of file From 07a192de765947ff061eda3cb8e78e0919d39212 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Sun, 28 Jun 2020 14:22:05 +0800 Subject: [PATCH 063/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E5=A2=9E=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StatsIssueController.java | 15 +++ .../com/epmet/dao/issue/StatsIssueDao.java | 3 +- .../com/epmet/service/Issue/IssueService.java | 3 +- .../service/Issue/impl/IssueServiceImpl.java | 4 +- .../com/epmet/service/StatsIssueService.java | 9 ++ .../service/impl/StatsIssueServiceImpl.java | 55 +++++++--- .../resources/mapper/issue/StatsIssueDao.xml | 102 +++++++++++++----- 7 files changed, 146 insertions(+), 45 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java index 850c3b7a75..b78ca89680 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java @@ -1,12 +1,17 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsIssueService; +import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; 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.io.Serializable; + /** * @author zhaoqifeng * @dscription @@ -30,4 +35,14 @@ public class StatsIssueController { statsIssueService.agencyGridIssueStats(); return new Result(); } + @Data + private static class StatsDate implements Serializable { + private static final long serialVersionUID = 149723067011918433L; + private String date; + } + @PostMapping("date") + public Result agencyGridIssueStatsOfDate(@RequestBody StatsDate statsDate) { + statsIssueService.agencyGridIssueStatsOfDate(DateUtils.parse(statsDate.getDate(), DateUtils.DATE_PATTERN)); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 98d2e0e96d..87cd7c6879 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -18,11 +18,12 @@ public interface StatsIssueDao extends BaseDao { * 获取当前日期组织下议题统计结果 * * @param customerId + * @param date * @return java.util.List * @author zhaoqifeng * @date 2020/6/17 14:13 */ - List selectAgencyIssueTotal(@Param("customerId") String customerId); + List selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date); /** * 获取当前日期组织下议题增量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index c6b8a8bee0..4ffeb599c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -18,9 +18,10 @@ public interface IssueService { * @author zhaoqifeng * @date 2020/6/17 16:04 * @param customerId + * @param date * @return java.util.List */ - List getAgencyIssueTotal(String customerId); + List getAgencyIssueTotal(String customerId, String date); /** * 获取当前日期组织下议题增量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 9cef7c5340..443c9ddc41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -26,8 +26,8 @@ public class IssueServiceImpl implements IssueService { private StatsIssueDao statsIssueDao; @Override - public List getAgencyIssueTotal(String customerId) { - List list = statsIssueDao.selectAgencyIssueTotal(customerId); + public List getAgencyIssueTotal(String customerId, String date) { + List list = statsIssueDao.selectAgencyIssueTotal(customerId, date); list.forEach(dto -> { String[] pIds = dto.getPIds().split(":"); dto.setPId(pIds[pIds.length - 2]); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java index 5d0e6b4292..7faf406333 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -17,6 +17,15 @@ public interface StatsIssueService { */ void agencyGridIssueStats(); + /** + * 指定日期议题统计 + * @author zhaoqifeng + * @date 2020/6/28 11:01 + * @param date + * @return void + */ + void agencyGridIssueStatsOfDate(Date date); + /** * 机关下议题日统计 * @author zhaoqifeng 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 ab38ff305a..3043e97e1a 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 @@ -20,6 +20,7 @@ import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; +import oracle.sql.DATE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -66,6 +67,28 @@ public class StatsIssueServiceImpl implements StatsIssueService { //获取当前日期前一天 Date date = DateUtils.getBeforeDay(new Date()); customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + try { + customerStats(customerId, date); + } catch(Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", customerId, DateUtils.format(date), + e.getMessage())); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + @Override + public void agencyGridIssueStatsOfDate(Date date) { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取当前日期前一天 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { //遍历统计每一个客户数据 @@ -109,7 +132,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 - List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId, dateString); //获取机关下议题各种状态的数目增量 List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString); //获取机关下已关闭议题统计 @@ -129,10 +152,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setPid(agency.getPid()); String pIds; - if (null == agency.getPids() || agency.getPids().isEmpty()) { - pIds = agency.getPid().concat(":").concat(agency.getId()); + if (NumConstant.ZERO_STR.equals(agency.getPid())) { + pIds = agency.getPid(); } else { - pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + pIds = agency.getPids().concat(":").concat(agency.getId()); } //总量统计 saveTotal(issueAgencyTotalList, agency, entity, pIds); @@ -172,7 +195,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 - List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId, dateString); //获取机关下已关闭议题统计 List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); //已结案项目统计 @@ -185,10 +208,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { FactIssueAgencyMonthlyEntity monthly = initIssueAgencyMonthly(dimId); String pIds; - if (null == agency.getPids() || agency.getPids().isEmpty()) { - pIds = agency.getPid().concat(":").concat(agency.getId()); + if (NumConstant.ZERO_STR.equals(agency.getPid())) { + pIds = agency.getPid(); } else { - pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + pIds = agency.getPids().concat(":").concat(agency.getId()); } //总量统计 saveTotal(issueAgencyTotalList, agency, daily, pIds); @@ -550,6 +573,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { int shiftInc = NumConstant.ZERO; //已关闭增量 int closedInc = NumConstant.ZERO; + //议题增量 + int issueInc = NumConstant.ZERO; for (IssueGridDTO dto : list) { if (grid.getId().equals(dto.getGridId())) { if (IssueConstant.VOTING.equals(dto.getStatus())) { @@ -558,13 +583,15 @@ public class StatsIssueServiceImpl implements StatsIssueService { } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { //已转项目议题数量 shiftInc = dto.getCount(); - } else { + } else if(IssueConstant.CLOSED.equals(dto.getStatus())) { //已关闭议题数量 closedInc = dto.getCount(); + } else { + issueInc = dto.getCount(); } } } - int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); entity.setShiftProjectIncr(shiftInc); entity.setClosedIncr(closedInc); @@ -712,6 +739,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { int shiftInc = NumConstant.ZERO; //已关闭增量 int closedInc = NumConstant.ZERO; + //议题增量 + int issueInc = NumConstant.ZERO; for (IssueAgencyDTO issueAgency : list) { if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { if (IssueConstant.VOTING.equals(issueAgency.getStatus())) { @@ -720,13 +749,15 @@ public class StatsIssueServiceImpl implements StatsIssueService { } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { //已转项目议题数量 shiftInc = shiftInc + issueAgency.getCount(); - } else { + } else if(IssueConstant.CLOSED.equals(issueAgency.getStatus())) { //已关闭议题数量 closedInc = closedInc + issueAgency.getCount(); + } else { + //议题增量 + issueInc = issueInc + issueAgency.getCount(); } } } - int issueInc = votingInc + shiftInc + closedInc; entity.setVotingIncr(votingInc); entity.setShiftProjectIncr(shiftInc); entity.setClosedIncr(closedInc); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 3120f939d8..23dd47e689 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -12,26 +12,49 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} + AND DATE(UPDATED_TIME) #{date} GROUP BY ORG_ID, ISSUE_STATUS From b0f912f089e3e52310f47ab4f6fbeb88161be913 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sun, 28 Jun 2020 14:52:33 +0800 Subject: [PATCH 067/137] =?UTF-8?q?=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 f63d887dd9..3b81c15cfa 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 @@ -14,6 +14,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.text.DecimalFormat; import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -182,8 +183,9 @@ public class TopicServiceImpl implements TopicService { TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); if (topicSummaryInfo.size() != NumConstant.ZERO && shiftedCount != null) { Integer collect = topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue)); + DecimalFormat decimalFormat = new DecimalFormat(".00"); String ratio; - ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : ((float) shiftedCount.getShiftedIssueCount() / (float) collect) * NumConstant.ONE_HUNDRED + TopicConstant.RATIO; + ratio = collect == NumConstant.ZERO ? NumConstant.ZERO + TopicConstant.RATIO : decimalFormat.format(((float) shiftedCount.getShiftedIssueCount() / (float) collect) * NumConstant.ONE_HUNDRED) + TopicConstant.RATIO; TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); result.setName(TopicConstant.SHIFTED); result.setRatio(ratio); From 378d5d73a26ae76b90d0e05cd65f473025c1eb35 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 28 Jun 2020 14:52:35 +0800 Subject: [PATCH 068/137] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=A8=8B=E5=BA=8FBug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/StatsProjectServiceImpl.java | 4 ++-- .../src/main/resources/mapper/project/ProjectProcessDao.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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 0c4793e565..1dbb6f81f1 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 @@ -246,7 +246,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } agencyDailyEntity.setProjectIncr(projectIncr.intValue()); - agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); + agencyDailyEntity.setPendingIncr(projectIncr.intValue()); agencyDailyEntity.setClosedIncr(closedIncr.intValue()); agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue()); agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); @@ -539,7 +539,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } gridDailyEntity.setProjectIncr(projectIncr.intValue()); - gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); + gridDailyEntity.setPendingIncr(projectIncr.intValue()); gridDailyEntity.setClosedIncr(closedIncr.intValue()); gridDailyEntity.setResolvedIncr(resolvedIncr.intValue()); gridDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 9f839a668e..5f6816ff3b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -5,9 +5,9 @@ @@ -45,13 +47,14 @@ VOTING_TOTAL, SHIFT_PROJECT_TOTAL, CLOSED_TOTAL, - MAX(DATE_ID) AS DATE_ID + DATE_ID AS DATE_ID FROM fact_issue_grid_daily figd INNER JOIN dim_grid dg ON figd.GRID_ID = dg.ID WHERE figd.DEL_FLAG = '0' AND figd.AGENCY_ID = #{agencyId} + AND figd.DATE_ID = #{dateId} GROUP BY GRID_ID ORDER BY figd.ISSUE_TOTAL DESC From f948da1746ba26ea8b86398327bc9a00d96f3a59 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 18:13:14 +0800 Subject: [PATCH 079/137] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=99=BE=E5=88=86=E6=AF=94=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/user/impl/UserAnalysisServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 5265749de5..a001f3847d 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 @@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.text.DecimalFormat; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -47,7 +47,6 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private UserAnalysisDao userAnalysisDao; - DecimalFormat decimalFormat = new DecimalFormat("0.00"); /** * @return java.lang.String * @param @@ -69,6 +68,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); } } + logger.info(String.format("用户%s的所属机关id为%s",loginUserDetailsFormDTO.getUserId(),result.getData().getAgencyId())); return result.getData().getAgencyId(); } /** @@ -92,9 +92,9 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { if(null!=userSummaryInfoResultDTO){ userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 - String partyMemberProStr=decimalFormat.format(userSummaryInfoResultDTO.getPartymemberProportionValue()); + String partyMemberProStr=userSummaryInfoResultDTO.getPartymemberProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); userSummaryInfoResultDTO.setPartymemberProportion(partyMemberProStr.concat("%")); - String warmProStr=decimalFormat.format(userSummaryInfoResultDTO.getWarmHeartedProportionValue()); + String warmProStr=userSummaryInfoResultDTO.getWarmHeartedProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); userSummaryInfoResultDTO.setWarmHeartedProportion(warmProStr.concat("%")); } logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); From 3216935822001b37feea94d868f0462d087467c7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 28 Jun 2020 18:20:44 +0800 Subject: [PATCH 080/137] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=9B=B4=E6=96=B0=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- .../epmet-job/epmet-job-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-job/epmet-job-server/pom.xml | 2 +- .../epmet-message-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-message/epmet-message-server/pom.xml | 2 +- .../gov-issue/gov-issue-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-issue/gov-issue-server/pom.xml | 2 +- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 2258dd43cf..21ee831dcc 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.8 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.9 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index a03e16e222..8c2ac84759 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.8 + 0.3.9 data-report-server diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 9f622320e1..2478d1b203 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.7 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.8 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 3cb1ed3e57..702c4a4194 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.7 + 0.3.8 data-statistical com.epmet 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 e20714082d..1aa3f41622 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.11 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.12 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 6301d4acec..a7130ca254 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.11 + 0.3.12 com.epmet epmet-job 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 c5e1c7579d..9aa157cd04 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.22 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.23 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 cf6938d147..bf543a83f3 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.22 + 0.3.23 com.epmet epmet-message diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index 06fc27b887..e5f9b0eb87 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.42 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.44 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 2dd11868f2..ad883bcc23 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.43 + 0.3.44 gov-issue com.epmet diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 48cd31c6f1..28f015a3c5 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.29 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 382580cd85..a3db2f67a8 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.28 + 0.3.29 gov-project com.epmet From d5afc43c74f5f48490387b482ea25e1799b31f63 Mon Sep 17 00:00:00 2001 From: wxz Date: Sun, 28 Jun 2020 18:51:46 +0800 Subject: [PATCH 081/137] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E6=9B=B4=E6=96=B0=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=9A=84=E7=BC=93=E5=AD=98=E4=BF=A1=E6=81=AFbug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GovLoginServiceImpl.java | 20 +++++++++++++- .../epmet/dto/form/GovStaffRoleFormDTO.java | 12 +++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 14 +++++++--- .../EpmetUserOpenFeignClientFallback.java | 11 +++++--- .../controller/GovStaffRoleController.java | 27 ++++++++++++++++--- .../java/com/epmet/dao/GovStaffRoleDao.java | 2 ++ .../java/com/epmet/feign/AuthFeignClient.java | 4 +-- .../epmet/service/GovStaffRoleService.java | 2 ++ .../service/impl/GovStaffRoleServiceImpl.java | 5 ++++ .../main/resources/mapper/GovStaffRoleDao.xml | 9 +++++++ 10 files changed, 91 insertions(+), 15 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java 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 bbb71f448b..5c8f90e81e 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 @@ -22,6 +22,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; @@ -62,6 +63,8 @@ public class GovLoginServiceImpl implements GovLoginService { private GovOrgFeignClient govOrgFeignClient; @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; /** * @param formDTO @@ -297,7 +300,22 @@ public class GovLoginServiceImpl implements GovLoginService { if (userDetails == null) { return; } - List roles = queryGovStaffRoles(staffId, orgId); + + GovStaffRoleFormDTO form = new GovStaffRoleFormDTO(); + form.setRoleIdList(roleIds); + Result> result = userOpenFeignClient.getByIds(form); + if (!result.success()) { + throw new RenException("更新缓存中的角色列表失败:" + result.getInternalMsg()); + } + + List roles = result.getData().stream().map(roleDto -> { + GovTokenDto.Role role = new GovTokenDto.Role(); + role.setRoleName(roleDto.getRoleName()); + role.setRoleKey(roleDto.getRoleKey()); + role.setId(roleDto.getRoleId()); + return role; + }).collect(Collectors.toList()); + userDetails.setRoleList(roles); cpUserDetailRedis.set(userDetails, jwtTokenProperties.getExpire()); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java new file mode 100644 index 0000000000..9d5ae26351 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.util.List; + +@Data +public class GovStaffRoleFormDTO { + + private List roleIdList; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index c8c1848738..d4a09e63cc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -4,12 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.GovStaffRoleFormDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.TagCustomerFormDTO; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -24,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087") @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) public interface EpmetUserOpenFeignClient { @@ -72,4 +71,11 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/user/getcustomeridbyuserid") Result getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO); + /** + * 根据角色id列表批量查询角色信息 + * @param form + * @return + */ + @PostMapping("/epmetuser/govstaffrole/getbyids") + Result> getByIds(@RequestBody GovStaffRoleFormDTO form); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 54c904449e..9f87d6f530 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -5,12 +5,10 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; +import com.epmet.dto.form.GovStaffRoleFormDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.TagCustomerFormDTO; -import com.epmet.dto.result.CustomerStaffRoleListResultDTO; -import com.epmet.dto.result.CustomerStaffRoleResultDTO; -import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.dto.result.TagCustomerResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; import org.springframework.stereotype.Component; @@ -50,4 +48,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO); } + @Override + public Result> getByIds(GovStaffRoleFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getById", form); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java index 8b8ccd1048..38081f88cd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -1,17 +1,20 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.RoleDTO; +import com.epmet.dto.form.GovStaffRoleFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.entity.GovStaffRoleEntity; import com.epmet.service.GovStaffRoleService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; @RequestMapping("govstaffrole") @RestController @@ -40,4 +43,20 @@ public class GovStaffRoleController { List roleTemplates = govStaffRoleService.listRoleTemplates(); return new Result().ok(roleTemplates); } + + /** + * 使用id列表查询角色列表 + * @param form + * @return + */ + @PostMapping("getbyids") + public Result> getByIds(@RequestBody GovStaffRoleFormDTO form) { + List roleDTOS = new ArrayList<>(); + List roleIdList = form.getRoleIdList(); + if (!CollectionUtils.isEmpty(roleIdList)) { + roleDTOS = roleIdList.stream().map(roleId -> govStaffRoleService.getDTOById(roleId)).collect(Collectors.toList()); + } + + return new Result>().ok(roleDTOS); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index d7562fafad..275a2e9742 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -59,4 +59,6 @@ public interface GovStaffRoleDao extends BaseDao { GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(@Param("customerId") String customerId, @Param("roleKey") String roleKey); List listRolesByCustomer(@Param("customerId") String customerId); + + GovStaffRoleResultDTO getDTOById(@Param("roleId") String roleId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java index dd1ed9ec46..cba4210ee7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java @@ -8,8 +8,8 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class, url = "localhost:8081") -//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class) +//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class, url = "localhost:8081") +@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class) public interface AuthFeignClient { /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 25d6fe495b..1322bf06d1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -125,4 +125,6 @@ public interface GovStaffRoleService extends BaseService { List listRolesByCustomer(String customerId); List listRoleTemplates(); + + GovStaffRoleResultDTO getDTOById(String roleId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 000ea2cd40..6da54b7c69 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -176,4 +176,9 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRoleTemplates() { return govStaffRoleTemplateDao.listValidateRoles(); } + + @Override + public GovStaffRoleResultDTO getDTOById(String roleId) { + return govStaffRoleDao.getDTOById(roleId); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index aa495b89f5..22f47ce8bc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -59,4 +59,13 @@ FROM gov_staff_role r WHERE r.CUSTOMER_ID = #{customerId} + + \ No newline at end of file From 40d3a28be31b13fa2e9152c9f161c49984e97fc8 Mon Sep 17 00:00:00 2001 From: wxz Date: Sun, 28 Jun 2020 18:52:47 +0800 Subject: [PATCH 082/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth/deploy/docker-compose-dev.yml | 2 +- epmet-auth/pom.xml | 2 +- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index 568dbc652d..3431acda04 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.25 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.26 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 3c591c3076..4ef8116c0e 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.25 + 0.3.26 com.epmet epmet-cloud 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 26c2930a6a..62e0f89277 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.64 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.65 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 549e4b72db..84957941b8 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.64 + 0.3.65 com.epmet epmet-user From 5ba67b9c19d0386624e7e699504abe65fdcfa307 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 28 Jun 2020 18:58:43 +0800 Subject: [PATCH 083/137] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatsPublicityServiceImpl.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 b7d5c4a20b..9f5ea34159 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 @@ -451,20 +451,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); - if (!CollectionUtils.isEmpty(agencySummaryMap)){ - //同一个机关下数据累加 - for (Map.Entry entry : agencySummaryMap.entrySet()) { - String agencyId = entry.getKey(); - ArticleGridPublishedSummaryDTO summary = entry.getValue(); - FactArticlePublishedAgencyDailyEntity dimAgencyEntity = agencyDailyEntityMap.get(agencyId); - if (dimAgencyEntity == null) { - continue; - } - dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount()); - dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount()); - dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount()); - } - } + //获取当天的业务数据 List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); Map haveDataAgencyDailyMap = new HashMap<>(); @@ -495,6 +482,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); } } + if (!CollectionUtils.isEmpty(agencySummaryMap)){ + //同一个机关下数据累加 + for (Map.Entry entry : agencySummaryMap.entrySet()) { + String agencyId = entry.getKey(); + ArticleGridPublishedSummaryDTO summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dimAgencyEntity = agencyDailyEntityMap.get(agencyId); + if (dimAgencyEntity == null) { + continue; + } + dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount()); + dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount()); + dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount()); + } + } //数据向上级机关添加 if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { From b80ecb5081cf1b297de38fe3fa7732ab3aaa850b Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 28 Jun 2020 19:10:34 +0800 Subject: [PATCH 084/137] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml | 2 +- .../resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml | 2 +- .../src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index b99b5e409b..6a18c289ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -13,7 +13,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml index 8e8fb7e9b3..1f802a277e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml @@ -14,7 +14,7 @@ DEPARTMENT_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml index 1970dc22a7..adb493b15e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml @@ -12,7 +12,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID From 28bbc622854f2374d18f3f785613e6da0481832e Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 28 Jun 2020 19:12:55 +0800 Subject: [PATCH 085/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 2478d1b203..3b575eab88 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.8 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.9 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 702c4a4194..880f67c044 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.8 + 0.3.9 data-statistical com.epmet From 8b861db5bd5c5004a41f230920232dc19367a55b Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 08:38:04 +0800 Subject: [PATCH 086/137] =?UTF-8?q?error=E6=97=A5=E5=BF=97=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DimController.java | 28 ++----- .../service/impl/StatsIssueServiceImpl.java | 8 +- .../service/impl/StatsProjectServiceImpl.java | 8 +- .../impl/StatsPublicityServiceImpl.java | 83 +++++++++---------- .../service/impl/StatsTopicServiceImpl.java | 2 +- .../service/impl/StatsUserServiceImpl.java | 4 +- 6 files changed, 56 insertions(+), 77 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java index 81ee884d47..3318ef39a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; @@ -51,64 +50,55 @@ public class DimController { dimDateService.initDimDate(); logger.info("初始化按日维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化按日维度失败:%s", errorStackTrace)); + logger.error("初始化按日维度失败:", e); } try { statsDimService.initGridDim(); logger.info("初始化网格维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化网格维度失败:%s", errorStackTrace)); + logger.error("初始化网格维度失败:", e); } try { statsDimService.initAgencyDim(); logger.info("初始化机关维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化机关维度失败:%s", errorStackTrace)); + logger.error("初始化机关维度失败:", e); } try { statsDimService.initCustomerDim(); logger.info("初始化客户维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化客户维度失败:%s", errorStackTrace)); + logger.error("初始化客户维度失败:", e); } try { statsDimService.initDepartmentDim(); logger.info("初始化部门维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化部门维度失败:%s", errorStackTrace)); + logger.error("初始化部门维度失败:", e); } try { dimMonthService.initMonthDim(); logger.info("初始化按月维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化按月维度失败:%s", errorStackTrace)); + logger.error("初始化按月维度失败:", e); } try { quarterService.initQuarterDim(); logger.info("初始化季度维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化季度维度失败:%s", errorStackTrace)); + logger.error("初始化季度维度失败:", e); } try { dimYearService.initYearDim(); logger.info("初始化年度维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化年度维度失败:%s", errorStackTrace)); + logger.error("初始化年度维度失败:", e); } try { dimWeekService.initWeekDim(); logger.info("初始化按周维度成功"); } catch (Exception e) { - String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); - logger.error(String.format("初始化按周维度失败:%s", errorStackTrace)); + logger.error("初始化按周维度失败:", e); } return new Result(); } 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 11f7e915fb..8fc548d4c2 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 @@ -20,9 +20,7 @@ import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; -import oracle.sql.DATE; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -73,8 +71,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { try { customerStats(customerId, date); } catch(Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", customerId, DateUtils.format(date), - e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", customerId, DateUtils.format(date)), + e); } } } @@ -95,7 +93,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { try { customerStats(customerId, date); } catch(Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyGridIssueStats", DateUtils.format(date)), e); } } } 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 1dbb6f81f1..75748d696b 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 @@ -117,7 +117,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关日统计方法,方法名:agencyDateProjectStats,客户Id:" + customerId); agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyDateProjectStats", customerId, dimId.getDateId()), e); } //5.2:执行机关月数据统计 @@ -126,7 +126,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { log.info("StatsProjectServiceImpl.customerAgencyStats-开始执行机关月统计方法,方法名:agencyMonthProjectStats,客户Id:" + customerId); agencyMonthProjectStats(customerId, dimId, dimAgencyList); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyMonthProjectStats", customerId, dimId.getMonthId()), e); } //} } @@ -409,7 +409,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关日统计方法,方法名:gridDateProjectStats,客户Id:" + customerId); gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridDateProjectStats", customerId, dimId.getDateId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridDateProjectStats", customerId, dimId.getDateId()), e); } //5.2:执行网格月数据统计 @@ -418,7 +418,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { log.info("StatsProjectServiceImpl.customerGridStats-开始执行机关月统计方法,方法名:gridMonthProjectStats,客户Id:" + customerId); gridMonthProjectStats(customerId, dimId, dimGridList); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridMonthProjectStats", customerId, dimId.getMonthId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridMonthProjectStats", customerId, dimId.getMonthId()), e); } //} } 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 9f5ea34159..eabcec07ad 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 @@ -163,7 +163,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedDailyStatsjob", customerId, dimIdBean.getDateId()), e); } } } @@ -191,7 +191,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId()), e); } } } @@ -220,7 +220,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagViewedDaily(statsDate, dimIdBean, customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", customerId, dimIdBean.getDateId()), e); } } } @@ -248,7 +248,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedMonthlyStatsjob", customerId, dimIdBean.getDateId()), e); } } } @@ -273,22 +273,18 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - executorService.submit(() -> { - try { - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); - } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); - } - }); - executorService.submit(() -> { - try { - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedYearly(dimIdBean.getYearId(), customerId); - } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId(), e.getMessage())); - } - }); + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedQuarterly", customerId, dimIdBean.getQuarterId()), e); + } + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagUsedYearly", customerId, dimIdBean.getYearId()), e); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -312,24 +308,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - executorService.submit(() -> { - try { - log.debug("start === statsTagViewedQuarterly "); - statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); - } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId(), e.getMessage())); - } - }); - executorService.submit(() -> { - try { - log.debug("start === statsTagViewedYearly "); - statsTagViewedYearly(dimIdBean.getYearId(), customerId); - - - } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId(), e.getMessage())); - } - }); + try { + log.debug("start === statsTagViewedQuarterly "); + statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getQuarterId()), e); + } + try { + log.debug("start === statsTagViewedYearly "); + statsTagViewedYearly(dimIdBean.getYearId(), customerId); + + + } catch (Exception e) { + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId()), e); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -366,7 +358,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate, e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate), e); } } @@ -435,7 +427,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); } catch (Exception e) { e.printStackTrace(); - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate, e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate), e); } @@ -468,7 +460,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); //构建机关自己的数据 @@ -482,7 +473,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); } } - if (!CollectionUtils.isEmpty(agencySummaryMap)){ + if (!CollectionUtils.isEmpty(agencySummaryMap)) { //同一个机关下数据累加 for (Map.Entry entry : agencySummaryMap.entrySet()) { String agencyId = entry.getKey(); @@ -491,9 +482,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (dimAgencyEntity == null) { continue; } - dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount()+summary.getArticleTotalCount()); - dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount()+summary.getArticlePublishedCount()); - dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount()+summary.getPublishedCount()); + dimAgencyEntity.setArticleTotalCount(dimAgencyEntity.getArticlePublishedCount() + summary.getArticleTotalCount()); + dimAgencyEntity.setArticlePublishedCount(dimAgencyEntity.getPublishedCount() + summary.getArticlePublishedCount()); + dimAgencyEntity.setPublishedCount(dimAgencyEntity.getPublishedCount() + summary.getPublishedCount()); } } //数据向上级机关添加 @@ -517,7 +508,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } catch (Exception e) { e.printStackTrace(); - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate, e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate), e); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java index e481f0a596..be7340eec0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -91,7 +91,7 @@ public class StatsTopicServiceImpl implements StatsTopicService { //6.生成唯一性统计数据 topicStatisticalService.insertUniquely(data); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "topicStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "topicStats", customerId, date), e); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 04101bc378..e9c2a764ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -84,7 +84,7 @@ public class StatsUserServiceImpl implements StatsUserService { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); userStatisticalService.insertUniquely(agencyData); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyUserStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyUserStats", customerId, new Date().toString()), e); } //5.计算网格统计数据、生成唯一性统计数据 @@ -92,7 +92,7 @@ public class StatsUserServiceImpl implements StatsUserService { UserStatisticalData gridData = userService.traverseGridUser(agencies, date, timeDimension); userStatisticalService.insertUniquely(gridData); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridUserStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridUserStats", customerId, new Date().toString()), e); } } } From 0009ef4b8dc4b40cdafa94a568fe9e4e22a62378 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 08:39:54 +0800 Subject: [PATCH 087/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 3b575eab88..50cf60444e 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.9 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.10 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 880f67c044..280b7e7c58 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.9 + 0.3.10 data-statistical com.epmet From 93d4bfbe8d32a738b0573611169223e3fb61f9f8 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 29 Jun 2020 09:59:36 +0800 Subject: [PATCH 088/137] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B0=83=E6=95=B4=EF=BC=8C=E7=83=AD=E5=BF=83?= =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DataStatisticalOpenFeignClient.java | 23 ++ ...ataStatisticalOpenFeignClientFallBack.java | 27 +++ .../com/epmet/service/StatsTopicService.java | 13 ++ .../com/epmet/service/StatsUserService.java | 12 + .../service/impl/StatsTopicServiceImpl.java | 26 ++- .../service/impl/StatsUserServiceImpl.java | 26 ++- .../service/topic/impl/TopicServiceImpl.java | 131 ++++++----- .../service/user/impl/UserServiceImpl.java | 212 +++++++++++------- .../java/com/epmet/util/ModuleConstant.java | 8 + .../db/migration/data_statistical.sql | 6 +- .../main/resources/mapper/user/UserDao.xml | 184 +++++++++++---- .../com/epmet/service/StatsTopicService.java | 15 ++ .../com/epmet/service/StatsUserService.java | 15 ++ .../service/impl/StatsTopicServiceImpl.java | 42 ++++ .../service/impl/StatsUserServiceImpl.java | 42 ++++ .../java/com/epmet/task/StatsTopicTask.java | 34 +++ .../java/com/epmet/task/StatsUserTask.java | 34 +++ 17 files changed, 644 insertions(+), 206 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsTopicService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsTopicTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserTask.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index b19cd277b5..6289bd7d88 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -5,6 +5,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.Date; /** * desc: 数据统计 对外feign client @@ -128,4 +131,24 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statsproject/gridprojectstats") Result gridProjectStats(); + /** + * @Description 执行用户统计 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:26 + **/ + @PostMapping("/data/stats/statsuser/execute") + Result execUserStatistical(@RequestParam(value = "date",required = false) Date date); + + /** + * @Description 执行话题统计 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:27 + **/ + @PostMapping("/data/stats/statstopic/execute") + Result execTopicStatistical(@RequestParam(value = "date",required = false) Date date); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 336020e353..3205a10b5a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -6,6 +6,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; + +import java.util.Date; + /** * desc: * @@ -132,4 +135,28 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result gridProjectStats() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats"); } + + /** + * @Description 执行用户统计 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:26 + **/ + @Override + public Result execUserStatistical(Date date) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical",date); + } + + /** + * @Description 执行话题统计 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:27 + **/ + @Override + public Result execTopicStatistical(Date date) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java index 847a7d9923..9e653812d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -2,7 +2,20 @@ package com.epmet.service; import java.util.Date; +/** + * @Description 话题统计Service接口 + * @ClassName StatsTopicService + * @Auth wangc + * @Date 2020-06-23 15:22 + */ public interface StatsTopicService { + /** + * @Description 分区统计,按照客户Id划分 + * @param date 如果目标日期为空,则自动计算为T-1天 + * @return + * @author wangc + * @date 2020.06.28 14:38 + **/ void partition(Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java index 7e98b2178f..6bf55f86ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java @@ -2,7 +2,19 @@ package com.epmet.service; import java.util.Date; +/** + * @author wangc + * @dscription + * @date 2020/6/17 16:51 + */ public interface StatsUserService { + /** + * @Description 分区统计,按照客户Id划分 + * @param date 如果目标日期为空,则自动计算为T-1天 + * @return + * @author wangc + * @date 2020.06.28 14:38 + **/ void partition(Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java index e481f0a596..911281919b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.service.stats.DimTopicStatusService; import com.epmet.service.stats.topic.TopicStatisticalService; import com.epmet.service.topic.TopicService; import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -22,7 +23,7 @@ import org.springframework.util.CollectionUtils; import java.util.*; /** - * @Description + * @Description 话题统计Service * @ClassName StatsTopicServiceImpl * @Auth wangc * @Date 2020-06-23 15:22 @@ -47,6 +48,13 @@ public class StatsTopicServiceImpl implements StatsTopicService { @Autowired private TopicStatisticalService topicStatisticalService; + /** + * @Description 分区统计,按照客户Id划分 + * @param date 如果目标日期为空,则自动计算为T-1天 + * @return + * @author wangc + * @date 2020.06.28 14:38 + **/ @Override public void partition(Date date) { @@ -65,14 +73,22 @@ public class StatsTopicServiceImpl implements StatsTopicService { } + /** + * @Description 生成话题统计数据 + * @param customerId - 客户Id + * @parma date - 目标日期 + * @return + * @author wangc + * @date 2020.06.28 14:50 + **/ void generate(String customerId,Date date){ //1.初始化时间参数 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.DATE, NumConstant.ONE_NEG); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); //2.初始化时间维度 DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); @@ -91,7 +107,7 @@ public class StatsTopicServiceImpl implements StatsTopicService { //6.生成唯一性统计数据 topicStatisticalService.insertUniquely(data); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "topicStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, ModuleConstant.EXCEPTION_DING_INTERCEPTOR_PREFIX_TOPIC_STATISTICAL, customerId, new Date().toString(), e.getMessage())); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 04101bc378..17fd8ccfc6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.user.UserStatisticalService; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -45,6 +46,13 @@ public class StatsUserServiceImpl implements StatsUserService { @Autowired private UserStatisticalService userStatisticalService; + /** + * @Description 分区统计,按照客户Id划分 + * @param date 如果目标日期为空,则自动计算为T-1天 + * @return + * @author wangc + * @date 2020.06.28 14:38 + **/ @Override public void partition(Date date) { int pageNo = NumConstant.ONE; @@ -62,15 +70,23 @@ public class StatsUserServiceImpl implements StatsUserService { } + /** + * @Description 生成用户统计数据 + * @param customerId 客户Id + * @param date 目标日期 + * @return + * @author wangc + * @date 2020.06.28 14:40 + **/ void generate(String customerId,Date date){ //1.初始化时间参数 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); //获取当日的零点 calendar.add(Calendar.DATE, NumConstant.ONE_NEG); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); //2.初始化时间维度 DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); @@ -84,7 +100,7 @@ public class StatsUserServiceImpl implements StatsUserService { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); userStatisticalService.insertUniquely(agencyData); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "agencyUserStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, ModuleConstant.EXCEPTION_DING_INTERCEPTOR_PREFIX_AGENCY_USER_STATISTICAL, customerId, new Date().toString(), e.getMessage())); } //5.计算网格统计数据、生成唯一性统计数据 @@ -92,7 +108,7 @@ public class StatsUserServiceImpl implements StatsUserService { UserStatisticalData gridData = userService.traverseGridUser(agencies, date, timeDimension); userStatisticalService.insertUniquely(gridData); }catch(Exception e){ - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "gridUserStats", customerId, new Date().toString(), e.getMessage())); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, ModuleConstant.EXCEPTION_DING_INTERCEPTOR_PREFIX_GRID_USER_STATISTICAL, customerId, new Date().toString(), e.getMessage())); } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 296d66ee22..999a90709e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -55,7 +55,7 @@ public class TopicServiceImpl implements TopicService { @Override public TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension) { if(null == agencies || agencies.size() == NumConstant.ZERO){ - logger.warn("没有相应的机关集合"); + logger.warn(ModuleConstant.LOG_WARN_NO_AGENCY_MESSAGE); return null; } @@ -74,6 +74,18 @@ public class TopicServiceImpl implements TopicService { Map> gridGroupMap = topics.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + agencies.forEach(agency -> { + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + agency.getGridIds().forEach(gridId -> { + if(!gridGroupMap.containsKey(gridId)){ + gridGroupMap.put(gridId,null); + } + }); + + } + + }); + return calculateAndSummarizeTopicStatisticalData(subGridOfAgency,agencies,gridGroupMap,targetDate,statusDimension,timeDimension,customerId); } @@ -166,19 +178,19 @@ public class TopicServiceImpl implements TopicService { * @date 2020.06.22 13:45 **/ void analyzeTopic(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Map> topicOperationMap, Date targetDate, TopicStatisticalData dataPacket, List statusDimension, DimIdGenerator.DimIdBean timeDimension){ - Boolean isMonthEnd = false; + //Boolean isMonthEnd = false; Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); - //前一天 + //前一天零点 calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; calendar.setTime(targetDateCheck); //如果目标日期是当月的最后一天 - - - - if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ //求出这个月的第一天 calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); @@ -186,8 +198,8 @@ public class TopicServiceImpl implements TopicService { calendar.set(Calendar.MINUTE, NumConstant.ZERO); calendar.set(Calendar.SECOND, NumConstant.ZERO); - isMonthEnd = true; - } + // isMonthEnd = true; + //} //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); @@ -231,6 +243,9 @@ public class TopicServiceImpl implements TopicService { if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ entry.getValue().forEach(gridId -> { + + + FactTopicIssueGridDailyDTO issueGridD = new FactTopicIssueGridDailyDTO(); FactTopicStatusGridDailyDTO topicGridD_discussing = new FactTopicStatusGridDailyDTO(); FactTopicStatusGridDailyDTO topicGridD_hidden = new FactTopicStatusGridDailyDTO(); @@ -305,6 +320,8 @@ public class TopicServiceImpl implements TopicService { if(!gridDistinct.get(gridId)) { setGridDailyDataPacket(dataPacket, issueGridD, totalGirdD, topicGridD_discussing, topicGridD_hidden, topicGridD_closed); } + + gridDistinct.put(gridId,true); }); //机关-百分比 @@ -318,13 +335,13 @@ public class TopicServiceImpl implements TopicService { - if(isMonthEnd){ + // if(isMonthEnd){ gridDistinct.forEach((k,v) -> { gridDistinct.put(k,false); }); - List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,null); + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,dataPacket.getCustomerId()); Map> GridGroupMapBetweenTimeRange = topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); List groupListBetweenTimeRange = new LinkedList<>(); @@ -355,8 +372,9 @@ public class TopicServiceImpl implements TopicService { if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ entry.getValue().forEach(gridId -> { + FactTopicIssueGridMonthlyDTO issueGridM = new FactTopicIssueGridMonthlyDTO(); - initGridMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getCustomerId(),gridId,timeDimension,issueGridM); + initGridMonthlyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,issueGridM); List groups = gridGroupMap.get(gridId); @@ -372,7 +390,7 @@ public class TopicServiceImpl implements TopicService { issueGridM.setIssueTotal(issueGridM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); - GroupTopicData data = groupTopicData.get(group.getGroupId()); + GroupTopicData data = groupTopicDataBetweenTimeRange.get(group.getGroupId()); if (null != data) { @@ -392,9 +410,11 @@ public class TopicServiceImpl implements TopicService { }); } + if(!gridDistinct.get(gridId)) { setGridMonthlyDataPacket(dataPacket, issueGridM); } + gridDistinct.put(gridId,true); }); //机关-百分比 @@ -408,7 +428,7 @@ public class TopicServiceImpl implements TopicService { - } + // } } @@ -431,10 +451,13 @@ public class TopicServiceImpl implements TopicService { GroupTopicData groupTopicData = new GroupTopicData(); groupTopicData.setGroupId(group.getGroupId()); - - groupTopicData.setTotal(group.getTopics().size()); - if (null == group.getTopics() || group.getTopics().size() == NumConstant.ZERO) { + groupTopicData.setTotal(NumConstant.ZERO); + }else { + groupTopicData.setTotal(group.getTopics().size()); + } + + //if (null == group.getTopics() || group.getTopics().size() == NumConstant.ZERO) { groupTopicData.setTopicIncr(NumConstant.ZERO); groupTopicData.setHiddenTotal(NumConstant.ZERO); groupTopicData.setHiddenIncr(NumConstant.ZERO); @@ -444,7 +467,7 @@ public class TopicServiceImpl implements TopicService { groupTopicData.setDiscussingTotal(NumConstant.ZERO); groupTopicData.setDiscussingIncr(NumConstant.ZERO); groupTopicData.setIssueTotal(NumConstant.ZERO); - }else{ + //}else{ for (ResiTopicResultDTO topic : group.getTopics()) { if(StringUtils.isBlank(topic.getTopicId())) continue; @@ -458,79 +481,53 @@ public class TopicServiceImpl implements TopicService { } Map> hiddenGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; - Map> hiddenCancelledGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden_cancelled",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + //Map> hiddenCancelledGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden_cancelled",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + if(operFlag) { + //如果在同一天内被多次屏蔽,只计算一次 + hiddenGroupByDate.forEach((k, v) -> { + if (null != v && v.size() > NumConstant.ZERO) { + groupTopicData.setHiddenIncr(groupTopicData.getHiddenIncr() + NumConstant.ONE); + } + }); + //转议题,operations会根据daily与monthly维度不同而取值不同,当daily时,operations只有当天的操作日志,当monthly时,operations包含时间区间内的操作日志 + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "shift_issue")).findAny().isPresent()) { + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + + if (topic.isShiftIssue()) { + groupTopicData.setIssueTotal(groupTopicData.getIssueTotal() + NumConstant.ONE); + } //对于话题,每个话题的操作记录中,【关闭】与【转议题】只会出现一次,而【屏蔽】与【取消屏蔽】会出现多次 switch (topic.getStatus()) { case "hidden": groupTopicData.setHiddenTotal(groupTopicData.getHiddenTotal() + NumConstant.ONE); - if (operFlag) { - //如果在同一天内被多次屏蔽,只计算一次 - hiddenGroupByDate.forEach((k, v) -> { - if (null != v && v.size() > NumConstant.ZERO) { - groupTopicData.setHiddenIncr(groupTopicData.getHiddenIncr() + NumConstant.ONE); - } - }); - - for (ResiTopicOperationResultDTO operation : operations) { - if (StringUtils.equals(operation.getStatus(), "shift_issue")) - groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); - } - } break; case "closed": - groupTopicData.setClosedTotal(groupTopicData.getClosedTotal() + NumConstant.ONE); if (operFlag) { - for (ResiTopicOperationResultDTO operation : operations) { - if (StringUtils.equals(operation.getStatus(), "closed")) - groupTopicData.setClosedIncr(groupTopicData.getClosedIncr() + NumConstant.ONE); - if (StringUtils.equals(operation.getStatus(), "shift_issue")) - groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "closed")).findAny().isPresent()) { + groupTopicData.setClosedIncr(groupTopicData.getClosedIncr() + NumConstant.ONE); } } break; case "discussing": - groupTopicData.setDiscussingTotal(groupTopicData.getDiscussingTotal() + NumConstant.ONE); - - Set dateRelease = new HashSet<>(); if(operFlag) { - if (null != hiddenGroupByDate && hiddenGroupByDate.size() > NumConstant.ZERO){ - hiddenGroupByDate.forEach((k, v) -> { - if (null != v && v.size() > NumConstant.ZERO) { - if (null != hiddenCancelledGroupByDate.get(k) && hiddenCancelledGroupByDate.get(k).size() > NumConstant.ZERO) { - if (hiddenCancelledGroupByDate.get(k).size() == v.size()) { - groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); - dateRelease.add(k); - return; //相当于continue,循环下一个日期 - } else { - //话题操作日志与话题状态不符 - - } - } - } - }); - } - - - if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "discussing") && !dateRelease.contains(operation.getCreatedTime())).findAny().isPresent()) { + //创建话题,operations会根据daily与monthly维度不同而取值不同,当daily时,operations只有当天的操作日志,当monthly时,operations包含时间区间内的操作日志 + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "discussing")).findAny().isPresent()) { groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); } - if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "shift_issue")).findAny().isPresent()) { - groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); - } } break; } - if (topic.isShiftIssue()) { - groupTopicData.setIssueTotal(groupTopicData.getIssueTotal() + NumConstant.ONE); - } + } - } + // } groupTopicStatistical.put(group.getGroupId(), groupTopicData); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 2fca7b32fb..f7655f12a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -48,7 +48,7 @@ public class UserServiceImpl implements UserService { @Override public UserStatisticalData traverseAgencyUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { if(null == agencies || agencies.size() == NumConstant.ZERO){ - logger.warn("没有相应的机关集合"); + logger.warn(ModuleConstant.LOG_WARN_NO_AGENCY_MESSAGE); return null; } @@ -90,7 +90,7 @@ public class UserServiceImpl implements UserService { @Override public UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { if(null == agencies || agencies.size() == NumConstant.ZERO){ - logger.warn("没有相应的机关集合"); + logger.warn(ModuleConstant.LOG_WARN_NO_AGENCY_MESSAGE); return null; } @@ -184,15 +184,15 @@ public class UserServiceImpl implements UserService { NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); - Boolean isMonthEnd = false; + Boolean isMonthBeginning = true; Calendar calendar =Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.DATE, NumConstant.ONE_NEG); Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; calendar.setTime(targetDateCheck); - //如果目标日期是当月的最后一天 - if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //如果目标日期不是是当月的第一天 + if(calendar.get(Calendar.DATE) != calendar.getActualMinimum(Calendar.DAY_OF_MONTH)){ //求出这个月的第一天 calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); @@ -200,7 +200,7 @@ public class UserServiceImpl implements UserService { calendar.set(Calendar.MINUTE, NumConstant.ZERO); calendar.set(Calendar.SECOND, NumConstant.ZERO); - isMonthEnd = true; + isMonthBeginning = false; } if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){ @@ -297,10 +297,68 @@ public class UserServiceImpl implements UserService { } - //月末处理 - if(isMonthEnd){ + + FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); + regAgencyM.setCustomerId(customerId); + regAgencyM.setAgencyId(agencyId); + regAgencyM.setMonthId(timeDimension.getMonthId()); + regAgencyM.setQuarterId(timeDimension.getQuarterId()); + regAgencyM.setYearId(timeDimension.getYearId()); + regAgencyM.setRegTotal(regData.getTotal()); + regAgencyM.setResiTotal(regData.getTotal()); + regAgencyM.setWarmHeartedTotal(warmRegData.getTotal()); + regAgencyM.setPartymemberTotal(partyRegData.getTotal()); + regAgencyM.setRegIncr(regData.getIncr()); + regAgencyM.setWarmIncr(warmRegData.getIncr()); + regAgencyM.setPartymemberIncr(partiData.getIncr()); + regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion()); + regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion()); + regAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + FactParticipationUserAgencyMonthlyDTO partiAgencyM = new FactParticipationUserAgencyMonthlyDTO(); + partiAgencyM.setCustomerId(customerId); + partiAgencyM.setAgencyId(agencyId); + partiAgencyM.setMonthId(timeDimension.getMonthId()); + partiAgencyM.setQuarterId(timeDimension.getQuarterId()); + partiAgencyM.setYearId(timeDimension.getYearId()); + partiAgencyM.setRegTotal(partiData.getTotal()); + partiAgencyM.setResiTotal(partiData.getTotal()); + partiAgencyM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiAgencyM.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyM.setRegIncr(partiData.getIncr()); + partiAgencyM.setWarmIncr(warmPartiData.getIncr()); + partiAgencyM.setPartymemberIncr(partyPartiData.getIncr()); + partiAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiAgencyM.setPartymemberProportion(partiAgencyD.getPartymemberProportion()); + partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); + partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + //如果是月初第一天,不再做日期区间查询 + if(isMonthBeginning) { + if (null == dataPacket.getRegAgencyMonthlyList()) { + List list = new LinkedList<>(); + list.add(regAgencyM); + dataPacket.setRegAgencyMonthlyList(list); + } else { + dataPacket.getRegAgencyMonthlyList().add(regAgencyM); + } + if (null == dataPacket.getPartiAgencyMonthlyList()) { + List list = new LinkedList<>(); + list.add(partiAgencyM); + dataPacket.setPartiAgencyMonthlyList(list); + } else { + dataPacket.getPartiAgencyMonthlyList().add(partiAgencyM); + } + }else{ + //如果不是月初第一天 + //本月注册用户增长数 Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); //本月新增注册用户Id集合 @@ -321,23 +379,10 @@ public class UserServiceImpl implements UserService { Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,gridIds,calendar.getTime(),targetDateCheck); - FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); - regAgencyM.setCustomerId(customerId); - regAgencyM.setAgencyId(agencyId); - regAgencyM.setMonthId(timeDimension.getMonthId()); - regAgencyM.setQuarterId(timeDimension.getQuarterId()); - regAgencyM.setYearId(timeDimension.getYearId()); - regAgencyM.setRegTotal(regData.getTotal()); - regAgencyM.setResiTotal(regData.getTotal()); - regAgencyM.setWarmHeartedTotal(warmRegData.getTotal()); - regAgencyM.setPartymemberTotal(partyRegData.getTotal()); + regAgencyM.setRegIncr(regIncrMonthly); regAgencyM.setWarmIncr(incrWarmOfRegMonthly); regAgencyM.setPartymemberIncr(incrPartyOfRegMonthly); - regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); - regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion()); - regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion()); - regAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); if(null == dataPacket.getRegAgencyMonthlyList()){ List list = new LinkedList<>(); list.add(regAgencyM); @@ -347,23 +392,10 @@ public class UserServiceImpl implements UserService { } - FactParticipationUserAgencyMonthlyDTO partiAgencyM = new FactParticipationUserAgencyMonthlyDTO(); - partiAgencyM.setCustomerId(customerId); - partiAgencyM.setAgencyId(agencyId); - partiAgencyM.setMonthId(timeDimension.getMonthId()); - partiAgencyM.setQuarterId(timeDimension.getQuarterId()); - partiAgencyM.setYearId(timeDimension.getYearId()); - partiAgencyM.setRegTotal(partiData.getTotal()); - partiAgencyM.setResiTotal(partiData.getTotal()); - partiAgencyM.setWarmHeartedTotal(warmPartiData.getTotal()); - partiAgencyM.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyM.setRegIncr(partiIncrMonthly); partiAgencyM.setWarmIncr(incrWarmOfPartiMonthly); partiAgencyM.setPartymemberIncr(incrPartyOfPartiMonthly); - partiAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); - partiAgencyM.setPartymemberProportion(partiAgencyD.getPartymemberProportion()); - partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); - partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); if(null == dataPacket.getPartiAgencyMonthlyList()){ List list = new LinkedList<>(); list.add(partiAgencyM); @@ -381,7 +413,7 @@ public class UserServiceImpl implements UserService { Set singleGridIdSet = new HashSet<>(); - final boolean monthEndFlag = isMonthEnd; + final boolean monthBeginningFlag = isMonthBeginning; //grid gridIds.forEach(gridId -> { @@ -486,7 +518,68 @@ public class UserServiceImpl implements UserService { - if(monthEndFlag){ + FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO(); + regGridM.setCustomerId(customerId); + regGridM.setAgencyId(agencyId); + regGridM.setGridId(gridId); + regGridM.setMonthId(timeDimension.getMonthId()); + regGridM.setQuarterId(timeDimension.getQuarterId()); + regGridM.setYearId(timeDimension.getYearId()); + regGridM.setRegTotal(regData.getTotal()); + regGridM.setResiTotal(regData.getTotal()); + regGridM.setWarmHeartedTotal(warmRegData.getTotal()); + regGridM.setPartymemberTotal(partyRegData.getTotal()); + regGridM.setRegIncr(regData.getIncr()); + regGridM.setWarmIncr(warmRegData.getIncr()); + regGridM.setPartymemberIncr(partyRegData.getIncr()); + regGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); + regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); + regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO(); + partiGridM.setCustomerId(customerId); + partiGridM.setAgencyId(agencyId); + partiGridM.setGridId(gridId); + partiGridM.setMonthId(timeDimension.getMonthId()); + partiGridM.setQuarterId(timeDimension.getQuarterId()); + partiGridM.setYearId(timeDimension.getYearId()); + partiGridM.setRegTotal(partiData.getTotal()); + partiGridM.setResiTotal(partiData.getTotal()); + partiGridM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiGridM.setPartymemberTotal(partyPartiData.getTotal()); + partiGridM.setRegIncr(partiData.getIncr()); + partiGridM.setWarmIncr(warmPartiData.getIncr()); + partiGridM.setPartymemberIncr(partyPartiData.getIncr()); + partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion()); + partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion()); + partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + + //如果是月初第一天,不再做日期区间查询 + if(monthBeginningFlag){ + if(null != dataPacket.getRegGridMonthlyList()){ + dataPacket.getRegGridMonthlyList().add(regGridM); + }else{ + List list = new ArrayList<>(); + list.add(regGridM); + dataPacket.setRegGridMonthlyList(list); + } + + + if(null != dataPacket.getPartiGridMonthlyList()){ + dataPacket.getPartiGridMonthlyList().add(partiGridM); + }else{ + List list = new ArrayList<>(); + list.add(partiGridM); + dataPacket.setPartiGridMonthlyList(list); + } + + }else{ //本月注册用户增长数 Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck); //本月新增注册用户Id集合 @@ -506,24 +599,11 @@ public class UserServiceImpl implements UserService { //本月新增热心居民数(参与用户) Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck); - FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO(); - regGridM.setCustomerId(customerId); - regGridM.setAgencyId(agencyId); - regGridM.setGridId(gridId); - regGridM.setMonthId(timeDimension.getMonthId()); - regGridM.setQuarterId(timeDimension.getQuarterId()); - regGridM.setYearId(timeDimension.getYearId()); - regGridM.setRegTotal(regData.getTotal()); - regGridM.setResiTotal(regData.getTotal()); - regGridM.setWarmHeartedTotal(warmRegData.getTotal()); - regGridM.setPartymemberTotal(partyRegData.getTotal()); + regGridM.setRegIncr(regIncrMonthly); regGridM.setWarmIncr(incrWarmOfRegMonthly); regGridM.setPartymemberIncr(incrPartyOfRegMonthly); - regGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); - regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); - regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); - regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getRegGridMonthlyList()){ dataPacket.getRegGridMonthlyList().add(regGridM); }else{ @@ -532,24 +612,11 @@ public class UserServiceImpl implements UserService { dataPacket.setRegGridMonthlyList(list); } - FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO(); - partiGridM.setCustomerId(customerId); - partiGridM.setAgencyId(agencyId); - partiGridM.setGridId(gridId); - partiGridM.setMonthId(timeDimension.getMonthId()); - partiGridM.setQuarterId(timeDimension.getQuarterId()); - partiGridM.setYearId(timeDimension.getYearId()); - partiGridM.setRegTotal(partiData.getTotal()); - partiGridM.setResiTotal(partiData.getTotal()); - partiGridM.setWarmHeartedTotal(warmPartiData.getTotal()); - partiGridM.setPartymemberTotal(partyPartiData.getTotal()); + partiGridM.setRegIncr(partiIncrMonthly); partiGridM.setWarmIncr(incrWarmOfPartiMonthly); partiGridM.setPartymemberIncr(incrPartyOfPartiMonthly); - partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); - partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion()); - partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion()); - partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getPartiGridMonthlyList()){ dataPacket.getPartiGridMonthlyList().add(partiGridM); }else{ @@ -568,7 +635,6 @@ public class UserServiceImpl implements UserService { } - } @@ -592,12 +658,4 @@ public class UserServiceImpl implements UserService { System.out.println(format.format(calendar.getTime())); System.out.println(format2.format(calendar.getTime())); } - - /** - * @Description 先查出所有的用户单位时间内新增的注册居民、党员、热心居民(跟随网格),然后查出单位时间内,每一个网格下的参与用户Id集合和注册用户Id集合 - * @param - * @return - * @author wangc - * @date 2020.06.23 00:32 - **/ } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java index 48a1b9a08c..7473434df9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -31,4 +31,12 @@ public interface ModuleConstant { * 统计机器人 * */ String CREATED_BY_STATISTICAL_ROBOT = "STATISTICAL_ROBOT"; + + String EXCEPTION_DING_INTERCEPTOR_PREFIX_AGENCY_USER_STATISTICAL = "agencyUserStats"; + + String EXCEPTION_DING_INTERCEPTOR_PREFIX_GRID_USER_STATISTICAL = "gridUserStats"; + + String EXCEPTION_DING_INTERCEPTOR_PREFIX_TOPIC_STATISTICAL = "topicStats"; + + String LOG_WARN_NO_AGENCY_MESSAGE = "没有相应的机关集合"; } 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 25b7b1e955..60d6b107fe 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 @@ -697,7 +697,7 @@ CREATE TABLE `fact_topic_status_agency_daily` ( `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态ID 关联dim_topic_status表\n讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量 指定状态的话题数量', - `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态百分比 指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_PROPORTION` decimal(11,6) NOT NULL COMMENT '话题状态百分比 指定状态话题数/话题总数\n总数在topic_total_agency_daily中', `TOPIC_INCREMENT` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的状态话题的增加数', `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', @@ -727,7 +727,7 @@ CREATE TABLE `fact_topic_status_agency_monthly` ( `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID 关联年度dm表', `TOPIC_STATUS_ID` varchar(32) NOT NULL COMMENT '话题状态 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', `TOPIC_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '话题数量', - `TOPIC_PROPORTION` decimal(4,2) NOT NULL COMMENT '话题状态占比 月末一天 \n指定状态话题数/话题总数\n总数在topic_total_agency_daily中', + `TOPIC_PROPORTION` decimal(11,6) NOT NULL COMMENT '话题状态占比 月末一天 \n指定状态话题数/话题总数\n总数在topic_total_agency_daily中', `TOPIC_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '话题增量 单位时间内的话题状态增加数', `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', @@ -758,7 +758,7 @@ CREATE TABLE `fact_topic_status_grid_daily` ( `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', `TOPIC_STATUS_ID` varchar(32) DEFAULT NULL COMMENT '话题状态ID 讨论中 discussing\n已屏蔽 hidden\n已关闭 closed\n已转项目 shift_project', `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '话题数量', - `TOPIC_PROPORTION` decimal(4,2) DEFAULT NULL COMMENT '话题状态占比 指定状态话题数/话题总数\n总数在topic_total_grid_daily中', + `TOPIC_PROPORTION` decimal(11,6) DEFAULT NULL COMMENT '话题状态占比 指定状态话题数/话题总数\n总数在topic_total_grid_daily中', `TOPIC_INCREMENT` int(11) DEFAULT '0' COMMENT '话题增量', `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 1b6f925c97..6b796d944e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -6,17 +6,17 @@ SELECT - count( 1 ) AS total, + count( DISTINCT urole.USER_ID ) AS total, ( SELECT - count( 1 ) + count( DISTINCT urole.USER_ID) FROM USER_ROLE urole LEFT JOIN EPMET_ROLE erole ON urole.ROLE_ID = erole.ID @@ -163,9 +193,20 @@ AND erole.DEL_FLAG = '0' WHERE urole.DEL_FLAG = '0' - - urole.USER_ID = #{userId} - + + + + + AND urole.USER_ID = '' + + + + urole.USER_ID = #{userId} + + + + + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -180,10 +221,10 @@ @@ -259,14 +324,14 @@ SELECT - count( 1 ) + count( DISTINCT urole.USER_ID) FROM USER_ROLE urole LEFT JOIN EPMET_ROLE erole ON urole.ROLE_ID = erole.ID AND erole.DEL_FLAG = '0' WHERE urole.DEL_FLAG = '0' - - urole.USER_ID = #{incrUserId} - + + + AND urole.USER_ID = '' + + + + urole.USER_ID = #{incrUserId} + + + + AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '党员' @@ -305,7 +385,7 @@ diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsTopicService.java new file mode 100644 index 0000000000..1c8c8e07f1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +public interface StatsTopicService { + + /** + * @Description 调用统计服务执行统计 - 话题 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:40 + **/ + Result execTopicStatistical(String date); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserService.java new file mode 100644 index 0000000000..334f39f7ef --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +public interface StatsUserService { + + /** + * @Description 调用统计服务-用户 + * @param + * @return + * @author wangc + * @date 2020.06.29 09:39 + **/ + Result execUserStatistical(String date); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java new file mode 100644 index 0000000000..b99a8f9d4c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -0,0 +1,42 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsTopicService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Description + * @ClassName StatsTopicServiceImpl + * @Auth wangc + * @Date 2020-06-29 09:47 + */ +@Service +public class StatsTopicServiceImpl implements StatsTopicService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result execTopicStatistical(String date) { + Date dateParam = null; + if(StringUtils.isNotBlank(date)){ + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + try { + dateParam = format.parse(date); + }catch (Exception e){ + logger.error(String.format("执行话题统计时,日期格式转换异常,param:%s,e:%s"),date,e.getMessage()); + } + } + return dataStatisticalOpenFeignClient.execTopicStatistical(dateParam); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java new file mode 100644 index 0000000000..a50c619f0b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -0,0 +1,42 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsUserService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Description + * @ClassName StatsUserServiceImpl + * @Auth wangc + * @Date 2020-06-29 09:41 + */ +@Service +public class StatsUserServiceImpl implements StatsUserService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result execUserStatistical(String date) { + Date dateParam = null; + if(StringUtils.isNotBlank(date)){ + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + try { + dateParam = format.parse(date); + }catch (Exception e){ + logger.error(String.format("执行用户统计时,日期格式转换异常,param:%s,e:%s"),date,e.getMessage()); + } + } + return dataStatisticalOpenFeignClient.execUserStatistical(dateParam); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsTopicTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsTopicTask.java new file mode 100644 index 0000000000..6570e33b24 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsTopicTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsTopicService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName StatsTopicTask + * @Auth wangc + * @Date 2020-06-29 09:49 + */ +@Component("statsTopicTask") +public class StatsTopicTask implements ITask { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsTopicService statsTopicService; + + @Override + public void run(String params) { + logger.debug("StatsTopicTask定时任务正在执行,参数为:{}", params); + Result result = statsTopicService.execTopicStatistical(params); + if (result.success()){ + logger.debug("StatsTopicTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsTopicTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserTask.java new file mode 100644 index 0000000000..9fda8cfc88 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName StatsUserTask + * @Auth wangc + * @Date 2020-06-29 09:49 + */ +@Component("statsUserTask") +public class StatsUserTask implements ITask { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsUserService statsUserService; + + @Override + public void run(String params) { + logger.debug("StatsUserTask定时任务正在执行,参数为:{}", params); + Result result = statsUserService.execUserStatistical(params); + if (result.success()){ + logger.debug("StatsUserTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsUserTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From 54fb0b27f02b6d82fd7eb3c2bbf1f6cca99c9880 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 29 Jun 2020 10:17:22 +0800 Subject: [PATCH 089/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsGroupServiceImpl.java | 37 ++++++++----------- .../mapper/stats/FactGroupAgencyDailyDao.xml | 8 +--- 2 files changed, 18 insertions(+), 27 deletions(-) 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 7eba9840e7..8fc87943da 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 @@ -129,6 +129,13 @@ public class StatsGroupServiceImpl implements StatsGroupService { factGroupAgencyMonthlyService.insertAgencyGroupMonthly(lastDayAgency); } + /** + * @Description 网格小组 【机关-日】 数据统计处理 + * @param customerAgencyInfos + * @param timeDim + * @param customerId + * @author zxc + */ public List getAgencyGroupDaily(List customerAgencyInfos, DimIdGenerator.DimIdBean timeDim,String customerId){ if (customerAgencyInfos.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -143,10 +150,10 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setCustomerId(customerId); BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) - List allGrid = this.getAllGrid(agencyId); + List allGrid = this.getAllGrid(agencyId,customerId); String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); - // TODO 1. 机关下有多少网格 + // 1. 机关下有多少网格 List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(0); if (customerGridIdList.size() != NumConstant.ZERO){ @@ -161,22 +168,19 @@ public class StatsGroupServiceImpl implements StatsGroupService { }else { agencyResult.setGridTotal(NumConstant.ZERO); } - - // TODO 2. 机关下有多少小组,只算 state = ‘approved’ + // 2. 机关下有多少小组,只算 state = ‘approved’ List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); agencyResult.setGroupTotalCount(groupCount); - // TODO 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" + // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId); Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); agencyResult.setGroupMemberTotalCount(groupPeopleCount); - - // TODO 4. 机关下小组平均人数 + // 4. 机关下小组平均人数 agencyResult.setGroupMemberAvgCount( agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO : agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); - - // TODO 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID + // 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId); List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); Integer groupPeopleMedian; @@ -190,13 +194,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); agencyResult.setGroupMedian(groupPeopleMedian); - agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); agencyResult.setGroupMemberMinCount(sorted.get(sorted.size() - NumConstant.ONE).getGroupCount()); agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); } - // TODO 6. 机关下小组增量 + // 6. 机关下小组增量 List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId); Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); agencyResult.setGroupIncr(groupIncr); @@ -210,9 +213,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @param agencyId * @author zxc */ - public List getAllGrid(String agencyId){ + public List getAllGrid(String agencyId,String customerId){ List result = new ArrayList<>(); - List allAgency = dimAgencyService.getAllAgency(null); + List allAgency = dimAgencyService.getAllAgency(customerId); Map> subGridOfAgency = new HashMap<>(); allAgency.forEach(agency -> { @@ -237,7 +240,6 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ - //向map中放入数据 if(subGridOfAgency.containsKey(pid)){ //包含key @@ -254,13 +256,10 @@ public class StatsGroupServiceImpl implements StatsGroupService { Set grids = new HashSet<>(agency.getGridIds()); subGridOfAgency.put(pid,grids); } - //定义递归出口 if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ return ; } - - //定义递归入口 agency.getSubAgencies().forEach(obj -> { initAgencyGridMap(pid,obj,subGridOfAgency); @@ -285,8 +284,4 @@ public class StatsGroupServiceImpl implements StatsGroupService { return DimIdGenerator.getDimIdBean(result); } - public List getAgencyAllGrid(String customerId,String agencyId){ - - return null; - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index d2ef1b2a30..ced5e75721 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -91,11 +91,7 @@ fact_group_agency_daily WHERE del_flag = '0' - AND DATE_FORMAT(date_id,'%Y%m') = #{monthId} - GROUP BY - AGENCY_ID - ORDER BY - DATE_ID DESC + AND date_id = (SELECT MAX(date_id) FROM fact_group_agency_daily WHERE del_flag = '0') @@ -107,7 +103,7 @@ fact_group_agency_daily WHERE del_flag = '0' - AND SUBSTRING( date_id, 1, 6 ) = #{monthId} + AND month_id = #{monthId} GROUP BY agency_id From 4686aafc9e032cf5b4dd928a21d441fe574ef2ce Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 29 Jun 2020 10:42:47 +0800 Subject: [PATCH 090/137] =?UTF-8?q?=E5=9B=A0=E5=88=86=E5=B8=83=E5=BC=8F?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E9=97=AE=E9=A2=98=EF=BC=8C=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E8=BD=AC=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueServiceImpl.java | 1 + .../com/epmet/constant/ProjectConstant.java | 5 +++++ .../main/java/com/epmet/dao/ProjectDao.java | 8 ++++++++ .../epmet/service/impl/ProjectServiceImpl.java | 11 +++++++++++ .../src/main/resources/mapper/ProjectDao.xml | 18 ++++++++++++++++++ 5 files changed, 43 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 4ba36d235d..2730d87941 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -504,6 +504,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp //3:调用gov-project服务,新增项目各业务表初始数据 Result resultDTO = govProjectFeignClient.issueShiftProject(formDTO); if (!resultDTO.success() || null == resultDTO.getData()) { + logger.error(resultDTO.getInternalMsg()); throw new RenException(IssueConstant.GOV_PRJECT_EXCEPTION); } IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index a2d77e8446..fd8934060a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -113,4 +113,9 @@ public interface ProjectConstant { * 获取项目节点数据失败 */ String SELECT_process_EXCEPTION = "获取项目节点数据失败"; + /** + * 议题转项目已存在项目数据,不能重复转 + * 议题转项目 项目服务数据入库成功,议题数据更新或发送消息失败导致议题数据可以回滚,项目服务数据不能回滚 + */ + String SAVE_PROJECT_EXCEPTION = "已存在项目数据,不能重复转项目"; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 3b58c435b7..a45b46bb0a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -103,4 +103,12 @@ public interface ProjectDao extends BaseDao { * @Description 获取客户下已结案项目列表,按结案时间倒序 **/ List selectClosedProjectList(LatestListFormDTO formDTO); + + /** + * @param projectDTO + * @return + * @Author sun + * @Description 根据客户Id、机关Id、议题Id查询项目数据是否存在 + **/ + List selectProjectList(ProjectDTO projectDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 29a964851f..4ec3eacda5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -467,6 +467,17 @@ public class ProjectServiceImpl extends BaseServiceImpl staffList = formDTO.getStaffList(); IssueDTO issueDTO = formDTO.getIssueDTO(); + //0.因项目还未添加分布式事务,议题转项目,如果项目数据入库成功议题数据也修改成功但是消息发送失败时则议题数据可以回滚但项目服务的数据不能回滚 + //先根据客户Id机关Id议题Id查询项目表是否已存在,存在则说明之前转过切失败了,这样的数据不能再操作了,只能操作数据库,将项目表和项目进展表数据清除 + ProjectDTO projectDTO = new ProjectDTO(); + projectDTO.setCustomerId(issueDTO.getCustomerId()); + projectDTO.setAgencyId(issueDTO.getOrgId()); + projectDTO.setOrigin(ProjectConstant.ISSUE); + projectDTO.setOriginId(issueDTO.getId()); + List listProject = baseDao.selectProjectList(projectDTO); + if (null != listProject && listProject.size() > NumConstant.ZERO) { + throw new RenException(ProjectConstant.SAVE_PROJECT_EXCEPTION); + } //1:调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用 List agencyIdList = staffList.stream().map(TickStaffFormDTO::getAgencyId).collect(Collectors.toList()); agencyIdList.add(issueDTO.getOrgId()); diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 0dad21111b..548eb53128 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -165,4 +165,22 @@ ORDER BY p.created_time DESC + + \ No newline at end of file From d28a0813befa05fd3ae8f67a9ae7242f7fe56e79 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 29 Jun 2020 10:49:34 +0800 Subject: [PATCH 091/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=9C=8D=E5=8A=A1=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-issue/gov-issue-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-issue/gov-issue-server/pom.xml | 2 +- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index e5f9b0eb87..6dcdb4ec76 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.44 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.45 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index ad883bcc23..c0d4f4e42d 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.44 + 0.3.45 gov-issue com.epmet diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 28f015a3c5..78ebd86001 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.29 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.30 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index a3db2f67a8..3b5472c3e1 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.29 + 0.3.30 gov-project com.epmet From 763fddf71d8e116202e0e367f36a82a5e48fd4e9 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 29 Jun 2020 10:55:36 +0800 Subject: [PATCH 092/137] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=BB=B4=E5=BA=A6=E5=88=9D=E5=A7=8B=E5=8C=96=EF=BC=8C=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=88=B0=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=BD=93=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/StatsDimServiceImpl.java | 3 --- .../service/stats/impl/DimDateServiceImpl.java | 13 ++++++------- 2 files changed, 6 insertions(+), 10 deletions(-) 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..fc0241db68 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 @@ -154,9 +154,6 @@ public class StatsDimServiceImpl implements StatsDimService { List departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime); if (!CollectionUtils.isEmpty(departments)) { dimDepartmentService.initDepartmentDims(departments); - lastExecRecord.setExecTime(new Date()); - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index f6f0d9ee55..15ae161fbb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -115,20 +115,19 @@ public class DimDateServiceImpl extends BaseServiceImpl Date: Mon, 29 Jun 2020 10:59:54 +0800 Subject: [PATCH 093/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 50cf60444e..95c949f0f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.10 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.11 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 280b7e7c58..81d02ae79b 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.10 + 0.3.11 data-statistical com.epmet From 9627303f7726911e0cf92cafddd5a4c3ac7aa613 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 29 Jun 2020 11:07:47 +0800 Subject: [PATCH 094/137] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/project/ProjectDao.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 7c20a18f4c..ed572b8f52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -27,7 +27,7 @@ AND ORIGIN = 'issue' AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} - AND UPDATED_TIME #{date} + AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') #{date} GROUP BY AGENCY_ID, CLOSED_STATUS @@ -44,7 +44,7 @@ AND ORIGIN = 'issue' AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} - AND UPDATED_TIME = #{date} + AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date} GROUP BY AGENCY_ID, CLOSED_STATUS @@ -60,7 +60,7 @@ AND ORIGIN = 'issue' AND STATUS = 'closed' AND CUSTOMER_ID = #{customerId} - AND UPDATED_TIME #{date} + AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') #{date} \ No newline at end of file From 95de02eb929b6425863fb98c50c23a867e5cfd77 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 29 Jun 2020 11:10:17 +0800 Subject: [PATCH 095/137] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 3 ++- .../feign/DataStatisticalOpenFeignClient.java | 5 +++-- .../DataStatisticalOpenFeignClientFallBack.java | 4 ++-- .../service/impl/StatsTopicServiceImpl.java | 16 +++------------- .../epmet/service/impl/StatsUserServiceImpl.java | 15 ++------------- 5 files changed, 12 insertions(+), 31 deletions(-) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 354c47f3ea..2d4f57c3b7 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -120,6 +120,7 @@ lb://epmet-activiti-server lb://epmet-job-server + lb://epmet-user-server @@ -180,7 +181,7 @@ lb://data-statistical-server - + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 832ae37701..dffd25d035 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -16,6 +16,7 @@ import java.util.Date; * @date: 2020/6/22 17:39 * @author: jianjun liu */ +//url="http://localhost:8108" @FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class) public interface DataStatisticalOpenFeignClient { @@ -147,7 +148,7 @@ public interface DataStatisticalOpenFeignClient { * @date 2020.06.29 09:26 **/ @PostMapping("/data/stats/statsuser/execute") - Result execUserStatistical(@RequestParam(value = "date",required = false) Date date); + Result execUserStatistical(@RequestParam(value = "date",required = false) String date); /** * @Description 执行话题统计 @@ -157,6 +158,6 @@ public interface DataStatisticalOpenFeignClient { * @date 2020.06.29 09:27 **/ @PostMapping("/data/stats/statstopic/execute") - Result execTopicStatistical(@RequestParam(value = "date",required = false) Date date); + Result execTopicStatistical(@RequestParam(value = "date",required = false) String date); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 4c0a00d154..a15b468fdc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -149,7 +149,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp * @date 2020.06.29 09:26 **/ @Override - public Result execUserStatistical(Date date) { + public Result execUserStatistical(String date) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical",date); } @@ -161,7 +161,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp * @date 2020.06.29 09:27 **/ @Override - public Result execTopicStatistical(Date date) { + public Result execTopicStatistical(String date) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java index b99a8f9d4c..cefabfbdc7 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -3,14 +3,12 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.StatsTopicService; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.text.SimpleDateFormat; -import java.util.Date; + /** * @Description @@ -28,15 +26,7 @@ public class StatsTopicServiceImpl implements StatsTopicService { @Override public Result execTopicStatistical(String date) { - Date dateParam = null; - if(StringUtils.isNotBlank(date)){ - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - try { - dateParam = format.parse(date); - }catch (Exception e){ - logger.error(String.format("执行话题统计时,日期格式转换异常,param:%s,e:%s"),date,e.getMessage()); - } - } - return dataStatisticalOpenFeignClient.execTopicStatistical(dateParam); + + return dataStatisticalOpenFeignClient.execTopicStatistical(date); } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index a50c619f0b..3082f91779 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -3,14 +3,12 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.Result; import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.service.StatsUserService; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.text.SimpleDateFormat; -import java.util.Date; + /** * @Description @@ -28,15 +26,6 @@ public class StatsUserServiceImpl implements StatsUserService { @Override public Result execUserStatistical(String date) { - Date dateParam = null; - if(StringUtils.isNotBlank(date)){ - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - try { - dateParam = format.parse(date); - }catch (Exception e){ - logger.error(String.format("执行用户统计时,日期格式转换异常,param:%s,e:%s"),date,e.getMessage()); - } - } - return dataStatisticalOpenFeignClient.execUserStatistical(dateParam); + return dataStatisticalOpenFeignClient.execUserStatistical(date); } } From 0f4a434bddc5264f2326f2afb7f59f34d3ada1d6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 12:25:27 +0800 Subject: [PATCH 096/137] =?UTF-8?q?=E9=99=90=E5=88=B6=E9=92=89=E9=92=89?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/DingTalkTextMsg.java | 37 ++-- .../tools/filter/LogMsgSendFilter.java | 151 +++++++------- .../tools/utils/DingdingMsgSender.java | 185 ++++++++++++++++++ .../com/epmet/controller/DemoController.java | 12 +- .../src/main/resources/logback-spring.xml | 2 + 5 files changed, 308 insertions(+), 79 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java index b548bad87f..4a77d9b7cc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java @@ -1,25 +1,32 @@ package com.epmet.commons.tools.dto.form; import com.alibaba.fastjson.JSON; -import lombok.Data; import org.springframework.util.CollectionUtils; +import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; -/** - * desc: 钉钉文本消息参数 实体类 - * date: 2019/2/20 11:00 +/** + * desc: 钉钉文本消息参数 实体类 + * + * @date: 2020/6/29 9:06 * @author: jianjun liu - * email:liujianjun@yunzongnet.com + * email:liujianjun@git.elinkit.com.cn */ -public class DingTalkTextMsg { +public class DingTalkTextMsg implements Serializable { + private static final long serialVersionUID = -3611771312188821915L; /** * 消息接收者 */ - private String receiver; + private String webHook; + + /** + * 密钥 + */ + private String secret; /** * 发送内容 */ @@ -35,12 +42,12 @@ public class DingTalkTextMsg { */ private boolean isAtAll; - public String getReceiver() { - return receiver; + public String getWebHook() { + return webHook; } - public void setReceiver(String receiver) { - this.receiver = receiver; + public void setWebHook(String webHook) { + this.webHook = webHook; } public String getContent() { @@ -67,6 +74,14 @@ public class DingTalkTextMsg { isAtAll = atAll; } + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + public String getMsgContent() { Map items = new HashMap<>(); items.put("msgtype", "text"); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 826bb05905..4f24fa70d2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -6,8 +6,9 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.classic.spi.IThrowableProxy; import ch.qos.logback.classic.spi.StackTraceElementProxy; import ch.qos.logback.core.spi.FilterReply; -import com.epmet.commons.tools.utils.HttpClientManager; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.epmet.commons.tools.utils.DingdingMsgSender; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,78 +21,96 @@ import java.text.SimpleDateFormat; * @author: jianjun liu */ public class LogMsgSendFilter extends LevelFilter { - private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class); - @Override - public FilterReply decide(ILoggingEvent event) { - //如果日志级别等于设置的日志级别 则发送消息 - if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { - try { - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append("【日志告警】\n"); + private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class); + private DingdingMsgSender msgSender = new DingdingMsgSender(); + private String webHook; + private String secret; - stringBuilder.append("\n"); + @Override + public FilterReply decide(ILoggingEvent event) { + //如果日志级别等于设置的日志级别 则发送消息 + if (event.getLevel().isGreaterOrEqual(Level.ERROR)) { + try { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("【日志告警】\n"); - stringBuilder.append("告警级别:" + event.getLevel()); - stringBuilder.append("\n"); - stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); - stringBuilder.append("\n"); - stringBuilder.append("TraceId:" + Thread.currentThread().getName()); - stringBuilder.append("\n"); - stringBuilder.append("告警信息:" + event.getFormattedMessage()); - stringBuilder.append("\n"); + stringBuilder.append("\n"); - IThrowableProxy throwableProxy = event.getThrowableProxy(); - //异常信息处理 暂时处理一级的5行数据 - apendStackInfo(stringBuilder, throwableProxy); + stringBuilder.append("告警级别:" + event.getLevel()); + stringBuilder.append("\n"); + stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); + stringBuilder.append("\n"); + stringBuilder.append("TraceId:" + Thread.currentThread().getName()); + stringBuilder.append("\n"); + stringBuilder.append("告警信息:" + event.getFormattedMessage()); + stringBuilder.append("\n"); - Result flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString()); - if (!flag.success()) { - logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString()); - } - } catch (Exception e) { - logger.warn("decide exception", e); - } - } - //交给其他filter继续向下处理 - return super.decide(event); - } + IThrowableProxy throwableProxy = event.getThrowableProxy(); + //异常信息处理 暂时处理一级的5行数据 + apendStackInfo(stringBuilder, throwableProxy); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setContent(stringBuilder.toString()); + if (StringUtils.isNotBlank(webHook)) { + msg.setWebHook(webHook); + } + if (StringUtils.isNotBlank(secret)) { + msg.setSecret(secret); + } + boolean flag = msgSender.sendMsgAsync(msg); + if (!flag) { + logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString()); + } + } catch (Exception e) { + logger.warn("decide exception", e); + } + } + //交给其他filter继续向下处理 + return super.decide(event); + } - private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) { - int defaultRowLine = 5; - if (throwableProxy != null) { - stringBuilder.append("异常信息:") - .append(throwableProxy.getClassName()) - .append(" : ") - .append(throwableProxy.getMessage()) - .append("\n"); + private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) { + int defaultRowLine = 5; + if (throwableProxy != null) { + stringBuilder.append("异常信息:") + .append(throwableProxy.getClassName()) + .append(" : ") + .append(throwableProxy.getMessage()) + .append("\n"); - StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray(); - StackTraceElementProxy stackTraceElementProxy = null; + StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray(); + StackTraceElementProxy stackTraceElementProxy = null; - if (stackTraceElementProxyArray.length < defaultRowLine) { - defaultRowLine = stackTraceElementProxyArray.length; - } - for (int i = 0; i < defaultRowLine; i++) { - stackTraceElementProxy = stackTraceElementProxyArray[i]; - StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement(); - stringBuilder.append("\t\tat "); - stringBuilder.append(stackTraceElement.getClassName()); - stringBuilder.append("."); - stringBuilder.append(stackTraceElement.getMethodName()); - stringBuilder.append("("); - stringBuilder.append(stackTraceElement.getFileName()); - stringBuilder.append(":"); - stringBuilder.append(stackTraceElement.getLineNumber()); - stringBuilder.append(")"); - stringBuilder.append("\n"); - } - } - } + if (stackTraceElementProxyArray.length < defaultRowLine) { + defaultRowLine = stackTraceElementProxyArray.length; + } + for (int i = 0; i < defaultRowLine; i++) { + stackTraceElementProxy = stackTraceElementProxyArray[i]; + StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement(); + stringBuilder.append("\t\tat "); + stringBuilder.append(stackTraceElement.getClassName()); + stringBuilder.append("."); + stringBuilder.append(stackTraceElement.getMethodName()); + stringBuilder.append("("); + stringBuilder.append(stackTraceElement.getFileName()); + stringBuilder.append(":"); + stringBuilder.append(stackTraceElement.getLineNumber()); + stringBuilder.append(")"); + stringBuilder.append("\n"); + } + } + } - private String formatLongTime2Str(long timestamp) { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - return dateFormat.format(timestamp); - } + private String formatLongTime2Str(long timestamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + return dateFormat.format(timestamp); + } + public void setWebHook(String webHook) { + this.webHook = webHook; + } + + public void setSecret(String secret) { + this.secret = secret; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java new file mode 100644 index 0000000000..40420d1be7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java @@ -0,0 +1,185 @@ +package com.epmet.commons.tools.utils; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.Lists; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.annotation.PreDestroy; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * desc: 发送消息工具类 + * + * @date: 2020/6/29 8:43 + * @author: jianjun liu + */ +@Component +public class DingdingMsgSender { + + private final Logger logger = LoggerFactory.getLogger(DingdingMsgSender.class); + //如果不设置则为 开发环境机器人地址 + private static final String webHook = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c"; + private static final String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19"; + /** + * 默认10 + */ + private static Integer maxQueueSize = 10; + + /** + * 有序队列 + */ + private ArrayBlockingQueue msgQueue = new ArrayBlockingQueue<>(maxQueueSize); + + + private volatile boolean running = false; + + private Cache limitCache = CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).maximumSize(1000).build(); + + public DingdingMsgSender() { + + } + + + private void handleMsg() { + DingTalkTextMsg msg = null; + try { + //阻塞取元素 + msg = msgQueue.take(); + if (msg != null) { + AtomicInteger limitCount = limitCache.getIfPresent(msg.getWebHook()); + if (limitCount == null) { + limitCount = new AtomicInteger(1); + limitCache.put(msg.getWebHook(), limitCount); + } + if (limitCount.intValue() > maxQueueSize) { + msgQueue.offer(msg); + Thread.sleep(1000); + } else { + sendPostByJSON(msg); + limitCount.addAndGet(1); + } + } else { + Thread.sleep(1000); + } + } catch (Exception e) { + logger.warn("handleMsg exception,serverUrl:" + msg.getWebHook() + ",msg:" + JSON.toJSONString(msg), e); + } + } + + + /** + * desc:异步发送消息 + * + * @param messageParam + * @return + * @throws IOException + */ + public boolean sendMsgAsync(DingTalkTextMsg messageParam) { + if (!running) { + running = true; + getThread().start(); + } + boolean flag = false; + int currentQueueSize = msgQueue.size(); + //非阻塞 添加/删除元素 + if (currentQueueSize < maxQueueSize) { + flag = msgQueue.offer(messageParam); + } else { + msgQueue.poll(); + + DingTalkTextMsg param = new DingTalkTextMsg(); + param.setContent("待发送消息队列已满,当前队列个数" + msgQueue.size() + "\n" + "最新消息内容:" + JSON.toJSONString(messageParam)); + param.setWebHook(messageParam.getWebHook()); + sendPostByJSON(param); + } + return flag; + } + + /** + * 同步发送报警 + * + * @param messageParam + * @return + * @throws IOException + */ + public Result sendMsgSync(DingTalkTextMsg messageParam) { + return sendPostByJSON(messageParam); + } + + private Thread getThread() { + Thread sendMsgThread = new Thread("MsgSender-Thread") { + @Override + public void run() { + while (running) { + handleMsg(); + } + } + }; + return sendMsgThread; + } + + + @PreDestroy + public void destroy() { + running = false; + } + + /** + * 发送POST 请求 + * + * @param param 请求参数,JSON格式 + * @return + */ + private Result sendPostByJSON(DingTalkTextMsg param) { + if (StringUtils.isBlank(param.getWebHook())) { + param.setWebHook(webHook); + } + if (StringUtils.isBlank(param.getSecret())) { + param.setSecret(secret); + } + Result result = new Result().error(); + Long timestamp = System.currentTimeMillis(); + try { + String stringToSign = timestamp + "\n" + param.getSecret(); + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(param.getSecret().getBytes("UTF-8"), "HmacSHA256")); + byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); + String url = param.getWebHook(); + url = url.concat("×tamp=" + timestamp + "&sign=" + sign); + String jsonStrParam = param.getMsgContent(); + result = HttpClientManager.getInstance().sendPostByJSON(url, jsonStrParam); + } catch (Exception e) { + logger.warn("sendPostByJSON error", e); + } + return result; + } + + + public static void main(String[] args) { + for (int i = 0; i < 50; i++) { + + DingTalkTextMsg dingTalkTextMsg = new DingTalkTextMsg(); + dingTalkTextMsg.setWebHook(""); + dingTalkTextMsg.setContent("测试消息" + i); + dingTalkTextMsg.setAtMobiles(Lists.newArrayList()); + dingTalkTextMsg.setAtAll(false); + dingTalkTextMsg.setSecret(""); + DingdingMsgSender msgSender = new DingdingMsgSender(); + msgSender.sendMsgAsync(dingTalkTextMsg); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 2f6e7ac226..5f562630dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -2,20 +2,21 @@ package com.epmet.controller; import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDemoService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.time.LocalDateTime; +import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; -import java.util.List; - @RequestMapping("demo") @RestController +@Slf4j public class DemoController { @Autowired @@ -24,6 +25,13 @@ public class DemoController { @Autowired private ExecutorService executorService; + @GetMapping("testAlarm") + public void testAlarm() { + for (int i = 0; i < 20; i++) { + log.error("测试消息"+i); + } + } + @GetMapping("testtx") public void testTx() { demoService.testTx(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 148588bffb..fb3deaefb1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -130,6 +130,8 @@ ERROR ACCEPT DENY + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 From 7d44e82efcf6b9190ae87ec719b6fd865214f173 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 29 Jun 2020 12:58:39 +0800 Subject: [PATCH 097/137] =?UTF-8?q?job=E6=9C=8D=E5=8A=A1=E3=80=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9C=8D=E5=8A=A1=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- .../epmet-job/epmet-job-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-job/epmet-job-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 95c949f0f6..fb1cd42576 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.11 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.12 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 81d02ae79b..756bb24d61 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.11 + 0.3.12 data-statistical com.epmet 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 1aa3f41622..9f45cdc9e8 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.12 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.13 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 a7130ca254..d08f27704a 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.12 + 0.3.13 com.epmet epmet-job From 251db3d7a2fd93344e2a898f62e25fedd878b66c Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Mon, 29 Jun 2020 13:31:40 +0800 Subject: [PATCH 098/137] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--t?= =?UTF-8?q?ype=E4=BF=AE=E6=94=B9=E5=92=8C=E4=B8=8B=E7=BA=A7=E6=9C=BA?= =?UTF-8?q?=E5=85=B3=E5=8E=BB=E9=99=A4self?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/FactTagUsedAgencyDTO.java | 62 +++++++++++++++++++ ...cyDTO.java => FactTagViewedAgencyDTO.java} | 2 +- .../publicity/PublicityController.java | 8 +-- .../com/epmet/dao/publicity/PublicityDao.java | 12 ++-- .../service/publicity/PublicityService.java | 8 +-- .../publicity/impl/PublicityServiceImpl.java | 4 +- .../mapper/publicity/PublicityDao.xml | 15 +++-- 7 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.java rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/{FactTagAgencyDTO.java => FactTagViewedAgencyDTO.java} (95%) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.java new file mode 100644 index 0000000000..9f0ddc7b3e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.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 FactTagUsedAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 标签名称 标签名称 + */ + private String name; + + /** + * 使用改标签的数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 标签Id + */ + private String tagId; + + +} \ 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/FactTagViewedAgencyDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDTO.java index 35cbbc0390..31b5334303 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/FactTagViewedAgencyDTO.java @@ -30,7 +30,7 @@ import java.util.Date; * @since v1.0.0 2020-06-19 */ @Data -public class FactTagAgencyDTO implements Serializable { +public class FactTagViewedAgencyDTO implements Serializable { private static final long serialVersionUID = 1L; 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 56d31b9d17..8612d82002 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 @@ -65,7 +65,7 @@ public class PublicityController { * @author jyy */ @PostMapping("tagviewed") - public Result> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + public Result> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); Integer pageSize = formDTO.getPageSize(); @@ -73,7 +73,7 @@ public class PublicityController { pageSize = NumConstant.TEN; } String type = formDTO.getType(); - return new Result>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); + return new Result>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); } /** @@ -82,7 +82,7 @@ public class PublicityController { * @author jyy */ @PostMapping("tagused") - public Result> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + public Result> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); Integer pageSize = formDTO.getPageSize(); @@ -90,7 +90,7 @@ public class PublicityController { pageSize = NumConstant.TEN; } String type = formDTO.getType(); - return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); + return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); } /** 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 index 33801156b9..cf62356848 100644 --- 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 @@ -44,42 +44,42 @@ public interface PublicityDao { * @param agencyId,monthId,pageSize 机关id,月,展示数量 * @author zxc */ - List getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + 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); + 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); + 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); + 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); + 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); + List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); /** * @Description 当月———下级机发文数 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 9eccb5b29f..bec823066c 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,12 +18,8 @@ package com.epmet.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; -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; /** @@ -46,14 +42,14 @@ public interface PublicityService { * @param tokenDto,formDTO * @author jyy */ - public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; /** * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 * @param tokenDto,pageSize,type * @author jyy */ - public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; /** * @param tokenDto type 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 c5e94f7633..990cc97916 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 @@ -64,7 +64,7 @@ public class PublicityServiceImpl implements PublicityService { * @author jyy */ @Override - public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); Date date = new Date(); String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); @@ -92,7 +92,7 @@ public class PublicityServiceImpl implements PublicityService { * @author jyy */ @Override - public List tagused(TokenDto tokenDto, Integer pageSize, String type) { + public List tagused(TokenDto tokenDto, Integer pageSize, String type) { String agencyId = this.getLoginUserDetails(tokenDto); Date date = new Date(); String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); 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 index c7d032eb43..bb4b53fd65 100644 --- 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 @@ -14,7 +14,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -29,7 +29,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -44,7 +44,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -59,7 +59,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -74,7 +74,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -89,7 +89,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -116,6 +116,7 @@ where pub.agency_id = agency.id AND pub.PID =#{agencyId} + AND pub.agency_id not LIKE '%self%' AND pub.month_id=#{monthId} GROUP BY pub.agency_id ORDER BY value DESC,agencyId ASC @@ -135,6 +136,7 @@ where pub.agency_id = agency.id AND pub.PID =#{agencyId} + AND pub.agency_id not LIKE '%self%' AND pub.quarter_id=#{quarterId} GROUP BY pub.agency_id ORDER BY value DESC,agencyId ASC @@ -153,6 +155,7 @@ where pub.agency_id = agency.id AND pub.PID =#{agencyId} + AND pub.agency_id not LIKE '%self%' AND pub.year_id=#{yearId} GROUP BY pub.agency_id ORDER BY value DESC,agencyId ASC From 1c4798d086a7e3fa2a85a68354fe7a21b3b44fe4 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 29 Jun 2020 13:45:16 +0800 Subject: [PATCH 099/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/group/GroupDataDao.java | 8 +- .../group/impl/GroupDataServiceImpl.java | 32 ++--- .../service/impl/StatsGroupServiceImpl.java | 130 +++++++++++------- .../resources/mapper/group/GroupDataDao.xml | 16 +-- 4 files changed, 106 insertions(+), 80 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 28703e70e9..db1bc08318 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -50,21 +50,21 @@ public interface GroupDataDao { * @param * @author zxc */ - List getAgencyGroupTotalCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + List getAgencyGroupTotalCount(@Param("customerId") String customerId,@Param("dateId")String dateId); /** * @Description 查询机关下网格内的小组人数 【待优化】 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + List selectAgencyGridGroupPeopleTotal(@Param("customerId") String customerId,@Param("dateId")String dateId); /** * @Description 查询机关下每个小组的人数 【待优化】 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + List selectAgencyEveryGroupPeopleCount(@Param("customerId") String customerId,@Param("dateId")String dateId); /** * @Description 查询机关下的小组日增数 【待优化】 @@ -72,7 +72,7 @@ public interface GroupDataDao { * @param dateId * @author zxc */ - List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("dateId")String dateId); + List selectAgencyGroupIncr(@Param("customerId") String customerId,@Param("dateId")String dateId); /** * @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 1cdc3acdcf..cd4a68f97a 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 @@ -133,11 +133,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List getAgencyGroupTotalCount(List allGrid,String dateId){ - if (allGrid.size() == NumConstant.ZERO){ + public List getAgencyGroupTotalCount(String customerId,String dateId){ + /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); - } - return groupDataDao.getAgencyGroupTotalCount(allGrid,dateId); + }*/ + return groupDataDao.getAgencyGroupTotalCount(customerId,dateId); } /** @@ -146,11 +146,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @author zxc */ @Override - public List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId) { - if (allGrid.size() == NumConstant.ZERO){ + public List selectAgencyGridGroupPeopleTotal(String customerId,String dateId) { + /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); - } - return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid,dateId); + }*/ + return groupDataDao.selectAgencyGridGroupPeopleTotal(customerId,dateId); } /** @@ -158,11 +158,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId){ - if (allGrid.size() == NumConstant.ZERO){ + public List selectAgencyEveryGroupPeopleCount(String customerId,String dateId){ + /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); - } - return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid,dateId); + }*/ + return groupDataDao.selectAgencyEveryGroupPeopleCount(customerId,dateId); } /** @@ -171,11 +171,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @param dateId * @author zxc */ - public List selectAgencyGroupIncr(List allGrid,String dateId){ - if (allGrid.size() == NumConstant.ZERO){ + public List selectAgencyGroupIncr(String customerId,String dateId){ + /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); - } - return groupDataDao.selectAgencyGroupIncr(allGrid, dateId); + }*/ + return groupDataDao.selectAgencyGroupIncr(customerId, dateId); } /** 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 8fc87943da..5e86bc0bbb 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 @@ -151,58 +151,92 @@ public class StatsGroupServiceImpl implements StatsGroupService { BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId,customerId); - String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); - agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); - // 1. 机关下有多少网格 - List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); - AtomicReference gridSize = new AtomicReference<>(0); - if (customerGridIdList.size() != NumConstant.ZERO){ - customerGridIdList.forEach(gridId -> { - allGrid.forEach(allAgencyGrid -> { - if (gridId.getGridId().equals(allAgencyGrid)){ - gridSize.updateAndGet(v -> v + NumConstant.ONE); + if (allGrid.size() != NumConstant.ZERO) { + String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); + agencyResult.setPid(StringUtils.isBlank(pidByAgencyId) ? "0" : pidByAgencyId); + // 1. 机关下有多少网格 + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + AtomicReference gridSize = new AtomicReference<>(0); + if (customerGridIdList.size() != NumConstant.ZERO) { + customerGridIdList.forEach(gridId -> { + allGrid.forEach(allAgencyGrid -> { + if (gridId.getGridId().equals(allAgencyGrid)) { + gridSize.updateAndGet(v -> v + NumConstant.ONE); + } + }); + }); + agencyResult.setGridTotal(gridSize.get()); + } else { + agencyResult.setGridTotal(NumConstant.ZERO); + } + // 2. 机关下有多少小组,只算 state = ‘approved’ + List approvedResult = new ArrayList<>(); + List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(customerId, dateId); + allGrid.forEach(grid -> { + agencyGroupTotalCount.forEach(groupTotal -> { + if (grid.equals(groupTotal.getGridId())) { + approvedResult.add(groupTotal); } }); }); - agencyResult.setGridTotal(gridSize.get()); - }else { - agencyResult.setGridTotal(NumConstant.ZERO); - } - // 2. 机关下有多少小组,只算 state = ‘approved’ - List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); - Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); - agencyResult.setGroupTotalCount(groupCount); - // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" - List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId); - Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); - agencyResult.setGroupMemberTotalCount(groupPeopleCount); - // 4. 机关下小组平均人数 - agencyResult.setGroupMemberAvgCount( - agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO : - agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); - // 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID - List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId); - List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); - Integer groupPeopleMedian; - if (sorted.size() == NumConstant.ONE){ - agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); - agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); - agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); - agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); - }else if (sorted.size() >= NumConstant.TWO){ - groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? - (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : - sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); - agencyResult.setGroupMedian(groupPeopleMedian); - agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); - agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); - agencyResult.setGroupMemberMinCount(sorted.get(sorted.size() - NumConstant.ONE).getGroupCount()); - agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); + Integer groupCount = approvedResult.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + agencyResult.setGroupTotalCount(groupCount); + // 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" + List peopleTotal = new ArrayList<>(); + List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(customerId, dateId); + allGrid.forEach(grid -> { + agencyGridGroupPeopleTotal.forEach(people -> { + if (grid.equals(people.getGridId())) { + peopleTotal.add(people); + } + }); + }); + Integer groupPeopleCount = peopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + agencyResult.setGroupMemberTotalCount(groupPeopleCount); + // 4. 机关下小组平均人数 + agencyResult.setGroupMemberAvgCount( + agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO : + agencyResult.getGroupMemberTotalCount() / agencyResult.getGroupTotalCount()); + // 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID + List groupPeople = new ArrayList<>(); + List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(customerId, dateId); + allGrid.forEach(grid -> { + agencyGridGroupPeople.forEach(group -> { + if (grid.equals(group.getGridId())) { + groupPeople.add(group); + } + }); + }); + List sorted = groupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); + Integer groupPeopleMedian; + if (sorted.size() == NumConstant.ONE) { + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + } else if (sorted.size() >= NumConstant.TWO) { + groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); + agencyResult.setGroupMedian(groupPeopleMedian); + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(sorted.size() - NumConstant.ONE).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); + } + // 6. 机关下小组增量 + List groupIncr = new ArrayList<>(); + List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(customerId, dateId); + allGrid.forEach(grid -> { + agencyGroupIncr.forEach(incr -> { + if (grid.equals(incr.getGridId())) { + groupIncr.add(incr); + } + }); + }); + Integer groupIncrCount = groupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); + agencyResult.setGroupIncr(groupIncrCount); } - // 6. 机关下小组增量 - List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId); - Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); - agencyResult.setGroupIncr(groupIncr); result.add(agencyResult); }); return result; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 968ca9d83d..0ed8f428fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -73,7 +73,6 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 00f845829a..29ddddc6c6 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -94,6 +94,7 @@ LEFT JOIN dim_agency da ON da.id = ftiad.agency_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' + AND ftiad.customer_id = #{customerId} AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_agency_daily WHERE del_flag = '0') @@ -138,6 +139,7 @@ LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' + AND ftiad.customer_id = #{customerId} AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_grid_daily WHERE del_flag = '0') 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 a6d61a756e..82588801a7 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 @@ -21,24 +21,24 @@ public interface GroupDataService { /** * @Description 获取同级机关下网格下的小组数量 - * @param allGrid + * @param * @author zxc */ - List getAgencyGroupTotalCount(List allGrid,String dateId); + List getAgencyGroupTotalCount(String customerId,String dateId); /** * @Description 查询机关下网格内的小组人数 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId); + List selectAgencyGridGroupPeopleTotal(String customerId,String dateId); /** * @Description 查询机关下每个小组的人数 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId); + List selectAgencyEveryGroupPeopleCount(String customerId,String dateId); /** * @Description 查询机关下的小组日增数 @@ -46,7 +46,7 @@ public interface GroupDataService { * @param yesterday * @author zxc */ - List selectAgencyGroupIncr(List allGrid,String yesterday); + List selectAgencyGroupIncr(String customerId,String yesterday); /** * @Description 查询机关下所有网格小组人数 From 7defc80549052eb4f74113e6a9a68b18f46e1b1a Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 14:32:15 +0800 Subject: [PATCH 101/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index fb1cd42576..8f836f39b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.12 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.13 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 756bb24d61..3c2cbaf611 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.12 + 0.3.13 data-statistical com.epmet From e4afe22101609ceac457a0aa0f9a0f9a0a9f3f41 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 14:36:41 +0800 Subject: [PATCH 102/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 21ee831dcc..1430111cdc 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.9 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.10 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 8c2ac84759..e0a47dd9d7 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.9 + 0.3.10 data-report-server From 8b85794225b52f1b986ad7705e7e551020891149 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Jun 2020 14:43:48 +0800 Subject: [PATCH 103/137] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A/data/report?= =?UTF-8?q?/user/checksublist=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/DimDepartmentDTO.java | 25 ++++++++++++++++ .../result/user/UserAgencyInfoResultDTO.java | 29 +++++++++++++++++++ .../user/UserAnalysisController.java | 19 +++++++++--- .../com/epmet/dao/user/UserAnalysisDao.java | 10 +++++++ .../service/user/UserAnalysisService.java | 14 ++++++--- .../user/impl/UserAnalysisServiceImpl.java | 27 +++++++++++++++++ .../resources/mapper/user/UserAnalysisDao.xml | 12 ++++++++ 7 files changed, 128 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java new file mode 100644 index 0000000000..6e51daed40 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 部门维度 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/29 13:59 + */ +@Data +public class DimDepartmentDTO implements Serializable { + private static final long serialVersionUID = -521155628850201172L; + /** + * DEPARTMENT_ID + */ + private String id; + + /** + * 部门名称 + */ + private String departmentName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java new file mode 100644 index 0000000000..c298892d9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.user; + +import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimDepartmentDTO; +import com.epmet.dto.DimGridDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 直属机关、部门、网格列表查询 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/29 13:55 + */ +@Data +public class UserAgencyInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4471324414446061654L; + private Boolean subGridFlag; + private Boolean subDepartmentFlag; + private Boolean subAgencyFlag; +// @JsonIgnore + private List subAgencyList; +// @JsonIgnore + private List subGridList; +// @JsonIgnore + private List subDepartmentList; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java index 5f3cfaa290..cceebbef37 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -6,10 +6,7 @@ import com.epmet.dto.form.user.UserIncrTrendFormDTO; import com.epmet.dto.form.user.UserSubAgencyFormDTO; import com.epmet.dto.form.user.UserSubGridFormDTO; import com.epmet.dto.form.user.UserSummaryInfoFormDTO; -import com.epmet.dto.result.user.UserIncrTrendResultDTO; -import com.epmet.dto.result.user.UserSubAgencyResultDTO; -import com.epmet.dto.result.user.UserSubGridResultDTO; -import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import com.epmet.dto.result.user.*; import com.epmet.service.user.UserAnalysisService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -87,4 +84,18 @@ public class UserAnalysisController { return new Result>().ok(userIncrTrendResultDTO); } + /** + * @param + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属机关、部门、网格列表查询 + * @Date 2020/6/29 14:10 + **/ + @PostMapping("checksublist") + public Result checkSubList() { + UserAgencyInfoResultDTO userAgencyInfoResultDTO = userService.checkSubList(); + return new Result().ok(userAgencyInfoResultDTO); + } + + } 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 7b72652ea8..2df268feb2 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 @@ -2,6 +2,7 @@ package com.epmet.dao.user; import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimDepartmentDTO; import com.epmet.dto.DimGridDTO; import com.epmet.dto.result.user.UserIncrTrendResDTO; import com.epmet.dto.result.user.UserSubAgencyResDTO; @@ -132,4 +133,13 @@ public interface UserAnalysisDao { * @Date 2020/6/23 11:24 **/ List selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId 工作人员所属机关单位id + * @author yinzuomei + * @description 查询机关下的部门列表 + * @Date 2020/6/29 14:18 + **/ + List selectSubDepartmentList(@Param("agencyId")String myAgencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java index 6e0c796794..2c658fc1da 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java @@ -5,10 +5,7 @@ import com.epmet.dto.form.user.UserIncrTrendFormDTO; import com.epmet.dto.form.user.UserSubAgencyFormDTO; import com.epmet.dto.form.user.UserSubGridFormDTO; import com.epmet.dto.form.user.UserSummaryInfoFormDTO; -import com.epmet.dto.result.user.UserIncrTrendResultDTO; -import com.epmet.dto.result.user.UserSubAgencyResultDTO; -import com.epmet.dto.result.user.UserSubGridResultDTO; -import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import com.epmet.dto.result.user.*; import java.util.List; @@ -64,4 +61,13 @@ public interface UserAnalysisService { * @Date 2020/6/22 13:42 **/ List incrTrendV2(UserIncrTrendFormDTO formDTO); + + /** + * @return com.epmet.dto.result.user.UserAgencyInfoResultDTO + * @param + * @author yinzuomei + * @description 直属机关、部门、网格列表查询 + * @Date 2020/6/29 14:10 + **/ + UserAgencyInfoResultDTO checkSubList(); } 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 a001f3847d..707eec34f6 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 @@ -9,6 +9,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserAnalysisConstant; import com.epmet.dao.user.UserAnalysisDao; import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimDepartmentDTO; import com.epmet.dto.DimGridDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.user.UserIncrTrendFormDTO; @@ -454,6 +455,32 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { return resultList; } + @Override + public UserAgencyInfoResultDTO checkSubList() { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + UserAgencyInfoResultDTO userAgencyInfoResultDTO=new UserAgencyInfoResultDTO(); + userAgencyInfoResultDTO.setSubAgencyFlag(false); + userAgencyInfoResultDTO.setSubGridFlag(false); + userAgencyInfoResultDTO.setSubDepartmentFlag(false); + List subAgencyList=userAnalysisDao.selectSubAgencyList(myAgencyId); + if(null!=subAgencyList&&subAgencyList.size()>0){ + userAgencyInfoResultDTO.setSubAgencyFlag(true); + } + List subGridList=userAnalysisDao.selectSubGridList(myAgencyId); + if(null!=subGridList&&subGridList.size()>0){ + userAgencyInfoResultDTO.setSubGridFlag(true); + } + List subDepartmentList=userAnalysisDao.selectSubDepartmentList(myAgencyId); + if(null!=subDepartmentList&&subDepartmentList.size()>0){ + userAgencyInfoResultDTO.setSubDepartmentFlag(true); + } + userAgencyInfoResultDTO.setSubAgencyList(subAgencyList); + userAgencyInfoResultDTO.setSubGridList(subGridList); + userAgencyInfoResultDTO.setSubDepartmentList(subDepartmentList); + return userAgencyInfoResultDTO; + } + private List initUserIncrTrendResultDTO(String type) { List list=new ArrayList<>(); if(UserAnalysisConstant.DAY_TYPE.equals(type)){ 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 0d593b8379..a36fe93ab5 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 @@ -220,4 +220,16 @@ m.MONTH_ID DESC LIMIT 12 + + + \ No newline at end of file From 693bb791f9f57c53a8f1ad9cf9e5015cf177c05e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Jun 2020 14:46:35 +0800 Subject: [PATCH 104/137] =?UTF-8?q?datareport=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=EF=BC=9A0.3.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 1430111cdc..1c777c1185 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.10 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.11 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index e0a47dd9d7..df717a007f 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.10 + 0.3.11 data-report-server From d6ea012ea612577594ea56f691cea805754f2e35 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Mon, 29 Jun 2020 14:59:27 +0800 Subject: [PATCH 105/137] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--c?= =?UTF-8?q?ount=E5=8F=98=E4=B8=BAsum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/publicity/PublicityDao.java | 28 +++++++++---------- .../mapper/publicity/PublicityDao.xml | 12 ++++---- 2 files changed, 20 insertions(+), 20 deletions(-) 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 index cf62356848..a4babe6039 100644 --- 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 @@ -42,76 +42,76 @@ public interface PublicityDao { /** * @Description 当月———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 * @param agencyId,monthId,pageSize 机关id,月,展示数量 - * @author zxc + * @author jyy */ List getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); /** * @Description 当季———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 * @param agencyId,quarterId,pageSize 机关id,季,展示数量 - * @author zxc + * @author jyy */ List getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); /** * @Description 当年———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 * @param agencyId,yearId,pageSize 机关id,年,展示数量 - * @author zxc + * @author jyy */ List getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); /** * @Description 当月———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 * @param agencyId,monthId,pageSize 机关id,月,展示数量 - * @author zxc + * @author jyy */ List getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); /** * @Description 当季———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 * @param agencyId,quarterId,pageSize 机关id,季,展示数量 - * @author zxc + * @author jyy */ List getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); /** * @Description 当年———获取机关下,每个标签发文数量,按照数量降序,取前pagesize个 * @param agencyId,yearId,pageSize 机关id,年,展示数量 - * @author zxc + * @author jyy */ List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); /** * @Description 当月———下级机发文数 * @param agencyId,monthId 机关id,月 - * @author zxc + * @author jyy */ List getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); /** * @Description 当季———下级机发文数 * @param agencyId,quarterId 机关id,季度 - * @author zxc + * @author jyy */ List getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); /** * @Description 当年———下级机发文数 * @param agencyId,yearId 机关id,年 - * @author zxc + * @author jyy */ List getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); /** * @Description 当月———下级部门文数 * @param agencyId,monthId 机关id,月 - * @author zxc + * @author jyy */ List getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); /** * @Description 当季———下级部门文数 * @param agencyId,quarterId 机关id,季度 - * @author zxc + * @author jyy */ List getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); /** @@ -124,20 +124,20 @@ public interface PublicityDao { /** * @Description 当月———下级网格文数 * @param agencyId,monthId 机关id,月 - * @author zxc + * @author jyy */ List getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); /** * @Description 当季———下级网格文数 * @param agencyId,quarterId 机关id,季度 - * @author zxc + * @author jyy */ List getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); /** * @Description 当年———下级网格文数 * @param agencyId,yearId 机关id,年 - * @author zxc + * @author jyy */ List getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); 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 index bb4b53fd65..165aab88fa 100644 --- 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 @@ -19,7 +19,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(tag_read_count) AS value + SUM(tag_read_count) AS value FROM fact_tag_viewed_agency_monthly where agency_id = #{agencyId} AND month_id = #{monthId} @@ -34,7 +34,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(tag_read_count) AS value + SUM(tag_read_count) AS value FROM fact_tag_viewed_agency_quarterly where agency_id = #{agencyId} AND quarter_id = #{quarterId} @@ -49,7 +49,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(tag_read_count) AS value + SUM(tag_read_count) AS value FROM fact_tag_viewed_agency_yearly where agency_id = #{agencyId} AND year_id = #{yearId} @@ -64,7 +64,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(used_count) AS value + SUM(used_count) AS value FROM fact_tag_used_agency_monthly where agency_id = #{agencyId} AND month_id = #{monthId} @@ -79,7 +79,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(used_count) AS value + SUM(used_count) AS value FROM fact_tag_used_agency_quarterly where agency_id = #{agencyId} AND quarter_id = #{quarterId} @@ -94,7 +94,7 @@ tag_name AS name, agency_id AS agencyId, tag_id AS tagId, - COUNT(used_count) AS value + SUM(used_count) AS value FROM fact_tag_used_agency_yearly where agency_id = #{agencyId} AND year_id = #{yearId} From 51259c56fda2900c172d4c44c048ed930abc75db Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 29 Jun 2020 15:30:43 +0800 Subject: [PATCH 106/137] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9A=84=E6=9C=BA=E5=85=B3=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/topic/impl/TopicServiceImpl.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 999a90709e..a4e9ecbc6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -84,6 +84,10 @@ public class TopicServiceImpl implements TopicService { } + if(!subGridOfAgency.containsKey(agency.getAgencyId())){ + subGridOfAgency.put(agency.getAgencyId(),new HashSet<>()); + } + }); return calculateAndSummarizeTopicStatisticalData(subGridOfAgency,agencies,gridGroupMap,targetDate,statusDimension,timeDimension,customerId); @@ -324,13 +328,13 @@ public class TopicServiceImpl implements TopicService { gridDistinct.put(gridId,true); }); - //机关-百分比 - setAgencyTopicProportion(numberFormat,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed,totalAgencyD); - setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); } + //机关-百分比 + setAgencyTopicProportion(numberFormat,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed,totalAgencyD); + setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); } @@ -417,13 +421,14 @@ public class TopicServiceImpl implements TopicService { gridDistinct.put(gridId,true); }); - //机关-百分比 - setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); - setAgencyMonthlyDataPacket(dataPacket,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + } + //机关-百分比 + setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + setAgencyMonthlyDataPacket(dataPacket,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); } From 9f317106704b8dba1f58c608534da3c6e0dd8272 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 15:36:32 +0800 Subject: [PATCH 107/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 1c777c1185..521aed9fa4 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.11 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.12 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index df717a007f..accbc201dc 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.11 + 0.3.12 data-report-server From 722987fa2b2f5cd744d9ed236c850453a80e2b85 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 15:48:24 +0800 Subject: [PATCH 108/137] =?UTF-8?q?self=E7=9A=84pid=20=E6=98=AF=E5=AE=83?= =?UTF-8?q?=E6=9C=AC=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/StatsPublicityServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 eabcec07ad..63751accec 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 @@ -465,7 +465,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //构建机关自己的数据 FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); selfDaily.setCustomerId(gridDailyEntities.getCustomerId()); - selfDaily.setPid(gridDailyEntities.getPid()); + selfDaily.setPid(summaryDTO.getAgencyId()); selfDaily.setAgencyId(summaryDTO.getAgencyId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); selfDaily.setArticleTotalCount(summaryDTO.getArticleTotalCount()); selfDaily.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); @@ -571,7 +571,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; case ProjectConstant.PUBLISHER_TYPE_AGENCY: - convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); + convertTagUsedAgencyDailySelfEntity( tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); break; } } @@ -1048,14 +1048,14 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } - private void convertTagUsedAgencyDailySelfEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + private void convertTagUsedAgencyDailySelfEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { String agencyId = articleEntity.getOrgId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); String tagId = tagEntity.getTagId(); String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); FactTagUsedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); - entity.setPid(pid); + entity.setPid(articleEntity.getOrgId()); entity.setCustomerId(articleEntity.getCustomerId()); entity.setAgencyId(agencyId); entity.setTagId(tagId); @@ -1118,7 +1118,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { FactTagViewedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); - entity.setPid(dimAgencyEntity.getPid()); + entity.setPid(dimAgencyEntity.getId()); entity.setCustomerId(tagEntity.getCustomerId()); entity.setAgencyId(agencyId); entity.setTagId(tagId); From e7a0ded7c95ec110d4bf8fc1345a847885bda06a Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 15:56:34 +0800 Subject: [PATCH 109/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 8f836f39b1..573e50c5ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.14 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 3c2cbaf611..d508794938 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.13 + 0.3.14 data-statistical com.epmet From fa99295fbe849abcbe22db99df29e9ae38ddb0dc Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 16:17:01 +0800 Subject: [PATCH 110/137] =?UTF-8?q?count=E5=8F=98sum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml | 4 ++-- .../mapper/stats/FactTagUsedDepartmentMonthlyDao.xml | 4 ++-- .../main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml | 4 ++-- .../resources/mapper/stats/FactTagViewedAgencyDailyDao.xml | 2 +- .../resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml | 4 ++-- .../main/resources/mapper/stats/FactTagViewedGridDailyDao.xml | 2 +- .../resources/mapper/stats/FactTagViewedGridMonthlyDao.xml | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index 05d22a1a38..124bd1f198 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -10,7 +10,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID @@ -32,7 +32,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml index af8efb5266..9aad892518 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml @@ -10,7 +10,7 @@ DEPARTMENT_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID @@ -32,7 +32,7 @@ DEPARTMENT_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml index 67974a20e2..297903ed89 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml @@ -11,7 +11,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID @@ -33,7 +33,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( USED_COUNT ) USED_COUNT, + SUM( USED_COUNT ) USED_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml index f8c7a55728..be981cd24f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml @@ -13,7 +13,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml index 85e33ec0ac..8a313e66bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml @@ -12,7 +12,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID @@ -34,7 +34,7 @@ AGENCY_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml index 3fa886f434..556242237e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -14,7 +14,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml index 8bde85f5a3..e3c9f89bdc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -13,7 +13,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID @@ -35,7 +35,7 @@ GRID_ID, TAG_ID, TAG_NAME, - COUNT( TAG_READ_COUNT ) TAG_READ_COUNT, + SUM( TAG_READ_COUNT ) TAG_READ_COUNT, MONTH_ID, QUARTER_ID, YEAR_ID From e72f36df51275e800d45e73b05d3699782000fec Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 29 Jun 2020 17:48:15 +0800 Subject: [PATCH 111/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 ++ .../com/epmet/service/group/impl/GroupDataServiceImpl.java | 3 ++- .../java/com/epmet/service/impl/StatsGroupServiceImpl.java | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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 eb49ff744a..8c4309dfd6 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 @@ -113,6 +113,7 @@ public class TopicServiceImpl implements TopicService { } }); }); + //根据 话题的(讨论中 + 已屏蔽 + 已关闭 + 已转议题)的和,倒序 Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubGridResultDTO::getGridId)); Set>> entries = collect.entrySet(); entries.forEach(entry -> { @@ -157,6 +158,7 @@ public class TopicServiceImpl implements TopicService { } }); }); + //根据 话题的(讨论中 + 已屏蔽 + 已关闭 + 已转议题)的和,倒序 Map> collect = result.stream().collect(Collectors.groupingBy(TopicSubAgencyResultDTO::getAgencyId)); Set>> entries = collect.entrySet(); entries.forEach(entry -> { 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 cd4a68f97a..ace321cba1 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 @@ -95,12 +95,13 @@ public class GroupDataServiceImpl implements GroupDataService { Set>> entries = collect.entrySet(); entries.forEach(everyGroup -> { List value = everyGroup.getValue(); + String key = everyGroup.getKey(); List groupPeopleSorted = value.stream().sorted(Comparator.comparing(GridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); Integer groupPeopleMedian = groupPeopleSorted.size() % 2 == 0 ? (groupPeopleSorted.get(groupPeopleSorted.size() / 2 - 1).getGroupCount() + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount()) / 2 : groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount(); result.forEach(grid -> { - if (groupPeopleSorted.get(0).getGridId().equals(grid.getGridId())){ + if (key.equals(grid.getGridId())){ grid.setGroupMedian(groupPeopleMedian);//中位数 //网格下小组成员最大数 grid.setGroupMemberMaxCount(groupPeopleSorted.get(NumConstant.ZERO).getGroupCount()); 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 5e86bc0bbb..406648d681 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 @@ -210,6 +210,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List sorted = groupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); Integer groupPeopleMedian; if (sorted.size() == NumConstant.ONE) { + agencyResult.setGroupMedian(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); From fdb776d85489b2bfd31dad32633c5312815ad41e Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Jun 2020 18:49:44 +0800 Subject: [PATCH 112/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 573e50c5ba..e8523d3c75 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.14 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.15 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index d508794938..ab312b94a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.14 + 0.3.15 data-statistical com.epmet From 09f8eb9bce66b120cc4ad2261cab40068810f73e Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 29 Jun 2020 19:40:24 +0800 Subject: [PATCH 113/137] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=B0=8F=E7=BB=84=E5=90=8E=E7=BB=84=E4=BF=A1=E6=81=AF=EF=BC=88?= =?UTF-8?q?=E7=BC=93=E5=AD=98=EF=BC=89=E6=9C=89=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/ResiGroupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 72412d91cd..e9162746bf 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -502,7 +502,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl param = new HashMap<>(); - param.put(ModuleConstant.RESI_GROUP_ID_CAMEL, resiGroupDTO.getId()); + param.put(ModuleConstant.RESI_GROUP_ID, resiGroupDTO.getId()); param.put(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); List statisticalList = resiGroupStatisticalService.list(param); if (null != statisticalList && statisticalList.size() > 0) { From b478d23921469d0532b049982d0601c22c611a92 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 09:14:27 +0800 Subject: [PATCH 114/137] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1pid?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/StatsGroupServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 406648d681..77bbcd42ba 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 @@ -148,12 +148,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { String agencyId = agency.getId(); agencyResult.setAgencyId(agencyId); agencyResult.setCustomerId(customerId); + agencyResult.setPid(agency.getPid()); BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId,customerId); if (allGrid.size() != NumConstant.ZERO) { - String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); - agencyResult.setPid(StringUtils.isBlank(pidByAgencyId) ? "0" : pidByAgencyId); // 1. 机关下有多少网格 List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(0); From acf91a92691435b05a4c8cc48a3108f2f3ae1a04 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 10:35:47 +0800 Subject: [PATCH 115/137] =?UTF-8?q?=E7=94=A8=E6=88=B7summaryInfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/user/impl/UserAnalysisServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 707eec34f6..6db2f80497 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 @@ -90,14 +90,15 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { //注册用户 userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); } - if(null!=userSummaryInfoResultDTO){ + if (userSummaryInfoResultDTO == null){ + return new UserSummaryInfoResultDTO(); + } userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 String partyMemberProStr=userSummaryInfoResultDTO.getPartymemberProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); userSummaryInfoResultDTO.setPartymemberProportion(partyMemberProStr.concat("%")); String warmProStr=userSummaryInfoResultDTO.getWarmHeartedProportionValue().setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); userSummaryInfoResultDTO.setWarmHeartedProportion(warmProStr.concat("%")); - } logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); return userSummaryInfoResultDTO; } From b84d457f4aa125717a1eda20ff6d1ece6e862d9b Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 11:02:30 +0800 Subject: [PATCH 116/137] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=A2=AB=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E5=92=8C=E8=A2=AB=E9=98=85=E8=AF=BB=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/voice/TagCustomerDao.java | 42 +++ .../epmet/entity/voice/TagCustomerEntity.java | 53 ++++ .../impl/StatsPublicityServiceImpl.java | 272 ++++++++++++------ .../service/voice/TagCustomerService.java | 34 +++ .../voice/impl/TagCustomerServiceImpl.java | 44 +++ .../resources/mapper/voice/TagCustomerDao.xml | 17 ++ 6 files changed, 375 insertions(+), 87 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/TagCustomerDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/TagCustomerEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/TagCustomerService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/TagCustomerServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/TagCustomerDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/TagCustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/TagCustomerDao.java new file mode 100644 index 0000000000..15d8f18cbf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/TagCustomerDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.TagCustomerEntity; +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-02 + */ +@Mapper +public interface TagCustomerDao extends BaseDao { + /** + * desc:获取需要初始化的客户标签 + * + * @param customerId + * @return + */ + List getTagDefaultList(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/TagCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/TagCustomerEntity.java new file mode 100644 index 0000000000..818e227cad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/TagCustomerEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.voice; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("tag_customer") +public class TagCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 使用计数 + */ + private Integer useCount; + +} 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 63751accec..241ca6ad2f 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 @@ -12,12 +12,13 @@ import com.epmet.dto.voice.ArticleViewedSummaryDTO; import com.epmet.entity.stats.*; import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; +import com.epmet.entity.voice.TagCustomerEntity; 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; +import com.epmet.service.voice.TagCustomerService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -56,7 +57,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticleVisitRecordService articleVisitRecordService; @Autowired - private ArticleOperateRecordService articleOperateRecordService; + private TagCustomerService tagCustomerService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Autowired @@ -528,54 +529,64 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //获取所有网格 List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); if (CollectionUtils.isEmpty(agencyDTOList)) { - log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + log.warn("statsTagUsedDaily getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + List gridDTOList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(gridDTOList)) { + log.warn("statsTagUsedDaily getGridListByCustomerId return empty,customerId:{}", customerId); + } + List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("statsTagUsedDaily getDepartmentListByCustomerId return empty,customerId:{}", customerId); + } //转换为 需要插入的Entity key gridId_tagId Map tagUsedGridDailyMap = new HashMap<>(); Map tagUsedDeptDailyMap = new HashMap<>(); Map tagUsedAgencyDailyMap = new HashMap<>(); Map tagUsedAgencyDailySelfMap = new HashMap<>(); + + //默认标签 + buildDefaultUsedTag(dimIdBean, customerId, agencyDTOList, gridDTOList, departmentDTOList, tagUsedGridDailyMap, tagUsedDeptDailyMap, tagUsedAgencyDailyMap, tagUsedAgencyDailySelfMap); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //获取当天的业务数据 //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( tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); - break; + if (!CollectionUtils.isEmpty(publishedArticleList)) { + //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)) { + //tagId + for (ArticleTagsEntity tagEntity : articleTagsList) { + ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); + if (articleEntity == null) { + log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + continue; + } + 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(tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); + break; + } + } } } + factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); //向上级机关递归添加 数据 @@ -598,6 +609,64 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } + private void buildDefaultUsedTag(DimIdGenerator.DimIdBean dimIdBean, String customerId, List agencyDTOList, List gridDTOList, List departmentDTOList, Map tagUsedGridDailyMap, Map tagUsedDeptDailyMap, Map tagUsedAgencyDailyMap, Map tagUsedAgencyDailySelfMap) { + List tagDefaultList = tagCustomerService.getTagDefaultList(customerId); + if (!CollectionUtils.isEmpty(tagDefaultList)) { + agencyDTOList.forEach(agency -> { + if (!CollectionUtils.isEmpty(gridDTOList)) { + gridDTOList.forEach(grid -> { + tagDefaultList.forEach(tag -> { + FactTagUsedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setGridId(grid.getId()); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setUsedCount(0); + tagUsedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + + }); + } + if (!CollectionUtils.isEmpty(departmentDTOList)) { + departmentDTOList.forEach(dept -> { + tagDefaultList.forEach(tag -> { + FactTagUsedDepartmentDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedDepartmentDailyEntity.class); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setDepartmentId(dept.getId()); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setUsedCount(0); + tagUsedDeptDailyMap.put(dept.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + }); + } + tagDefaultList.forEach(tag -> { + FactTagUsedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(agency.getPid()); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setUsedCount(0); + tagUsedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + tagDefaultList.forEach(tag -> { + FactTagUsedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(agency.getId()); + entity.setCustomerId(customerId); + String agencyId = agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + entity.setAgencyId(agencyId); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setUsedCount(0); + tagUsedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + }); + } + } + /** * desc:按日统计 标签被阅读的次数 * @@ -621,50 +690,52 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List dimGridList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(dimGridList)) { log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); - return; } - Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); - //转换为 需要插入的Entity - Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId Map tagViewedGridDailyMap = new HashMap<>(); Map tagViewedAgencyDailyMap = new HashMap<>(); Map tagViewedAgencyDailySelfMap = new HashMap<>(); + + //默认标签 + buildDefaultViewedTag(dimIdBean, customerId, agencyDTOList, dimGridList, tagViewedGridDailyMap, tagViewedAgencyDailyMap, tagViewedAgencyDailySelfMap); + Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //获取当天的业务数据 //1获取今天文章的阅读记录数 Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); - if (CollectionUtils.isEmpty(visitRecordList)) { - return; - } - - for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { - List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); - if (CollectionUtils.isEmpty(articleTagsList)) { - continue; - } - ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); - if (articleEntity == null) { - continue; - } - boolean isAgencyPublished = false; - if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { - isAgencyPublished = true; - } - String gridId = viewedSummaryDTO.getGridId(); - DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); + if (!CollectionUtils.isEmpty(visitRecordList)) { + for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { + List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsList)) { + continue; + } + ArticleEntity articleEntity = articleService.selectArticleById(viewedSummaryDTO.getArticleId()); + if (articleEntity == null) { + continue; + } + boolean isAgencyPublished = false; + if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { + isAgencyPublished = true; + } + String gridId = viewedSummaryDTO.getGridId(); + DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); - if (dimGridEntity == null) { - log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); - continue; - } - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); - for (ArticleTagsEntity articleTag : articleTagsList) { - convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); - convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); - if (isAgencyPublished) { - convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + if (dimGridEntity == null) { + log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); + continue; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); + for (ArticleTagsEntity articleTag : articleTagsList) { + convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + if (isAgencyPublished) { + convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + } } } } @@ -679,7 +750,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); if (dimAgencyEntity == null) { - log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); continue; } @@ -691,6 +761,50 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } + private void buildDefaultViewedTag(DimIdGenerator.DimIdBean dimIdBean, String customerId, List agencyDTOList, List dimGridList, Map tagViewedGridDailyMap, Map tagViewedAgencyDailyMap, Map tagViewedAgencyDailySelfMap) { + List tagDefaultList = tagCustomerService.getTagDefaultList(customerId); + if (!CollectionUtils.isEmpty(tagDefaultList)) { + agencyDTOList.forEach(agency -> { + if (!CollectionUtils.isEmpty(dimGridList)) { + dimGridList.forEach(grid -> { + tagDefaultList.forEach(tag -> { + FactTagViewedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setGridId(grid.getId()); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setTagReadCount(0); + tagViewedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + + }); + } + tagDefaultList.forEach(tag -> { + FactTagViewedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(agency.getPid()); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setTagReadCount(0); + tagViewedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + tagDefaultList.forEach(tag -> { + FactTagViewedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(agency.getId()); + entity.setCustomerId(customerId); + String agencyId = agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + entity.setAgencyId(agencyId); + entity.setTagId(tag.getId()); + entity.setTagName(tag.getTagName()); + entity.setTagReadCount(0); + tagViewedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); + }); + }); + } + } + /** * desc:按月统计 标签使用数 * @@ -972,25 +1086,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { /** * desc:将网格对象构建为 tagUsedGridDaily 对象 * - * @param dimGridEntities * @param dimIdBean * @return */ - private Map convertTagUsedGridDailyEntity(List dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) { - Map result = new HashMap<>(); - dimGridEntities.forEach(dimGridEntity -> { - FactTagUsedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); - entity.setCustomerId(dimGridEntity.getCustomerId()); - entity.setAgencyId(dimGridEntity.getAgencyId()); - entity.setGridId(dimGridEntity.getId()); - entity.setTagId(""); - entity.setTagName(""); - entity.setUsedCount(0); - result.put(dimGridEntity.getId(), entity); - }); - return result; - } - private void convertTagUsedGridDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { String gridId = articleEntity.getPublisherId(); String tagId = tagEntity.getTagId(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/TagCustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/TagCustomerService.java new file mode 100644 index 0000000000..609d68cf5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/TagCustomerService.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.TagCustomerEntity; + +import java.util.List; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +public interface TagCustomerService extends BaseService { + + List getTagDefaultList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/TagCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/TagCustomerServiceImpl.java new file mode 100644 index 0000000000..36e872429e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/TagCustomerServiceImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.TagCustomerDao; +import com.epmet.entity.voice.TagCustomerEntity; +import com.epmet.service.voice.TagCustomerService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 客户标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-02 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class TagCustomerServiceImpl extends BaseServiceImpl implements TagCustomerService { + + @Override + public List getTagDefaultList(String customerId) { + return baseDao.getTagDefaultList(customerId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/TagCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/TagCustomerDao.xml new file mode 100644 index 0000000000..73defbbf6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/TagCustomerDao.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file From 1e69e99a980e61de2399a17ae297feb695ad4c10 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 11:06:05 +0800 Subject: [PATCH 117/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index e8523d3c75..c345cf1545 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.15 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.16 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index ab312b94a7..37170ee2bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.15 + 0.3.16 data-statistical com.epmet From 1fd84b479a156d1efa66b3a8f85fd8c8ddf83951 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 13:28:28 +0800 Subject: [PATCH 118/137] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatsPublicityServiceImpl.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) 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 241ca6ad2f..b3ff76bf3c 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 @@ -592,19 +592,21 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //向上级机关递归添加 数据 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()); + List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > 0).collect(Collectors.toList()); + log.debug("===tagUsedAgencyDailyMap:"+JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + for (FactTagUsedAgencyDailyEntity entry : agencyDailyEntities) { + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { - log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", entry.getAgencyId()); continue; } - setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, entry, dimIdBean); } + log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) { finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); } + log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } @@ -745,15 +747,14 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //向上级机关递归添加 数据 Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); - for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); - FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); - DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > 0).collect(Collectors.toList()); + for (FactTagViewedAgencyDailyEntity entry : tagViewedList) { + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { - log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", entry.getAgencyId()); continue; } - setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, entry, dimIdBean); } if (!CollectionUtils.isEmpty(tagViewedAgencyDailySelfMap)) { finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap); From 0554622b117a20b798a38fab4bd435a064776b94 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 13:30:51 +0800 Subject: [PATCH 119/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index c345cf1545..9f1d924fdd 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.16 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.17 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 37170ee2bf..dce137fd50 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.16 + 0.3.17 data-statistical com.epmet From b20b221257c32e76e783ddec94e3cface369c146 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 13:41:18 +0800 Subject: [PATCH 120/137] =?UTF-8?q?=E5=B8=B8=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/group/impl/GroupDataServiceImpl.java | 6 +++--- .../java/com/epmet/service/impl/StatsGroupServiceImpl.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) 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 ace321cba1..2b37f81ed6 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 @@ -97,9 +97,9 @@ public class GroupDataServiceImpl implements GroupDataService { List value = everyGroup.getValue(); String key = everyGroup.getKey(); List groupPeopleSorted = value.stream().sorted(Comparator.comparing(GridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); - Integer groupPeopleMedian = groupPeopleSorted.size() % 2 == 0 ? - (groupPeopleSorted.get(groupPeopleSorted.size() / 2 - 1).getGroupCount() + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount()) / 2 : - groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount(); + Integer groupPeopleMedian = groupPeopleSorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (groupPeopleSorted.get(groupPeopleSorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + groupPeopleSorted.get(groupPeopleSorted.size() / NumConstant.TWO).getGroupCount()) / NumConstant.TWO : + groupPeopleSorted.get(groupPeopleSorted.size() / NumConstant.TWO).getGroupCount(); result.forEach(grid -> { if (key.equals(grid.getGridId())){ grid.setGroupMedian(groupPeopleMedian);//中位数 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 77bbcd42ba..b9735e489c 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 @@ -14,6 +14,7 @@ import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; +import oracle.sql.NUMBER; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -155,7 +156,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { if (allGrid.size() != NumConstant.ZERO) { // 1. 机关下有多少网格 List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); - AtomicReference gridSize = new AtomicReference<>(0); + AtomicReference gridSize = new AtomicReference<>(NumConstant.ZERO); if (customerGridIdList.size() != NumConstant.ZERO) { customerGridIdList.forEach(gridId -> { allGrid.forEach(allAgencyGrid -> { From 9a448e8c8e4905bfda0f3e44f337b2e6f14a5d62 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 13:55:27 +0800 Subject: [PATCH 121/137] =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsPublicityServiceImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 b3ff76bf3c..c3827206b3 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 @@ -177,9 +177,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -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; @@ -234,9 +234,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -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; @@ -262,9 +262,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -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; @@ -297,9 +297,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -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; From abf46cb90c47f78a8b0d41cb678ea35cef2eab54 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 14:00:10 +0800 Subject: [PATCH 122/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1=20data-re?= =?UTF-8?q?port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 521aed9fa4..f9b9b888ce 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.12 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.13 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index accbc201dc..eec2aa0189 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.12 + 0.3.13 data-report-server From 6258e11eeb82ffc1c42386ebdd90ace07ea28b66 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 30 Jun 2020 14:41:11 +0800 Subject: [PATCH 123/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E5=85=AC=E5=BC=80=E7=AD=94=E5=A4=8D=E5=86=85=E5=AE=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 2 +- .../gov-issue/gov-issue-server/pom.xml | 2 + .../epmet/service/impl/IssueServiceImpl.java | 38 +++++++++++++++++++ .../src/main/resources/bootstrap.yml | 8 ++++ .../gov-project/gov-project-server/pom.xml | 2 + .../impl/ProjectProcessServiceImpl.java | 24 ++++++++++++ .../service/impl/ProjectServiceImpl.java | 38 ++++++++++++++++++- .../src/main/resources/bootstrap.yml | 8 ++++ 8 files changed, 120 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e12787cc3b..1ce9defc9f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -60,7 +60,7 @@ public enum EpmetErrorCode { ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), - + TEXT_SCAN_FAILED(8503,"内容审核失败,请重新编辑"), PROJECT_IS_CLOSED(8601,"项目已结案"), // 该错误不会提示给前端,只是后端传输错误信息用。 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index c0d4f4e42d..b6d1528406 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -147,6 +147,7 @@ false + https://epmet-dev.elinkservice.cn/epmetscan/api @@ -179,6 +180,7 @@ true + https://epmet-dev.elinkservice.cn/epmetscan/api diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 2730d87941..83fff55e27 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -7,10 +7,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.IssueConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; @@ -42,6 +47,7 @@ import com.epmet.utils.ModuleConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -86,6 +92,10 @@ public class IssueServiceImpl extends BaseServiceImpl imp private IssueVoteStatisticalDao issueVoteStatisticalDao; @Autowired private EpmetUserFeignClient epmetUserFeignClient; + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; @Override public PageData page(Map params) { @@ -351,6 +361,20 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void closeIssue(CloseIssueFormDTO formDTO) { + //公开回复内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(formDTO.getCloseReason()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + Date date = new Date(); //1:更新议题详情表数据 IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); @@ -479,6 +503,20 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void shiftProject(ShiftProjectFormDTO formDTO) { + //公开回复内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(formDTO.getPublicReply()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + //因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据 //1:查询议题数据 IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index c842bf462c..93f2568a4b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -103,6 +103,14 @@ ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan + #pageHelper分页插件 pagehelper: helper-dialect: mysql diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 3b5472c3e1..5dfd16abb4 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -147,6 +147,7 @@ false + https://epmet-dev.elinkservice.cn/epmetscan/api @@ -179,6 +180,7 @@ true + https://epmet-dev.elinkservice.cn/epmetscan/api diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 436610ef21..c856ef957b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -23,10 +23,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; @@ -46,6 +51,7 @@ import com.epmet.service.ProjectService; import com.epmet.service.ProjectStaffService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -77,6 +83,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -176,6 +186,20 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + //1:更新项目人员关联表数据状态为已处理 ProjectStaffEntity staffEntity = projectStaffDao.selectById(formDTO.getProjectStaffId()); if (null == staffEntity) { diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 4ec3eacda5..9f19a0ecf2 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -27,8 +27,12 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ParameterKeyConstant; import com.epmet.constant.ProjectConstant; import com.epmet.constant.UserMessageConstant; @@ -48,6 +52,7 @@ import com.epmet.redis.ProjectRedis; import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -82,6 +87,10 @@ public class ProjectServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + //更新项目表状态 ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { @@ -298,7 +321,6 @@ public class ProjectServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index d6aeb50289..ddd3113ac5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -103,6 +103,14 @@ ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan + #pageHelper分页插件 pagehelper: helper-dialect: mysql From e3442af9ec7134018a81ca377203a294afe7b2e4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 30 Jun 2020 14:47:59 +0800 Subject: [PATCH 124/137] =?UTF-8?q?=E6=B7=BB=E5=8A=A08504=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 1ce9defc9f..45fdce2511 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -61,6 +61,7 @@ public enum EpmetErrorCode { ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), TEXT_SCAN_FAILED(8503,"内容审核失败,请重新编辑"), + IMG_SCAN_FAILED(8504,"图片审核失败,请重新上传"), PROJECT_IS_CLOSED(8601,"项目已结案"), // 该错误不会提示给前端,只是后端传输错误信息用。 From 6592c4fc67fd544c4b4dd0a189edc6d20e8c51e4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 30 Jun 2020 14:54:03 +0800 Subject: [PATCH 125/137] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E5=85=AC=E5=BC=80=E7=AD=94=E5=A4=8D=E5=86=85=E5=AE=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-issue/gov-issue-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-issue/gov-issue-server/pom.xml | 2 +- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index 6dcdb4ec76..f281a49dfa 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.45 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.46 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index b6d1528406..b382bd5318 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.45 + 0.3.46 gov-issue com.epmet diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 78ebd86001..6cb3f90b79 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.30 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.31 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 5dfd16abb4..50d32abd7a 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.30 + 0.3.31 gov-project com.epmet From 77c8f23f0e88c8294cf2bf959fb4e047daf2a0c9 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 30 Jun 2020 14:55:16 +0800 Subject: [PATCH 126/137] =?UTF-8?q?=E6=96=B0=E5=AE=A2=E6=88=B7=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84currentDateId?= =?UTF-8?q?=E4=B8=BA=E6=98=A8=E5=A4=A9=EF=BC=8C=E6=A0=BC=E5=BC=8Fyyyy.mm.d?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/user/impl/UserAnalysisServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 6db2f80497..8c3f008f55 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 @@ -28,6 +28,8 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -91,7 +93,13 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); } if (userSummaryInfoResultDTO == null){ - return new UserSummaryInfoResultDTO(); + userSummaryInfoResultDTO = new UserSummaryInfoResultDTO(); + + LocalDate yesterday = LocalDate.now().plusDays(NumConstant.MINUS_ONE_L); + DateTimeFormatter format = DateTimeFormatter.ofPattern(DateUtils.DATE_PATTERN_YYYYMMDD); + userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(yesterday.format(format),".")); + + return userSummaryInfoResultDTO; } userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 From edf6ac635d8a136c8b7271095d4067a95cf2191c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 30 Jun 2020 16:01:28 +0800 Subject: [PATCH 127/137] =?UTF-8?q?=E5=BE=85=E5=AE=A1=E6=A0=B8=E5=85=9A?= =?UTF-8?q?=E5=91=98=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PartyMemberConfirmServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 61d8f0a5f4..e047396cfd 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 @@ -1,5 +1,6 @@ package com.epmet.modules.partymember.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -354,9 +355,14 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //获取人工审核信息 PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId()); - //人工审核信息设为已读 - manualEntity.setReadFlag(PartyMemberConstant.READ); - partymemberConfirmManualService.updateById(manualEntity); + if(null!=manualEntity){ + //人工审核信息设为已读 + manualEntity.setReadFlag(PartyMemberConstant.READ); + partymemberConfirmManualService.updateById(manualEntity); + }else{ + logger.error(String.format("入参%s,查询partymember_confirm_manual为空", JSON.toJSONString(fromDTO))); + throw new RenException("数据异常,根据manualId查询partymember_confirm_manual为空"); + } //获取党员认证信息 PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId()); From a530514fa090f9a952deb566a506513fe3273f86 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 16:13:17 +0800 Subject: [PATCH 128/137] =?UTF-8?q?=E5=90=84=E7=A7=8D=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueSatisfactionDetailServiceImpl.java | 26 +++++++ .../ProjectSatisfactionDetailServiceImpl.java | 25 +++++- .../resi/group/constant/TopicConstant.java | 6 ++ .../resi-group/resi-group-server/pom.xml | 2 + .../impl/ResiTopicCommentServiceImpl.java | 29 +++++++ .../service/impl/ResiTopicServiceImpl.java | 76 ++++++++++++++++++- .../src/main/resources/bootstrap.yml | 10 ++- 7 files changed, 171 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java index 1ca0d1dba0..42a3b7e249 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java @@ -24,8 +24,13 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.IssueConstant; import com.epmet.dao.IssueSatisfactionDetailDao; import com.epmet.dto.EvaluateInfoDTO; @@ -41,12 +46,14 @@ import com.epmet.service.IssueSatisfactionDetailService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.UUID; /** * 议题满意度调查记录表 @@ -59,6 +66,10 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -142,6 +153,21 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } IssueSatisfactionDetailEntity entity = new IssueSatisfactionDetailEntity(); BeanUtils.copyProperties(formDTO,entity); InitEvaluationFormDTO initEvaluation = new InitEvaluationFormDTO(); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java index e831d30530..d693ca5def 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java @@ -24,10 +24,13 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; import com.epmet.dao.ProjectSatisfactionDetailDao; import com.epmet.dto.ProjectSatisfactionDetailDTO; @@ -40,6 +43,7 @@ import com.epmet.service.ProjectSatisfactionDetailService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -59,6 +63,10 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -178,6 +186,21 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } ProjectSatisfactionDetailEntity entity = new ProjectSatisfactionDetailEntity(); BeanUtils.copyProperties(formDTO,entity); //校验是否评价 diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java index 9d9971ccf3..8a96cc23b4 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java @@ -72,4 +72,10 @@ public interface TopicConstant { * 构造queryWrapper 用户Id * */ String CUSTOMER_USER_ID = "CUSTOMER_USER_ID"; + + String REVIEW_TOPIC = "评论话题失败,评论内容为:%s"; + + String CREATE_TOPIC = "创建话题失败,话题内容为:%s"; + + String SHIFT_ISSUE = "转议题失败,标题为:%s , 建议为:%s"; } diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 60ef52d595..e9d7722410 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -150,6 +150,7 @@ false + https://epmet-dev.elinkservice.cn/epmetscan/api @@ -181,6 +182,7 @@ false true + https://epmet-dev.elinkservice.cn/epmetscan/api diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index 8751f579c2..0f0108348f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -21,14 +21,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; @@ -52,10 +57,12 @@ import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -69,6 +76,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2020-03-31 */ @Service +@Slf4j public class ResiTopicCommentServiceImpl extends BaseServiceImpl implements ResiTopicCommentService { @Autowired @@ -86,6 +94,11 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.REVIEW_TOPIC,commentContent)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } //1.判断当前用户是否被禁言 ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId()); if(null == topic){ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 4e3c3578b2..da1b435b8a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -24,12 +24,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CommonDataFilterResultDTO; @@ -72,14 +79,15 @@ import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.result.*; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -91,6 +99,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2020-03-31 */ @Service +@Slf4j public class ResiTopicServiceImpl extends BaseServiceImpl implements ResiTopicService { @Autowired @@ -132,6 +141,13 @@ public class ResiTopicServiceImpl extends BaseServiceImpl attachmentList = resiTopicPublishFormDTO.getAttachmentList(); + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(topicContent); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.CREATE_TOPIC,topicContent)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + //创建话题图片审核 + if (attachmentList.size() != NumConstant.ZERO){ + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + attachmentList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + } + } if (null == tokenDto) { logger.error(ModuleConstant.USER_NOT_NULL); throw new RenException(ModuleConstant.USER_NOT_NULL); @@ -1045,6 +1096,29 @@ public class ResiTopicServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + log.error(String.format(TopicConstant.SHIFT_ISSUE,issueTitle,suggestion)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } //1.统一时间(群组服务 -> 议题服务) Date now = new Date(); //2.调用gov-org获取数据权限 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 98f0d3e7bd..dd17343ed3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -117,4 +117,12 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan \ No newline at end of file From 9d438621825387fcda2448508dee0591809e58d0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 30 Jun 2020 16:21:59 +0800 Subject: [PATCH 129/137] =?UTF-8?q?resipartymember=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi-partymember-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-partymember/resi-partymember-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 b59f1fb9b1..6bd93a33df 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.53 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.54 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 383b4a14fe..d4d9fa21a1 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.53 + 0.3.54 com.epmet resi-partymember From 990d5319db990df8fb27ea1f421de91d27cbc370 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 16:23:50 +0800 Subject: [PATCH 130/137] =?UTF-8?q?=E5=90=84=E7=A7=8D=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/constant/IssueConstant.java | 2 ++ .../epmet/service/impl/IssueSatisfactionDetailServiceImpl.java | 3 +++ .../src/main/java/com/epmet/constant/ProjectConstant.java | 2 ++ .../service/impl/ProjectSatisfactionDetailServiceImpl.java | 3 +++ 4 files changed, 10 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java index 7fd12ac37d..1f8ae5abb9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java @@ -91,4 +91,6 @@ public interface IssueConstant { * 北京时区(北京时间) */ String BEIJING_TIME_ZONE = "+8"; + + String REVIEW_ISSUE = "议题评论失败,评论内容为:%s"; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java index 42a3b7e249..3d8405232b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.dto.result.InitEvaluationResultDTO; import com.epmet.entity.IssueSatisfactionDetailEntity; import com.epmet.redis.IssueSatisfactionDetailRedis; import com.epmet.service.IssueSatisfactionDetailService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -62,6 +63,7 @@ import java.util.UUID; * @since v1.0.0 2020-05-11 */ @Service +@Slf4j public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl implements IssueSatisfactionDetailService { @Autowired @@ -165,6 +167,7 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl implements ProjectSatisfactionDetailService { @Autowired @@ -198,6 +200,7 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl Date: Tue, 30 Jun 2020 16:37:05 +0800 Subject: [PATCH 131/137] =?UTF-8?q?issue=E3=80=81project=E3=80=81group?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-issue/gov-issue-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-issue/gov-issue-server/pom.xml | 2 +- .../gov-project-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/gov-project/gov-project-server/pom.xml | 2 +- .../resi-group/resi-group-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-group/resi-group-server/pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index f281a49dfa..33d4dd713c 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.46 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.47 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index b382bd5318..0accecf9f6 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.46 + 0.3.47 gov-issue com.epmet diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 6cb3f90b79..5c07879fe6 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.31 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.32 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 50d32abd7a..61e29c166c 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.31 + 0.3.32 gov-project com.epmet diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 34276d79e5..c1a06c861e 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.53 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.54 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index e9d7722410..ea2c9bbbd5 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.53 + 0.3.54 com.epmet resi-group From 747d3878d55d6db9b2b7c282a6d2a90e295e9536 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 16:38:26 +0800 Subject: [PATCH 132/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1=20data-re?= =?UTF-8?q?port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-report/data-report-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index f9b9b888ce..59f372c5d1 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.13 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.14 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index eec2aa0189..2b27fda73a 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-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"> - 0.3.13 + 0.3.14 data-report-server From 159d78c2cef06d8bc56fa1c6003494f3bdc05268 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 17:29:34 +0800 Subject: [PATCH 133/137] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/voice/ArticlePublishRangeDao.java | 56 ------- .../voice/ArticlePublishRangeEntity.java | 85 ----------- .../impl/StatsPublicityServiceImpl.java | 142 ++++++++---------- .../voice/ArticlePublishRangeService.java | 59 -------- .../impl/ArticlePublishRangeServiceImpl.java | 67 --------- .../mapper/voice/ArticlePublishRangeDao.xml | 57 ------- 6 files changed, 60 insertions(+), 406 deletions(-) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java deleted file mode 100644 index f8ff0e359b..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java +++ /dev/null @@ -1,56 +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.voice; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Mapper -public interface ArticlePublishRangeDao extends BaseDao { - - /** - * desc:查询网格发布文章总数及状态为发布中的文章总数 - * - * @param customerId - * @param createDate - * @return - */ - List getAllPublishedCount(@Param("customerId") String customerId, @Param("createDate") Date createDate); - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - */ - List getOneDayPublishedCount(@Param("customerId") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java deleted file mode 100644 index 1aac103337..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java +++ /dev/null @@ -1,85 +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.voice; - -import com.baomidou.mybatisplus.annotation.TableName; -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("article_publish_range") -public class ArticlePublishRangeEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID - */ - private String customerId; - - /** - * 文章ID - */ - private String articleId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 组织-网格名称 - */ - private String agencyGridName; - - /** - * 组织ID - */ - private String agencyId; - - /** - * 所有上级组织机构ID 以英文:隔开 - */ - private String pids; - - /** - * 所有上级名称 以横杠隔开 - */ - private String allParentName; - - /** - * 下线时间 - */ - private Date offLineTime; - - /** - * 发布状态 已发布:published;已下线:offline - */ - private String publishStatus; - -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index c3827206b3..31b48152f3 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 @@ -29,7 +29,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; /** @@ -104,21 +103,19 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactTagViewedGridYearlyService factTagViewedGridYearlyService; @Autowired private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; - @Autowired - private ExecutorService executorService; @Override public Boolean articleSummaryDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //查询的是昨天及以前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; String statsDateStr = DateUtils.format(statsDate); do { @@ -147,13 +144,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -177,13 +174,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -192,7 +189,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); } catch (Exception e) { - log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "按月统计标签被使用次数", customerId, dimIdBean.getMonthId()), e); + log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); } } } @@ -206,13 +203,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -234,13 +231,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -262,13 +259,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -297,13 +294,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -NumConstant.ONE), DateUtils.DATE_PATTERN); } else { statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); - int pageNo = 1; - int pageSize = 100; + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); @@ -318,8 +315,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { try { log.debug("start === statsTagViewedYearly "); statsTagViewedYearly(dimIdBean.getYearId(), customerId); - - } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsTagViewedQuarterly", customerId, dimIdBean.getYearId()), e); } @@ -357,7 +352,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { buildAgencySummaryData(agencySummaryMap, summaryDTO); } } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); } catch (Exception e) { log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedDepartmentDaily", customerId, statsDate), e); } @@ -430,8 +425,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedGridDaily", customerId, statsDate), e); } - - } private void statsPublishedAgencyDaily(String statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { @@ -460,9 +453,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); gridDailyEntities.setPublishedCount(summaryDTO.getPublishedCount()); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); - //构建机关自己的数据 FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); selfDaily.setCustomerId(gridDailyEntities.getCustomerId()); @@ -506,9 +497,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); } log.debug("statsPublishedAgencyDaily insert:{}", JSON.toJSONString(agencyDailyEntityMap.values())); - boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } catch (Exception e) { - e.printStackTrace(); log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "statsPublishedAgencyDaily", customerId, statsDate), e); } } @@ -558,7 +548,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //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); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN); //2 获取文章标签 List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); if (!CollectionUtils.isEmpty(articleTagsList)) { @@ -586,14 +576,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } - factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); //向上级机关递归添加 数据 Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); - List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > 0).collect(Collectors.toList()); - log.debug("===tagUsedAgencyDailyMap:"+JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + List agencyDailyEntities = tagUsedAgencyDailyMap.values().stream().filter(uesedTag -> uesedTag.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()); + log.debug("===tagUsedAgencyDailyMap:" + JSON.toJSONString(tagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); for (FactTagUsedAgencyDailyEntity entry : agencyDailyEntities) { DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { @@ -602,11 +591,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, entry, dimIdBean); } - log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); if (!CollectionUtils.isEmpty(tagUsedAgencyDailySelfMap)) { finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailySelfMap); } - log.debug("===finalTagUsedAgencyDailyMap:"+JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o->o.getUsedCount()>0).collect(Collectors.toList()))); + log.debug("===finalTagUsedAgencyDailyMap:" + JSON.toJSONString(finalTagUsedAgencyDailyMap.values().stream().filter(o -> o.getUsedCount() > NumConstant.ZERO).collect(Collectors.toList()))); factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } @@ -624,7 +613,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(grid.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); @@ -639,7 +628,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setDepartmentId(dept.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedDeptDailyMap.put(dept.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -651,7 +640,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agency.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); tagDefaultList.forEach(tag -> { @@ -662,7 +651,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setUsedCount(0); + entity.setUsedCount(NumConstant.ZERO); tagUsedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -708,7 +697,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //获取当天的业务数据 //1获取今天文章的阅读记录数 Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); - Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, NumConstant.ONE), DateUtils.DATE_PATTERN); List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); if (!CollectionUtils.isEmpty(visitRecordList)) { for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { @@ -747,7 +736,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //向上级机关递归添加 数据 Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); - List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > 0).collect(Collectors.toList()); + List tagViewedList = tagViewedAgencyDailyMap.values().stream().filter(tagViewed -> tagViewed.getTagReadCount() > NumConstant.ZERO).collect(Collectors.toList()); for (FactTagViewedAgencyDailyEntity entry : tagViewedList) { DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(entry.getAgencyId()); if (dimAgencyEntity == null) { @@ -775,10 +764,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(grid.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedGridDailyMap.put(grid.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); - }); } tagDefaultList.forEach(tag -> { @@ -788,7 +776,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agency.getId()); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedAgencyDailyMap.put(agency.getId().concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); tagDefaultList.forEach(tag -> { @@ -799,7 +787,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tag.getId()); entity.setTagName(tag.getTagName()); - entity.setTagReadCount(0); + entity.setTagReadCount(NumConstant.ZERO); tagViewedAgencyDailySelfMap.put(agencyId.concat(StrConstant.UNDER_LINE).concat(tag.getId()), entity); }); }); @@ -837,7 +825,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedMonthly(String monthId, String customerId) { - List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(gridDailyList)) { List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); @@ -849,7 +836,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); } - } /** @@ -859,7 +845,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); @@ -875,7 +860,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } - } /** @@ -885,19 +869,16 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedQuarterly(String quarterId, String customerId) { - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); } - List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } - } /** @@ -907,7 +888,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagUsedYearly(String yearId, String customerId) { - List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); @@ -923,7 +903,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } - } /** @@ -933,8 +912,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param customerId */ private void statsTagViewedYearly(String yearId, String customerId) { - - List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); @@ -945,7 +922,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } - } private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { @@ -982,6 +958,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); if (currentDimAgency == null) { + log.error("setTagViewedData2ParentAgency pid:{} not exist in dimAgency", pid); return; } if (parentAgencyDailyEntity == null) { @@ -1006,6 +983,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); if (parentAgency == null) { + log.error("setPublishedData2ParentAgency pid:{} not exist in dimAgency", pid); return; } parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); @@ -1031,9 +1009,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setAgencyId(dimGridEntity.getAgencyId()); entity.setGridId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1053,9 +1031,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setAgencyId(dimGridEntity.getAgencyId()); entity.setDepartmentId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1075,9 +1053,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setCustomerId(dimGridEntity.getCustomerId()); entity.setPid(dimGridEntity.getPid()); entity.setAgencyId(dimGridEntity.getId()); - entity.setArticleTotalCount(0); - entity.setArticlePublishedCount(0); - entity.setPublishedCount(0); + entity.setArticleTotalCount(NumConstant.ZERO); + entity.setArticlePublishedCount(NumConstant.ZERO); + entity.setPublishedCount(NumConstant.ZERO); result.put(dimGridEntity.getId(), entity); }); return result; @@ -1102,10 +1080,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setGridId(gridId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1121,10 +1099,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setDepartmentId(publisherId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1140,10 +1118,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1159,10 +1137,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); - entity.setUsedCount(1); + entity.setUsedCount(NumConstant.ONE); result.put(key, entity); } else { - entity.setUsedCount(entity.getUsedCount() + 1); + entity.setUsedCount(entity.getUsedCount() + NumConstant.ONE); } } @@ -1171,7 +1149,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String gridId = viewedSummaryDTO.getGridId(); String tagId = tagEntity.getTagId(); String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedGridDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); @@ -1192,7 +1170,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String agencyId = dimAgencyEntity.getId(); String tagId = tagEntity.getTagId(); String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); @@ -1213,7 +1191,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { String agencyId = dimAgencyEntity.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); String tagId = tagEntity.getTagId(); String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); - Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? NumConstant.ZERO : viewedSummaryDTO.getViewedCount(); FactTagViewedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java deleted file mode 100644 index 125e46e962..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java +++ /dev/null @@ -1,59 +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.service.voice; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -public interface ArticlePublishRangeService extends BaseService { - - /** - * desc: 根据客户Id 、创建日期查询 有史以来所有的发布文章总数 - * - * @param customerId - * @param createDate - * @return: List - * @date: 2020/6/17 16:59 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - List getAllPublishedCount(String customerId, Date createDate); - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - * @date: 2020/6/17 21:43 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - List getOneDayPublishedCount(String customerId, Date startDate, Date endDate); -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java deleted file mode 100644 index 8fc2f430cd..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java +++ /dev/null @@ -1,67 +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.service.voice.impl; - -import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.voice.ArticlePublishRangeDao; -import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.voice.ArticlePublishRangeEntity; -import com.epmet.service.voice.ArticlePublishRangeService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * 文章发布范围表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-17 - */ -@Slf4j -@Service -@DataSource(DataSourceConstant.GOV_VOICE) -public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { - - - @Override - public List getAllPublishedCount(String customerId, Date createDate) { - log.debug("getAllPublishedCount param customerId:{},createDate:{}", customerId, createDate); - return baseDao.getAllPublishedCount(customerId, createDate); - } - - /** - * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 - * - * @param customerId - * @param startDate - * @param endDate - * @return: List - * @date: 2020/6/17 21:43 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - @Override - public List getOneDayPublishedCount(String customerId, Date startDate, Date endDate) { - log.debug("getOneDayPublishedCount param startDate:{},endDate:{}", startDate, endDate); - return baseDao.getOneDayPublishedCount(customerId, startDate, endDate); - } -} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml deleted file mode 100644 index 154d617001..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From f2900848131dff4165487b364e491a4dcff7ae2e Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 17:40:37 +0800 Subject: [PATCH 134/137] =?UTF-8?q?=E5=90=84=E7=A7=8D=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IssueController.java | 8 ++++---- .../src/main/java/com/epmet/service/IssueService.java | 5 +++-- .../java/com/epmet/service/impl/IssueServiceImpl.java | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java index d86a754f6c..a20d0e61bc 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java @@ -131,8 +131,8 @@ public class IssueController { // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result evaluate(@LoginUser TokenDto tokenDto,@RequestBody EvaluateFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); - issueService.evaluate(tokenDto,formDTO); - return new Result(); + return issueService.evaluate(tokenDto,formDTO); + } /** @@ -144,8 +144,8 @@ public class IssueController { // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result projectEvaluate(@LoginUser TokenDto tokenDto,@RequestBody ProjectEvaluateFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); - issueService.projectEvaluate(tokenDto,formDTO); - return new Result(); + return issueService.projectEvaluate(tokenDto,formDTO); + } /** diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java index 36dbe70b15..d71c3e4b03 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import org.springframework.web.bind.annotation.RequestBody; @@ -72,14 +73,14 @@ public interface IssueService { * @param evaluateFormDTO * @author zxc */ - void evaluate(TokenDto tokenDto,EvaluateFormDTO evaluateFormDTO); + Result evaluate(TokenDto tokenDto,EvaluateFormDTO evaluateFormDTO); /** * @Description 提交满意度评价——已转项目 * @param projectEvaluateFormDTO * @author zxc */ - void projectEvaluate(TokenDto tokenDto, ProjectEvaluateFormDTO projectEvaluateFormDTO); + Result projectEvaluate(TokenDto tokenDto, ProjectEvaluateFormDTO projectEvaluateFormDTO); /** * @Description 满意度评价列表——已关闭 diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 854eb51aea..0551eb8423 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -201,9 +201,9 @@ public class IssueServiceImpl implements IssueService { * @author zxc */ @Override - public void evaluate(TokenDto tokenDto, EvaluateFormDTO evaluateFormDTO) { + public Result evaluate(TokenDto tokenDto, EvaluateFormDTO evaluateFormDTO) { evaluateFormDTO.setUserId(tokenDto.getUserId()); - govIssueFeignClient.evaluate(evaluateFormDTO); + return govIssueFeignClient.evaluate(evaluateFormDTO); } /** @@ -212,9 +212,9 @@ public class IssueServiceImpl implements IssueService { * @author zxc */ @Override - public void projectEvaluate(TokenDto tokenDto, ProjectEvaluateFormDTO projectEvaluateFormDTO) { + public Result projectEvaluate(TokenDto tokenDto, ProjectEvaluateFormDTO projectEvaluateFormDTO) { projectEvaluateFormDTO.setUserId(tokenDto.getUserId()); - govProjectFeignClient.projectEvaluate(projectEvaluateFormDTO); + return govProjectFeignClient.projectEvaluate(projectEvaluateFormDTO); } /** From dfa65e84afcc263a769c731216f2bc29102d7510 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 30 Jun 2020 17:43:24 +0800 Subject: [PATCH 135/137] =?UTF-8?q?resi-hall=E6=9C=8D=E5=8A=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi-hall/resi-hall-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/resi-hall/resi-hall-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml index cffa5d8eaf..22a0bfc441 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-hall-server: container_name: resi-hall-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-hall-server:0.3.20 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-hall-server:0.3.21 ports: - "8100:8100" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index b83cc8aad1..beb8ba5879 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-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.20 + 0.3.21 resi-hall com.epmet From 9ac57759a2ecc20e1b0aa4ae421a70314267d822 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 17:45:07 +0800 Subject: [PATCH 136/137] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/data-statistical/data-statistical-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 9f1d924fdd..934f89d9e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.17 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.18 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index dce137fd50..9c48019641 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.17 + 0.3.18 data-statistical com.epmet From 60220837e909b029790e3394bde9a76071e332c7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Jun 2020 17:52:16 +0800 Subject: [PATCH 137/137] =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=95=B0=E6=8D=AE=20?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-server/deploy/docker-compose-test.yml | 2 +- .../data-statistical-server/deploy/docker-compose-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml index 3c34b09319..4b2e0645ab 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.14 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml index bbe6d5f891..5762e78185 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.1 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.18 ports: - "8108:8108" network_mode: host # 使用现有网络