public ActionResult GetApplyListJson(Pagination pagination, string queryJson)
        {
            var watch      = CommonHelper.TimerStart();
            var queryParam = queryJson.ToJObject();
            var data       = aptitudeinvestigateauditbll.GetAuditList(queryParam["ID"].ToString());
            var jsonData   = new
            {
                rows     = data,
                total    = pagination.total,
                page     = pagination.page,
                records  = pagination.records,
                costtime = CommonHelper.TimerEnd(watch)
            };

            return(ToJsonResult(jsonData));
        }
Example #2
0
 public object GetSpecialAuditList([FromBody] JObject json)
 {
     try
     {
         string  res      = json.Value <string>("json");
         dynamic dy       = JsonConvert.DeserializeObject <ExpandoObject>(res);
         string  userId   = dy.userid;
         string  keyValue = res.Contains("id") ? dy.data.id : "";
         //获取用户基本信息
         OperatorProvider.AppUserId = userId;  //设置当前用户
         Operator user = OperatorProvider.Provider.Current();
         if (null == curUser)
         {
             return(new { code = -1, count = 0, info = "请求失败,请登录!" });
         }
         var obj = aptitudeinvestigateauditbll.GetAuditList(keyValue).Where(p => p.REMARK != "0").ToList();
         if (obj == null)
         {
             return(new { Code = -1, Count = 0, Info = "没有查询到数据!" });
         }
         else
         {
             string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");
             foreach (var item in obj)
             {
                 item.AUDITSIGNIMG = item.AUDITSIGNIMG.Replace("../../", webUrl + "/");
             }
             return(new { Code = 0, Count = -1, Info = "获取数据成功", data = obj });
         }
     }
     catch (Exception ex)
     {
         return(new { Code = -1, Count = 0, Info = ex.Message });
     }
 }
        public ActionResult GetFormJson(string keyValue)
        {
            var data = new
            {
                apply   = leaveApproveBLL.GetEntity(keyValue),
                approve = aptitudeinvestigateauditBLL.GetAuditList(keyValue).FirstOrDefault()
            };

            return(Content(data.ToJson()));
        }
Example #4
0
        public ActionResult GetApproveList(Pagination pagination, string queryJson)
        {
            var    queryParam = queryJson.ToJObject();
            string keyValue   = queryParam["keyValue"].ToString();
            string adjustId   = queryParam["adjustId"].ToString();
            var    data       = aptitudeinvestigateauditBLL.GetAuditList(keyValue).Where(t => t.APPLYID.Equals(adjustId)).ToList();
            var    JsonData   = new
            {
                rows    = data,
                total   = data.Count(),
                page    = pagination.page,
                records = data.Count()
            };

            return(Content(JsonData.ToJson()));
        }
        public ActionResult ApporveForm(string keyValue, SafetyCollectEntity entity, AptitudeinvestigateauditEntity aentity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string state = string.Empty;

            string moduleName = "竣工安全验收";


            /// <param name="currUser">当前登录人</param>
            /// <param name="state">是否有权限审核 1:能审核 0 :不能审核</param>
            /// <param name="moduleName">模块名称</param>
            /// <param name="outengineerid">工程Id</param>
            //ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out state, moduleName, outengineerid);
            ManyPowerCheckEntity mpcEntity = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, curUser.DeptId);

            #region                                                                                                                                 //审核信息表
            AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
            aidEntity.AUDITRESULT   = aentity.AUDITRESULT;                                                                                          //通过
            aidEntity.AUDITTIME     = Convert.ToDateTime(aentity.AUDITTIME.Value.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToString("HH:mm:ss")); //审核时间
            aidEntity.AUDITPEOPLE   = aentity.AUDITPEOPLE;                                                                                          //审核人员姓名
            aidEntity.AUDITPEOPLEID = aentity.AUDITPEOPLEID;                                                                                        //审核人员id
            aidEntity.APTITUDEID    = keyValue;                                                                                                     //关联的业务ID
            aidEntity.AUDITDEPTID   = aentity.AUDITDEPTID;                                                                                          //审核部门id
            aidEntity.AUDITDEPT     = aentity.AUDITDEPT;                                                                                            //审核部门
            aidEntity.AUDITOPINION  = aentity.AUDITOPINION;                                                                                         //审核意见
            aidEntity.FlowId        = aentity.FlowId;
            aidEntity.AUDITSIGNIMG  = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", "");
            if (null != mpcEntity)
            {
                aidEntity.REMARK = (mpcEntity.AUTOID.Value - 1).ToString(); //备注 存流程的顺序号
            }
            else
            {
                aidEntity.REMARK = "7";
            }
            aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            #endregion

            #region  //保存竣工安全验收记录
            var smEntity = SafetyCollectbll.GetEntity(keyValue);
            //审核通过
            if (aentity.AUDITRESULT == "0")
            {
                //0表示流程未完成,1表示流程结束
                if (null != mpcEntity)
                {
                    smEntity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                    smEntity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                    smEntity.FLOWROLE     = mpcEntity.CHECKROLEID;
                    smEntity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                    smEntity.ISSAVED      = "1";
                    smEntity.ISOVER       = "0";
                    smEntity.FlowId       = mpcEntity.ID;//赋值流程Id
                    smEntity.FLOWNAME     = mpcEntity.CHECKDEPTNAME + "审批中";
                }
                else
                {
                    smEntity.FLOWDEPT     = "";
                    smEntity.FLOWDEPTNAME = "";
                    smEntity.FLOWROLE     = "";
                    smEntity.FLOWROLENAME = "";
                    smEntity.ISSAVED      = "1";
                    smEntity.ISOVER       = "1";
                    smEntity.FLOWNAME     = "";
                }
            }
            else //审核不通过 归档
            {
                smEntity.FLOWDEPT     = "";
                smEntity.FLOWDEPTNAME = "";
                smEntity.FLOWROLE     = "";
                smEntity.FLOWROLENAME = "";
                smEntity.ISSAVED      = "2"; //标记审核不通过
                smEntity.ISOVER       = "1"; //流程结束
                smEntity.FLOWNAME     = "";
                //smEntity.FlowId = mpcEntity.ID;//回退后流程Id清空
                //var applyUser = new UserBLL().GetEntity(smEntity.CREATEUSERID);
                //if (applyUser != null)
                //{
                //    JPushApi.PushMessage(applyUser.Account, smEntity.CREATEUSERNAME, "WB002", entity.ID);
                //}
            }
            //更新竣工安全验收基本状态信息
            SafetyCollectbll.SaveForm(keyValue, smEntity);
            #endregion

            #region    //审核不通过
            if (aentity.AUDITRESULT == "1")
            {
                //获取当前业务对象的所有审核记录
                var shlist = aptitudeinvestigateauditbll.GetAuditList(keyValue);
                //批量更新审核记录关联ID
                foreach (AptitudeinvestigateauditEntity mode in shlist)
                {
                    //mode.APTITUDEID = hsentity.ID; //对应新的ID
                    //mode.REMARK = "99";
                    aptitudeinvestigateauditbll.SaveForm(mode.ID, mode);
                }
            }
            #endregion

            return(Success("操作成功!"));
        }
        public void ExportReport(string keyValue)
        {
            try
            {
                var userInfo = OperatorProvider.Provider.Current();  //获取当前用户
                string strDocPath = Server.MapPath("~/Resource/ExcelTemplate/人员资质审批表华润版本.doc");
                string fileName = "相关方施工人员进厂申请表_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".doc";
                Aspose.Words.Document doc = new Aspose.Words.Document(strDocPath);
                DocumentBuilder builder = new DocumentBuilder(doc);
                DataSet ds = new DataSet();
                DataTable dtPro = new DataTable("project");
                dtPro.Columns.Add("createdate");//申请时间
                dtPro.Columns.Add("outsourcingproject");//单位名称
                dtPro.Columns.Add("outsouringengineer");//工程名称
                dtPro.Columns.Add("predicttime");//计划工期
                dtPro.Columns.Add("engineerdirector");//施工负责人
                dtPro.Columns.Add("workpeoplecount");  //施工人数
                dtPro.Columns.Add("engineerletdeptid"); //用工部门
                dtPro.Columns.Add("linkman"); //联系人

                dtPro.Columns.Add("ygauditidea");//用工部门审核意见
                dtPro.Columns.Add("ygauditdate");//用工部门审核时间
                dtPro.Columns.Add("ehsauditidea");//EHS部审核意见
                dtPro.Columns.Add("ehsauditdate");//EHS部审核时间
                dtPro.Columns.Add("bgsauditidea");//办公室审核意见
                dtPro.Columns.Add("bgsauditdate");//办公室审核时间

                HttpResponse resp = System.Web.HttpContext.Current.Response;

                PeopleReviewEntity p = peoplereviewbll.GetEntity(keyValue);

                OutsouringengineerEntity eng = Outsouringengineernll.GetEntity(p.OUTENGINEERID);
                OutsourcingprojectEntity pro = Outsourcingprojectbll.GetOutProjectInfo(eng.OUTPROJECTID);

                DataRow row = dtPro.NewRow();
                row["createdate"] =Convert.ToDateTime(p.CREATEDATE).ToString("yyyy年MM月dd日");
                row["outsourcingproject"] = pro.OUTSOURCINGNAME;
                row["outsouringengineer"] = eng.ENGINEERNAME;
                row["predicttime"] = eng.PREDICTTIME;
                row["engineerdirector"] = eng.ENGINEERDIRECTOR;
                row["engineerletdeptid"] = eng.ENGINEERLETDEPT;
                row["linkman"] = pro.LINKMAN;
                row["workpeoplecount"] = aptitudeinvestigatepeoplebll.GetList("").Where(t => t.PEOPLEREVIEWID == keyValue).Count();
                List<AptitudeinvestigateauditEntity> list = auditbll.GetAuditList(keyValue).OrderByDescending(x => x.AUDITTIME).ToList();
                string pic = Server.MapPath("~/content/Images/no_1.png");//默认图片
                if (list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        var filepath = list[i].AUDITSIGNIMG == null ? "" : (Server.MapPath("~/") + list[i].AUDITSIGNIMG.ToString().Replace("../../", "").ToString()).Replace(@"\/", "/").ToString();
                        var stime = Convert.ToDateTime(list[i].AUDITTIME);
                        if (i == 0)
                        {
                            row["ygauditidea"] = list[i].AUDITOPINION;
                            //zauditusername = list[i].AuditUserName;
                            builder.MoveToMergeField("ygauditusername");
                            row["ygauditdate"] = stime.ToString("yyyy年MM月dd日");
                        }
                        else if (i == 1)
                        {
                            row["ehsauditidea"] = list[i].AUDITOPINION;
                            //sauditusername = list[i].AuditUserName;
                            builder.MoveToMergeField("ehsauditusername");
                            row["ehsauditdate"] = stime.ToString("yyyy年MM月dd日");
                        }
                        else if (i == 2)
                        {
                            row["bgsauditidea"] = list[i].AUDITOPINION;
                            //aauditusername = list[i].AuditUserName;
                            builder.MoveToMergeField("bgsauditusername");
                            row["bgsauditdate"] = stime.ToString("yyyy年MM月dd日");

                        }

                        if (!System.IO.File.Exists(filepath))
                        {
                            filepath = pic;
                        }
                        builder.InsertImage(filepath, 80, 35);
                    }
                }
                dtPro.Rows.Add(row);
                doc.MailMerge.Execute(dtPro);
                doc.MailMerge.DeleteFields();
                doc.Save(resp, Server.UrlEncode(fileName), ContentDisposition.Attachment, Aspose.Words.Saving.SaveOptions.CreateSaveOptions(SaveFormat.Doc));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #7
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 });
            }
        }
Example #8
0
        public ActionResult SubmitAppForm(string keyValue, string state, string recordData, IntromissionEntity entity, AptitudeinvestigateauditEntity aentity)
        {
            int noDoneCount = 0; //未完成个数

            bool isUseSetting = true;

            int isBack = 0;

            string newKeyValue = string.Empty;

            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string status = "";
            //更改申请信息状态
            ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out status, "入厂许可审查", entity.OUTENGINEERID, false, entity.FLOWID);


            JArray arr = new JArray();

            if (!recordData.IsEmpty())
            {
                arr = (JArray)JsonConvert.DeserializeObject(recordData);
            }

            //审查状态下更新审查内容
            if (state == "1")
            {
                //只更新审查内容
                for (int i = 0; i < arr.Count(); i++)
                {
                    string id       = arr[i]["id"].ToString();       //主键
                    string result   = arr[i]["result"].ToString();   //结果
                    string people   = arr[i]["people"].ToString();   //选择的人员
                    string peopleid = arr[i]["peopleid"].ToString(); //选择的人员
                    string signpic  = string.IsNullOrWhiteSpace(arr[i]["signpic"].ToString()) ? "" : HttpUtility.UrlDecode(arr[i]["signpic"].ToString()).Replace("../..", "");
                    if (!string.IsNullOrEmpty(id))
                    {
                        var scEntity = investigatedtrecordbll.GetEntity(id); //审查内容项
                        scEntity.INVESTIGATERESULT = result;
                        if (result == "未完成")
                        {
                            noDoneCount += 1;
                        }                                          //存在未完成的则累加
                        scEntity.INVESTIGATEPEOPLE   = people;
                        scEntity.INVESTIGATEPEOPLEID = peopleid;
                        scEntity.SIGNPIC             = HttpUtility.UrlDecode(signpic);
                        //更新当前流程进行中的审查内容
                        investigatedtrecordbll.SaveForm(id, scEntity);
                    }
                }
                //退回操作(审查退回)
                if (noDoneCount > 0)
                {
                    entity.FLOWDEPT         = " ";
                    entity.FLOWDEPTNAME     = " ";
                    entity.FLOWROLE         = " ";
                    entity.FLOWROLENAME     = " ";
                    entity.FLOWID           = " ";
                    entity.INVESTIGATESTATE = "0"; //更改状态为登记状态
                    entity.FLOWNAME         = "";

                    isBack = 1; //审查退回
                    var applyUser = new UserBLL().GetEntity(entity.APPLYPEOPLEID);
                    if (applyUser != null)
                    {
                        JPushApi.PushMessage(applyUser.Account, entity.CREATEUSERNAME, "WB012", entity.ID);
                    }
                    //  AddBackData(keyValue, out newKeyValue);
                }
                else
                {
                    if (null != mpcEntity)
                    {
                        entity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                        entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                        entity.FLOWROLE     = mpcEntity.CHECKROLEID;
                        entity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                        entity.FLOWID       = mpcEntity.ID;
                        DataTable dt          = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME);
                        var       userAccount = dt.Rows[0]["account"].ToString();
                        var       userName    = dt.Rows[0]["realname"].ToString();
                        JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID);
                    }
                    entity.FLOWNAME         = "审核中";
                    entity.INVESTIGATESTATE = "2"; //更改状态为审核
                }
            }
            else
            {
                //同意进行下一步
                if (aentity.AUDITRESULT == "0")
                {
                    //下一步流程不为空
                    if (null != mpcEntity)
                    {
                        entity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                        entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                        entity.FLOWROLE     = mpcEntity.CHECKROLEID;
                        entity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                        entity.FLOWID       = mpcEntity.ID;
                        DataTable dt          = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME);
                        var       userAccount = dt.Rows[0]["account"].ToString();
                        var       userName    = dt.Rows[0]["realname"].ToString();
                        JPushApi.PushMessage(userAccount, userName, "WB013", entity.ID);
                    }
                    else
                    {
                        entity.FLOWDEPT         = " ";
                        entity.FLOWDEPTNAME     = " ";
                        entity.FLOWROLE         = " ";
                        entity.FLOWROLENAME     = " ";
                        entity.FLOWID           = " ";
                        entity.FLOWNAME         = "已完结";
                        entity.INVESTIGATESTATE = "3"; //更改状态为完结状态
                    }

                    //添加审核记录
                    aentity.APTITUDEID   = keyValue; //关联id
                    aentity.AUDITSIGNIMG = HttpUtility.UrlDecode(aentity.AUDITSIGNIMG);
                    aentity.AUDITSIGNIMG = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", "");
                    aptitudeinvestigateauditbll.SaveForm("", aentity);
                }
                else  //退回到申请人 (审核退回)
                {
                    entity.FLOWDEPT         = " ";
                    entity.FLOWDEPTNAME     = " ";
                    entity.FLOWROLE         = " ";
                    entity.FLOWROLENAME     = " ";
                    entity.FLOWID           = " ";
                    entity.INVESTIGATESTATE = "0"; //更改状态为登记状态
                    entity.FLOWNAME         = "";
                    isBack = 2;                    //审核退回
                    var applyUser = new UserBLL().GetEntity(entity.APPLYPEOPLEID);
                    if (applyUser != null)
                    {
                        JPushApi.PushMessage(applyUser.Account, entity.CREATEUSERNAME, "WB012", entity.ID);
                    }
                    //  AddBackData(keyValue, out newKeyValue);  //添加历史记录
                }
            }
            //更改入厂许可申请单
            intromissionbll.SaveForm(keyValue, entity);

            //退回操作
            if (isBack > 0)
            {
                //添加历史记录
                AddBackData(keyValue, out newKeyValue);

                //审核退回
                if (isBack > 1)
                {
                    //获取当前业务对象的所有历史审核记录
                    var shlist = aptitudeinvestigateauditbll.GetAuditList(keyValue);
                    //批量更新审核记录关联ID
                    foreach (AptitudeinvestigateauditEntity mode in shlist)
                    {
                        mode.APTITUDEID = newKeyValue; //对应新的关联ID
                        aptitudeinvestigateauditbll.SaveForm(mode.ID, mode);
                    }
                    //添加审核记录
                    aentity.APTITUDEID   = newKeyValue; //关联id
                    aentity.AUDITSIGNIMG = HttpUtility.UrlDecode(aentity.AUDITSIGNIMG);
                    aentity.AUDITSIGNIMG = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", "");
                    aptitudeinvestigateauditbll.SaveForm("", aentity);
                }
            }

            return(Success("操作成功。"));
        }
Example #9
0
        public ActionResult ApporveForm(string keyValue, SecurityDynamicsEntity entity, AptitudeinvestigateauditEntity aentity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string state = string.Empty;

            string moduleName = "安全动态";

            entity = securitydynamicsbll.GetEntity(keyValue);

            string outengineerid = new DepartmentBLL().GetEntityByCode(entity.CreateUserDeptCode).DepartmentId;

            /// <param name="currUser">当前登录人</param>
            /// <param name="state">是否有权限审核 1:能审核 0 :不能审核</param>
            /// <param name="moduleName">模块名称</param>
            /// <param name="outengineerid">工程Id</param>
            //ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditPower(curUser, out state, moduleName, outengineerid);
            ManyPowerCheckEntity mpcEntity = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, outengineerid);

            #region                                                                                                                                 //审核信息表
            AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
            aidEntity.AUDITRESULT   = aentity.AUDITRESULT;                                                                                          //通过
            aidEntity.AUDITTIME     = Convert.ToDateTime(aentity.AUDITTIME.Value.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToString("HH:mm:ss")); //审核时间
            aidEntity.AUDITPEOPLE   = aentity.AUDITPEOPLE;                                                                                          //审核人员姓名
            aidEntity.AUDITPEOPLEID = aentity.AUDITPEOPLEID;                                                                                        //审核人员id
            aidEntity.APTITUDEID    = keyValue;                                                                                                     //关联的业务ID
            aidEntity.AUDITDEPTID   = aentity.AUDITDEPTID;                                                                                          //审核部门id
            aidEntity.AUDITDEPT     = aentity.AUDITDEPT;                                                                                            //审核部门
            aidEntity.AUDITOPINION  = aentity.AUDITOPINION;                                                                                         //审核意见
            aidEntity.FlowId        = aentity.FlowId;
            aidEntity.AUDITSIGNIMG  = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", "");
            if (null != mpcEntity)
            {
                aidEntity.REMARK = (mpcEntity.AUTOID.Value - 1).ToString(); //备注 存流程的顺序号
            }
            else
            {
                aidEntity.REMARK = "7";
            }
            aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            #endregion

            #region  //保存安全动态记录
            var smEntity = securitydynamicsbll.GetEntity(keyValue);
            //审核通过
            if (aentity.AUDITRESULT == "0")
            {
                //0表示流程未完成,1表示流程结束
                if (null != mpcEntity)
                {
                    smEntity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                    smEntity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                    smEntity.FLOWROLE     = mpcEntity.CHECKROLEID;
                    smEntity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                    smEntity.IsSend       = "0";
                    smEntity.ISOVER       = "0";
                    smEntity.FlowId       = mpcEntity.ID;//赋值流程Id
                    smEntity.FLOWNAME     = mpcEntity.CHECKDEPTNAME + "审核中";
                    //DataTable dt = new UserBLL().GetUserAccountByRoleAndDept(curUser.OrganizeId, mpcEntity.CHECKDEPTID, mpcEntity.CHECKROLENAME);
                    //var userAccount = dt.Rows[0]["account"].ToString();
                    //var userName = dt.Rows[0]["realname"].ToString();
                    //JPushApi.PushMessage(userAccount, userName, "WB001", entity.ID);
                }
                else
                {
                    smEntity.FLOWDEPT     = "";
                    smEntity.FLOWDEPTNAME = "";
                    smEntity.FLOWROLE     = "";
                    smEntity.FLOWROLENAME = "";
                    smEntity.IsSend       = "0";
                    smEntity.ISOVER       = "1";
                    smEntity.FLOWNAME     = "";
                    smEntity.ReleaseTime  = DateTime.Now;//发布时间
                }
            }
            else //审核不通过
            {
                smEntity.FLOWDEPT     = "";
                smEntity.FLOWDEPTNAME = "";
                smEntity.FLOWROLE     = "";
                smEntity.FLOWROLENAME = "";
                smEntity.IsSend       = "1"; //处于登记阶段
                smEntity.ISOVER       = "0"; //是否完成状态赋值为未完成
                smEntity.FLOWNAME     = "审核(批)未通过";
                smEntity.FlowId       = "";  //回退后流程Id清空
                //var applyUser = new UserBLL().GetEntity(smEntity.CREATEUSERID);
                //if (applyUser != null)
                //{
                //    JPushApi.PushMessage(applyUser.Account, smEntity.CREATEUSERNAME, "WB002", entity.ID);
                //}
            }
            //更新安全动态基本状态信息
            securitydynamicsbll.SaveForm(keyValue, smEntity);
            #endregion

            #region    //审核不通过
            if (aentity.AUDITRESULT == "1")
            {
                //添加历史记录
                //HistoryRiskWorkEntity hsentity = new HistoryRiskWorkEntity();
                //hsentity.CREATEUSERID = smEntity.CREATEUSERID;
                //hsentity.CREATEUSERDEPTCODE = smEntity.CREATEUSERDEPTCODE;
                //hsentity.CREATEUSERORGCODE = smEntity.CREATEUSERORGCODE;
                //hsentity.CREATEDATE = smEntity.CREATEDATE;
                //hsentity.CREATEUSERNAME = smEntity.CREATEUSERNAME;
                //hsentity.MODIFYDATE = smEntity.MODIFYDATE;
                //hsentity.MODIFYUSERID = smEntity.MODIFYUSERID;
                //hsentity.MODIFYUSERNAME = smEntity.MODIFYUSERNAME;
                //hsentity.SUBMITDATE = smEntity.SUBMITDATE;
                //hsentity.SUBMITPERSON = smEntity.SUBMITPERSON;
                //hsentity.PROJECTID = smEntity.PROJECTID;
                //hsentity.CONTRACTID = smEntity.ID; //关联ID
                //hsentity.ORGANIZER = smEntity.ORGANIZER;
                //hsentity.ORGANIZTIME = smEntity.ORGANIZTIME;
                //hsentity.ISOVER = smEntity.ISOVER;
                //hsentity.ISSAVED = smEntity.ISSAVED;
                //hsentity.FLOWDEPTNAME = smEntity.FLOWDEPTNAME;
                //hsentity.FLOWDEPT = smEntity.FLOWDEPT;
                //hsentity.FLOWROLENAME = smEntity.FLOWROLENAME;
                //hsentity.FLOWROLE = smEntity.FLOWROLE;
                //hsentity.FLOWNAME = smEntity.FLOWNAME;
                //hsentity.SummitContent = smEntity.SummitContent;
                //hsentity.ID = "";

                //historyRiskWorkbll.SaveForm(hsentity.ID, hsentity);

                //获取当前业务对象的所有审核记录
                var shlist = aptitudeinvestigateauditbll.GetAuditList(keyValue);
                //批量更新审核记录关联ID
                foreach (AptitudeinvestigateauditEntity mode in shlist)
                {
                    //mode.APTITUDEID = hsentity.ID; //对应新的ID
                    mode.REMARK = "99";
                    aptitudeinvestigateauditbll.SaveForm(mode.ID, mode);
                }
                //批量更新附件记录关联ID
                //var flist = fileinfobll.GetImageListByObject(keyValue);
                //foreach (FileInfoEntity fmode in flist)
                //{
                //    fmode.RecId = hsentity.ID; //对应新的ID
                //    fileinfobll.SaveForm("", fmode);
                //}
            }
            #endregion

            return(Success("操作成功!"));
        }
Example #10
0
        public object GetInfo([FromBody] JObject json)
        {
            try
            {
                string  res     = json.Value <string>("json");
                dynamic dy      = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  userId  = dy.userid;
                string  disid   = dy.data.disid;
                var     disBll  = new DistrictBLL();
                var     didBll  = new DataItemDetailBLL();
                var     deptBll = new DepartmentBLL();
                //获取用户基本信息
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator user    = OperatorProvider.Provider.Current();
                var      entity  = techdisclosurebll.GetEntity(disid);
                var      project = new OutsouringengineerBLL().GetEntity(entity.PROJECTID);
                if (project != null)
                {
                    if (!string.IsNullOrWhiteSpace(project.OUTPROJECTID))
                    {
                        var dept = new DepartmentBLL().GetEntity(project.OUTPROJECTID);
                        project.OUTPROJECTCODE = dept.EnCode;
                        project.OUTPROJECTNAME = dept.FullName;
                    }
                    //if (!string.IsNullOrWhiteSpace(project.ENGINEERAREA))
                    //{
                    //    var area = disBll.GetEntity(project.ENGINEERAREA);
                    //    if (area != null)
                    project.ENGINEERAREANAME = project.EngAreaName;
                    //}
                    if (!string.IsNullOrWhiteSpace(project.ENGINEERTYPE))
                    {
                        var listType = didBll.GetDataItem("ProjectType", project.ENGINEERTYPE).ToList();
                        if (listType != null && listType.Count > 0)
                        {
                            entity.ENGINEERTYPENAME = listType[0].ItemName;
                        }
                    }
                    if (!string.IsNullOrWhiteSpace(project.ENGINEERLEVEL))
                    {
                        var listLevel = didBll.GetDataItem("ProjectLevel", project.ENGINEERLEVEL).ToList();
                        if (listLevel != null && listLevel.Count > 0)
                        {
                            entity.ENGINEERLEVELNAME = listLevel[0].ItemName;
                        }
                    }
                }
                else
                {
                    var listLevel = didBll.GetDataItem("ProjectLevel", entity.ENGINEERLEVEL).ToList();
                    if (listLevel != null && listLevel.Count > 0)
                    {
                        entity.ENGINEERLEVELNAME = listLevel[0].ItemName;
                    }

                    var listType = didBll.GetDataItem("ProjectType", entity.ENGINEERTYPE).ToList();
                    if (listType != null && listType.Count > 0)
                    {
                        entity.ENGINEERTYPENAME = listType[0].ItemName;
                    }
                }
                var listmaj = didBll.GetDataItem("BelongMajor", entity.DISCLOSUREMAJOR).ToList();
                if (listmaj != null && listmaj.Count > 0)
                {
                    entity.DISCLOSUREMAJORNAME = listmaj[0].ItemName;
                }
                var    files  = new FileInfoBLL().GetFiles(disid);        //获取相关附件
                var    pics   = new FileInfoBLL().GetFiles(disid + "01"); //获取相关附件
                string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");
                foreach (DataRow dr in files.Rows)
                {
                    dr["filepath"] = dr["filepath"].ToString().Replace("~/", webUrl + "/");
                }
                foreach (DataRow dr in pics.Rows)
                {
                    dr["filepath"] = dr["filepath"].ToString().Replace("~/", webUrl + "/");
                }
                List <AptitudeinvestigateauditEntity> AptitudeList = aptitudeinvestigateauditbll.GetAuditList(entity.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(entity.ID, "13", curUser);
                var data = new
                {
                    AuditInfo = AptitudeList,
                    nodeList  = nodeList,
                    project   = project,
                    entity    = entity,
                    piclist   = pics,
                    filelist  = files
                };
                Dictionary <string, string> dict_props = new Dictionary <string, string>();
                //Id 转换前的列名  keyvalue 转换后的列名
                //dict_props.Add("Id", "keyvalue");

                JsonSerializerSettings settings = new JsonSerializerSettings
                {
                    ContractResolver = new LowercaseContractResolver(dict_props), //转小写,并对指定的列进行自定义名进行更换
                    DateFormatString = "yyyy-MM-dd HH:mm",                        //格式化日期
                    //NullValueHandling = NullValueHandling.Ignore 值为空则在JSON中体现
                };
                return(new { code = 0, info = "获取数据成功", count = 1, data = JObject.Parse(JsonConvert.SerializeObject(data, Formatting.None, settings)) });
            }
            catch (Exception ex)
            {
                return(new { code = -1, count = 0, info = ex.Message });
            }
        }
Example #11
0
        public ActionResult ApporveForm(string keyValue, AptitudeinvestigateauditEntity aentity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string state = string.Empty;

            string moduleName = "日常考核";

            DailyexamineEntity entity = dailyexaminebll.GetEntity(keyValue);
            /// <param name="currUser">当前登录人</param>
            /// <param name="state">是否有权限审核 1:能审核 0 :不能审核</param>
            /// <param name="moduleName">模块名称</param>
            /// <param name="createdeptid">创建人部门ID</param>
            ManyPowerCheckEntity mpcEntity = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, entity.CreateUserDeptId);


            #region                                                                                                                                 //审核信息表
            AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
            aidEntity.AUDITRESULT   = aentity.AUDITRESULT;                                                                                          //通过
            aidEntity.AUDITTIME     = Convert.ToDateTime(aentity.AUDITTIME.Value.ToString("yyyy-MM-dd") + " " + DateTime.Now.ToString("HH:mm:ss")); //审核时间
            aidEntity.AUDITPEOPLE   = aentity.AUDITPEOPLE;                                                                                          //审核人员姓名
            aidEntity.AUDITPEOPLEID = aentity.AUDITPEOPLEID;                                                                                        //审核人员id
            aidEntity.APTITUDEID    = keyValue;                                                                                                     //关联的业务ID
            aidEntity.AUDITDEPTID   = aentity.AUDITDEPTID;                                                                                          //审核部门id
            aidEntity.AUDITDEPT     = aentity.AUDITDEPT;                                                                                            //审核部门
            aidEntity.AUDITOPINION  = aentity.AUDITOPINION;                                                                                         //审核意见
            aidEntity.FlowId        = entity.FlowID;
            aidEntity.AUDITSIGNIMG  = HttpUtility.UrlDecode(aidEntity.AUDITSIGNIMG);
            aidEntity.AUDITSIGNIMG  = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace("../..", "");
            if (null != mpcEntity)
            {
                aidEntity.REMARK = (mpcEntity.AUTOID.Value - 1).ToString(); //备注 存流程的顺序号
            }
            else
            {
                aidEntity.REMARK = "7";
            }
            aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            #endregion

            #region  //保存日常考核
            //审核通过
            if (aentity.AUDITRESULT == "0")
            {
                //0表示流程未完成,1表示流程结束
                if (null != mpcEntity)
                {
                    entity.FlowDept     = mpcEntity.CHECKDEPTID;
                    entity.FlowDeptName = mpcEntity.CHECKDEPTNAME;
                    entity.FlowRole     = mpcEntity.CHECKROLEID;
                    entity.FlowRoleName = mpcEntity.CHECKROLENAME;
                    entity.IsSaved      = 1;
                    entity.IsOver       = 0;
                    entity.FlowID       = mpcEntity.ID;
                    entity.FlowName     = mpcEntity.CHECKDEPTNAME + "审核中";
                }
                else
                {
                    entity.FlowDept     = "";
                    entity.FlowDeptName = "";
                    entity.FlowRole     = "";
                    entity.FlowRoleName = "";
                    entity.IsSaved      = 1;
                    entity.IsOver       = 1;
                    entity.FlowName     = "";
                }
            }
            else //审核不通过
            {
                entity.FlowDept     = "";
                entity.FlowDeptName = "";
                entity.FlowRole     = "";
                entity.FlowRoleName = "";
                entity.IsOver       = 0; //处于登记阶段
                entity.IsSaved      = 0; //是否完成状态赋值为未完成
                entity.FlowName     = "";
                entity.FlowID       = "";
            }
            //更新日常考核基本状态信息
            dailyexaminebll.SaveForm(keyValue, entity);
            #endregion

            #region    //审核不通过
            if (aentity.AUDITRESULT == "1")
            {
                //添加历史记录
                HistorydailyexamineEntity hsentity = new HistorydailyexamineEntity();
                hsentity.CreateUserId       = entity.CreateUserId;
                hsentity.CreateUserDeptCode = entity.CreateUserDeptCode;
                hsentity.CreateUserOrgCode  = entity.CreateUserOrgCode;
                hsentity.CreateDate         = entity.CreateDate;
                hsentity.CreateUserName     = entity.CreateUserName;
                hsentity.CreateUserDeptId   = entity.CreateUserDeptId;
                hsentity.ModifyDate         = entity.ModifyDate;
                hsentity.ModifyUserId       = entity.ModifyUserId;
                hsentity.ModifyUserName     = entity.ModifyUserName;
                hsentity.ExamineCode        = entity.ExamineCode;
                hsentity.ExamineDept        = entity.ExamineDept;
                hsentity.ExamineDeptId      = entity.ExamineDeptId;
                hsentity.ExamineToDeptId    = entity.ExamineToDeptId;
                hsentity.ExamineToDept      = entity.ExamineToDept;
                hsentity.ExamineType        = entity.ExamineType; //关联ID
                hsentity.ExamineMoney       = entity.ExamineMoney;
                hsentity.ExaminePerson      = entity.ExaminePerson;
                hsentity.ExaminePersonId    = entity.ExaminePersonId; //关联ID
                hsentity.ExamineTime        = entity.ExamineTime;
                hsentity.ExamineContent     = entity.ExamineContent;
                hsentity.ExamineBasis       = entity.ExamineBasis;
                hsentity.Remark             = entity.Remark;
                hsentity.ContractId         = entity.Id;//关联ID
                hsentity.IsSaved            = 2;
                hsentity.IsOver             = entity.IsOver;
                hsentity.FlowDeptName       = entity.FlowDeptName;
                hsentity.FlowDept           = entity.FlowDept;
                hsentity.FlowRoleName       = entity.FlowRoleName;
                hsentity.FlowRole           = entity.FlowRole;
                hsentity.FlowName           = entity.FlowName;
                hsentity.Project            = entity.Project;
                hsentity.ProjectId          = entity.ProjectId;
                hsentity.Id = "";

                historydailyexaminebll.SaveForm(hsentity.Id, hsentity);

                //获取当前业务对象的所有审核记录
                var shlist = aptitudeinvestigateauditbll.GetAuditList(keyValue);
                //批量更新审核记录关联ID
                foreach (AptitudeinvestigateauditEntity mode in shlist)
                {
                    mode.APTITUDEID = hsentity.Id; //对应新的ID
                    aptitudeinvestigateauditbll.SaveForm(mode.ID, mode);
                }
                //批量更新附件记录关联ID
                var flist = fileinfobll.GetImageListByObject(keyValue);
                foreach (FileInfoEntity fmode in flist)
                {
                    fmode.RecId = hsentity.Id; //对应新的ID
                    fileinfobll.SaveForm("", fmode);
                }
            }
            #endregion

            return(Success("操作成功!"));
        }
        public ActionResult GetSpecialAuditList(string keyValue)
        {
            var data = aptitudeinvestigateauditbll.GetAuditList(keyValue);

            return(ToJsonResult(data));
        }
        private void ExportDataByCode(string keyValue, string tempPath, string fileName)
        {
            var    userInfo   = OperatorProvider.Provider.Current(); //获取当前用户
            string strDocPath = Server.MapPath(tempPath);

            Aspose.Words.Document doc = new Aspose.Words.Document(strDocPath);
            DataTable             dt  = new DataTable("people");

            dt.Columns.Add("ApplyCode");                  //编号
            dt.Columns.Add("CreateDate");                 //填报日期
            dt.Columns.Add("AccidentEventName");          //事故事件名称
            dt.Columns.Add("HappenTime");                 //发生时间
            dt.Columns.Add("BelongDept");                 //责任归属
            dt.Columns.Add("AccidentEventProperty");      //性质
            dt.Columns.Add("SituationIntroduction");      //情况简述
            dt.Columns.Add("ReasonAndProblem");           //暴露原因及问题
            dt.Columns.Add("RectificationMeasures");      //防范措施及要求
            dt.Columns.Add("SignDeptName");               //发至单位
            dt.Columns.Add("RealSignPersonName");         //签收人
            dt.Columns.Add("ApproveDept");                //审核部门
            dt.Columns.Add("ApprovePerson");              //审核人
            dt.Columns.Add("RectificationPerson");        //整改负责人
            dt.Columns.Add("RectificationDutyDept");      //责任部门
            dt.Columns.Add("RectificationTime");          //完成期限
            dt.Columns.Add("RectificationSituation");     //措施完成情况
            dt.Columns.Add("RectificationPersonSignImg"); //措施完成责任人签名
            dt.Columns.Add("ReformDate");                 //整改日期
            dt.Columns.Add("CheckPerson1");               //部门负责人
            dt.Columns.Add("CheckIdea1");                 //验收意见1
            dt.Columns.Add("CheckIdea2");                 //验收意见2
            dt.Columns.Add("CheckPerson2");               //验收人2
            dt.Columns.Add("CheckDate2");                 //验收日期2
            dt.Columns.Add("CheckIdea3");                 //验收意见3
            dt.Columns.Add("CheckPerson3");               //验收人3
            dt.Columns.Add("CheckDate3");                 //验收日期3
            dt.Columns.Add("CheckDept3");                 //验收部门3
            dt.Columns.Add("CheckIdea4");                 //验收意见4
            dt.Columns.Add("CheckPerson4");               //验收人4
            dt.Columns.Add("CheckDate4");                 //验收日期4
            dt.Columns.Add("CheckDept4");                 //验收部门4

            HttpResponse resp         = System.Web.HttpContext.Current.Response;
            string       defaultimage = Server.MapPath("~/content/Images/no_1.png");
            DataRow      row          = dt.NewRow();
            PowerplanthandledetailEntity   powerplanthandledetailentity   = powerplanthandledetailbll.GetEntity(keyValue);
            PowerplanthandleEntity         powerplanthandleentity         = powerplanthandlebll.GetEntity(powerplanthandledetailentity.PowerPlantHandleId);
            AptitudeinvestigateauditEntity aptitudeinvestigateauditentity = aptitudeinvestigateauditbll.GetAuditList(powerplanthandleentity.Id).Where(t => t.Disable == "0").OrderByDescending(t => t.AUDITTIME).FirstOrDefault();
            PowerplantreformEntity         powerplantreformentity         = powerplantreformbll.GetList("").Where(t => t.Disable == 0 && t.PowerPlantHandleDetailId == keyValue).FirstOrDefault();
            IList <PowerplantcheckEntity>  powerplantcheckentitylist      = powerplantcheckbll.GetList("").Where(t => t.Disable == 0 && t.PowerPlantHandleDetailId == keyValue).OrderBy(t => t.CreateDate).ToList();

            row["ApplyCode"]                  = powerplanthandledetailentity.ApplyCode;
            row["CreateDate"]                 = Convert.ToDateTime(powerplanthandledetailentity.CreateDate).ToString("yyyy年MM月dd日");
            row["AccidentEventName"]          = powerplanthandleentity.AccidentEventName;
            row["HappenTime"]                 = Convert.ToDateTime(powerplanthandleentity.HappenTime).ToString("yyyy年MM月dd日");
            row["BelongDept"]                 = powerplanthandleentity.BelongDept;
            row["AccidentEventProperty"]      = scaffoldbll.getName(powerplanthandleentity.AccidentEventProperty, "AccidentEventProperty");
            row["SituationIntroduction"]      = powerplanthandleentity.SituationIntroduction;
            row["ReasonAndProblem"]           = powerplanthandledetailentity.ReasonAndProblem;
            row["RectificationMeasures"]      = powerplanthandledetailentity.RectificationMeasures;
            row["SignDeptName"]               = powerplanthandledetailentity.SignDeptName;
            row["RealSignPersonName"]         = powerplanthandledetailentity.RealSignPersonName;
            row["ApproveDept"]                = aptitudeinvestigateauditentity == null ? "" : aptitudeinvestigateauditentity.AUDITDEPT;
            row["ApprovePerson"]              = aptitudeinvestigateauditentity == null ? "" : (System.IO.File.Exists(Server.MapPath("~/") + aptitudeinvestigateauditentity.AUDITSIGNIMG.Replace("../../", "").ToString()) ? Server.MapPath("~/") + aptitudeinvestigateauditentity.AUDITSIGNIMG.Replace("../../", "").ToString() : defaultimage);
            row["RectificationPerson"]        = powerplantreformentity.RectificationPerson;
            row["RectificationDutyDept"]      = powerplantreformentity.RectificationDutyDept;
            row["RectificationTime"]          = Convert.ToDateTime(powerplantreformentity.RectificationTime).ToString("yyyy年MM月dd日");
            row["RectificationSituation"]     = powerplantreformentity.RectificationSituation;
            row["RectificationPersonSignImg"] = System.IO.File.Exists(Server.MapPath("~/") + powerplantreformentity.RectificationPersonSignImg.Replace("../../", "").ToString()) ? Server.MapPath("~/") + powerplantreformentity.RectificationPersonSignImg.Replace("../../", "").ToString() : defaultimage;
            row["ReformDate"]                 = Convert.ToDateTime(powerplantreformentity.CreateDate).ToString("yyyy年MM月dd日");
            for (int i = 0; i < powerplantcheckentitylist.Count; i++)
            {
                switch (i)
                {
                case 0:
                    row["CheckPerson1"] = System.IO.File.Exists(Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString()) ? Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString() : defaultimage;
                    row["CheckIdea1"]   = string.IsNullOrEmpty(powerplantcheckentitylist[i].AuditOpinion) ? "同意" : powerplantcheckentitylist[i].AuditOpinion;
                    break;

                case 1:
                    row["CheckIdea2"]   = powerplantcheckentitylist[i].AuditOpinion;
                    row["CheckPerson2"] = System.IO.File.Exists(Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString()) ? Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString() : defaultimage;
                    row["CheckDate2"]   = Convert.ToDateTime(powerplantcheckentitylist[i].AuditTime).ToString("yyyy年MM月dd日");
                    break;

                case 2:
                    row["CheckIdea3"]   = powerplantcheckentitylist[i].AuditOpinion;
                    row["CheckPerson3"] = System.IO.File.Exists(Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString()) ? Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString() : defaultimage;
                    row["CheckDate3"]   = Convert.ToDateTime(powerplantcheckentitylist[i].AuditTime).ToString("yyyy年MM月dd日");
                    row["CheckDept3"]   = powerplantcheckentitylist[i].AuditDept;
                    break;

                case 3:
                    row["CheckIdea4"]   = powerplantcheckentitylist[i].AuditOpinion;
                    row["CheckPerson4"] = System.IO.File.Exists(Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString()) ? Server.MapPath("~/") + powerplantcheckentitylist[i].AuditSignImg.Replace("../../", "").ToString() : defaultimage;
                    row["CheckDate4"]   = Convert.ToDateTime(powerplantcheckentitylist[i].AuditTime).ToString("yyyy年MM月dd日");
                    row["CheckDept4"]   = powerplantcheckentitylist[i].AuditDept;
                    break;

                default:
                    break;
                }
            }

            dt.Rows.Add(row);
            doc.MailMerge.Execute(dt);
            doc.MailMerge.DeleteFields();
            doc.Save(resp, Server.UrlEncode(fileName), ContentDisposition.Attachment, Aspose.Words.Saving.SaveOptions.CreateSaveOptions(SaveFormat.Doc));
        }