Browse Source

不知道

master
jianjun 3 years ago
parent
commit
47dee44a41
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 29
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java
  3. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java
  4. 12
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java

2
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;

29
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;
}
}

3
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;
@ -229,6 +230,8 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl<BaseGridDailyw
log.warn("未查询到网格信息:"+ d.getGridId());
return;
}
String s = StrUtil.filterEmoji(d.getWorkContent());
d.setWorkContent(s);
d.setGridCode(gridInfo.getCode());
d.setGridName(gridInfo.getGridName());
});

12
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;
@ -83,7 +84,9 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl<EventreportPi
entity.setGridCode(item.getOrgCode());
entity.setGridName(item.getOrgName());
entity.setEventCode(("py_").concat(item.getId()));
entity.setEventName(item.getEventName());
String eventName = StrUtil.filterEmoji(item.getEventName());
entity.setEventName(eventName);
entity.setEventCategory(item.getEventCategory());
entity.setGridUserCardid("");
entity.setGridUserName("");
@ -111,10 +114,11 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl<EventreportPi
entity.setHappenTime(item.getHappenDate());
entity.setHappenPlace(item.getHappenPlace());
String eventDescription = item.getEventDescription();
//如果不为空 长度控制1000以内
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > 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());
//业务不确定

Loading…
Cancel
Save