Commit 39a14086 by 孙喜旺

修改字段名称

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