Exemple #1
0
 public object ApproveForm()
 {
     try
     {
         string  res    = HttpContext.Current.Request["json"];
         dynamic dy     = JsonConvert.DeserializeObject <ExpandoObject>(res);
         string  userId = dy.userid;
         string  id     = dy.data.id;
         string  entity = JsonConvert.SerializeObject(dy.data.entity);
         TechDisclosureEntity Entity = JsonConvert.DeserializeObject <TechDisclosureEntity>(entity);
         string auditentity          = JsonConvert.SerializeObject(dy.data.auditentity);
         AptitudeinvestigateauditEntity Auditentity = JsonConvert.DeserializeObject <AptitudeinvestigateauditEntity>(auditentity);
         string strurl = new DataItemDetailBLL().GetItemValue("imgUrl");
         Auditentity.AUDITSIGNIMG = string.IsNullOrWhiteSpace(Auditentity.AUDITSIGNIMG) ? "" : Auditentity.AUDITSIGNIMG.ToString().Replace(strurl, "");
         //获取用户基本信息
         OperatorProvider.AppUserId = userId;  //设置当前用户
         Operator currUser = OperatorProvider.Provider.Current();
         techdisclosurebll.ApporveForm(id, Entity, Auditentity);
         return(new { code = 0, count = 1, info = "提交成功" });
     }
     catch (Exception ex)
     {
         return(new { code = -1, count = 0, info = ex.Message });
     }
 }
        public ActionResult CommitApply(string keyValue, AptitudeinvestigateauditEntity entity, SaferewardEntity rewEntity, string leaderShipId, [System.Web.Http.FromBody] string dataJson)
        {
            if (rewEntity != null && (string.IsNullOrEmpty(rewEntity.ApplyState) || rewEntity.ApplyState == "0"))
            {
                var year       = DateTime.Now.ToString("yyyy");
                var month      = DateTime.Now.ToString("MM");
                var day        = DateTime.Now.ToString("dd");
                var rewardCode = "Q/CRPHZHB 2208.06.01-JL01-" + year + month + day + saferewardbll.GetRewardCode();
                rewEntity.SafeRewardCode = !string.IsNullOrEmpty(rewEntity.SafeRewardCode) ? rewEntity.SafeRewardCode : rewardCode;
                int?rewardmoney = 0;
                if (dataJson.Length > 0)
                {
                    if (saferewarddetailbll.Remove(keyValue) > 0)
                    {
                        List <SaferewarddetailEntity> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <SaferewarddetailEntity> >(dataJson);
                        foreach (SaferewarddetailEntity data in list)
                        {
                            data.RewardId = keyValue;
                            saferewarddetailbll.SaveForm("", data);
                            rewardmoney += data.RewardNum;
                        }
                    }
                }
                rewEntity.RewardMoney = rewardmoney;
                saferewardbll.SaveForm(keyValue, rewEntity);
            }

            if (!string.IsNullOrEmpty(keyValue) && entity != null)
            {
                saferewardbll.CommitApply(keyValue, entity, leaderShipId);
            }

            return(Success("操作成功。"));
        }
Exemple #3
0
        public ActionResult Audit(string keyValue, AptitudeinvestigateauditEntity AuditInfo)
        {
            ThreePeopleCheckEntity entity = threepeoplecheckbll.GetEntity(keyValue);
            Operator             curUser  = OperatorProvider.Provider.Current();
            string               status   = "0";
            ManyPowerCheckEntity mp       = threepeoplecheckbll.CheckAuditPower(curUser, out status, "三种人审核", entity.CreateUserDeptId, keyValue);

            AuditInfo.AUDITPEOPLEID = curUser.UserId;
            AuditInfo.AUDITDEPTID   = curUser.DeptId;
            AuditInfo.APTITUDEID    = keyValue;
            AuditInfo.FlowId        = entity.NodeId;
            if (mp != null)
            {
                if (status == "0")
                {
                    return(Error("对不起,您没有审核的权限"));
                }
                else
                {
                    new AptitudeinvestigateauditBLL().SaveForm("", AuditInfo);
                    entity.NodeId   = AuditInfo.AUDITRESULT == "1"?"-100":mp.ID;
                    entity.IsOver   = 0;
                    entity.IsSumbit = AuditInfo.AUDITRESULT == "1" ? 0 : 1;
                    entity.Status   = AuditInfo.AUDITRESULT == "1"?"被退回,请重新提交":mp.FLOWNAME;
                    threepeoplecheckbll.SaveForm(keyValue, entity, new List <ThreePeopleInfoEntity>(), AuditInfo);
                    if (AuditInfo.AUDITRESULT == "1")
                    {
                        new DepartmentBLL().ExecuteSql(string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set disable='1' where aptitudeid='{0}'", keyValue));
                        ERCHTMS.Busines.JPush.JPushApi.PushMessage(entity.UserAccount, entity.CreateUserName, "ThreePeople", keyValue);
                    }
                    return(Success("操作成功。"));
                }
            }
            else
            {
                if (status == "0")
                {
                    return(Error("对不起,您没有审核的权限"));
                }
                else
                {
                    new AptitudeinvestigateauditBLL().SaveForm("", AuditInfo);
                    entity.IsOver   = AuditInfo.AUDITRESULT == "1" ? 0:1;
                    entity.IsSumbit = AuditInfo.AUDITRESULT == "1" ? 0 : 1;
                    entity.Status   = AuditInfo.AUDITRESULT == "1" ? "被退回,请重新提交" :"流程结束";
                    entity.NodeId   = "-100";
                    threepeoplecheckbll.SaveForm(keyValue, entity, new List <ThreePeopleInfoEntity>(), AuditInfo);
                    if (AuditInfo.AUDITRESULT == "1")
                    {
                        ERCHTMS.Busines.JPush.JPushApi.PushMessage(entity.UserAccount, entity.CreateUserName, "ThreePeople", keyValue);
                        new DepartmentBLL().ExecuteSql(string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set disable='1' where aptitudeid='{0}'", keyValue));
                    }
                    return(Success("操作成功"));
                }
            }
        }
Exemple #4
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, AptitudeinvestigateauditEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
 /// <summary>
 /// 审核表单
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="aentity"></param>
 /// <param name="DetailData"></param>
 public string AuditForm(string keyValue, AptitudeinvestigateauditEntity aentity, string DetailData)
 {
     try
     {
         return(service.AuditForm(keyValue, aentity, DetailData));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #6
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// 保证金审核
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveSafetyEamestMoney(string keyValue, AptitudeinvestigateauditEntity entity)
 {
     try
     {
         service.SaveSafetyEamestMoney(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
 /// <summary>
 /// 审核表单
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="entity"></param>
 /// <param name="aentity"></param>
 public void ApporveForm(string keyValue, TechDisclosureEntity entity, AptitudeinvestigateauditEntity aentity)
 {
     try
     {
         service.ApporveForm(keyValue, entity, aentity);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #8
0
 public void CommitApply(string keyValue, AptitudeinvestigateauditEntity entity)
 {
     try
     {
         service.CommitApply(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #9
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// 复工申请审核:更新工程状态
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void AuditReturnForWork(string keyValue, AptitudeinvestigateauditEntity entity)
 {
     try
     {
         service.AuditReturnForWork(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #10
0
 /// <summary>
 /// 离场审批
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="aentity"></param>
 public void LeaveApprove(string keyValue, LeaveApproveEntity entity, AptitudeinvestigateauditEntity aentity)
 {
     try
     {
         PushMessageData pushdata   = service.LeaveApprove(keyValue, entity, aentity);
         UserEntity      userEntity = userservice.GetEntity(entity.CreateUserId);
         JPushApi.PushMessage(userEntity.Account, userEntity.RealName, pushdata.SendCode, "", "", pushdata.EntityId);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult ApproveForm(string keyValue, AptitudeinvestigateauditEntity aentity)
 {
     try
     {
         LeaveApproveEntity entity = leaveApproveBLL.GetEntity(keyValue);
         leaveApproveBLL.LeaveApprove(keyValue, entity, aentity);
         return(Content("true"));
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
        public ActionResult AuditStartApply(string keyValue, AptitudeinvestigateauditEntity entity, string projectId, string result = "", string users = "")
        {
            var user = ERCHTMS.Code.OperatorProvider.Provider.Current();
            StartapplyforBLL applyBll = new StartapplyforBLL();
            var    sl     = applyBll.GetEntity(entity.APTITUDEID);
            string status = "";
            var    mp     = new PeopleReviewBLL().CheckAuditPower(user, out status, "开工申请", projectId);

            if (mp != null)
            {
                if (sl != null)
                {
                    sl.NodeName  = mp.FLOWNAME;
                    sl.NodeId    = mp.ID;
                    sl.AuditRole = mp.CHECKROLEID;
                    applyBll.SaveForm(entity.APTITUDEID, sl);
                }
            }
            else
            {
                if (status == "1")
                {
                    sl.NodeName = "审核完成";
                    sl.NodeId   = "";
                    sl.IsOver   = 1;
                }
            }
            if (entity.AUDITRESULT == "1")
            {
                sl.ISCOMMIT = "0";
                sl.NodeName = "";
                sl.NodeId   = "";
                sl.IsOver   = 0;
            }
            if (!string.IsNullOrEmpty(result))
            {
                sl.CheckResult = result;
                sl.CheckUsers  = users;
            }
            if (applyBll.SaveForm(entity.APTITUDEID, sl))
            {
                aptitudeinvestigateauditbll.AuditStartApply("", entity);
            }
            return(Success("操作成功。"));
        }
Exemple #13
0
 public ActionResult ApproveForm(string keyValue, string applyId, AptitudeinvestigateauditEntity aentity)
 {
     try
     {
         bool flag = safeAdjustmentBLL.ApproveForm(keyValue, applyId, aentity);
         if (flag)
         {
             return(Success("操作成功!"));
         }
         else
         {
             return(Success("没有操作权限!"));
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
Exemple #14
0
        public ActionResult CommitApply(string keyValue, AptitudeinvestigateauditEntity entity, SafepunishEntity punEntity, SafekpidataEntity kpiEntity, [System.Web.Http.FromBody] string punishJson, [System.Web.Http.FromBody] string relatedpunishJson)
        {
            if (punEntity != null && (string.IsNullOrEmpty(punEntity.ApplyState) || punEntity.ApplyState == "0"))
            {
                var year       = DateTime.Now.ToString("yyyy");
                var month      = DateTime.Now.ToString("MM");
                var day        = DateTime.Now.ToString("dd");
                var punishCode = "Q/CRPHZHB 2208.06.01-JL02-" + year + month + day + safepunishbll.GetPunishCode();
                punEntity.SafePunishCode = !string.IsNullOrEmpty(punEntity.SafePunishCode) ? punEntity.SafePunishCode : punishCode;
                safepunishbll.SaveForm(keyValue, punEntity, kpiEntity);
                if (punishJson.Length > 0)
                {
                    if (safepunishdetailbll.Remove(keyValue, "0") > 0)
                    {
                        List <SafepunishdetailEntity> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <SafepunishdetailEntity> >(punishJson);
                        foreach (SafepunishdetailEntity data in list)
                        {
                            safepunishdetailbll.SaveForm("", data);
                        }
                    }
                }

                if (relatedpunishJson.Length > 0)
                {
                    if (safepunishdetailbll.Remove(keyValue, "1") > 0)
                    {
                        List <SafepunishdetailEntity> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <SafepunishdetailEntity> >(relatedpunishJson);
                        foreach (SafepunishdetailEntity data in list)
                        {
                            safepunishdetailbll.SaveForm("", data);
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(keyValue) && entity != null)
            {
                safepunishbll.CommitApply(keyValue, entity);
            }

            return(Success("操作成功。"));
        }
 public ActionResult AuditForm(string keyValue, AptitudeinvestigateauditEntity aentity, string DetailData)
 {
     try
     {
         string message = "";
         message = suppliesacceptbll.AuditForm(keyValue, aentity, DetailData);
         if (!string.IsNullOrWhiteSpace(message))
         {
             return(Error(message));
         }
         else
         {
             return(Success("审核成功。"));
         }
     }
     catch (System.Exception ex)
     {
         return(Error(ex.ToString()));
     }
 }
Exemple #16
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("操作成功。"));
        }
Exemple #17
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("操作成功!"));
        }
Exemple #18
0
        public ActionResult SubmitForm(string keyValue, SecurityDynamicsEntity entity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string state = string.Empty;

            string outengineerid = curUser.DeptId;
            string flowid        = 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 = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, curUser.DeptId);

            //新增时会根据角色自动审核,此时需根据工程和审核配置查询审核流程Id
            OutsouringengineerEntity    engineerEntity = new OutsouringengineerBLL().GetEntity(curUser.DeptId);
            List <ManyPowerCheckEntity> powerList      = new ManyPowerCheckBLL().GetListBySerialNum(curUser.OrganizeCode, "安全动态");
            List <ManyPowerCheckEntity> checkPower     = new List <ManyPowerCheckEntity>();

            //先查出执行部门编码
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTCODE == "-1" || powerList[i].CHECKDEPTID == "-1")
                {
                    //powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntity(entity.PROJECTID).EnCode;
                    //powerList[i].CHECKDEPTID = new DepartmentBLL().GetEntity(entity.PROJECTID).DepartmentId;
                    //powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntityByCode(entity.CreateUserDeptCode).EnCode;
                    //powerList[i].CHECKDEPTID = new DepartmentBLL().GetEntityByCode(entity.CreateUserDeptCode).DepartmentId;
                    powerList[i].CHECKDEPTCODE = curUser.DeptCode;
                    powerList[i].CHECKDEPTID   = curUser.DeptId;
                }
                //创建部门
                if (powerList[i].CHECKDEPTCODE == "-3" || powerList[i].CHECKDEPTID == "-3")
                {
                    if (entity.CreateUserDeptCode == null || entity.CreateUserDeptCode == "")
                    {
                        powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntityByCode(curUser.DeptCode).EnCode;
                        powerList[i].CHECKDEPTID   = new DepartmentBLL().GetEntityByCode(curUser.DeptCode).DepartmentId;
                    }
                    else
                    {
                        powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntityByCode(entity.CreateUserDeptCode).EnCode;
                        powerList[i].CHECKDEPTID   = new DepartmentBLL().GetEntityByCode(entity.CreateUserDeptCode).DepartmentId;
                    }
                }
            }
            //登录人是否有审核权限--有审核权限直接审核通过
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTID == curUser.DeptId)
                {
                    var rolelist = curUser.RoleName.Split(',');
                    for (int j = 0; j < rolelist.Length; j++)
                    {
                        if (powerList[i].CHECKROLENAME.Contains(rolelist[j]))
                        {
                            checkPower.Add(powerList[i]);
                            break;
                        }
                    }
                }
            }
            if (checkPower.Count > 0)
            {
                ManyPowerCheckEntity check = checkPower.Last();//当前

                for (int i = 0; i < powerList.Count; i++)
                {
                    if (check.ID == powerList[i].ID)
                    {
                        flowid = powerList[i].ID;
                    }
                }
            }
            if (null != mpcEntity)
            {
                //保存安全动态记录
                entity.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                entity.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                entity.FLOWROLE     = mpcEntity.CHECKROLEID;
                entity.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                entity.IsSend       = "0"; //标记已经从登记到审核阶段
                entity.ISOVER       = "0"; //流程未完成,1表示完成
                entity.FLOWNAME     = mpcEntity.CHECKDEPTNAME + "审核中";
                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, "WB001", entity.ID);
            }
            else  //为空则表示已经完成流程
            {
                entity.FLOWDEPT     = "";
                entity.FLOWDEPTNAME = "";
                entity.FLOWROLE     = "";
                entity.FLOWROLENAME = "";
                entity.IsSend       = "0"; //标记已经从登记到审核阶段
                entity.ISOVER       = "1"; //流程未完成,1表示完成
                entity.FLOWNAME     = "";
                entity.FlowId       = flowid;
                entity.ReleaseTime  = DateTime.Now;//发布时间
            }
            securitydynamicsbll.SaveForm(keyValue, entity);

            //添加审核记录
            if (state == "1")
            {
                //审核信息表
                AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
                aidEntity.AUDITRESULT   = "0"; //通过
                aidEntity.AUDITTIME     = DateTime.Now;
                aidEntity.AUDITPEOPLE   = curUser.UserName;
                aidEntity.AUDITPEOPLEID = curUser.UserId;
                aidEntity.APTITUDEID    = entity.Id; //关联的业务ID
                aidEntity.AUDITOPINION  = "";        //审核意见
                aidEntity.AUDITSIGNIMG  = curUser.SignImg;
                if (null != mpcEntity)
                {
                    aidEntity.REMARK = (powerList[0].AUTOID.Value - 1).ToString(); //备注 存流程的顺序号

                    //aidEntity.FlowId = mpcEntity.ID;
                }
                else
                {
                    aidEntity.REMARK = "7";
                }
                aidEntity.FlowId = flowid;
                //if (curUser.RoleName.Contains("公司级用户") || curUser.RoleName.Contains("厂级部门用户"))
                //{
                //    aidEntity.AUDITDEPTID = curUser.OrganizeId;
                //    aidEntity.AUDITDEPT = curUser.OrganizeName;
                //}
                //else
                //{
                aidEntity.AUDITDEPTID = curUser.DeptId;
                aidEntity.AUDITDEPT   = curUser.DeptName;
                //}
                aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            }

            return(Success("操作成功!"));
        }
 public ActionResult AuditPeopleReview(string keyValue, AptitudeinvestigateauditEntity entity)
 {
     aptitudeinvestigateauditbll.AuditPeopleReview(keyValue, entity);
     return(Success("操作成功。"));
 }
Exemple #20
0
        /// <summary>
        /// 审核表单
        /// </summary>
        /// <param name="keyValue"></param>
        /// <param name="entity"></param>
        /// <param name="aentity"></param>
        public void ApporveForm(string keyValue, TechDisclosureEntity entity, AptitudeinvestigateauditEntity aentity)
        {
            Operator curUser  = ERCHTMS.Code.OperatorProvider.Provider.Current();
            var      smEntity = GetEntity(keyValue);

            try
            {
                string state      = string.Empty;
                string moduleName = "";
                if (string.IsNullOrWhiteSpace(smEntity.PROJECTID))
                {
                    moduleName = "安全技术交底(手输工程)";
                    if (smEntity.ENGINEERLEVEL == "001")
                    {
                        moduleName += "_一级风险";
                    }
                    else if (smEntity.ENGINEERLEVEL == "002")
                    {
                        moduleName += "_二级风险";
                    }
                    else if (smEntity.ENGINEERLEVEL == "003")
                    {
                        moduleName += "_三级风险";
                    }
                }
                else
                {
                    moduleName = "安全技术交底(选择工程)";
                    if (smEntity.ENGINEERLEVEL == "001")
                    {
                        moduleName += "_一级风险";
                    }
                    else if (smEntity.ENGINEERLEVEL == "002")
                    {
                        moduleName += "_二级风险";
                    }
                    else if (smEntity.ENGINEERLEVEL == "003")
                    {
                        moduleName += "_三级风险";
                    }
                }

                string outengineerid           = smEntity.PROJECTID;
                ManyPowerCheckEntity mpcEntity = peoplereviewservice.CheckAuditPower(curUser, out state, moduleName, outengineerid, false, smEntity.FLOWID);


                #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        = smEntity.FLOWID;
                aentity.AUDITSIGNIMG    = HttpUtility.UrlDecode(aentity.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";
                }
                aptitudeinvestigateauditservice.SaveForm(aidEntity.ID, aidEntity);
                #endregion

                #region  //保存安全技术交底

                //审核通过
                if (aentity.AUDITRESULT == "0")
                {
                    //0表示流程未完成,1表示流程结束
                    if (null != mpcEntity)
                    {
                        smEntity.STATUS = 1;
                        smEntity.FLOWID = mpcEntity.ID;
                    }
                    else
                    {
                        smEntity.STATUS = 3;
                        smEntity.FLOWID = "";
                    }
                }
                else //审核不通过
                {
                    smEntity.ISSUBMIT = 0;
                    smEntity.STATUS   = 0;
                    smEntity.FLOWID   = "";
                }

                #endregion

                #region    //审核不通过
                if (aentity.AUDITRESULT == "1")
                {
                    //添加历史记录
                    HistoryTechDisclosureEntity hsentity = new HistoryTechDisclosureEntity();
                    hsentity       = JsonConvert.DeserializeObject <HistoryTechDisclosureEntity>(JsonConvert.SerializeObject(smEntity));
                    hsentity.ID    = "";
                    hsentity.RecId = smEntity.ID;
                    historytechdisclosureservice.SaveForm(hsentity.ID, hsentity);

                    //获取当前业务对象的所有审核记录
                    var shlist = aptitudeinvestigateauditservice.GetAuditList(keyValue);
                    //批量更新审核记录关联ID
                    foreach (AptitudeinvestigateauditEntity mode in shlist)
                    {
                        mode.APTITUDEID = hsentity.ID; //对应新的ID
                        aptitudeinvestigateauditservice.SaveForm(mode.ID, mode);
                    }
                    //批量更新附件记录关联ID
                    var flist = fileinfoservice.GetImageListByObject(keyValue);
                    foreach (FileInfoEntity fmode in flist)
                    {
                        fmode.RecId = hsentity.ID; //对应新的ID
                        fileinfoservice.SaveForm("", fmode);
                    }
                }
                #endregion
                //更新安全技术交底基本状态信息
                smEntity.Modify(keyValue);
                this.BaseRepository().Update(smEntity);
                #region 更新工程流程状态
                if (smEntity.STATUS == 3 && smEntity.PROJECTID != "" && smEntity.PROJECTID != null)
                {
                    Repository <StartappprocessstatusEntity> proecss = new Repository <StartappprocessstatusEntity>(DbFactory.Base());
                    StartappprocessstatusEntity startProecss         = proecss.FindList(string.Format("select * from epg_startappprocessstatus t where t.outengineerid='{0}'", smEntity.PROJECTID)).ToList().FirstOrDefault();
                    startProecss.TECHNICALSTATUS = "1";
                    var res = DbFactory.Base().BeginTrans();
                    res.Update <StartappprocessstatusEntity>(startProecss);
                }
                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        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("操作成功!"));
        }
Exemple #22
0
        public object ApproveForm()
        {
            try
            {
                string   res      = HttpContext.Current.Request["json"];
                dynamic  dy       = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string   userid   = dy.userid;
                string   keyValue = dy.data.keyvalue;
                Operator curUser  = ERCHTMS.Code.OperatorProvider.Provider.Current();

                AptitudeinvestigateauditEntity aentity = new AptitudeinvestigateauditEntity
                {
                    AUDITRESULT   = dy.data.auditresult,
                    AUDITTIME     = Convert.ToDateTime(dy.data.audittime),
                    AUDITPEOPLE   = dy.data.auditpeople,
                    AUDITPEOPLEID = dy.data.auditpeopleid,
                    AUDITDEPTID   = dy.data.auditdeptid,
                    AUDITDEPT     = dy.data.auditdept,
                    AUDITOPINION  = dy.data.auditopinion,
                    AUDITSIGNIMG  = dy.data.auditsignimg
                };
                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  = string.IsNullOrWhiteSpace(aentity.AUDITSIGNIMG) ? "" : aentity.AUDITSIGNIMG.ToString().Replace(new DataItemDetailBLL().GetItemValue("imgUrl"), "");

                HttpFileCollection files = HttpContext.Current.Request.Files;
                if (files.Count > 0)
                {
                    for (int i = 0; i < files.AllKeys.Length; i++)
                    {
                        HttpPostedFile file           = files[i];
                        string         fileOverName   = System.IO.Path.GetFileName(file.FileName);
                        string         fileName       = System.IO.Path.GetFileNameWithoutExtension(file.FileName);
                        string         FileEextension = Path.GetExtension(file.FileName);
                        //if (fileName == aidEntity.ID)
                        //{
                        string dir         = new DataItemDetailBLL().GetItemValue("imgPath") + "\\Resource\\sign";
                        string newFileName = fileName + FileEextension;
                        string newFilePath = dir + "\\" + newFileName;
                        file.SaveAs(newFilePath);
                        aidEntity.AUDITSIGNIMG = "/Resource/sign/" + fileOverName;
                        break;
                        //}
                    }
                }
                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.FlowID       = mpcEntity.ID;
                        entity.IsOver       = 0;
                        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.FlowID       = "";
                    entity.IsOver       = 0; //处于登记阶段
                    entity.IsSaved      = 0; //是否完成状态赋值为未完成
                    entity.FlowName     = "";
                }
                //更新日常考核基本状态信息
                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       = Convert.ToDouble(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.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(new { Code = 0, Count = 0, Info = "保存成功" });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
Exemple #23
0
        public void SubmitForm(SafeAdjustmentEntity adjustmentEntity)
        {
            adjustmentEntity.ID = Guid.NewGuid().ToString();
            Operator             curUser   = OperatorProvider.Provider.Current();
            string               flowid    = string.Empty;
            string               status    = string.Empty;
            string               curFlowId = string.Empty;
            SafeMeasureEntity    entity    = safeMeasure.GetEntity(adjustmentEntity.SafeMeasureId);
            ManyPowerCheckEntity mpcEntity = service.CheckAuditPower(curUser, out status, "安措计划调整审批", curUser.DeptId, out curFlowId);


            if (mpcEntity != null)
            {
                //如果当前登录人是审核人,直接审核通过
                if (status.Equals("1"))
                {
                    AptitudeinvestigateauditEntity aentity = new AptitudeinvestigateauditEntity();
                    aentity.Create();
                    aentity.AUDITPEOPLEID = curUser.UserId;
                    aentity.AUDITPEOPLE   = curUser.UserName;
                    aentity.AUDITDEPTID   = curUser.DeptId;
                    aentity.AUDITDEPT     = curUser.DeptName;
                    aentity.APTITUDEID    = entity.Id;
                    aentity.APPLYID       = adjustmentEntity.ID;
                    aentity.FlowId        = curFlowId;//mpcEntity.ID;
                    aentity.AUDITTIME     = DateTime.Now;
                    aentity.AUDITRESULT   = "0";
                    aentity.Disable       = "0";
                    new AptitudeinvestigateauditBLL().SaveForm("", aentity);
                    if (mpcEntity.CHECKROLENAME.Equals("公司领导"))
                    {
                        entity.Stauts = mpcEntity.CHECKROLENAME;
                        adjustmentEntity.AdjustStauts = mpcEntity.CHECKROLENAME;
                    }
                    else
                    {
                        entity.Stauts = mpcEntity.CHECKDEPTNAME + mpcEntity.CHECKROLENAME;
                        adjustmentEntity.AdjustStauts = mpcEntity.CHECKDEPTNAME + mpcEntity.CHECKROLENAME;
                    }
                    entity.ProcessState           = 2;
                    adjustmentEntity.ProcessState = 2;
                }
                else
                {
                    if (mpcEntity.CHECKROLENAME.Equals("公司领导"))
                    {
                        entity.Stauts = mpcEntity.CHECKROLENAME;
                        adjustmentEntity.AdjustStauts = mpcEntity.CHECKROLENAME;
                    }
                    else
                    {
                        entity.Stauts = curUser.DeptName + mpcEntity.CHECKROLENAME;
                        adjustmentEntity.AdjustStauts = curUser.DeptName + mpcEntity.CHECKROLENAME;
                    }
                    entity.ProcessState           = 1;
                    adjustmentEntity.ProcessState = 1;
                }
                entity.FlowId       = mpcEntity.ID;
                entity.FlowName     = mpcEntity.FLOWNAME;
                entity.FlowRole     = mpcEntity.CHECKROLEID;
                entity.FlowRoleName = mpcEntity.CHECKROLENAME;
                entity.FlowDept     = mpcEntity.CHECKDEPTID;
                entity.FlowDeptName = mpcEntity.CHECKDEPTNAME;
                entity.IsCommit     = "1";
                entity.IsOver       = 0;
            }
            else
            {
                entity.FlowId                 = "";
                entity.FlowName               = "";
                entity.FlowRole               = "";
                entity.FlowRoleName           = "";
                entity.FlowDept               = "";
                entity.FlowDeptName           = "";
                entity.IsCommit               = "1";
                entity.IsOver                 = 1;
                entity.Stauts                 = "审批通过";
                entity.ProcessState           = 3;
                adjustmentEntity.ProcessState = 3;
                //审批通过,更新调整费用和调整时间
                if (adjustmentEntity.IsAdjustFee == 1)
                {
                    entity.Cost = Convert.ToDouble(adjustmentEntity.AdjustFee);
                }
                if (adjustmentEntity.IsDelay == 1)
                {
                    entity.PlanFinishDate = entity.PlanFinishDate.Value.AddDays(Convert.ToDouble(adjustmentEntity.DelayDays));
                }
                adjustmentEntity.AdjustStauts = "审批通过";
            }
            service.InsertAdjustment(adjustmentEntity);
            safeMeasure.UpdateForm(entity.Id, entity);
        }
Exemple #24
0
        public bool ApproveForm(string keyValue, string applyId, AptitudeinvestigateauditEntity aentity)
        {
            SafeMeasureEntity entity    = safeMeasure.GetEntity(keyValue);
            Operator          curUser   = OperatorProvider.Provider.Current();
            string            status    = "";
            string            curFlowId = string.Empty;

            aentity.AUDITPEOPLEID = curUser.UserId;
            aentity.AUDITDEPTID   = curUser.DeptId;
            aentity.APTITUDEID    = keyValue;
            aentity.APPLYID       = applyId;
            aentity.FlowId        = entity.FlowId;
            ManyPowerCheckEntity mpcEntity = service.CheckAuditPower(curUser, out status, "安措计划调整审批", curUser.DeptId, out curFlowId);

            aentity.Disable = aentity.AUDITRESULT == "1" ? "1" : "0";

            SafeAdjustmentEntity adjustmentEntity = service.GetEntity(entity.Id);

            if (mpcEntity != null)
            {
                if (status == "0")
                {
                    return(false);
                }
                else
                {
                    aentity.Create();
                    new AptitudeinvestigateauditBLL().SaveForm("", aentity);
                    entity.FlowId       = mpcEntity.ID;
                    entity.FlowRoleName = mpcEntity.CHECKROLENAME;
                    entity.FlowDept     = mpcEntity.CHECKDEPTID;
                    entity.FlowDeptName = mpcEntity.CHECKDEPTNAME;
                    entity.IsCommit     = "1";
                    if (aentity.AUDITRESULT == "1")
                    {
                        //调整审批不通过
                        entity.FlowName = "审批不通过";
                        entity.Stauts   = "审批不通过";
                        adjustmentEntity.AdjustStauts = "审批不通过";
                        entity.IsOver = 1;
                    }
                    else
                    {
                        entity.FlowName = mpcEntity.FLOWNAME;
                        entity.IsOver   = 0;
                        if (mpcEntity.CHECKROLENAME.Equals("公司领导"))
                        {
                            entity.Stauts = mpcEntity.CHECKROLENAME;
                            adjustmentEntity.AdjustStauts = mpcEntity.CHECKROLENAME;
                        }
                        else
                        {
                            entity.Stauts = mpcEntity.CHECKDEPTNAME + mpcEntity.CHECKROLENAME;
                            adjustmentEntity.AdjustStauts = mpcEntity.CHECKDEPTNAME + mpcEntity.CHECKROLENAME;
                        }
                    }
                    entity.ProcessState           = 2;
                    adjustmentEntity.ProcessState = 2;
                    safeMeasure.UpdateForm(keyValue, entity);
                    service.UpdateAdjustment(adjustmentEntity);
                    return(true);
                }
            }
            else
            {
                if (status == "0")
                {
                    return(false);
                }
                else
                {
                    aentity.Create();
                    new AptitudeinvestigateauditBLL().SaveForm("", aentity);
                    entity.FlowId                 = "";
                    entity.FlowRoleName           = "";
                    entity.FlowDept               = "";
                    entity.FlowDeptName           = "";
                    entity.IsOver                 = 1;
                    entity.IsCommit               = "1";
                    entity.ProcessState           = 3;
                    adjustmentEntity.ProcessState = 3;
                    entity.Stauts                 = aentity.AUDITRESULT == "1" ? "审批不通过" : "审批通过";
                    if (aentity.AUDITRESULT == "0")
                    {
                        //审批通过,更新调整费用和调整时间

                        if (adjustmentEntity != null)
                        {
                            if (adjustmentEntity.IsAdjustFee == 1)
                            {
                                entity.Cost = Convert.ToDouble(adjustmentEntity.AdjustFee);
                            }
                            if (adjustmentEntity.IsDelay == 1)
                            {
                                entity.PlanFinishDate = entity.PlanFinishDate.Value.AddDays(Convert.ToDouble(adjustmentEntity.DelayDays));
                            }
                        }
                    }
                    safeMeasure.UpdateForm(keyValue, entity);
                    adjustmentEntity.AdjustStauts = aentity.AUDITRESULT == "1" ? "审批不通过" : "审批通过";
                    service.UpdateAdjustment(adjustmentEntity);
                    return(true);
                }
            }
        }
Exemple #25
0
        public object SubmitForm()
        {
            try
            {
                string  res      = HttpContext.Current.Request["json"];;
                dynamic dy       = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string  keyValue = res.Contains("keyvalue") ? dy.data.keyvalue : "";
                string  userid   = dy.userid;
                string  fileid   = res.Contains("fileid") ? dy.data.fileid : "";

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

                DailyexamineEntity entity = new DailyexamineEntity
                {
                    Id              = keyValue,
                    ExamineCode     = dy.data.examinecode,
                    ExamineDept     = dy.data.examinedept,
                    ExamineDeptId   = dy.data.examinedeptid,
                    ExamineType     = dy.data.examinetype,
                    ExamineMoney    = Convert.ToDouble(dy.data.examinemoney),
                    ExaminePerson   = dy.data.examineperson,
                    ExaminePersonId = dy.data.examinepersonid,
                    ExamineTime     = Convert.ToDateTime(dy.data.examinetime),
                    ExamineBasis    = dy.data.examinebasis,
                    Remark          = dy.data.remark,
                    IsSaved         = 1,
                    IsOver          = 0,
                    ExamineContent  = dy.data.examinecontent,
                    ExamineToDept   = dy.data.examinetodept,
                    ExamineToDeptId = dy.data.examinetodeptid
                };
                string state = string.Empty;

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

                List <ManyPowerCheckEntity> powerList  = new ManyPowerCheckBLL().GetListBySerialNum(curUser.OrganizeCode, moduleName);
                List <ManyPowerCheckEntity> checkPower = new List <ManyPowerCheckEntity>();
                //先查出执行部门编码
                for (int i = 0; i < powerList.Count; i++)
                {
                    if (powerList[i].CHECKDEPTCODE == "-3" || powerList[i].CHECKDEPTID == "-3")
                    {
                        if (curUser.RoleName.Contains("班组") || curUser.RoleName.Contains("专业"))
                        {
                            var pDept = new DepartmentBLL().GetParentDeptBySpecialArgs(curUser.ParentId, "部门");
                            powerList[i].CHECKDEPTCODE = pDept.EnCode;
                            powerList[i].CHECKDEPTID   = pDept.DepartmentId;
                        }
                        else
                        {
                            powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntity(curUser.DeptId).EnCode;
                            powerList[i].CHECKDEPTID   = new DepartmentBLL().GetEntity(curUser.DeptId).DepartmentId;
                        }
                    }
                }
                //登录人是否有审核权限--有审核权限直接审核通过
                for (int i = 0; i < powerList.Count; i++)
                {
                    if (powerList[i].CHECKDEPTID == curUser.DeptId)
                    {
                        var rolelist = curUser.RoleName.Split(',');
                        for (int j = 0; j < rolelist.Length; j++)
                        {
                            if (powerList[i].CHECKROLENAME.Contains(rolelist[j]))
                            {
                                checkPower.Add(powerList[i]);
                                break;
                            }
                        }
                    }
                }
                if (checkPower.Count > 0)
                {
                    ManyPowerCheckEntity check = checkPower.Last();//当前

                    for (int i = 0; i < powerList.Count; i++)
                    {
                        if (check.ID == powerList[i].ID)
                        {
                            flowid = powerList[i].ID;
                        }
                    }
                }
                //if (curUser.RoleName.Contains("公司级用户"))
                //{
                //    mpcEntity = null;
                //}
                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; //流程未完成,1表示完成
                    entity.FlowID       = mpcEntity.ID;
                    entity.FlowName     = mpcEntity.CHECKDEPTNAME + "审核中";
                }
                else  //为空则表示已经完成流程
                {
                    entity.FlowDept     = "";
                    entity.FlowDeptName = "";
                    entity.FlowRole     = "";
                    entity.FlowRoleName = "";
                    entity.IsSaved      = 1; //标记已经从登记到审核阶段
                    entity.IsOver       = 1; //流程未完成,1表示完成
                    entity.FlowName     = "";
                    entity.FlowID       = flowid;
                }

                HttpFileCollection files = HttpContext.Current.Request.Files;
                keyValue = string.IsNullOrEmpty(keyValue) ? Guid.NewGuid().ToString() : keyValue;
                if (!string.IsNullOrEmpty(fileid))
                {
                    DeleteFile(fileid);
                }
                string path = string.Empty;
                UploadifyFile(keyValue, files, ref path);

                dailyexaminebll.SaveForm(keyValue, entity);

                //添加审核记录
                if (state == "1")
                {
                    //审核信息表
                    AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
                    aidEntity.AUDITRESULT   = "0"; //通过
                    aidEntity.AUDITTIME     = DateTime.Now;
                    aidEntity.AUDITPEOPLE   = curUser.UserName;
                    aidEntity.AUDITPEOPLEID = curUser.UserId;
                    aidEntity.APTITUDEID    = entity.Id; //关联的业务ID
                    aidEntity.AUDITOPINION  = "";        //审核意见
                    aidEntity.AUDITSIGNIMG  = curUser.SignImg;
                    aidEntity.FlowId        = flowid;
                    aidEntity.AUDITDEPTID   = curUser.DeptId;
                    aidEntity.AUDITDEPT     = curUser.DeptName;
                    aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
                }

                return(new { Code = 0, Count = 0, Info = "保存成功" });
            }
            catch (Exception ex)
            {
                return(new { Code = -1, Count = 0, Info = ex.Message });
            }
        }
Exemple #26
0
        /// <summary>
        /// 提交审批
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void CommitApply(string keyValue, AptitudeinvestigateauditEntity aentity)
        {
            if (!string.IsNullOrEmpty(keyValue))
            {
                SafepunishEntity entity     = GetEntity(keyValue);
                UserInfoEntity   createuser = new UserInfoService().GetUserInfoEntity(entity.CreateUserId);
                Operator         curUser    = ERCHTMS.Code.OperatorProvider.Provider.Current();
                entity.Modify(keyValue);
                DataItemModel ehsDepart     = new DataItemDetailService().GetDataItemListByItemCode("'EHSDepartment'").Where(p => p.ItemName == curUser.OrganizeId).ToList().FirstOrDefault();
                string        ehsDepartCode = "";
                if (ehsDepart != null)
                {
                    ehsDepartCode = ehsDepart.ItemValue;
                }
                if (entity.FlowState != "1")
                {
                    if (!string.IsNullOrEmpty(entity.ApplyState))
                    {
                        #region                                      //审核信息表
                        AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
                        aidEntity.AUDITRESULT = aentity.AUDITRESULT; //通过
                        if (aentity.AUDITTIME != null)
                        {
                            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.AUDITSIGNIMG  = aentity.AUDITSIGNIMG;                //个人签名
                        aidEntity.Disable       = "1";                                 //流程图的最新记录
                        if (entity.ApplyState != null)
                        {
                            aidEntity.REMARK = (entity.ApplyState).ToString();                            //备注 存流程的顺序号
                        }
                        new AptitudeinvestigateauditService().SaveForm(aidEntity.ID, aidEntity);
                        #endregion
                    }

                    if (entity.AmerceType == "1" || entity.AmerceType == "2") //事故事件跟其他类型
                    {
                        switch (entity.ApplyState ?? "0")
                        {
                        case "0":
                            if (createuser.RoleName.Contains("厂级部门用户") && !createuser.RoleName.Contains("负责人"))
                            {
                                entity.ApplyState        = "1";
                                entity.FlowState         = "0";
                                entity.ApproverPeopleIds = GetEhsUserId() ?? "";
                            }
                            else if (createuser.RoleName.Contains("厂级部门用户") && createuser.RoleName.Contains("负责人"))
                            {
                                entity.ApplyState        = "2";
                                entity.FlowState         = "0";
                                entity.ApproverPeopleIds = GetLeaderId() ?? "";
                            }
                            else if (GetLeaderId().Contains(entity.CreateUserId))
                            {
                                entity.ApplyState        = "3";
                                entity.FlowState         = "1";
                                entity.ApproverPeopleIds = "";
                            }

                            break;

                        case "1":
                            if (aentity.AUDITRESULT == "0")
                            {
                                entity.ApplyState        = "2";
                                entity.ApproverPeopleIds = GetLeaderId() ?? "";
                                entity.DeptManagerId     = entity.ApproverPeopleIds;
                            }
                            else
                            {
                                entity.ApplyState        = "0";
                                entity.FlowState         = "2";
                                entity.ApproverPeopleIds = "";
                                string strsql = string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set Disable = 0 where APTITUDEID ='{0}'", keyValue);
                                this.BaseRepository().ExecuteBySql(strsql);
                            }

                            break;

                        case "2":
                            if (aentity.AUDITRESULT == "0")
                            {
                                entity.ApplyState = "3";
                                entity.FlowState  = "1";
                            }
                            else
                            {
                                entity.ApplyState        = "0";
                                entity.FlowState         = "2";
                                entity.ApproverPeopleIds = "";
                                string strsql = string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set Disable = 0 where APTITUDEID ='{0}'", keyValue);
                                this.BaseRepository().ExecuteBySql(strsql);
                            }
                            break;
                        }
                    }
                    if (entity.AmerceType == "3" || entity.AmerceType == "4")  //日常考核跟隐患排查治理
                    {
                        switch (entity.ApplyState ?? "0")
                        {
                        case "0":
                            if ((createuser.Nature == "专业" || createuser.Nature == "班组") && !createuser.RoleName.Contains("负责人"))
                            {
                                entity.ApplyState        = "1";
                                entity.FlowState         = "0";
                                entity.ApproverPeopleIds = GetMajorUserId(createuser.DepartmentId);
                            }
                            else if (((createuser.Nature == "专业" || createuser.Nature == "班组") && createuser.RoleName.Contains("负责人")) || (createuser.Nature == "部门" && !createuser.RoleName.Contains("负责人")))
                            {
                                entity.ApplyState        = "2";
                                entity.FlowState         = "0";
                                entity.ApproverPeopleIds = GetRoleUserId(entity.CreateUserId) ?? "";
                            }
                            else if (createuser.Nature == "部门" && createuser.RoleName.Contains("负责人"))
                            {
                                entity.ApplyState        = "3";
                                entity.FlowState         = "1";
                                entity.ApproverPeopleIds = "";
                            }
                            break;

                        case "1":
                            if (aentity.AUDITRESULT == "0")
                            {
                                entity.ApplyState        = "2";
                                entity.ApproverPeopleIds = GetRoleUserId(entity.CreateUserId) ?? "";
                                entity.DeptManagerId     = entity.ApproverPeopleIds;
                            }
                            else
                            {
                                entity.ApplyState        = "0";
                                entity.FlowState         = "2";
                                entity.ApproverPeopleIds = "";
                                string strsql = string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set Disable = 0 where APTITUDEID ='{0}'", keyValue);
                                this.BaseRepository().ExecuteBySql(strsql);
                            }

                            break;

                        case "2":
                            if (aentity.AUDITRESULT == "0")
                            {
                                entity.ApplyState = "3";
                                entity.FlowState  = "1";
                            }
                            else
                            {
                                entity.ApplyState        = "0";
                                entity.FlowState         = "2";
                                entity.ApproverPeopleIds = "";
                                string strsql = string.Format("update EPG_APTITUDEINVESTIGATEAUDIT set Disable = 0 where APTITUDEID ='{0}'", keyValue);
                                this.BaseRepository().ExecuteBySql(strsql);
                            }
                            break;
                        }
                    }


                    this.BaseRepository().Update(entity);
                }
            }
        }
        public ActionResult SubmitForm(string keyValue, SafetyCollectEntity entity)
        {
            Operator curUser = ERCHTMS.Code.OperatorProvider.Provider.Current();

            string state = string.Empty;

            string flowid = string.Empty;

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

            // <param name="state">是否有权限审核 1:能审核 0 :不能审核</param>
            ManyPowerCheckEntity mpcEntity = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, curUser.DeptId);

            //新增时会根据角色自动审核
            List <ManyPowerCheckEntity> powerList  = new ManyPowerCheckBLL().GetListBySerialNum(curUser.OrganizeCode, "竣工安全验收");
            List <ManyPowerCheckEntity> checkPower = new List <ManyPowerCheckEntity>();
            var outsouringengineer = outsouringengineerbll.GetEntity(entity.EngineerId);

            //先查出执行部门编码
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTCODE == "-1" || powerList[i].CHECKDEPTID == "-1")
                {
                    var createdeptentity  = new DepartmentBLL().GetEntity(outsouringengineer.ENGINEERLETDEPTID);
                    var createdeptentity2 = new DepartmentEntity();
                    while (createdeptentity.Nature == "专业" || createdeptentity.Nature == "班组")
                    {
                        createdeptentity2 = new DepartmentBLL().GetEntity(createdeptentity.ParentId);
                        if (createdeptentity2.Nature != "专业" || createdeptentity2.Nature != "班组")
                        {
                            break;
                        }
                    }
                    powerList[i].CHECKDEPTCODE = createdeptentity.DeptCode;
                    powerList[i].CHECKDEPTID   = createdeptentity.DepartmentId;
                    if (createdeptentity2 != null)
                    {
                        powerList[i].CHECKDEPTCODE = createdeptentity.DeptCode + "," + createdeptentity2.DeptCode;
                        powerList[i].CHECKDEPTID   = createdeptentity.DepartmentId + "," + createdeptentity2.DepartmentId;
                    }
                }
                //创建部门
                if (powerList[i].CHECKDEPTCODE == "-3" || powerList[i].CHECKDEPTID == "-3")
                {
                    var createdeptentity = new DepartmentBLL().GetEntityByCode(curUser.DeptCode);
                    while (createdeptentity.Nature == "专业" || createdeptentity.Nature == "班组")
                    {
                        createdeptentity = new DepartmentBLL().GetEntity(createdeptentity.ParentId);
                    }
                    powerList[i].CHECKDEPTCODE = createdeptentity.DeptCode;
                    powerList[i].CHECKDEPTID   = createdeptentity.DepartmentId;
                }
            }
            //登录人是否有审核权限--有审核权限直接审核通过
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTID.Contains(curUser.DeptId))
                {
                    var rolelist = curUser.RoleName.Split(',');
                    for (int j = 0; j < rolelist.Length; j++)
                    {
                        if (powerList[i].CHECKROLENAME.Contains(rolelist[j]))
                        {
                            checkPower.Add(powerList[i]);
                            break;
                        }
                    }
                }
            }
            if (checkPower.Count > 0)
            {
                state = "1";
                ManyPowerCheckEntity check = checkPower.Last();//当前

                for (int i = 0; i < powerList.Count; i++)
                {
                    if (check.ID == powerList[i].ID)
                    {
                        flowid = powerList[i].ID;
                    }
                }
            }
            else
            {
                state     = "0";
                mpcEntity = powerList.First();
            }
            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"; //流程未完成,1表示完成
                //entity.FLOWNAME = entity.FLOWDEPTNAME + "审核中";
                if (mpcEntity.CHECKDEPTNAME == "执行部门" && mpcEntity.CHECKROLENAME == "负责人")
                {
                    entity.FLOWNAME = outsouringengineer.ENGINEERLETDEPT + "审批中";
                }
                else
                {
                    entity.FLOWNAME = mpcEntity.CHECKDEPTNAME + "审批中";
                }
                entity.FlowId = mpcEntity.ID;
            }
            else  //为空则表示已经完成流程
            {
                entity.FLOWDEPT     = "";
                entity.FLOWDEPTNAME = "";
                entity.FLOWROLE     = "";
                entity.FLOWROLENAME = "";
                entity.ISSAVED      = "1"; //标记已经从登记到审核阶段
                entity.ISOVER       = "1"; //流程未完成,1表示完成
                entity.FLOWNAME     = "";
                entity.FlowId       = flowid;
            }
            SafetyCollectbll.SaveForm(keyValue, entity);

            //添加审核记录
            if (state == "1")
            {
                //审核信息表
                AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
                aidEntity.AUDITRESULT   = "0"; //通过
                aidEntity.AUDITTIME     = DateTime.Now;
                aidEntity.AUDITPEOPLE   = curUser.UserName;
                aidEntity.AUDITPEOPLEID = curUser.UserId;
                aidEntity.APTITUDEID    = entity.ID; //关联的业务ID
                aidEntity.AUDITOPINION  = "";        //审核意见
                aidEntity.AUDITSIGNIMG  = curUser.SignImg;
                if (null != mpcEntity)
                {
                    aidEntity.REMARK = (powerList[0].AUTOID.Value - 1).ToString(); //备注 存流程的顺序号

                    //aidEntity.FlowId = mpcEntity.ID;
                }
                else
                {
                    aidEntity.REMARK = "7";
                }
                aidEntity.FlowId      = flowid;
                aidEntity.AUDITDEPTID = curUser.DeptId;
                aidEntity.AUDITDEPT   = curUser.DeptName;

                aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            }

            return(Success("操作成功!"));
        }
Exemple #28
0
        public ActionResult SubmitForm(string keyValue, DailyexamineEntity entity)
        {
            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 = dailyexaminebll.CheckAuditPower(curUser, out state, moduleName, curUser.DeptId);

            string flowid = string.Empty;
            List <ManyPowerCheckEntity> powerList  = new ManyPowerCheckBLL().GetListBySerialNum(curUser.OrganizeCode, moduleName);
            List <ManyPowerCheckEntity> checkPower = new List <ManyPowerCheckEntity>();

            //先查出执行部门编码
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTCODE == "-3" || powerList[i].CHECKDEPTID == "-3")
                {
                    if (curUser.RoleName.Contains("班组") || curUser.RoleName.Contains("专业"))
                    {
                        var pDept = new DepartmentBLL().GetParentDeptBySpecialArgs(curUser.ParentId, "部门");
                        powerList[i].CHECKDEPTCODE = pDept.EnCode;
                        powerList[i].CHECKDEPTID   = pDept.DepartmentId;
                    }
                    else
                    {
                        powerList[i].CHECKDEPTCODE = new DepartmentBLL().GetEntity(curUser.DeptId).EnCode;
                        powerList[i].CHECKDEPTID   = new DepartmentBLL().GetEntity(curUser.DeptId).DepartmentId;
                    }
                }
            }
            //登录人是否有审核权限--有审核权限直接审核通过
            for (int i = 0; i < powerList.Count; i++)
            {
                if (powerList[i].CHECKDEPTID == curUser.DeptId)
                {
                    var rolelist = curUser.RoleName.Split(',');
                    for (int j = 0; j < rolelist.Length; j++)
                    {
                        if (powerList[i].CHECKROLENAME.Contains(rolelist[j]))
                        {
                            checkPower.Add(powerList[i]);
                            break;
                        }
                    }
                }
            }
            if (checkPower.Count > 0)
            {
                ManyPowerCheckEntity check = checkPower.Last();//当前

                for (int i = 0; i < powerList.Count; i++)
                {
                    if (check.ID == powerList[i].ID)
                    {
                        flowid = powerList[i].ID;
                    }
                }
            }
            //if (curUser.RoleName.Contains("公司级用户"))
            //{
            //    mpcEntity = null;
            //}
            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; //流程未完成,1表示完成
                entity.FlowID       = mpcEntity.ID;
                entity.FlowName     = mpcEntity.CHECKDEPTNAME + "审核中";
            }
            else  //为空则表示已经完成流程
            {
                entity.FlowDept     = "";
                entity.FlowDeptName = "";
                entity.FlowRole     = "";
                entity.FlowRoleName = "";
                entity.IsSaved      = 1; //标记已经从登记到审核阶段
                entity.IsOver       = 1; //流程未完成,1表示完成
                entity.FlowName     = "";
                entity.FlowID       = flowid;
            }
            dailyexaminebll.SaveForm(keyValue, entity);

            //添加审核记录
            if (state == "1")
            {
                //审核信息表
                AptitudeinvestigateauditEntity aidEntity = new AptitudeinvestigateauditEntity();
                aidEntity.AUDITRESULT   = "0"; //通过
                aidEntity.AUDITTIME     = DateTime.Now;
                aidEntity.AUDITPEOPLE   = curUser.UserName;
                aidEntity.AUDITPEOPLEID = curUser.UserId;
                aidEntity.APTITUDEID    = entity.Id; //关联的业务ID
                aidEntity.AUDITOPINION  = "";        //审核意见
                aidEntity.AUDITSIGNIMG  = curUser.SignImg;
                aidEntity.FlowId        = flowid;
                if (null != mpcEntity)
                {
                    aidEntity.REMARK = (mpcEntity.AUTOID.Value - 1).ToString(); //备注 存流程的顺序号
                }
                else
                {
                    aidEntity.REMARK = "7";
                }
                aidEntity.AUDITDEPTID = curUser.DeptId;
                aidEntity.AUDITDEPT   = curUser.DeptName;
                aptitudeinvestigateauditbll.SaveForm(aidEntity.ID, aidEntity);
            }

            return(Success("操作成功!"));
        }
 public bool SaveForm(string keyValue, ThreePeopleCheckEntity entity, List <ThreePeopleInfoEntity> list, AptitudeinvestigateauditEntity auditInfo = null)
 {
     try
     {
         int count = 0;
         if (!string.IsNullOrEmpty(keyValue))
         {
             entity.Id = keyValue;
             var tp = BaseRepository().FindEntity(keyValue);
             if (tp == null)
             {
                 entity.Create();
                 entity.ApplySno = GetSno(entity.CreateUserOrgCode);
                 count           = this.BaseRepository().Insert(entity);
             }
             else
             {
                 entity.Modify(keyValue);
                 count = this.BaseRepository().Update(entity);
             }
         }
         else
         {
             entity.Create();
             entity.ApplySno = GetSno(entity.CreateUserOrgCode);
             count           = this.BaseRepository().Insert(entity);
         }
         if (count > 0)
         {
             if (auditInfo != null)
             {
                 if (auditInfo.AUDITRESULT == "0")
                 {
                     if (entity.IsOver == 1)
                     {
                         DataTable dt = BaseRepository().FindTable(string.Format("select tickettype,idcard from BIS_THREEPEOPLEINFO where applyid='{0}'", entity.Id));
                         foreach (DataRow dr in dt.Rows)
                         {
                             BaseRepository().ExecuteBySql(string.Format("update base_user set isfourperson='是',FOURPERSONTYPE='{0}' where IDENTIFYID='{1}'", dr[0].ToString(), dr[1].ToString()));
                         }
                     }
                 }
             }
             if (list.Count > 0)
             {
                 this.BaseRepository().ExecuteBySql(string.Format("delete from BIS_THREEPEOPLEINFO where applyid='{0}'", entity.Id));
                 new RepositoryFactory <ThreePeopleInfoEntity>().BaseRepository().Insert(list);
             }
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Exemple #30
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("操作成功!"));
        }