|
|
@@ -13867,8 +13867,64 @@ FROM
|
|
|
x => string.Join("\r\n", x.Select(y => $"{y.具体时间} {y.行程安排}".Trim()))
|
|
|
);
|
|
|
|
|
|
- return Ok(JsonView(true, "团组行程信息导出成功!", grouopTraveListByStr));
|
|
|
+ var groupTraveListByKey = grouopTraveListByStr.Select(x => new
|
|
|
+ {
|
|
|
+ key = x.Key,
|
|
|
+ value = x.Value,
|
|
|
+ }
|
|
|
+ ).ToList();
|
|
|
+
|
|
|
+
|
|
|
+ var blackCode = await _sqlSugar.Queryable<Air_TicketBlackCode>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.Id == dto.BlackCodeId)
|
|
|
+ .FirstAsync();
|
|
|
+
|
|
|
+ if (blackCode == null)
|
|
|
+ {
|
|
|
+ jw.Msg = "黑屏代码不存在!";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ string chat = string.Empty;
|
|
|
+ var templateSetting = await _sqlSugar
|
|
|
+ .Queryable<Sys_SetData>()
|
|
|
+ .FirstAsync(x => x.Id == 1553 && x.IsDel == 0);
|
|
|
+
|
|
|
+ if (templateSetting != null && !string.IsNullOrEmpty(templateSetting.Remark))
|
|
|
+ {
|
|
|
+ var stringFormatResp = await GeneralMethod.StringFormatAsync(new StringFormatDto
|
|
|
+ {
|
|
|
+ FormatTemplate = templateSetting.Remark,
|
|
|
+ Parameters = new List<string> {
|
|
|
+ JsonConvert.SerializeObject(groupTraveListByKey),
|
|
|
+ blackCode.BlackCode,
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (stringFormatResp.Success)
|
|
|
+ {
|
|
|
+ chat = stringFormatResp.FormattedResult;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ jw.Msg = "对话内容模板格式化失败! templateSetting.Id: " + templateSetting.Id + ",错误:" + stringFormatResp.Message;
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ jw.Msg = "获取对话内容模板失败! templateSetting.Id: " + templateSetting.Id;
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
+
|
|
|
+ var chatResult = await _doubaoService.CompleteChatAsync(new List<DouBaoChatMessage> { new DouBaoChatMessage { Role = DouBaoRole.user, Content = chat } });
|
|
|
+ if (string.IsNullOrEmpty(chatResult))
|
|
|
+ {
|
|
|
+ jw.Msg = "行程框架导出失败!";
|
|
|
+ return Ok(jw);
|
|
|
+ }
|
|
|
|
|
|
+ return Ok(JsonView(true, "行程框架导出成功!", chatResult));
|
|
|
}
|
|
|
|
|
|
#endregion
|