AI识别接收

This commit is contained in:
2025-08-09 12:27:29 +08:00
parent a52ecd996d
commit afa4976828
12 changed files with 741 additions and 1 deletions
+50
View File
@@ -295,7 +295,57 @@ namespace BLL
public const string HSEAgreementUrlFilePath = "FileUpload\\HSEAgreementUrl\\";
#endregion
#endregion
public static void SaveAttachUrlForApi(string source, string attachUrl, string menuId, string toKeyId)
{
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
{
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
if (string.IsNullOrEmpty(rootUrl))
{
rootUrl = Funs.RootPath;
}
List<Model.AttachFile> sour = (from x in db.AttachFile
where x.MenuId == menuId && x.ToKeyId == toKeyId
select x).ToList();
if (sour.Count() == 0)
{
Model.AttachFile att = new Model.AttachFile
{
AttachFileId = SQLHelper.GetNewID(),
ToKeyId = toKeyId,
AttachSource = source.ToString(),
AttachUrl = attachUrl,
MenuId = menuId,
// ImageByte= imageByte,
//AttachPath= attachPath,
};
if (menuId == BLL.Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
db.AttachFile.InsertOnSubmit(att);
db.SubmitChanges();
}
else
{
Model.AttachFile att = db.AttachFile.FirstOrDefault(x => x.MenuId == menuId && x.AttachFileId == sour.First().AttachFileId);
if (att != null)
{
att.ToKeyId = toKeyId;
att.AttachSource = source.ToString();
att.AttachUrl = attachUrl;
att.MenuId = menuId;
if (menuId == BLL.Const.PersonListMenuId)
{
att.ImageByte = AttachFileService.SetImageToByteArray(rootUrl + attachUrl.Split(',')[0]);
}
db.SubmitChanges();
}
}
}
}
/// <summary>
/// 保存附件
/// </summary>