|
@@ -1,8 +1,11 @@
|
|
-using OASystem.API.OAMethodLib.TencentCloudAPI;
|
|
+using OASystem.API.OAMethodLib.File;
|
|
|
|
+using OASystem.API.OAMethodLib.NPOI;
|
|
|
|
+using OASystem.API.OAMethodLib.TencentCloudAPI;
|
|
using OASystem.Domain.Dtos.CRM;
|
|
using OASystem.Domain.Dtos.CRM;
|
|
using OASystem.Domain.Dtos.Tencent;
|
|
using OASystem.Domain.Dtos.Tencent;
|
|
using OASystem.Domain.ViewModels.TencentOCR;
|
|
using OASystem.Domain.ViewModels.TencentOCR;
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
using OASystem.Infrastructure.Repositories.CRM;
|
|
|
|
+using Org.BouncyCastle.Crypto;
|
|
using StackExchange.Redis;
|
|
using StackExchange.Redis;
|
|
using System.Net.NetworkInformation;
|
|
using System.Net.NetworkInformation;
|
|
using TencentCloud.Ocr.V20181119.Models;
|
|
using TencentCloud.Ocr.V20181119.Models;
|
|
@@ -107,7 +110,7 @@ namespace OASystem.API.Controllers
|
|
CerdAddress = idCardData.Data.Address,
|
|
CerdAddress = idCardData.Data.Address,
|
|
});
|
|
});
|
|
|
|
|
|
- IDCardOCRView iDCardOCRView = new IDCardOCRView()
|
|
+ IDCardOCRAndDownUrlView iDCardOCRView = new IDCardOCRAndDownUrlView()
|
|
{
|
|
{
|
|
Status = cerdStatus,
|
|
Status = cerdStatus,
|
|
Name = idCardData.Data.Name,
|
|
Name = idCardData.Data.Name,
|
|
@@ -120,6 +123,26 @@ namespace OASystem.API.Controllers
|
|
ValidDate = idCardData.Data.ValidDate
|
|
ValidDate = idCardData.Data.ValidDate
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ #region word生成 返回地址
|
|
|
|
+ string tempPath = string.Format("{0}", "C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Template\\ocr_身份证(人像面).doc");
|
|
|
|
+
|
|
|
|
+ Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
|
+ dic.Add("Name", iDCardOCRView.Name);
|
|
|
|
+ dic.Add("Sex", iDCardOCRView.Sex);
|
|
|
|
+ dic.Add("Nation", iDCardOCRView.Nation);
|
|
|
|
+ dic.Add("Birth", iDCardOCRView.Birth);
|
|
|
|
+ dic.Add("Address", iDCardOCRView.Address);
|
|
|
|
+ dic.Add("IdNum", iDCardOCRView.IdNum);
|
|
|
|
+ dic.Add("Authority", iDCardOCRView.Authority);
|
|
|
|
+ dic.Add("ValidDate", iDCardOCRView.ValidDate);
|
|
|
|
+
|
|
|
|
+ string downPath = string.Format("C:\\Server\\File\\OA2023\\Office\\Word\\TencentOCR\\Save\\{0}.doc",
|
|
|
|
+ dic["Name"].ToString() + "身份证(人像面)" + DateTime.Now.ToString("yyyyMMddHHmmss"));
|
|
|
|
+
|
|
|
|
+ string serverPathh = AsposeHelper.ExpertWordToModel(tempPath, downPath, dic, null);
|
|
|
|
+ iDCardOCRView.DownUrl = serverPathh.Replace("C:", "http:\\132.232.92.186");
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
return Ok(JsonView(iDCardOCRView));
|
|
return Ok(JsonView(iDCardOCRView));
|
|
}
|
|
}
|
|
|
|
|