diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 0d18e6f706..95158b2929 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -49,7 +49,7 @@ public interface NumConstant { BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); BigDecimal ZERO_DECIMAL = new BigDecimal(0); int ONE_THOUSAND = 1000; - int TEN_THOUSAND = 10000; + int THREE_THOUSAND = 3000; int MAX = 99999999; int EIGHTY_EIGHT = 88; int EIGHTY = 80; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java new file mode 100644 index 0000000000..055b7a2ae2 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java @@ -0,0 +1,29 @@ +package com.epmet.commons.tools.utils; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2022/7/22 9:45 下午 + * @version: 1.0 + */ +public class StrUtil { + + private static final Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]", Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); + + public static String filterEmoji(String source) { + + if (source != null) { + Matcher emojiMatcher = emoji.matcher(source); + if (emojiMatcher.find()) { + source = emojiMatcher.replaceAll(""); + return source; + } + return source; + } + return source; + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java index e070cc30ce..0ae3ac01e9 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java @@ -23,9 +23,9 @@ public interface GridInfoPingyinDao extends BaseDao { List selectByGridCode(String gridCode); - int updateSomeCol(@Param("id") Long id, + int updateSomeCol(@Param("gridCode") String gridCode, @Param("gridName")String gridName, @Param("gridLevel")Integer gridLevel, @Param("lng")BigDecimal lng, @Param("lat")BigDecimal lat); -} \ No newline at end of file +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java index 84cddbe1d3..0dc15d325a 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java @@ -1,8 +1,6 @@ package com.epmet.opendata.entity; import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -22,11 +20,6 @@ public class EventreportPingyinEntity { private static final long serialVersionUID = 1L; - /** - * 数据库主键自增字段,请勿指定 - */ - private Long id; - /** * 上报区县代码,参照6位行政区划代码 */ diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java index 6051db5f01..9f64f9175d 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java @@ -1,8 +1,6 @@ package com.epmet.opendata.entity; import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -22,11 +20,6 @@ public class GridInfoPingyinEntity { private static final long serialVersionUID = 1L; - /** - * 数据库主键自增字段,请勿指定 - */ - private Long id; - /** * 上报区县代码,参照6位行政区划代码 */ diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java index 0a53873f89..ef5fc9d982 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java @@ -1,8 +1,6 @@ package com.epmet.opendata.entity; import com.baomidou.mybatisplus.annotation.TableName; - -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -21,11 +19,6 @@ public class GridstaffInfoPingyinEntity { private static final long serialVersionUID = 1L; - /** - * 数据库主键自增字段,请勿指定 - */ - private Long id; - /** * 上报区县代码,参照6位行政区划代码 */ @@ -97,7 +90,7 @@ public class GridstaffInfoPingyinEntity { private String education; /** - * 入职时间,格式为“YYYY-MM-DD” + * 入职时间,格式为“YYYY-MM-DD” */ private Date entryDate; @@ -107,7 +100,7 @@ public class GridstaffInfoPingyinEntity { private String isLeave; /** - * 离职时间,格式为“YYYY-MM-DD” + * 离职时间,格式为“YYYY-MM-DD” */ private Date leaveDate; diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java index bcb4df6f14..c02ed2d50f 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; 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.StrUtil; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.dto.form.patrol.PatrolQueryFormDTO; @@ -209,6 +210,7 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl data; do { Result> record = epmetUserOpenFeignClient.getPatrolRoutineWorkListV2(midPatrolFormDTO); + midPatrolFormDTO.setPageNo(midPatrolFormDTO.getPageNo() + 1); if (record == null || !record.success()) { log.error("获取例行工作记录V2失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); @@ -225,12 +227,16 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(d.getGridId()); if (null == gridInfo){ - throw new EpmetException("未查询到网格信息:"+ d.getGridId()); + log.warn("未查询到网格信息:"+ d.getGridId()); + return; } + String s = StrUtil.filterEmoji(d.getWorkContent()); + d.setWorkContent(s); d.setGridCode(gridInfo.getCode()); d.setGridName(gridInfo.getGridName()); }); insertNewRecordBatch(data); + }while (data.size() == NumConstant.ONE_THOUSAND); return true; } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java index 08d3ffccf7..df1d77eca2 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.StrUtil; import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.basereport.result.EventInfoResultDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; @@ -76,7 +77,6 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl entityList = list.stream().map(item -> { EventreportPingyinEntity entity = new EventreportPingyinEntity(); entity.setQxBm("370124"); @@ -84,7 +84,9 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl NumConstant.ONE_THOUSAND) { - eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND); + //如果不为空 长度控制3000以内 + if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.THREE_THOUSAND) { + eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.THREE_THOUSAND); } + eventDescription = StrUtil.filterEmoji(eventDescription); entity.setEventDescription(eventDescription); entity.setWaysOfResolving(item.getWaysOfResolving()); //业务不确定 @@ -139,7 +139,7 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl StringUtils.isNotBlank(item.getGridCode()) && StringUtils.isNotBlank(item.getGridName()) && @@ -149,7 +149,7 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); @@ -158,8 +158,7 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl - + - + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml index fd75c023f0..a6f7c2ef5a 100755 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml @@ -33,7 +33,7 @@ @@ -42,6 +42,6 @@ grid_level = #{gridLevel}, lng = #{lng}, lat = #{lat} - where id = #{id} + where grid_code = #{gridCode} and is_del = 'N' - \ No newline at end of file +