|
@@ -25,6 +25,7 @@ using OASystem.Domain.Dtos.CRM;
|
|
|
using System.Diagnostics;
|
|
|
using MathNet.Numerics.Statistics.Mcmc;
|
|
|
using AlibabaCloud.OpenApiClient.Models;
|
|
|
+using System;
|
|
|
|
|
|
namespace OASystem.API.Controllers
|
|
|
{
|
|
@@ -483,6 +484,118 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<ActionResult> PostIOSVisaProgressImageList(IOS_VisaImageListDto dto)
|
|
|
+ {
|
|
|
+ if (dto == null)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "请求错误:"));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<VisaProgressImageView> list = _delegationVisaRep.GetVisaProgressImageList(dto.visaProgressCustomerId, dto.picType);
|
|
|
+
|
|
|
+ return Ok(JsonView(list));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<ActionResult> PostIOSVisaProgressUploadImage(IOS_VisaUploadImageDto dto)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ DateTime dt1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
|
|
+ int sucNum = 0;
|
|
|
+ foreach (var item in dto.base64DataList)
|
|
|
+ {
|
|
|
+ string imageName = dto.imageName + ((DateTime.Now.Ticks - dt1970.Ticks) / 10000).ToString();
|
|
|
+ string result = decodeBase64ToImage(item, imageName);
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(result))
|
|
|
+ {
|
|
|
+ Grp_VisaProgressCustomerPicture pic = new Grp_VisaProgressCustomerPicture();
|
|
|
+ pic.CreateUserId = dto.CreateUserId;
|
|
|
+ pic.PicName = imageName;
|
|
|
+ pic.PicPath = result;
|
|
|
+ pic.VisaProgressCustomerId = dto.visaProgressCustomerId;
|
|
|
+
|
|
|
+ int insertResult = await _delegationVisaRep.AddAsync<Grp_VisaProgressCustomerPicture>(pic);
|
|
|
+ if (insertResult > 0)
|
|
|
+ {
|
|
|
+ sucNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ string msg = string.Format(@"成功上传{0}张", sucNum);
|
|
|
+
|
|
|
+ return Ok(JsonView(true, msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ private string decodeBase64ToImage(string base64DataURL, string imgName)
|
|
|
+ {
|
|
|
+ string filename = "";
|
|
|
+
|
|
|
+ String base64 = base64DataURL.Substring(base64DataURL.IndexOf(",") + 1);
|
|
|
+ System.Drawing.Bitmap bitmap = null;
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ byte[] arr = Convert.FromBase64String(base64);
|
|
|
+
|
|
|
+ System.IO.MemoryStream ms = new System.IO.MemoryStream(arr);
|
|
|
+ bitmap = new System.Drawing.Bitmap(ms);
|
|
|
+
|
|
|
+ var fileDir = AppSettingsHelper.Get("VisaProgressImageFtpPath");
|
|
|
+
|
|
|
+ filename = "VisaProgress_" + DateTime.Now.ToString("yyyyMMddHHmmss") + "_" + imgName + ".jpg";
|
|
|
+
|
|
|
+ string filePath = "";
|
|
|
+ if (!Directory.Exists(fileDir))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(fileDir);
|
|
|
+ }
|
|
|
+
|
|
|
+ filePath = fileDir + filename;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ bitmap.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ms.Close();
|
|
|
+ bitmap.Dispose();
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ string massage = e.Message;
|
|
|
+ }
|
|
|
+ return filename;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 团组任务分配
|
|
@@ -906,7 +1019,7 @@ namespace OASystem.API.Controllers
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
|
|
|
Result groupData = await _airTicketResRep.OpAirTicketRes(dto);
|
|
|
if (groupData.Code != 0)
|