Commit aa6b649d by danmo

修改字段名称

1 parent 87ea9c94
...@@ -75,7 +75,7 @@ public class ChatMsgCheckListener implements MessageListener { ...@@ -75,7 +75,7 @@ public class ChatMsgCheckListener implements MessageListener {
} }
private void handleSensitiveHit(JSONObject jsonObject) { private void handleSensitiveHit(JSONObject jsonObject) {
String from = jsonObject.getString("from"); String fromId = jsonObject.getString("from");
String msgId = jsonObject.getString("msgid"); String msgId = jsonObject.getString("msgid");
String msgtype = jsonObject.getString("msgtype"); String msgtype = jsonObject.getString("msgtype");
StringBuilder objectString = new StringBuilder(jsonObject.getString(msgtype)); StringBuilder objectString = new StringBuilder(jsonObject.getString(msgtype));
...@@ -96,15 +96,15 @@ public class ChatMsgCheckListener implements MessageListener { ...@@ -96,15 +96,15 @@ public class ChatMsgCheckListener implements MessageListener {
allSensitiveRules.forEach(weSensitive -> { allSensitiveRules.forEach(weSensitive -> {
List<String> patternWords = Arrays.asList(weSensitive.getPatternWords().split(",")); List<String> patternWords = Arrays.asList(weSensitive.getPatternWords().split(","));
List<String> users = weSensitiveService.getScopeUsers(weSensitive.getAuditUserScope()); List<String> users = weSensitiveService.getScopeUsers(weSensitive.getAuditUserScope());
log.info("handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>>finalContent:{}, patternWords:{},users:{},from:{}", finalContent, JSONObject.toJSONString(patternWords), JSONObject.toJSONString(users), from); log.info("handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>>finalContent:{}, patternWords:{},users:{},from:{}", finalContent, JSONObject.toJSONString(patternWords), JSONObject.toJSONString(users), fromId);
if (StringUtils.isNotBlank(finalContent) if (StringUtils.isNotBlank(finalContent)
&& !CollectionUtils.isEmpty(users) && !CollectionUtils.isEmpty(users)
&& users.stream().anyMatch(from::equals)) { && users.stream().anyMatch(fromId::equals)) {
WeChatContactSensitiveMsg wccsm = hitSensitive(patternWords, from, finalContent); WeChatContactSensitiveMsg wccsm = hitSensitive(patternWords, fromId, finalContent);
log.info("handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>> wccsm:{}",JSONObject.toJSONString(wccsm)); log.info("handleSensitiveHit: >>>>>>>>>>>>>>>>>>>>>> wccsm:{}",JSONObject.toJSONString(wccsm));
if (wccsm != null) { if (wccsm != null) {
wccsm.setMsgId(msgId); wccsm.setMsgId(msgId);
wccsm.setFrom(from); wccsm.setFromId(fromId);
wccsm.setMsgTime(new Date(jsonObject.getLong("msgtime"))); wccsm.setMsgTime(new Date(jsonObject.getLong("msgtime")));
int result = weChatContactSensitiveMsgMapper.insert(wccsm); int result = weChatContactSensitiveMsgMapper.insert(wccsm);
if (result > 0) { if (result > 0) {
......
...@@ -16,7 +16,7 @@ import java.util.Date; ...@@ -16,7 +16,7 @@ import java.util.Date;
@Data @Data
public class WeChatContactSensitiveMsgVO { public class WeChatContactSensitiveMsgVO {
@ApiModelProperty("发送人") @ApiModelProperty("发送人")
private String from; private String fromId;
@ApiModelProperty("发送内容") @ApiModelProperty("发送内容")
private String content; private String content;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
......
...@@ -184,7 +184,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService { ...@@ -184,7 +184,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
} }
LambdaQueryWrapper<WeChatContactSensitiveMsg> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<WeChatContactSensitiveMsg> wrapper = new LambdaQueryWrapper<>();
if(CollectionUtil.isNotEmpty(userIds)){ if(CollectionUtil.isNotEmpty(userIds)){
wrapper.in(WeChatContactSensitiveMsg::getFrom, userIds); wrapper.in(WeChatContactSensitiveMsg::getFromId, userIds);
} }
if (StringUtils.isNotBlank(weSensitiveHitQuery.getKeyword())) { if (StringUtils.isNotBlank(weSensitiveHitQuery.getKeyword())) {
wrapper.like(WeChatContactSensitiveMsg::getPatternWords, weSensitiveHitQuery.getKeyword()); wrapper.like(WeChatContactSensitiveMsg::getPatternWords, weSensitiveHitQuery.getKeyword());
...@@ -200,7 +200,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService { ...@@ -200,7 +200,7 @@ public class WeSensitiveServiceImpl implements IWeSensitiveService {
msgList.forEach(msg -> { msgList.forEach(msg -> {
WeChatContactSensitiveMsgVO vo = new WeChatContactSensitiveMsgVO(); WeChatContactSensitiveMsgVO vo = new WeChatContactSensitiveMsgVO();
vo.setContent(msg.getContent()); vo.setContent(msg.getContent());
vo.setFrom(msg.getFrom()); vo.setFromId(msg.getFromId());
vo.setMsgtime(msg.getMsgTime()); vo.setMsgtime(msg.getMsgTime());
vo.setStatus(msg.getSendStatus().toString()); vo.setStatus(msg.getSendStatus().toString());
vo.setPatternWords(msg.getPatternWords()); vo.setPatternWords(msg.getPatternWords());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!