Beispiel #1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, ScaffoldauditrecordEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
 /// <summary>
 /// 更新业务表、审核表
 /// </summary>
 /// <param name="firewaterentity">业务主表实体</param>
 /// <param name="auditEntity">审核表实体</param>
 public void UpdateForm(FireWaterEntity fireWaterEntity, ScaffoldauditrecordEntity auditEntity)
 {
     try
     {
         this.SaveForm(fireWaterEntity.Id, fireWaterEntity);
         if (auditEntity != null)
         {
             auditEntity.AuditDate    = DateTime.Now;
             auditEntity.AuditSignImg = string.IsNullOrWhiteSpace(auditEntity.AuditSignImg) ? "" : auditEntity.AuditSignImg.ToString().Replace("../..", "");
             scaffoldauditrecordservice.SaveForm(auditEntity.Id, auditEntity);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public object AppSubmitAccpAudit()
        {
            try
            {
                string             res         = HttpContext.Current.Request["json"];
                dynamic            dy          = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string             userId      = dy.userid;
                string             applyentity = JsonConvert.SerializeObject(dy.data.applyentity);
                SafetychangeEntity change      = JsonConvert.DeserializeObject <SafetychangeEntity>(applyentity);

                string auditstr = JsonConvert.SerializeObject(dy.data.aiditentity);
                ScaffoldauditrecordEntity auditentity = JsonConvert.DeserializeObject <ScaffoldauditrecordEntity>(auditstr);
                string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");

                //获取用户基本信息
                OperatorProvider.AppUserId = userId;  //设置当前用户
                Operator currUser   = OperatorProvider.Provider.Current();
                string   moduleName = string.Empty;
                if (change.WORKUNITTYPE == "0")
                {
                    moduleName = "(内部)设施变动验收审核";
                }
                else
                {
                    moduleName = "(外包)设施变动验收审核";
                }
                auditentity.FlowId = change.NodeId;
                ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditForNextByWorkUnit(currUser, moduleName, change.WORKUNITID, change.NodeId, false);
                //同意进行下一步
                if (auditentity.AuditState == 0)
                {
                    //下一步流程不为空
                    if (null != mpcEntity)
                    {
                        change.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                        change.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                        change.FLOWROLE     = mpcEntity.CHECKROLEID;
                        change.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                        change.NodeId       = mpcEntity.ID;
                        change.NodeName     = mpcEntity.FLOWNAME;
                        change.ISCOMMIT     = 1;
                        change.ISACCPCOMMIT = 1;

                        new ScaffoldBLL().SendMessage(change.FLOWDEPT, change.FLOWROLE, "ZY012", change.ID);
                    }
                    else
                    {
                        change.FLOWDEPT     = " ";
                        change.FLOWDEPTNAME = " ";
                        change.FLOWROLE     = " ";
                        change.FLOWROLENAME = " ";
                        //change.NodeId = " ";
                        change.NodeName     = "已完结";
                        change.ISAPPLYOVER  = 1;
                        change.ISCOMMIT     = 1;
                        change.ISACCPCOMMIT = 1;
                        change.ISACCEPOVER  = 1;
                    }
                }
                else
                {
                    change.FLOWDEPT     = " ";
                    change.FLOWDEPTNAME = " ";
                    change.FLOWROLE     = " ";
                    change.FLOWROLENAME = " ";
                    //change.NodeId = " ";
                    change.NodeName     = "已完结";
                    change.ISAPPLYOVER  = 1;
                    change.ISCOMMIT     = 1;
                    change.ISACCPCOMMIT = 1;
                    change.ISACCEPOVER  = 2;

                    //审批不通过,推消息到申请人
                    var high = safetychangebll.GetEntity(change.ID);
                    if (high != null)
                    {
                        UserEntity userEntity = new UserBLL().GetEntity(high.CREATEUSERID);
                        if (userEntity != null)
                        {
                            JPushApi.PushMessage(userEntity.Account, userEntity.RealName, "ZY014", change.ID);
                        }
                    }
                }
                safetychangebll.SaveForm(change.ID, change);
                auditentity.ScaffoldId   = change.ID;
                auditentity.AuditDate    = DateTime.Now;
                auditentity.AuditSignImg = string.IsNullOrWhiteSpace(auditentity.AuditSignImg) ? "" : auditentity.AuditSignImg.Replace(webUrl, "").ToString();
                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 == auditentity.Id)
                        {
                            string dir         = new DataItemDetailBLL().GetItemValue("imgPath") + "\\Resource\\sign";
                            string newFileName = fileName + FileEextension;
                            string newFilePath = dir + "\\" + newFileName;
                            file.SaveAs(newFilePath);
                            auditentity.AuditSignImg = "/Resource/sign/" + fileOverName;
                            break;
                        }
                    }
                }
                auditentity.Id = null;
                scaffoldauditrecordbll.SaveForm("", auditentity);
                return(new { code = 0, count = 1, info = "提交成功" });
            }
            catch (Exception ex)
            {
                return(new { code = -1, count = 0, info = ex.Message });
            }
        }
Beispiel #4
0
        /// <summary>
        /// 申请审核
        /// 适用于审核时,修改业务状态信息
        /// </summary>
        /// <param name="key">申请信息主键ID</param>
        /// <param name="auditEntity">审核记录</param>
        public void ApplyCheck(string keyValue, ScaffoldauditrecordEntity auditEntity)
        {
            FireWaterEntity      fireWaterEntity = service.GetEntity(keyValue);
            Operator             currUser        = ERCHTMS.Code.OperatorProvider.Provider.Current();
            ManyPowerCheckEntity mpcEntity       = null;

            //把当前业务流程节点赋值到审核记录中
            auditEntity.FlowId = fireWaterEntity.FlowId;
            if (fireWaterEntity.WorkDeptType == "0")
            {
                mpcEntity = peopleReviwservice.CheckAuditForNextByWorkUnit(currUser, "消防水使用-内部审核", fireWaterEntity.WorkDeptId, fireWaterEntity.FlowId, false);
            }
            else
            {
                mpcEntity = peopleReviwservice.CheckAuditForNextByOutsourcing(currUser, "消防水使用-外部审核", fireWaterEntity.WorkDeptId, fireWaterEntity.FlowId, false, true, fireWaterEntity.EngineeringId);
            }
            //如果审核记录不为空,且为不同意,流程结束
            if (auditEntity.AuditState == 1)
            {
                //下一步流程不为空
                if (null != mpcEntity)
                {
                    fireWaterEntity.FlowDept         = mpcEntity.CHECKDEPTID;
                    fireWaterEntity.FlowDeptName     = mpcEntity.CHECKDEPTNAME;
                    fireWaterEntity.FlowRole         = mpcEntity.CHECKROLEID;
                    fireWaterEntity.FlowRoleName     = mpcEntity.CHECKROLENAME;
                    fireWaterEntity.FlowId           = mpcEntity.ID;
                    fireWaterEntity.FlowName         = mpcEntity.FLOWNAME;
                    fireWaterEntity.ApplyState       = "1";
                    fireWaterEntity.InvestigateState = "2";
                    fireWaterEntity.FlowRemark       = !string.IsNullOrEmpty(mpcEntity.REMARK) ? mpcEntity.REMARK : "";

                    //推送消息到有审批权限的人
                    string type = fireWaterEntity.FlowRemark != "1" ? "0" : "1";
                    new ScaffoldBLL().SendMessage(fireWaterEntity.FlowDept, fireWaterEntity.FlowRole, "ZY100", fireWaterEntity.Id, "", "", type, !string.IsNullOrEmpty(fireWaterEntity.SpecialtyType) ? fireWaterEntity.SpecialtyType : "");
                }
                else
                {
                    fireWaterEntity.FlowRemark       = "";
                    fireWaterEntity.FlowDept         = " ";
                    fireWaterEntity.FlowDeptName     = " ";
                    fireWaterEntity.FlowRole         = " ";
                    fireWaterEntity.FlowRoleName     = " ";
                    fireWaterEntity.ApplyState       = "3";
                    fireWaterEntity.FlowName         = "已完结";
                    fireWaterEntity.InvestigateState = "3";
                    fireWaterEntity.FlowId           = "";


                    var high = GetEntity(fireWaterEntity.Id);
                    if (high != null)
                    {
                        string     Content      = "作业内容:" + high.WorkContent + "&#10;作业时间:" + high.WorkStartTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + " 到 " + high.WorkEndTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + "&#10;作业地点:" + high.WorkPlace;
                        UserEntity userEntity   = userservice.GetEntity(high.CreateUserId);
                        string[]   workuserlist = high.WorkUserIds.Split(',');
                        string[]   copyuserlist = high.CopyUserIds.Split(',');
                        DataTable  dutyuserDt   = new DataTable();
                        dutyuserDt = userservice.GetUserTable(workuserlist);
                        //推送给作业申请人
                        if (userEntity != null)
                        {
                            JPushApi.PushMessage(userEntity.Account, userEntity.RealName, "ZY020", "消防水使用许可申请已通过,请及时处理", Content, fireWaterEntity.Id);
                        }
                        DataTable copyuserdt = new DataTable();
                        copyuserdt = userservice.GetUserTable(copyuserlist);


                        //推送给作业负责人/作业人
                        if (dutyuserDt.Rows.Count > 0)
                        {
                            string Account  = "";
                            string RealName = "";
                            foreach (DataRow item in dutyuserDt.Rows)
                            {
                                Account  += item["account"].ToString() + ",";
                                RealName += item["realname"].ToString() + ",";
                            }
                            if (!string.IsNullOrEmpty(Account))
                            {
                                Account  = Account.Substring(0, Account.Length - 1);
                                RealName = RealName.Substring(0, RealName.Length - 1);
                            }
                            JPushApi.PushMessage(Account, RealName, "ZY020", "您有一条新的消防水使用作业任务,请及时处理", Content, fireWaterEntity.Id);
                        }
                        //推送给抄送人
                        if (copyuserdt.Rows.Count > 0)
                        {
                            string Account  = "";
                            string RealName = "";
                            foreach (DataRow item in copyuserdt.Rows)
                            {
                                Account  += item["account"].ToString() + ",";
                                RealName += item["realname"].ToString() + ",";
                            }
                            if (!string.IsNullOrEmpty(Account))
                            {
                                Account  = Account.Substring(0, Account.Length - 1);
                                RealName = RealName.Substring(0, RealName.Length - 1);
                            }
                            JPushApi.PushMessage(Account, RealName, "ZY020", "消防水使用许可申请审核已经通过,请知晓", Content, fireWaterEntity.Id);
                        }
                    }
                }
            }
            else
            {
                fireWaterEntity.FlowRemark       = "";
                fireWaterEntity.FlowDept         = " ";
                fireWaterEntity.FlowDeptName     = " ";
                fireWaterEntity.FlowRole         = " ";
                fireWaterEntity.FlowRoleName     = " ";
                fireWaterEntity.ApplyState       = "2";
                fireWaterEntity.FlowName         = "已完结";
                fireWaterEntity.InvestigateState = "3";
                fireWaterEntity.FlowId           = "";
                //审批不通过,推消息到申请人
                UserEntity userEntity = new UserService().GetEntity(fireWaterEntity.CreateUserId);
                if (userEntity != null)
                {
                    var high = GetEntity(fireWaterEntity.Id);
                    if (high != null)
                    {
                        string Content = "作业内容:" + high.WorkContent + "&#10;作业时间:" + high.WorkStartTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + " 到 " + high.WorkEndTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + "&#10;作业地点:" + high.WorkPlace;
                        JPushApi.PushMessage(userEntity.Account, userEntity.RealName, "ZY019", "消防水使用许可申请未通过,请及时处理", Content, fireWaterEntity.Id);
                    }
                }
            }
            this.service.UpdateForm(fireWaterEntity, auditEntity);
        }
        public ActionResult SubmitAccpAudit(string keyValue, SafetychangeEntity change, ScaffoldauditrecordEntity entity)
        {
            Operator currUser   = ERCHTMS.Code.OperatorProvider.Provider.Current();
            string   moduleName = string.Empty;

            if (change.WORKUNITTYPE == "0")
            {
                moduleName = "(内部)设施变动验收审核";
            }
            else
            {
                moduleName = "(外包)设施变动验收审核";
            }
            entity.FlowId = change.NodeId;
            ManyPowerCheckEntity mpcEntity = peoplereviewbll.CheckAuditForNextByWorkUnit(currUser, moduleName, change.WORKUNITID, change.NodeId, false);

            //同意进行下一步
            if (entity.AuditState == 0)
            {
                //下一步流程不为空
                if (null != mpcEntity)
                {
                    change.FLOWDEPT     = mpcEntity.CHECKDEPTID;
                    change.FLOWDEPTNAME = mpcEntity.CHECKDEPTNAME;
                    change.FLOWROLE     = mpcEntity.CHECKROLEID;
                    change.FLOWROLENAME = mpcEntity.CHECKROLENAME;
                    change.NodeId       = mpcEntity.ID;
                    change.NodeName     = mpcEntity.FLOWNAME;
                    change.ISCOMMIT     = 1;
                    change.ISACCPCOMMIT = 1;

                    change.FLOWREMARK = !string.IsNullOrEmpty(mpcEntity.REMARK) ? mpcEntity.REMARK : "";

                    string type = change.FLOWREMARK != "1" ? "0" : "1";
                    new ScaffoldBLL().SendMessage(change.FLOWDEPT, change.FLOWROLE, "ZY012", keyValue, "", "", type, !string.IsNullOrEmpty(change.ACCSPECIALTYTYPE) ? change.ACCSPECIALTYTYPE : "");
                }
                else
                {
                    change.FLOWREMARK   = "";
                    change.FLOWDEPT     = " ";
                    change.FLOWDEPTNAME = " ";
                    change.FLOWROLE     = " ";
                    change.FLOWROLENAME = " ";
                    //change.NodeId = " ";
                    change.NodeName     = "已完结";
                    change.ISAPPLYOVER  = 1;
                    change.ISCOMMIT     = 1;
                    change.ISACCPCOMMIT = 1;
                    change.ISACCEPOVER  = 1;
                }
            }
            else
            {
                change.FLOWREMARK   = "";
                change.FLOWDEPT     = " ";
                change.FLOWDEPTNAME = " ";
                change.FLOWROLE     = " ";
                change.FLOWROLENAME = " ";
                //change.NodeId = " ";
                change.NodeName     = "已完结";
                change.ISAPPLYOVER  = 1;
                change.ISCOMMIT     = 1;
                change.ISACCPCOMMIT = 1;
                change.ISACCEPOVER  = 2;

                //审批不通过,推消息到申请人
                var high = safetychangebll.GetEntity(keyValue);
                if (high != null)
                {
                    UserEntity userEntity = new UserBLL().GetEntity(high.CREATEUSERID);
                    if (userEntity != null)
                    {
                        JPushApi.PushMessage(userEntity.Account, userEntity.RealName, "ZY014", keyValue);
                    }
                }
            }
            safetychangebll.SaveForm(keyValue, change);
            entity.AuditSignImg = string.IsNullOrWhiteSpace(entity.AuditSignImg) ? "" : entity.AuditSignImg.ToString().Replace("../..", "");
            entity.ScaffoldId   = keyValue;
            scaffoldauditrecordbll.SaveForm(entity.Id, entity);
            return(Success("操作成功。"));
        }
Beispiel #6
0
 /// <summary>
 /// 确认,审核
 /// </summary>
 /// <param name="keyValue"></param>
 /// <param name="state"></param>
 /// <param name="recordData"></param>
 /// <param name="entity"></param>
 /// <param name="aentity"></param>
 public void SubmitCheckForm(string keyValue, string state, string recordData, HighRiskCommonApplyEntity entity, ScaffoldauditrecordEntity aentity)
 {
     try
     {
         PushMessageData pushdata = service.SubmitCheckForm(keyValue, state, recordData, entity, aentity);
         if (pushdata != null)
         {
             if (pushdata.Success == 1 && !string.IsNullOrEmpty(pushdata.SendCode))
             {
                 pushdata.Content = getName(entity.WorkType, "CommonType");
                 if (pushdata.SendCode == "ZY003")
                 {
                     pushdata.Content = "您提交的" + pushdata.Content + "申请未通过,请及时处理。";
                     var high = GetEntity(entity.Id);
                     if (high != null)
                     {
                         UserEntity userEntity = userservice.GetEntity(high.CreateUserId);
                         if (userEntity != null)
                         {
                             JPushApi.PushMessage(userEntity.Account, userEntity.RealName, pushdata.SendCode, "", pushdata.Content, pushdata.EntityId);
                         }
                     }
                 }
                 else if (pushdata.SendCode == "ZY018")
                 {
                     var high = GetEntity(entity.Id);
                     if (high != null)
                     {
                         String CommonType = pushdata.Content;
                         pushdata.Content = "作业内容:" + high.WorkContent + "&#10;作业时间:" + high.WorkStartTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + " 到 " + high.WorkEndTime.Value.ToString("yyyy年MM月dd日 HH时mm分") + "&#10;作业地点:" + high.WorkPlace;
                         UserEntity userEntity         = userservice.GetEntity(high.CreateUserId);
                         UserEntity tutelageuserEntity = userservice.GetEntity(high.WorkTutelageUserId);
                         string[]   workuserlist       = (high.WorkDutyUserId + "," + high.WorkUserIds).Split(',');
                         //List<string> b = workuserlist.ToList();
                         //b.Add(high.WorkDutyUserId);
                         //workuserlist = b.ToArray();
                         DataTable dutyuserDt = new DataTable();
                         dutyuserDt = userservice.GetUserTable(workuserlist);
                         //推送给作业申请人
                         if (userEntity != null)
                         {
                             JPushApi.PushMessage(userEntity.Account, userEntity.RealName, pushdata.SendCode, "高风险作业(" + CommonType + ")申请已通过,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                         //推送给作业负责人/作业人
                         if (dutyuserDt.Rows.Count > 0)
                         {
                             string Account  = "";
                             string RealName = "";
                             foreach (DataRow item in dutyuserDt.Rows)
                             {
                                 Account  += item["account"].ToString() + ",";
                                 RealName += item["realname"].ToString() + ",";
                             }
                             if (!string.IsNullOrEmpty(Account))
                             {
                                 Account  = Account.Substring(0, Account.Length - 1);
                                 RealName = RealName.Substring(0, RealName.Length - 1);
                             }
                             JPushApi.PushMessage(Account, RealName, pushdata.SendCode, "您有一条新的高风险作业(" + CommonType + ")任务,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                         //推送给作业监护人
                         if (tutelageuserEntity != null)
                         {
                             JPushApi.PushMessage(tutelageuserEntity.Account, tutelageuserEntity.RealName, pushdata.SendCode, "您有一条新的高风险作业(" + CommonType + ")监护任务,请及时处理。", pushdata.Content, pushdata.EntityId);
                         }
                     }
                 }
                 else
                 {
                     //极光推送
                     PushMessageForCommon(pushdata);
                 }
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }