diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java index a762a6848d..d1a35124af 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/PhoneValidatorUtils.java @@ -10,7 +10,7 @@ import java.util.regex.Pattern; * @Date 2020/4/18 15:04 */ public class PhoneValidatorUtils { - private static final String REGEX_MOBILE ="((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))"; + private static final String REGEX_MOBILE ="((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19([0-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))"; /** * 判断是否是手机号 @@ -23,5 +23,9 @@ public class PhoneValidatorUtils { } return Pattern.matches(REGEX_MOBILE, tel); } + + public static void main(String[] args) { + System.out.println(isMobile("19353198889")); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java index 812935ef6e..d26edb4af4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java @@ -37,8 +37,9 @@ public interface FactPartyMemberVanguardAgencyDailyDao extends BaseDao NumConstant.ZERO); + + //批量插入 每次100 + if (CollectionUtils.isEmpty(vanguardList)) { + log.warn("customerAgencyStats insert list is empty,customerId:{},dateId:{}", customerId, dimId.getDateId()); + } + + ListUtils.partition(vanguardList, NumConstant.ONE_HUNDRED) + .forEach(part -> factPartyMemberVanguardAgencyDailyService.insertBatch(part)); + } } /** @@ -327,10 +337,19 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang } }); } - //删除旧数据 - factPartyMemberVanguardGridDailyService.deleteDailyData(customerId, dimId.getDateId()); - //批量插入 - factPartyMemberVanguardGridDailyService.insertBatch(vanguardList); + + //删除旧数据 每次删除1000 + Integer effectRow; + do { + effectRow = factPartyMemberVanguardGridDailyService.deleteDailyData(customerId, dimId.getDateId(), NumConstant.ONE_THOUSAND); + } while (effectRow != null && effectRow > NumConstant.ZERO); + + //批量插入 每次100 + if (CollectionUtils.isEmpty(vanguardList)){ + log.warn("customerGridStats insert list is empty,customerId:{},dateId:{}", customerId, dimId.getDateId()); + } + ListUtils.partition(vanguardList, NumConstant.ONE_HUNDRED) + .forEach(part -> factPartyMemberVanguardGridDailyService.insertBatch(part)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java index 385b615549..1ff31be7cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java @@ -99,7 +99,8 @@ public interface FactPartyMemberVanguardAgencyDailyService extends BaseService delete from fact_party_member_vanguard_agency_daily where customer_id = #{customerId} and DATE_ID = #{dateId} + limit #{limit} - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml index 311262a04f..95a527b323 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml @@ -34,7 +34,8 @@ delete from fact_party_member_vanguard_grid_daily where customer_id = #{customerId} and DATE_ID = #{dateId} + limit #{limit} - \ No newline at end of file + diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index a4afdcc2ba..ac1f514cec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -241,7 +241,7 @@ --> 8111 - test + prod diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 73fe6adeb8..8c2e85a6a1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -212,8 +212,8 @@ public class ResiActListController { * @Date 13:39 2020-07-21 **/ @PostMapping("livereclist") - public Result liveRecList(@RequestBody Map map) { - return actLiveRecService.liveRecList(map); + public Result liveRecList(@LoginUser TokenDto tokenDto,@RequestBody Map map) { + return actLiveRecService.liveRecList(tokenDto,map); } /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java index 9ebe84e2ff..d7c960d4f1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -42,7 +42,7 @@ public interface ActLiveRecService extends BaseService { * @Author zhangyong * @Date 13:39 2020-07-21 **/ - Result liveRecList(Map map); + Result liveRecList(TokenDto tokenDto,Map map); /** * 活动-添加实况 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java index 15ff440c80..c745c98192 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -36,7 +36,6 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils; -import com.epmet.constant.ActMessageConstant; import com.epmet.dao.ActLivePicDao; import com.epmet.dao.ActLiveRecDao; import com.epmet.dto.ActInfoDTO; @@ -90,10 +89,10 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl liveRecList(Map map) { - if (map.get("actId") == null){ - logger.error("传参中没有活动ID"); - throw new RenException("传参中没有活动ID"); + public Result liveRecList(TokenDto tokenDto,Map map) { + if (!map.containsKey("actId") || StringUtils.isEmpty(map.get("actId"))) { + logger.warn("传参中没有actId,或者actId为空,userId:" + tokenDto.getUserId() + "客户id:" + tokenDto.getCustomerId()); + throw new RenException("actId不能为空"); } // 数据汇总 ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java index 5cfb9a1c5c..26fed9cca7 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueProjectTagDictRedis.java @@ -108,9 +108,11 @@ public class IssueProjectTagDictRedis { Map> result = new HashMap<>(); //传入的categories不会只包含"其他"这个分类,因为情况下ifOtherOnly为true,直接传入null List _default = poolDao.selectDefault(customerId,ifOtherOnly ? null : category); - if(!CollectionUtils.isEmpty(_default)){ - result.put(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME,_default); - }else log.error("there is no default tag data in database , customerId : {}",customerId); + if (!CollectionUtils.isEmpty(_default)) { + result.put(ModuleConstants.DEFAULT_TAG_CATEGORY_NAME, _default); + } else { + log.error("there is no default tag data in database , customerId : {},category:{}", customerId, ifOtherOnly ? null : category); + } //如果keys集合为空,说明缓存中没有当前客户的标签排行信息,直接进行补偿 @@ -441,7 +443,7 @@ public class IssueProjectTagDictRedis { secondCategoryIds.forEach(cid -> { String key = GovIssueRedisKeys.getGovernmentTagKey(customerId, cid); - Set> tagTuples = + Set> tagTuples = redisUtils.zReverseRangeWithScores(key, NumConstant.ZERO_L, (long) (NumConstant.ONE_NEG)); if(!CollectionUtils.isEmpty(tagTuples)){ @@ -477,4 +479,4 @@ public class IssueProjectTagDictRedis { T t = objectMapper.convertValue(o, clazz); return t; } -} \ No newline at end of file +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java index bd138b5583..4d640f5c13 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java @@ -1,6 +1,7 @@ package com.epmet.modules.topic.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -82,6 +83,7 @@ public class TopicShareLinkRecordController { * @date 2020/12/18 上午10:14 */ @PostMapping("createurl") + @NoRepeatSubmit public Result getCreateUrlId(@RequestBody CreateUrlFormDTO createUrlFormDTO, @LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(createUrlFormDTO, CreateUrlFormDTO.CreateUrlForm.class); return new Result().ok(topicShareLinkRecordService.getCreateUrlId(createUrlFormDTO,tokenDto));