Ejemplo n.º 1
0
        /// <summary>
        /// 专项整治逻辑处理
        /// </summary>
        /// <param name="WFSNAME">流程详细名称</param>
        /// <param name="WFSID">流程详细ID</param>
        /// <param name="smsj">要处理的表(smsj)</param>
        /// <returns></returns>
        public string function_specialtasks(out string WFSNAME, string WFSID, zxzz_tasks zxzzmodel)
        {
            Entities             dbsmsj        = new Entities();
            zxzz_tasks           zxzztaskmodel = null;
            string               INDID         = string.Empty;
            wf_workflowspecifics wfsmodel      = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);

            if (wfsmodel != null && !string.IsNullOrEmpty(wfsmodel.tablenameid))
            {
                zxzztaskmodel = dbsmsj.zxzz_tasks.SingleOrDefault(t => t.taskid == wfsmodel.tablenameid);

                if (zxzztaskmodel == null)
                {
                    zxzztaskmodel = new zxzz_tasks();
                    INDID         = GetNewId();
                }
                else
                {
                    zxzztaskmodel.summarytime   = zxzzmodel.summarytime;
                    zxzztaskmodel.summaryuserid = zxzzmodel.summaryuserid;
                    zxzztaskmodel.summary       = zxzzmodel.summary;
                    zxzztaskmodel.results       = zxzzmodel.results;
                    zxzztaskmodel.experiences   = zxzzmodel.experiences;

                    new Zxzz_SpecialTaskDAL().UpdateSpecailTask(zxzztaskmodel);
                }
            }
            else
            {
                zxzztaskmodel = new zxzz_tasks();
                INDID         = GetNewId();
            }

            if (!string.IsNullOrEmpty(INDID))//说明不存在
            {
                zxzztaskmodel.taskid       = INDID;
                zxzztaskmodel.title        = zxzzmodel.title;
                zxzztaskmodel.tasktype     = zxzzmodel.tasktype;
                zxzztaskmodel.level        = zxzzmodel.level;
                zxzztaskmodel.term         = zxzzmodel.term;
                zxzztaskmodel.starttime    = zxzzmodel.starttime;
                zxzztaskmodel.endtime      = zxzzmodel.endtime;
                zxzztaskmodel.region       = zxzzmodel.region;
                zxzztaskmodel.taskexplain  = zxzzmodel.taskexplain;
                zxzztaskmodel.grometry     = zxzzmodel.grometry;
                zxzztaskmodel.fqr          = zxzzmodel.fqr;
                zxzztaskmodel.fqtime       = zxzzmodel.fqtime;
                zxzztaskmodel.xdzd         = zxzzmodel.xdzd;
                zxzztaskmodel.leader       = zxzzmodel.leader;
                zxzztaskmodel.createuserid = zxzzmodel.createuserid;
                zxzztaskmodel.createtime   = DateTime.Now;
            }
            if (!string.IsNullOrEmpty(INDID))
            {
                //添加
                dbsmsj.zxzz_tasks.Add(zxzztaskmodel);
                dbsmsj.SaveChanges();
            }

            if (string.IsNullOrEmpty(INDID))
            {
                INDID = zxzztaskmodel.taskid;
            }

            WFSNAME = zxzzmodel.title;
            return(INDID);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 协同管理执法的逻辑处理
        /// </summary>
        /// <param name="WFSNAME">流程详细名称</param>
        /// <param name="WFSID">流程详细ID</param>
        /// <param name="smsj">要处理的表(smsj)</param>
        /// <returns></returns>
        public string function_citizenservices(out string WFSNAME, string WFSID, sm_citizenservices smsj)
        {
            Entities             dbsmsj = new Entities();
            sm_citizenservices   citizenservicesmodel = null;
            string               INDID    = string.Empty;
            wf_workflowspecifics wfsmodel = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);

            if (wfsmodel != null && !string.IsNullOrEmpty(wfsmodel.tablenameid))
            {
                citizenservicesmodel = dbsmsj.sm_citizenservices.SingleOrDefault(t => t.citizenid == wfsmodel.tablenameid);

                if (citizenservicesmodel == null)
                {
                    citizenservicesmodel = new sm_citizenservices();
                    INDID = GetNewId();
                }
                if (!string.IsNullOrEmpty(smsj.processmode) || !string.IsNullOrEmpty(smsj.satisfaction))
                {
                    citizenservicesmodel.processmode  = smsj.processmode;
                    citizenservicesmodel.satisfaction = smsj.satisfaction;
                    new SM_CitizenServicesDAL().UpdateCitizen(citizenservicesmodel);
                }
                if (smsj.processuserid != null)
                {
                    citizenservicesmodel.processuserid = smsj.processuserid;
                    new SM_CitizenServicesDAL().UpdateCitizenProcess(citizenservicesmodel);
                }
                if (smsj.officeuserid != null)
                {
                    citizenservicesmodel.officeuserid = smsj.officeuserid;
                    new SM_CitizenServicesDAL().UpdateCitizenOffice(citizenservicesmodel);
                }
                if (!string.IsNullOrEmpty(smsj.workflowtype))
                {
                    citizenservicesmodel.workflowtype = smsj.workflowtype;
                    new SM_CitizenServicesDAL().UpdateCitizenOffice(citizenservicesmodel);
                }
                if (!string.IsNullOrEmpty(smsj.suggest))
                {
                    citizenservicesmodel.suggest = smsj.suggest;
                    new SM_CitizenServicesDAL().UpdateCitizenOffice(citizenservicesmodel);
                }
                if (smsj.gdsj != null)
                {
                    citizenservicesmodel.gdsj = smsj.gdsj;
                    new SM_CitizenServicesDAL().UpdateCitizengdsj(citizenservicesmodel);
                }
                if (!string.IsNullOrEmpty(smsj.pqxzid))
                {
                    citizenservicesmodel.pqxzid = smsj.pqxzid;
                    new SM_CitizenServicesDAL().UpdateCitizenpqxz(citizenservicesmodel);
                }
            }
            else
            {
                citizenservicesmodel = new sm_citizenservices();
                INDID = GetNewId();
            }

            if (!string.IsNullOrEmpty(INDID))//说明不存在
            {
                citizenservicesmodel.citizenid      = INDID;
                citizenservicesmodel.sourceid       = smsj.sourceid;
                citizenservicesmodel.dutytime       = smsj.dutytime;
                citizenservicesmodel.eventid        = smsj.eventid;
                citizenservicesmodel.complainant    = smsj.complainant;
                citizenservicesmodel.cnumber        = smsj.cnumber;
                citizenservicesmodel.foundtime      = smsj.foundtime;
                citizenservicesmodel.contactphone   = smsj.contactphone;
                citizenservicesmodel.contactaddress = smsj.contactaddress;
                citizenservicesmodel.eventaddress   = smsj.eventaddress;
                citizenservicesmodel.eventtitle     = smsj.eventtitle;
                citizenservicesmodel.eventcontent   = smsj.eventcontent;
                citizenservicesmodel.bigtypeid      = smsj.bigtypeid;
                citizenservicesmodel.smalltypeid    = smsj.smalltypeid;
                citizenservicesmodel.limittime      = smsj.limittime;
                citizenservicesmodel.recorduser     = smsj.recorduser;
                citizenservicesmodel.grometry       = smsj.grometry;
                citizenservicesmodel.createtime     = smsj.createtime;
                citizenservicesmodel.createuserid   = smsj.createuserid;
                citizenservicesmodel.sfzxzz         = smsj.sfzxzz;
                citizenservicesmodel.srid           = smsj.srid;
                citizenservicesmodel.processmode    = smsj.processmode;
                citizenservicesmodel.satisfaction   = smsj.satisfaction;
                citizenservicesmodel.processuserid  = smsj.processuserid;
                citizenservicesmodel.gdsj           = smsj.gdsj;
                citizenservicesmodel.workflowtype   = smsj.workflowtype;
                citizenservicesmodel.suggest        = smsj.suggest;
                citizenservicesmodel.xzid           = smsj.xzid;
                citizenservicesmodel.pqxzid         = smsj.pqxzid;
            }
            if (!string.IsNullOrEmpty(INDID))
            {
                //添加
                dbsmsj.sm_citizenservices.Add(citizenservicesmodel);
                dbsmsj.SaveChanges();
            }
            //else
            //{
            //    //更新
            //    sm_citizenservices smsjmodel = dbsmsj.sm_citizenservices.SingleOrDefault(a => a.citizenid == wfsmodel.tablenameid);
            //    if (smsjmodel != null)
            //    {
            //        smsjmodel.sourceid = smsj.sourceid;
            //        smsjmodel.dutytime = smsj.dutytime;
            //        smsjmodel.eventid = smsj.eventid;
            //        smsjmodel.complainant = smsj.complainant;
            //        smsjmodel.cnumber = smsj.cnumber;
            //        smsjmodel.foundtime = smsj.foundtime;
            //        smsjmodel.contactphone = smsj.contactphone;
            //        smsjmodel.contactaddress = smsj.contactaddress;
            //        smsjmodel.eventaddress = smsj.eventaddress;
            //        smsjmodel.eventtitle = smsj.eventtitle;
            //        smsjmodel.eventcontent = smsj.eventcontent;
            //        smsjmodel.bigtypeid = smsj.bigtypeid;
            //        smsjmodel.smalltypeid = smsj.smalltypeid;
            //        smsjmodel.limittime = smsj.limittime;
            //        smsjmodel.recorduser = smsj.recorduser;
            //        smsjmodel.grometry = smsj.grometry;
            //        smsjmodel.createtime = smsj.createtime;
            //        smsjmodel.createuserid = smsj.createuserid;
            //        smsjmodel.sfzxzz = smsj.sfzxzz;
            //        smsjmodel.srid = smsj.srid;
            //        smsjmodel.processmode = smsj.processmode;
            //        smsjmodel.satisfaction = smsj.satisfaction;
            //        smsjmodel.processuserid = smsj.processuserid;
            //        smsjmodel.gdsj = smsj.gdsj;
            //        dbsmsj.SaveChanges();
            //    }
            //}


            if (string.IsNullOrEmpty(INDID))
            {
                INDID = citizenservicesmodel.citizenid;
            }

            WFSNAME = smsj.eventtitle;
            return(INDID);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 养护任务逻辑处理
        /// </summary>
        /// <param name="WFSNAME">流程详细名称</param>
        /// <param name="WFSID">流程详细ID</param>
        /// <param name="smsj">要处理的表(smsj)</param>
        /// <returns></returns>
        public string function_yhtasks(out string WFSNAME, string WFSID, yh_yhtasks yhmodel)
        {
            Entities             dbsmsj       = new Entities();
            yh_yhtasks           yhtasksmodel = null;
            string               INDID        = string.Empty;
            wf_workflowspecifics wfsmodel     = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);

            if (wfsmodel != null && !string.IsNullOrEmpty(wfsmodel.tablenameid))
            {
                yhtasksmodel = dbsmsj.yh_yhtasks.SingleOrDefault(t => t.yhtaskid == wfsmodel.tablenameid);

                if (yhtasksmodel == null)
                {
                    yhtasksmodel = new yh_yhtasks();
                    INDID        = GetNewId();
                }
                //if (!string.IsNullOrEmpty(smsj.processmode) || !string.IsNullOrEmpty(smsj.satisfaction))
                //{
                //    citizenservicesmodel.processmode = smsj.processmode;
                //    citizenservicesmodel.satisfaction = smsj.satisfaction;
                //    new SM_CitizenServicesDAL().UpdateCitizen(citizenservicesmodel);
                //}
                if (yhmodel.pqrid != null)
                {
                    yhtasksmodel.pqrid = yhmodel.pqrid;
                    new YH_YhTaskDAL().UpdateCitizenProcess(yhtasksmodel);
                }
                //if (smsj.officeuserid!=null)
                //{
                //     citizenservicesmodel.officeuserid = smsj.officeuserid;
                //     new SM_CitizenServicesDAL().UpdateCitizenOffice(citizenservicesmodel);
                //}
            }
            else
            {
                yhtasksmodel = new yh_yhtasks();
                INDID        = GetNewId();
            }

            if (!string.IsNullOrEmpty(INDID))//说明不存在
            {
                yhtasksmodel.yhtaskid     = INDID;
                yhtasksmodel.yhcompany    = yhmodel.yhcompany;
                yhtasksmodel.foundtime    = yhmodel.foundtime;
                yhtasksmodel.fileename    = yhmodel.fileename;
                yhtasksmodel.wtsource     = yhmodel.wtsource;
                yhtasksmodel.yhtype       = yhmodel.yhtype;
                yhtasksmodel.wtbigclass   = yhmodel.wtbigclass;
                yhtasksmodel.wtsmallclass = yhmodel.wtsmallclass;
                yhtasksmodel.yhobject     = yhmodel.yhobject;
                yhtasksmodel.weather      = yhmodel.weather;
                yhtasksmodel.duetime      = yhmodel.duetime;
                yhtasksmodel.outlay       = yhmodel.outlay;
                yhtasksmodel.workload     = yhmodel.workload;
                yhtasksmodel.yhcontract   = yhmodel.yhcontract;
                yhtasksmodel.wtaddress    = yhmodel.wtaddress;
                yhtasksmodel.wtdescribe   = yhmodel.wtdescribe;
                yhtasksmodel.geography84  = yhmodel.geography84;

                yhtasksmodel.geography2000 = yhmodel.geography2000;
                yhtasksmodel.wtnature      = yhmodel.wtnature;
                yhtasksmodel.points        = yhmodel.points;
                yhtasksmodel.debit         = yhmodel.debit;
                yhtasksmodel.sendusername  = yhmodel.sendusername;
                yhtasksmodel.outlay        = yhmodel.outlay;
                yhtasksmodel.sendopinion   = yhmodel.sendopinion;
                yhtasksmodel.createtime    = DateTime.Now;
                yhtasksmodel.createuserid  = yhmodel.createuserid;
            }
            if (!string.IsNullOrEmpty(INDID))
            {
                //添加
                dbsmsj.yh_yhtasks.Add(yhtasksmodel);
                dbsmsj.SaveChanges();
            }

            if (string.IsNullOrEmpty(INDID))
            {
                INDID = yhtasksmodel.yhtaskid;
            }

            WFSNAME = yhmodel.yhobject;
            return(INDID);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 流程提交
        /// </summary>
        /// <param name="workflow">流程实例模型</param>
        /// <param name="TableModel">具体表模型</param>
        /// <returns></returns>
        public string WF_Submit(WorkFlowClass workflow, object TableModel)
        {
            #region 获取数据
            string tableName     = workflow.FunctionName;  //获取表名
            string WFID          = workflow.WFID;          //工作流编号
            string WFDID         = workflow.WFDID;         //工作流环节编号
            string WFSID         = workflow.WFSID;         //活动实例编号
            string WFSAID        = workflow.WFSAID;        //当前环节实例编号
            string dealContent   = workflow.DEALCONTENT;   //会签意见
            string NextWFDID     = workflow.NextWFDID;     //下一个环节编号
            string NextWFUSERIDS = workflow.NextWFUSERIDS; //获取下一个环节的用户
            string IsSendMsg     = workflow.IsSendMsg;     //是否发送短信
            string Remark        = workflow.Remark;
            string processmode   = workflow.processmode;
            string satisfaction  = workflow.satisfaction;
            #endregion

            #region 增加/修改 对应的流程
            string TABLENAMEID = string.Empty; //对应表数据编号
            string WFSNAME     = string.Empty; //活动流程名称
            switch (workflow.FunctionName)
            {
            case "sm_citizenservices":    //市民服务基础表
                TABLENAMEID = function_citizenservices(out WFSNAME, workflow.WFSID, (sm_citizenservices)TableModel);
                break;

            case "yh_yhtasks":    //养护任务基础表
                TABLENAMEID = function_yhtasks(out WFSNAME, workflow.WFSID, (yh_yhtasks)TableModel);
                break;

            case "zxzz_tasks":    //专项整治基础表
                TABLENAMEID = function_specialtasks(out WFSNAME, workflow.WFSID, (zxzz_tasks)TableModel);
                break;

            case "audit_project_w":    //行政审批基础表
                TABLENAMEID = workflow.syncrowguid;
                break;

            default:
                break;
            }
            #endregion

            #region 检查是否存在当前实例,如果不存在则增加当前活动实例

            wf_workflowspecifics WFSModel = null;
            if (!string.IsNullOrEmpty(workflow.WFSID))
            {
                WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(workflow.WFSID);
                if (WFSModel == null)
                {
                    WFSID = "";
                }
                else
                {
                    WFSModel.wfsname = WFSNAME;
                    new WF_WorkFlowSpecificDAL().Update(WFSModel);
                }
            }

            if (string.IsNullOrEmpty(WFSID))
            {
                WFSModel              = new wf_workflowspecifics();
                WFSModel.wfsid        = GetNewId();
                WFSModel.wfid         = WFID;
                WFSModel.tablename    = tableName;
                WFSModel.createuserid = workflow.WFCreateUserID;
                WFSModel.createtime   = DateTime.Now;
                WFSModel.status       = 1;
                WFSModel.tablenameid  = TABLENAMEID;
                WFSModel.wfsname      = WFSNAME;
                new WF_WorkFlowSpecificDAL().Add(WFSModel);
                WFSID = WFSModel.wfsid;
            }
            #endregion

            #region 增加活动实例具体的流程

            #region 更新当前环节
            decimal oldStatus;//当前环节是否已经处理完成 1:未处理,2已经处理
            //更新或者增加当前流程的具体事例---返回当前环节编号
            WFSAID = function_WF_DealCurentActivity(WFSAID, WFSID, workflow.WFCreateUserID.Value, 2, WFDID, out oldStatus);
            //更新或者增加当前环节用户处理的意见---返回当前环节用户需要处理的编号
            string WFSUID = function_WF_DealCurentActivityUser(WFSAID, workflow.WFCreateUserID.Value, dealContent, 2, DateTime.Now, "false", WFSNAME, workflow.WFCreateUserID.Value, Remark, processmode, satisfaction);
            //增加当前处理用户的附件
            switch (workflow.FunctionName)
            {
            case "sm_citizenservices":    //市民服务
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "yh_yhtasks":    //养护任务
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "zxzz_tasks":    //专项整治
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            case "audit_project_w":    //行政审批基础表
                function_WF_WorkFlowAttrach_smsj(WFSUID, workflow.files, workflow.FileSource);
                break;

            default:
                break;
            }

            #endregion
            //当前状态为处理,则说明是第一个人处理,则需要增加下一个环节,如果当前环节已经处理,则不需要增加下一个环节
            string NextWFSAID = "";
            if (oldStatus == 1)
            {
                //获取该环节是否为最后一个环节
                wf_workflowdetails wfdModel = new WF_WorkFlowDetailDAL().GetSingle(NextWFDID);
                //如果下一个环节的子环节存在,则状态为执行中,内容为空,否则下一个环节状态为结束,内容为已结束
                int    status_wfsa  = 0;
                string content_wfsa = string.Empty;
                if (wfdModel != null && !string.IsNullOrEmpty(wfdModel.nextid))
                {
                    status_wfsa  = 1;
                    content_wfsa = "";
                }
                else
                {
                    //结束该流程
                    WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);
                    if (WFSModel != null)
                    {
                        WFSModel.status = 2;
                        new WF_WorkFlowSpecificDAL().Update(WFSModel);
                    }
                    status_wfsa  = 2;
                    content_wfsa = "已结束";
                }

                #region 增加下一个环节

                //增加环节
                NextWFSAID = function_WF_DealCurentActivity("", WFSID, workflow.WFCreateUserID.Value, status_wfsa, NextWFDID, out oldStatus);

                #region 更新活动实例的当前环节编号
                WFSModel = new WF_WorkFlowSpecificDAL().GetSingle(WFSID);
                if (WFSModel != null)
                {
                    WFSModel.currentwfsaid = NextWFSAID;
                    WFSModel.status        = status_wfsa;
                    new WF_WorkFlowSpecificDAL().Update(WFSModel);
                }
                #endregion

                //增加下一个环节的能操作的用户
                if (!string.IsNullOrEmpty(NextWFUSERIDS))
                {
                    string[] NextWFUSERIDS_split = NextWFUSERIDS.Split(',');
                    foreach (var item in NextWFUSERIDS_split)
                    {
                        decimal  userid;
                        DateTime?dealTime = null;
                        if (decimal.TryParse(item, out userid))
                        {
                            if (status_wfsa == 2)
                            {
                                userid    = workflow.WFCreateUserID.Value;
                                dealTime  = DateTime.Now;
                                IsSendMsg = "false";
                            }
                            //增加流程能操作的用户
                            function_WF_DealCurentActivityUser(NextWFSAID, (int)userid, content_wfsa, status_wfsa, dealTime, IsSendMsg, WFSNAME, workflow.WFCreateUserID, Remark, processmode, satisfaction);
                        }
                    }
                }

                #endregion
            }
            #endregion
            return(WFSID + "," + NextWFSAID + "," + TABLENAMEID);
        }