调整保持数据库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 " +
"from ods_messagearchiving_d " +
"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," +
"(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 " +
@@ -283,31 +283,32 @@ public class MqMessageRecordServiceImpl extends ServiceImpl<MqMessageRecordMappe
log.info("processChatRecord 未获取到任何语音或企微语料信息");
output.setHandleStatus(HandleStatusEnum.ANALYSIS_CONTENT_EMPTY.getCode());
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);
log.info("processChatRecord 开始脱敏数据为 {}", contentStr);
RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput();
runMaskingRuleInput.setOpinionId(input.getBusinessId());
runMaskingRuleInput.setOldStr(contentStr.toString());
runMaskingRuleInput.setDataMaskingRules(maskingRuleItems);
String summaryText = dataMaskingRuleService.runMaskingRule(runMaskingRuleInput);
log.info("processChatRecord 结束脱敏结果为 {}", summaryText);
Map<String, Object> record = new HashMap<>();
record.put("record",summaryText);
DiFyReq diFyReq = new DiFyReq();
diFyReq.setUser(user);
diFyReq.setFlowId(flowId);
diFyReq.setInputs(record);
JSONObject difResult = (JSONObject) diFyService.getDiFyObject(diFyReq);
output.setHandleStatus(HandleStatusEnum.ANALYSIS_NORMAL.getCode());
output.setResultStr(difResult.getString("result"));
log.info("processChatRecord DiFy平台处理结果:{}", output.getResultStr());
}
//获取脱敏配置信息
List<DataMaskingRule> maskingRuleItems = dataMaskingRuleService.getDataMaskingRuleListByApplicationChannel(Constant.CHANNEL_DCC);
log.info("processChatRecord 开始脱敏 {}", contentStr);
RunMaskingRuleInput runMaskingRuleInput = new RunMaskingRuleInput();
runMaskingRuleInput.setOpinionId(input.getBusinessId());
runMaskingRuleInput.setOldStr(contentStr.toString());
runMaskingRuleInput.setDataMaskingRules(maskingRuleItems);
String summaryText = dataMaskingRuleService.runMaskingRule(runMaskingRuleInput);
log.info("processChatRecord 脱敏结果 {}", summaryText);
Map<String, Object> record = new HashMap<>();
record.put("record",summaryText);
DiFyReq diFyReq = new DiFyReq();
diFyReq.setUser(user);
diFyReq.setFlowId(flowId);
diFyReq.setInputs(record);
JSONObject difResult = (JSONObject) diFyService.getDiFyObject(diFyReq);
output.setHandleStatus(HandleStatusEnum.ANALYSIS_NORMAL.getCode());
output.setResultStr(difResult.getString("result"));
log.info("processChatRecord DiFy平台处理结果:{}", output.getResultStr());
return new DiffDefeatAnalyseOutputResult(output, "{\"Content\": \""+contentStr+"\"}");
return new DiffDefeatAnalyseOutputResult(output, JSON.parse("{\"Content\": \""+contentStr+"\"}").toString());
}
@Override