|
@@ -525,25 +525,33 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
DateTime dt1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
|
|
int sucNum = 0;
|
|
|
- foreach (var item in dto.base64DataList)
|
|
|
+ try
|
|
|
{
|
|
|
- string imageName = dto.imageName + ((DateTime.Now.Ticks - dt1970.Ticks) / 10000).ToString();
|
|
|
- string result = decodeBase64ToImage(item, imageName);
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty(result))
|
|
|
+ foreach (var item in dto.base64DataList)
|
|
|
{
|
|
|
- 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)
|
|
|
+ string imageName = dto.imageName + ((DateTime.Now.Ticks - dt1970.Ticks) / 10000).ToString();
|
|
|
+ string result = decodeBase64ToImage(item, imageName);
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(result))
|
|
|
{
|
|
|
- sucNum++;
|
|
|
+ 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++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
}
|
|
|
|
|
|
string msg = string.Format(@"成功上传{0}张", sucNum);
|