public ActionResult Add(Epm_CompletionAcceptance model) { ResultView <int> view = new ResultView <int>(); CompletionAcceptanceView complete = new CompletionAcceptanceView(); complete.CompletionAcceptance = model; //表单校验 if (string.IsNullOrEmpty(model.ProjectName)) { view.Flag = false; view.Message = "项目名称不能为空"; return(Json(view)); } if (string.IsNullOrEmpty(model.Title)) { view.Flag = false; view.Message = "验收标题不能为空"; return(Json(view)); } if (string.IsNullOrEmpty(model.Content)) { view.Flag = false; view.Message = "验收内容不能为空"; return(Json(view)); } string dataVisaCompany = Request.Form["Unit"]; if (!string.IsNullOrEmpty(dataVisaCompany)) { complete.CompletionRectifyCompanys = JsonConvert.DeserializeObject <List <Epm_CompletionRectifyCompany> >(dataVisaCompany); } string fileDataJson = Request.Form["fileDataJsonFile"]; //获取上传图片json字符串 complete.BaseFiles = JsonConvert.DeserializeObject <List <Base_Files> >(fileDataJson); //将文件信息json字符 Result <int> result = new Result <int>(); using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request))) { result = proxy.AddCompletionAcceptanceNew(complete); var project = proxy.GetProject(model.ProjectId.Value).Data; DateTime time = DateTime.Now; foreach (var item in complete.BaseFiles) { if (string.IsNullOrEmpty(item.ImageType)) { if (item.TableColumn == "YSD" || item.TableColumn == "JGT") { Bp_SendDate send = new Bp_SendDate(); send.IsSend = false; if (item.TableColumn == "YSD") { send.Key = "2003020004"; } if (item.TableColumn == "JGT") { send.Key = "2003020002"; } send.Value = "{\"FDFS_NAME\":\"" + item.Url + "\",\"FDFS_GROUP\":\"" + item.Group + "\",\"NAME\":\"" + item.Name + "\",\"WJLX\":\"" + ListExtensionMethod.GetFileType(item.Name) + "\",\"SIZE\":\"" + ListExtensionMethod.GetByteLength(item.Size) + "\",\"USER\":\"" + CurrentUser.UserCode + "\"}"; send.Type = "12"; send.Project = "BIM"; send.KeyValue = project.ObjeId; send.UserName = CurrentUser.UserCode; send.CreateTime = time; send.OperateTime = time; send.OperateUserId = CurrentUser.UserId; send.OperateUserName = CurrentUser.UserName; send.CreateUserId = CurrentUser.UserId; send.CreateUserName = CurrentUser.UserName; proxy.AddSendDate(send); } } } } return(Json(result.ToResultView())); }