Exemple #1
0
        public void UpdateCitizenProcess(yh_yhtasks model)
        {
            using (Entities db = new Entities())
            {
                yh_yhtasks yhmodel = db.yh_yhtasks.FirstOrDefault(a => a.yhtaskid == model.yhtaskid);

                if (yhmodel != null)
                {
                    yhmodel.pqrid = model.pqrid;
                    db.SaveChanges();
                }
            }
        }
Exemple #2
0
        public HttpResponseMessage AddYhTask(YH_YhtaskModel model)
        {
            string[]         fileClass = model.uploadpanelValue;
            List <FileClass> list      = new List <FileClass>();

            if (fileClass != null && fileClass.Length > 0)
            {
                foreach (var item in fileClass)
                {
                    FileClass file = new FileClass();
                    JObject   jo   = new JObject();
                    jo = (JObject)JsonConvert.DeserializeObject(item);
                    file.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                    file.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                    file.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                    file.size         = jo["size"] == null ? 0 : (double)jo["size"];
                    list.Add(file);
                }
            }


            yh_yhtasks yhmodel = new yh_yhtasks();

            yhmodel.yhcompany    = model.yhcompany;
            yhmodel.foundtime    = model.foundtime;
            yhmodel.fileename    = model.fileename;
            yhmodel.wtsource     = model.wtsource;
            yhmodel.yhtype       = model.yhtype;
            yhmodel.wtbigclass   = model.wtbigclass;
            yhmodel.wtsmallclass = model.wtsmallclass;
            yhmodel.yhobject     = model.yhobject;
            yhmodel.weather      = model.weather;
            yhmodel.duetime      = model.duetime;
            yhmodel.outlay       = model.outlay;
            yhmodel.workload     = model.workload;
            yhmodel.yhcontract   = model.yhcontract;
            yhmodel.wtaddress    = model.wtaddress;
            yhmodel.wtdescribe   = model.wtdescribe;
            yhmodel.geography84  = model.geography84;
            //if (!string.IsNullOrEmpty(model.geography84))
            //{
            //    yhmodel.geography2000=new MapXYConvent().WGS84ToCGCS2000(model.geography84);
            //}
            yhmodel.wtnature     = model.wtnature;
            yhmodel.points       = model.points;
            yhmodel.debit        = model.debit;
            yhmodel.sendusername = model.sendusername;
            yhmodel.sendopinion  = model.sendopinion;
            yhmodel.createuserid = model.createuserid;
            WorkFlowClass wf = new WorkFlowClass();

            wf.FunctionName   = "yh_yhtasks";                  //市民事件表名
            wf.WFID           = "2017040610490001";            //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = "2017040610570001";            //工作流详细编号 2017021410240001 上报事件
            wf.NextWFDID      = "2017040610570002";            //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = model.createuserid.ToString(); //下一步流程ID
            wf.IsSendMsg      = "false";                       //是否发送短信
            wf.WFCreateUserID = model.createuserid;            //当前流程创建人
            wf.files          = list;
            WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
            string             wf_id = wfbll.WF_Submit(wf, yhmodel);

            #region 添加日志
            SystemLogBLL slbll = new SystemLogBLL();
            slbll.WriteSystemLog("养护问题", "", (int)model.createuserid);
            #endregion

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
            response.Content = new StringContent("{\"success\":true}", Encoding.GetEncoding("UTF-8"), "text/html");
            return(response);
        }
Exemple #3
0
        public object YHTaskFlowLink(YHDealWithLinkModel scmodel)
        {
            try
            {
                yh_yhtasks model = new yh_yhtasks();

                #region 图片处理
                List <FileClass> List_FC   = new List <FileClass>();
                string[]         fileClass = scmodel.uploadpanelValue;
                if (fileClass != null && fileClass.Length > 0)
                {
                    foreach (var item in fileClass)
                    {
                        FileClass infileClass = new FileClass();
                        JObject   jo          = new JObject();
                        jo = (JObject)JsonConvert.DeserializeObject(item);
                        infileClass.OriginalPath = jo["OriginalPath"] == null ? "" : jo["OriginalPath"].ToString();
                        infileClass.OriginalName = jo["OriginalName"] == null ? "" : jo["OriginalName"].ToString();
                        infileClass.OriginalType = jo["OriginalType"] == null ? "" : jo["OriginalType"].ToString();
                        infileClass.size         = jo["size"] == null ? 0 : (double)jo["size"];
                        List_FC.Add(infileClass);
                    }
                }
                #endregion
                if (scmodel.wfdid == "2017040610570002")
                {
                    model.pqrid = scmodel.wfcreateuserid;
                }

                WorkFlowManagerBLL bll     = new WorkFlowManagerBLL();
                SMS_Messages       sm      = new SMS_Messages();
                UserBLL            userbll = new UserBLL();
                if (scmodel.nextwfuserids == "0")//回退
                {
                    WF_WorkFlowLinkOld oldmodel = bll.GetOldLink(scmodel.wfsid, scmodel.nextwfdid);
                    if (oldmodel != null)
                    {
                        scmodel.nextwfuserids = oldmodel.dealuserid.ToString();
                    }
                }
                if (scmodel.nextwfuserids == "-1")//无派遣
                {
                    scmodel.nextwfuserids = "";
                    //获取市容环卫科人员ID
                    foreach (UserModel item in userbll.GetUsersStaff(8))
                    {
                        scmodel.nextwfuserids += item.ID + ",";
                    }
                    scmodel.nextwfuserids = "," + scmodel.nextwfuserids;
                }
                #region 发送短信
                //if (!string.IsNullOrEmpty(scmodel.mobile))
                //{
                //    sm.SendMessage(scmodel.mobile);
                //}
                #endregion



                WorkFlowClass wf = new WorkFlowClass();

                #region 事件流程
                wf.FunctionName   = "yh_yhtasks";          //市民事件表名
                wf.WFID           = "2017040610490001";    //工作流程编号 2017021409560001 事件流程
                wf.WFDID          = scmodel.wfdid;         //工作流详细编号 2017021410240003 事件处理
                wf.NextWFDID      = scmodel.nextwfdid;     //下一步流程编号 2017021410240004 中队长审核
                wf.NextWFUSERIDS  = scmodel.nextwfuserids; //下一步流程用户ID
                wf.WFSAID         = scmodel.wfsaid;
                wf.WFSID          = scmodel.wfsid;
                wf.DEALCONTENT    = scmodel.dealcontent;
                wf.IsSendMsg      = "false";                //是否发送短信
                wf.WFCreateUserID = scmodel.wfcreateuserid; //当前流程创建人
                wf.files          = List_FC;
                #endregion

                bll.WF_Submit(wf, model);
                return(new
                {
                    msg = "上报成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
            }
        }
Exemple #4
0
        public object AddYhTaskApi(YH_YhtaskModel model)
        {
            #region 图片处理
            List <FileClass> List_FC    = new List <FileClass>();
            string           OriginPath = ConfigManageClass.YhTaskOriginalPath;
            string           smallPath  = ConfigManageClass.YhTaskFilesPath;

            for (int i = 0; i < model.uploadpanelValue.Length; i++)
            {
                string   imgArray = model.uploadpanelValue[i];
                string[] spilt    = imgArray.Split(',');
                if (spilt.Length > 0)
                {
                    byte[]    imgByte = Convert.FromBase64String(spilt[1]);
                    FileClass imgFile = FileFactory.FileUpload(imgByte, ".jpg", OriginPath, smallPath, 100, 100);
                    List_FC.Add(imgFile);
                }
            }

            #endregion

            yh_yhtasks yhmodel = new yh_yhtasks();
            yhmodel.yhcompany    = model.yhcompany;
            yhmodel.foundtime    = model.foundtime;
            yhmodel.fileename    = model.fileename;
            yhmodel.wtsource     = model.wtsource;
            yhmodel.yhtype       = model.yhtype;
            yhmodel.wtbigclass   = model.wtbigclass;
            yhmodel.wtsmallclass = model.wtsmallclass;
            yhmodel.yhobject     = model.yhobject;
            yhmodel.weather      = model.weather;
            yhmodel.duetime      = model.duetime;
            yhmodel.outlay       = model.outlay;
            yhmodel.workload     = model.workload;
            yhmodel.yhcontract   = model.yhcontract;
            yhmodel.wtaddress    = model.wtaddress;
            yhmodel.wtdescribe   = model.wtdescribe;
            yhmodel.geography84  = model.geography84;
            yhmodel.wtnature     = model.wtnature;
            yhmodel.points       = model.points;
            yhmodel.debit        = model.debit;
            yhmodel.sendusername = model.sendusername;
            yhmodel.sendopinion  = model.sendopinion;
            yhmodel.createuserid = model.createuserid;
            WorkFlowClass wf = new WorkFlowClass();

            wf.FunctionName   = "yh_yhtasks";                  //市民事件表名
            wf.WFID           = "2017040610490001";            //工作流程编号 2017021409560001 事件流程
            wf.WFDID          = "2017040610570001";            //工作流详细编号 2017021410240001 上报事件
            wf.NextWFDID      = "2017040610570003";            //下一步流程编号 2017021410240002 事件派遣
            wf.NextWFUSERIDS  = model.createuserid.ToString(); //下一步流程ID
            wf.IsSendMsg      = "false";                       //是否发送短信
            wf.WFCreateUserID = model.createuserid;            //当前流程创建人
            wf.files          = List_FC;

            try
            {
                WorkFlowManagerBLL wfbll = new WorkFlowManagerBLL();
                string             wf_id = wfbll.WF_Submit(wf, yhmodel);
                return(new
                {
                    msg = "上报成功",
                    resCode = 1
                });
            }
            catch (Exception)
            {
                return(new
                {
                    msg = "json数据不正确",
                    resCode = 0
                });
                // return "{\"msg\":\"json数据不正确\",\"resCode\":\"0\"}";
            }
        }
Exemple #5
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);
        }