调整保持数据库JSON对象

This commit is contained in:
zhangfan
2024-12-27 14:07:51 +08:00
parent 55c7c7fea3
commit e261585d43

View File

@@ -225,7 +225,7 @@ public class MqMessageRecordServiceImpl extends ServiceImpl<MqMessageRecordMappe
"select *, ROW_NUMBER() OVER (PARTITION BY id ORDER BY msgtime DESC) as rn " + "select *, ROW_NUMBER() OVER (PARTITION BY id ORDER BY msgtime DESC) as rn " +
"from ods_messagearchiving_d " + "from ods_messagearchiving_d " +
"where msgtime >= '" + startTime + "' and msgtime < '" + endTime + "' " + "where msgtime >= '" + startTime + "' and msgtime < '" + endTime + "' " +
"and chattype = '0' and msgtype='text')" + "and chattype = 0 and msgtype='text')" +
"select id,fromuserid,acceptuserid,msgtime,content,seq,actiontype,msgid,msgtype," + "select id,fromuserid,acceptuserid,msgtime,content,seq,actiontype,msgid,msgtype," +
"(case when tab2.userid is null or tab2.userid='' then 0 else 1 end) as fromuserrole " + "(case when tab2.userid is null or tab2.userid='' then 0 else 1 end) as fromuserrole " +
"from tab LEFT JOIN (select distinct userid from ods_workuserinfo_d) tab2 " + "from tab LEFT JOIN (select distinct userid from ods_workuserinfo_d) tab2 " +
@@ -283,18 +283,18 @@ public class MqMessageRecordServiceImpl extends ServiceImpl<MqMessageRecordMappe
log.info("processChatRecord 未获取到任何语音或企微语料信息"); log.info("processChatRecord 未获取到任何语音或企微语料信息");
output.setHandleStatus(HandleStatusEnum.ANALYSIS_CONTENT_EMPTY.getCode()); output.setHandleStatus(HandleStatusEnum.ANALYSIS_CONTENT_EMPTY.getCode());
output.setResultStr(HandleStatusEnum.ANALYSIS_CONTENT_EMPTY.getMessage()); output.setResultStr(HandleStatusEnum.ANALYSIS_CONTENT_EMPTY.getMessage());
return new DiffDefeatAnalyseOutputResult(output, "{\"Content\": \""+contentStr+"\"}"); } else {
} log.info("processChatRecord 获取到语音或企微语料信息 {}", contentStr);
//获取脱敏配置信息 //获取脱敏配置信息
List<DataMaskingRule> maskingRuleItems = dataMaskingRuleService.getDataMaskingRuleListByApplicationChannel(Constant.CHANNEL_DCC); List<DataMaskingRule> maskingRuleItems = dataMaskingRuleService.getDataMaskingRuleListByApplicationChannel(Constant.CHANNEL_DCC);
log.info("processChatRecord 开始脱敏 {}", contentStr); log.info("processChatRecord 开始脱敏数据为 {}", contentStr);
RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput(); RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput();
runMaskingRuleInput.setOpinionId(input.getBusinessId()); runMaskingRuleInput.setOpinionId(input.getBusinessId());
runMaskingRuleInput.setOldStr(contentStr.toString()); runMaskingRuleInput.setOldStr(contentStr.toString());
runMaskingRuleInput.setDataMaskingRules(maskingRuleItems); runMaskingRuleInput.setDataMaskingRules(maskingRuleItems);
String summaryText = dataMaskingRuleService.runMaskingRule(runMaskingRuleInput); String summaryText = dataMaskingRuleService.runMaskingRule(runMaskingRuleInput);
log.info("processChatRecord 脱敏结果 {}", summaryText); log.info("processChatRecord 结束脱敏结果 {}", summaryText);
Map<String, Object> record = new HashMap<>(); Map<String, Object> record = new HashMap<>();
record.put("record",summaryText); record.put("record",summaryText);
@@ -307,7 +307,8 @@ public class MqMessageRecordServiceImpl extends ServiceImpl<MqMessageRecordMappe
output.setHandleStatus(HandleStatusEnum.ANALYSIS_NORMAL.getCode()); output.setHandleStatus(HandleStatusEnum.ANALYSIS_NORMAL.getCode());
output.setResultStr(difResult.getString("result")); output.setResultStr(difResult.getString("result"));
log.info("processChatRecord DiFy平台处理结果:{}", output.getResultStr()); log.info("processChatRecord DiFy平台处理结果:{}", output.getResultStr());
return new DiffDefeatAnalyseOutputResult(output, "{\"Content\": \""+contentStr+"\"}"); }
return new DiffDefeatAnalyseOutputResult(output, JSON.parse("{\"Content\": \""+contentStr+"\"}").toString());
} }
@Override @Override