Beispiel #1
0
 public ActionResult GetFormJson(string keyValue)
 {
     try
     {
         var data   = dailyexaminebll.GetEntity(keyValue);
         var exDept = new DepartmentBLL().GetEntity(data.ExamineToDeptId);
         if (exDept != null)
         {
             if (exDept.Nature == "承包商")
             {
                 var result = new
                 {
                     data  = data,
                     iscbs = true
                 };
                 return(ToJsonResult(result));
             }
             else
             {
                 var result = new
                 {
                     data  = data,
                     iscbs = false
                 };
                 return(ToJsonResult(result));
             }
         }
         else
         {
             return(ToJsonResult(data));
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
Beispiel #2
0
        public object GetForm([FromBody] JObject json)
        {
            try
            {
                string  res      = json.Value <string>("json");
                dynamic dy       = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId   = dy.userid;
                string  keyvalue = dy.data.keyvalue;
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();
                if (null == curUser)
                {
                    return(new { code = -1, count = 0, info = "请求失败,请登录!" });
                }
                var    dailyExamineEntity = dailyexaminebll.GetEntity(keyvalue);
                var    files  = new FileInfoBLL().GetFiles(keyvalue);//获取相关附件
                string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");
                foreach (DataRow dr in files.Rows)
                {
                    dr["filepath"] = dr["filepath"].ToString().Replace("~/", webUrl + "/");
                }

                List <AptitudeinvestigateauditEntity> AptitudeList = aptitudeinvestigateauditbll.GetAuditList(dailyExamineEntity.Id);
                for (int i = 0; i < AptitudeList.Count; i++)
                {
                    if (string.IsNullOrWhiteSpace(AptitudeList[i].AUDITSIGNIMG))
                    {
                        AptitudeList[i].AUDITSIGNIMG = string.Empty;
                    }
                    else
                    {
                        AptitudeList[i].AUDITSIGNIMG = webUrl + AptitudeList[i].AUDITSIGNIMG.ToString().Replace("../../", "/").ToString();
                    }
                }
                //查询审核流程图
                List <CheckFlowData> nodeList = new AptitudeinvestigateinfoBLL().GetAppFlowList(keyvalue, "8", curUser);
                return(new
                {
                    Code = 0,
                    Count = 1,
                    Info = "获取数据成功",
                    data = new
                    {
                        dailyexamineentity = new
                        {
                            examinecode = dailyExamineEntity.ExamineCode,
                            examinetodept = dailyExamineEntity.ExamineToDept,
                            examinetodeptid = dailyExamineEntity.ExamineToDeptId,
                            examinetype = dailyExamineEntity.ExamineType,
                            examinemoney = dailyExamineEntity.ExamineMoney,
                            examinecontent = dailyExamineEntity.ExamineContent,
                            examinebasis = dailyExamineEntity.ExamineBasis,
                            remark = dailyExamineEntity.Remark,
                            examineperson = dailyExamineEntity.ExaminePerson,
                            examinepersonid = dailyExamineEntity.ExaminePersonId,
                            examinetime = dailyExamineEntity.ExamineTime.Value.ToString("yyyy-MM-dd"),
                            examinedept = dailyExamineEntity.ExamineDept,
                            examinedeptid = dailyExamineEntity.ExamineDeptId
                        },
                        files = files,
                        auditinfo = AptitudeList.Select(g => new
                        {
                            auditresult = g.AUDITRESULT,
                            audittime = g.AUDITTIME.Value.ToString("yyyy-MM-dd"),
                            auditopinion = g.AUDITOPINION,
                            auditdept = g.AUDITDEPT,
                            auditpeople = g.AUDITPEOPLE,
                            auditsignimg = g.AUDITSIGNIMG
                        }).ToList(),
                        nodeList = nodeList
                    }
                });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }