Example #1
0
        /// <summary>
        /// //projclass = 3时进行的归档操作,执行落数程序
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_facterid"></param>
        /// <param name="ds_facter"></param>
        /// <param name="str_txt_bak_message"></param>
        /// <param name="clientInf"></param>
        /// <returns></returns>
        public string set_complete(string sys_ids, string str_facterid, DataSet ds_facter, string str_txt_bak_message, string clientInf)
        {
            /*
             * all_result返回参数的整理:
             * 1、"{\"result\":\"true\",\"message\":\"\"}"----》第二次点击落地按钮,(理论上不应该出现这个情况,有可能是第一次操作时整个操作流程没有完成,所以造成用户可以点击这个按钮,所以此处的操作仅实现状态修改,返回值为true)
             * 2、"{\"result\":\"submit\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,shpid|path
             * 3、"{\"result\":\"false\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,异常信息。
             * 4、"{\"result\":\"submitqueue\",\"message\":\"\"}"----》成功加入队列
             *
             */
            IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf);
            string userid   = clientInfoDic["userid"];
            string username = clientInfoDic["username"];


            string all_result = "";

            string[] sys_idss = sys_ids.Split(',');
            for (int i = 0; i < sys_idss.Length; i++)
            {
                try
                {
                    _model_tbl_maintable = _idal_itbl_maintable.GetList(" sys_id='" + sys_idss[i].ToString() + "'", "", "*", "", "", null)[0];


                    if (all_result == "")
                    {
                        string result = "";
                        string sql    = "";
                        _t = commonclass.CreateIAccessDataTrans();
                        _t.getTrans().begin();

                        #region businesscode
                        //businesscode
                        //在此处添加针对projclassid = 3的业务代码
                        //更改水表表,客户表的状态 (多个客户)
                        //置空客户表的f_value1,f_value2状态
                        //更新本表的状态
                        model_tbl_ld_xhhbt = idal_tbl_ld_xhhbt.GetList(" fk_tbl_maintable_sys_id='" + sys_idss[i].ToString() + "'", "", "*", "", "", null)[0];

                        IList <sara.dd.ldsw.model.tbl_ld_xhhbtzb> model_tbl_ld_xhhbtzb = idal_tbl_ld_xhhbtzb.GetList(" fk_tbl_ld_xhhbt_sys_id='" + model_tbl_ld_xhhbt.sys_id + "'", "", "*", "", "", null);

                        foreach (sara.dd.ldsw.model.tbl_ld_xhhbtzb model in model_tbl_ld_xhhbtzb)
                        {
                            sql = " update tbl_ld_khb set f_zt = '停用' , f_ztid ='9',f_value1='',f_value2='' where sys_id ='" + model.f_khbhid + "'";
                            _t.ExecuteSql(sql);

                            //在客户表中加日志
                            model_tbl_ld_khb = idal_tbl_ld_khb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            List <IDictionary <string, string> > array = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_khb.f_zt != "停用")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_khb.f_zt);
                                temp.Add("newvalue", "停用");
                                temp.Add("name", "状态");
                                array.Add(temp);
                            }

                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", model_tbl_ld_khb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户报停", array, clientInf, _t);

                            sql = " update tbl_ld_sbb set f_zt = '停用' , f_ztid ='9' where f_khbh ='" + model.f_khbh + "'";
                            _t.ExecuteSql(sql);


                            //在水表表中加日志
                            model_tbl_ld_sbb = idal_tbl_ld_sbb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            List <IDictionary <string, string> > array1 = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_sbb.f_zt != "停用")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_sbb.f_zt);
                                temp.Add("newvalue", "停用");
                                temp.Add("name", "状态");
                                array1.Add(temp);
                            }

                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_sbb", model_tbl_ld_sbb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户报停", array1, clientInf, _t);

                            //更新用户表的状态为停用
                            sql = " update tbl_ld_yhb set f_zt = '停用' , f_ztid ='9' where f_khbh ='" + model.f_khbh + "'";
                            _t.ExecuteSql(sql);


                            //在用户表中加日志
                            model_tbl_ld_yhb = idal_tbl_ld_yhb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            List <IDictionary <string, string> > array2 = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_yhb.f_zt != "停用")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_yhb.f_zt);
                                temp.Add("newvalue", "停用");
                                temp.Add("name", "状态");
                                array2.Add(temp);
                            }
                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_yhb", model_tbl_ld_yhb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户报停", array2, clientInf, _t);

                            sql = " update tbl_ld_xhhbt set f_zt = '归档' , f_ztid ='2',f_czr='" + username + "',f_czrid='" + userid + "',f_czsj=to_date('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd hh24:mi:ss') where sys_id ='" + model_tbl_ld_xhhbt.sys_id + "'";
                            _t.ExecuteSql(sql);
                        }


                        #endregion

                        //调整数据状态

                        NameValueCollection nvc_maintableparameters = new NameValueCollection();
                        nvc_maintableparameters.Add("sys_processnextuser", "^nextuser");
                        nvc_maintableparameters.Add("fk_tbl_maintable_sys_id", "^null");
                        nvc_maintableparameters.Add("fk_workflow_sys_id", "^null");
                        result = _hic.NextStateItemNew(sys_idss[i].ToString(), nvc_maintableparameters, str_facterid, ds_facter, str_txt_bak_message, "", "", clientInf, _t);


                        if (result == "")
                        {
                            _t.getTrans().commit();
                        }
                        else
                        {
                            _t.getTrans().rollback();
                            all_result = "{\"result\":\"false\",\"message\":\"" + result + "\"}";
                        }
                    }
                }
                catch (Exception ex)
                {
                    all_result = "{\"result\":\"false\",\"message\":\"" + ex.Message + "\"}";
                }
            }
            if (all_result == "")
            {
                // all_result = "{\"result\":\"true\",\"message\":\"\"}";
            }
            return(all_result);
        }
Example #2
0
        /// <summary>
        /// //projclass = 3时进行的归档操作,执行落数程序
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_facterid"></param>
        /// <param name="ds_facter"></param>
        /// <param name="str_txt_bak_message"></param>
        /// <param name="clientInf"></param>
        /// <returns></returns>
        public string set_complete(string sys_ids, string str_facterid, DataSet ds_facter, string str_txt_bak_message, string clientInf)
        {
            /*
             * all_result返回参数的整理:
             * 1、"{\"result\":\"true\",\"message\":\"\"}"----》第二次点击落地按钮,(理论上不应该出现这个情况,有可能是第一次操作时整个操作流程没有完成,所以造成用户可以点击这个按钮,所以此处的操作仅实现状态修改,返回值为true)
             * 2、"{\"result\":\"submit\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,shpid|path
             * 3、"{\"result\":\"false\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,异常信息。
             * 4、"{\"result\":\"submitqueue\",\"message\":\"\"}"----》成功加入队列
             *
             */

            IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf);
            string userid   = clientInfoDic["userid"];
            string username = clientInfoDic["username"];

            string all_result = "";

            string[] sys_idss = sys_ids.Split(',');
            for (int i = 0; i < sys_idss.Length; i++)
            {
                try
                {
                    _model_tbl_maintable = _idal_itbl_maintable.GetList(" sys_id='" + sys_idss[i].ToString() + "'", "", "*", "", "", null)[0];


                    if (all_result == "")
                    {
                        string result = "";
                        _t = commonclass.CreateIAccessDataTrans();
                        _t.getTrans().begin();

                        #region businesscode
                        //businesscode
                        //在此处添加针对projclassid = 3的业务代码
                        //更新旧水表的状态为停用
                        //更新客户表冗余水表信息的字段,判断停用水表编号是否有值,有用“^”分割保存。把f_value1,f_value2置为空
                        //更新更换水表表的状态为归档
                        model_tbl_ld_ghsb = idal_tbl_ld_ghsb.GetList(" fk_tbl_maintable_sys_id = '" + sys_idss[i].ToString() + "' ", "", "*", "", "", null)[0];
                        model_tbl_ld_khb  = idal_tbl_ld_khb.GetList(" sys_id = '" + model_tbl_ld_ghsb.f_khbhid + "' ", "", "*", "", "", null)[0];
                        _model_tbl_ld_sbb = idal_tbl_ld_sbb.GetList(" sys_id = '" + model_tbl_ld_khb.f_sbbhid + "' ", "", "*", "", "", null)[0];
                        #region 在水表表中新增一条数据

                        sara.dd.ldsw.model.tbl_ld_sbb model_tbl_ld_sbb = new sara.dd.ldsw.model.tbl_ld_sbb();
                        model_tbl_ld_sbb.sys_id = 0;

                        model_tbl_ld_sbb.sys_orderid = "";

                        model_tbl_ld_sbb.sys_creatuserid = userid;

                        model_tbl_ld_sbb.sys_creatusername = username;

                        model_tbl_ld_sbb.sys_creatdate = DateTime.Now;

                        model_tbl_ld_sbb.sys_lastedituserid = userid;

                        model_tbl_ld_sbb.sys_lasteditusername = username;

                        model_tbl_ld_sbb.sys_lasteditdate = DateTime.Now;

                        model_tbl_ld_sbb.sys_deluserid = "";

                        model_tbl_ld_sbb.sys_delusername = "";

                        model_tbl_ld_sbb.sys_deldate = DateTime.Parse("1900-1-1");

                        model_tbl_ld_sbb.sys_delflag = "0";

                        model_tbl_ld_sbb.f_value1 = "";

                        model_tbl_ld_sbb.f_value2 = "";

                        model_tbl_ld_sbb.f_value3 = "";

                        model_tbl_ld_sbb.f_value4 = "";

                        model_tbl_ld_sbb.f_value5 = "";

                        model_tbl_ld_sbb.f_value6 = "";

                        model_tbl_ld_sbb.f_value7 = "";

                        model_tbl_ld_sbb.f_value8 = "";

                        model_tbl_ld_sbb.f_value9 = "";

                        model_tbl_ld_sbb.f_value10 = "";
                        model_tbl_ld_sbb.f_sbbh    = sara.dd.ldsw.commonclass.commonclass.getBusinessNum("sb", model_tbl_ld_ghsb.f_newsblxid, null);
                        model_tbl_ld_sbb.f_ztsbh   = "";
                        model_tbl_ld_sbb.f_lxth    = "";
                        model_tbl_ld_sbb.f_sbfz    = model_tbl_ld_ghsb.f_newsbfz;
                        model_tbl_ld_sbb.f_sbfzid  = model_tbl_ld_ghsb.f_newsbfzid;
                        model_tbl_ld_sbb.f_sbpp    = model_tbl_ld_ghsb.f_newsbpp;
                        model_tbl_ld_sbb.f_mph     = model_tbl_ld_ghsb.f_newmph;
                        model_tbl_ld_sbb.f_sbdz    = model_tbl_ld_ghsb.f_newsbdz;
                        model_tbl_ld_sbb.f_khbh    = model_tbl_ld_ghsb.f_khbh;
                        model_tbl_ld_sbb.f_rs      = model_tbl_ld_ghsb.f_newrs;
                        model_tbl_ld_sbb.f_sbkj    = model_tbl_ld_ghsb.f_newsbkj;
                        model_tbl_ld_sbb.f_sbkjid  = model_tbl_ld_ghsb.f_newsbkjid;
                        model_tbl_ld_sbb.f_sblx    = model_tbl_ld_ghsb.f_newsblx;
                        model_tbl_ld_sbb.f_sblxid  = model_tbl_ld_ghsb.f_newsblxid;
                        model_tbl_ld_sbb.f_jllx    = model_tbl_ld_ghsb.f_newjllx;
                        model_tbl_ld_sbb.f_jllxid  = model_tbl_ld_ghsb.f_newjllxid;
                        model_tbl_ld_sbb.f_cszm    = model_tbl_ld_ghsb.f_newcszm;
                        model_tbl_ld_sbb.f_bqzm    = model_tbl_ld_ghsb.f_newbqzm;
                        model_tbl_ld_sbb.f_sqzm    = model_tbl_ld_ghsb.f_newsqzm;
                        model_tbl_ld_sbb.f_sqsl    = model_tbl_ld_ghsb.f_newsqsl;
                        model_tbl_ld_sbb.f_ljgl    = model_tbl_ld_ghsb.f_newljgl;
                        model_tbl_ld_sbb.f_qsqpjsl = model_tbl_ld_ghsb.f_newqsqpjsl;
                        model_tbl_ld_sbb.f_qlqpjsl = model_tbl_ld_ghsb.f_newqlqpjsl;
                        model_tbl_ld_sbb.f_zt      = model_tbl_ld_ghsb.f_newzt;
                        model_tbl_ld_sbb.f_ztid    = model_tbl_ld_ghsb.f_newztid;
                        model_tbl_ld_sbb.f_bz      = model_tbl_ld_ghsb.f_bz;
                        model_tbl_ld_sbb.f_bqsl    = model_tbl_ld_ghsb.f_newdysl;
                        model_tbl_ld_sbb.f_nljgl   = model_tbl_ld_ghsb.f_newnysl;
                        model_tbl_ld_sbb.f_azrq    = model_tbl_ld_ghsb.f_newazrq;
                        model_tbl_ld_sbb.f_qfzt    = model_tbl_ld_ghsb.f_newqfzt;
                        model_tbl_ld_sbb.f_fj      = model_tbl_ld_ghsb.f_xsbfj;
                        model_tbl_ld_sbb.f_synx    = model_tbl_ld_ghsb.f_newsynx;
                        string sbbhid = idal_tbl_ld_sbb.Add(model_tbl_ld_sbb, null);
                        #endregion

                        #region 更新客户表冗余水表信息的字段,判断停用水表编号是否有值,有用“^”分割保存。把f_value1,f_value2置为空
                        model_tbl_ld_khb.f_sbbh    = model_tbl_ld_sbb.f_sbbh;
                        model_tbl_ld_khb.f_sbbhid  = sbbhid;
                        model_tbl_ld_khb.f_bqzm    = model_tbl_ld_sbb.f_bqzm;
                        model_tbl_ld_khb.f_sqzm    = model_tbl_ld_sbb.f_sqzm;
                        model_tbl_ld_khb.f_bqsl    = model_tbl_ld_sbb.f_bqsl;
                        model_tbl_ld_khb.f_sqsl    = model_tbl_ld_sbb.f_sqsl;
                        model_tbl_ld_khb.f_qsqpjsl = model_tbl_ld_sbb.f_qsqpjsl;
                        model_tbl_ld_khb.f_qlqpjsl = model_tbl_ld_sbb.f_qlqpjsl;
                        //model_tbl_ld_khb.f_ljgl = model_tbl_ld_sbb.f_ljgl;
                        model_tbl_ld_khb.f_lxth   = model_tbl_ld_sbb.f_lxth;
                        model_tbl_ld_khb.f_sblx   = model_tbl_ld_sbb.f_sblx;
                        model_tbl_ld_khb.f_sblxid = model_tbl_ld_sbb.f_sblxid;
                        model_tbl_ld_khb.f_jllx   = model_tbl_ld_sbb.f_jllx;
                        model_tbl_ld_khb.f_jllxid = model_tbl_ld_sbb.f_jllxid;
                        if (model_tbl_ld_khb.f_tssbbh != "")
                        {
                            model_tbl_ld_khb.f_tssbbh   = model_tbl_ld_khb.f_tssbbh + "^" + _model_tbl_ld_sbb.f_sbbh;
                            model_tbl_ld_khb.f_tssbbhid = model_tbl_ld_khb.f_tssbbhid + "^" + _model_tbl_ld_sbb.sys_id;
                        }
                        else
                        {
                            model_tbl_ld_khb.f_tssbbh   = _model_tbl_ld_sbb.f_sbbh;
                            model_tbl_ld_khb.f_tssbbhid = _model_tbl_ld_sbb.sys_id.ToString();
                        }
                        model_tbl_ld_khb.f_ztsbh  = model_tbl_ld_sbb.f_ztsbh;
                        model_tbl_ld_khb.f_rs     = model_tbl_ld_sbb.f_rs;
                        model_tbl_ld_khb.f_sbkj   = model_tbl_ld_sbb.f_sbkj;
                        model_tbl_ld_khb.f_sbkjid = model_tbl_ld_sbb.f_sbkjid;
                        model_tbl_ld_khb.f_sbfz   = model_tbl_ld_sbb.f_sbfz;
                        model_tbl_ld_khb.f_sbfzid = model_tbl_ld_sbb.f_sbfzid;
                        //model_tbl_ld_khb.f_nljgl = model_tbl_ld_sbb.f_nljgl;

                        model_tbl_ld_khb.f_value1 = "";
                        model_tbl_ld_khb.f_value2 = "";

                        idal_tbl_ld_khb.Update(model_tbl_ld_khb, "f_sbbh,f_sbbhid,f_bqzm,f_sqzm,f_bqsl,f_sqsl,f_qsqpjsl,f_qlqpjsl,f_ljgl,f_lxth,f_sblx,f_sblxid,f_jllx,f_jllxid,f_tssbbh,f_tssbbhid,f_ztsbh,f_rs ,f_sbkj,f_sbkjid,f_sbfz,f_sbfzid,f_nljg,f_value1,f_value2", null);


                        #endregion

                        #region 更新旧水表的状态为停用
                        _model_tbl_ld_sbb.f_zt   = "停用";
                        _model_tbl_ld_sbb.f_ztid = "9";
                        idal_tbl_ld_sbb.Update(_model_tbl_ld_sbb, "f_zt,f_ztid", null);
                        #endregion

                        #region 更新更换水表表的状态为归档,操作人,操作时间
                        model_tbl_ld_ghsb.f_zt      = "归档";
                        model_tbl_ld_ghsb.f_ztid    = "2";
                        model_tbl_ld_ghsb.f_czr     = username;
                        model_tbl_ld_ghsb.f_czrid   = userid;
                        model_tbl_ld_ghsb.f_czsj    = DateTime.Now;
                        model_tbl_ld_ghsb.f_newsbbh = model_tbl_ld_sbb.f_sbbh;
                        idal_tbl_ld_ghsb.Update(model_tbl_ld_ghsb, "f_zt,f_ztid,f_czr,f_czrid,f_czsj,f_newsbbh", null);

                        #endregion


                        #endregion

                        //调整数据状态

                        NameValueCollection nvc_maintableparameters = new NameValueCollection();
                        nvc_maintableparameters.Add("sys_processnextuser", "^nextuser");
                        nvc_maintableparameters.Add("fk_tbl_maintable_sys_id", "^null");
                        nvc_maintableparameters.Add("fk_workflow_sys_id", "^null");
                        result = _hic.NextStateItemNew(sys_idss[i].ToString(), nvc_maintableparameters, str_facterid, ds_facter, str_txt_bak_message, "", "", clientInf, _t);


                        if (result == "")
                        {
                            _t.getTrans().commit();
                        }
                        else
                        {
                            _t.getTrans().rollback();
                            all_result = "{\"result\":\"false\",\"message\":\"" + result + "\"}";
                        }
                    }
                }
                catch (Exception ex)
                {
                    all_result = "{\"result\":\"false\",\"message\":\"" + ex.Message + "\"}";
                }
            }
            if (all_result == "")
            {
                // all_result = "{\"result\":\"true\",\"message\":\"\"}";
            }
            return(all_result);
        }
Example #3
0
        public string meterAlert(string jsontable)
        {
            Eva.Library.Data.AccessDataTrans.IAccessDataTrans t = commonclass.commonclass.CreateIAccessDataTrans();
            //jsontable = jsontable.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "").Replace("\\\\\\\\\\\\\\\\", "\\\\\\\\").Replace("\\\"","\"").Replace("\"[","[").Replace("]\"","]");
            DataTable dt = Eva.Library.Format.FormatEntityTool.FormatJsonToDataTable(jsontable);


            try
            {
                t.getTrans().begin();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dt.Rows[i];
                    #region 增加一条报警记录

                    if (dr["f_sbbh"].ToString() != null && dr["f_sbbh"].ToString() != "")
                    {
                        DateTime bjsj        = Convert.ToDateTime(dr["f_bjsj"].ToString());
                        DateTime currentTime = System.DateTime.Now;

                        List <sara.dd.ldsw.model.tbl_ld_sbb> sbmodellist = _idal_tbl_ld_sbb.GetList("f_sbbh='" + dr["f_sbbh"].ToString() + "'", "", "*", "", "", t);
                        if (sbmodellist.Count == 1)
                        {
                            sara.dd.ldsw.model.tbl_ld_sbbj model   = new sara.dd.ldsw.model.tbl_ld_sbbj();
                            sara.dd.ldsw.model.tbl_ld_sbb  sbmodel = sbmodellist[0];
                            model.sys_creatuserid      = "74";
                            model.sys_creatusername    = "******";
                            model.sys_creatdate        = currentTime;
                            model.sys_lastedituserid   = "74";
                            model.sys_lasteditusername = "******";
                            model.sys_lasteditdate     = currentTime;
                            model.sys_deldate          = DateTime.Parse("1900-01-01");
                            model.sys_delflag          = "0";
                            model.f_sbid = sbmodel.sys_id.ToString();
                            model.f_sbbh = dr["f_sbbh"].ToString();
                            model.f_bjsj = bjsj;
                            if (dr["f_bjxx"].ToString() == "在线")
                            {
                                model.f_bjzt     = "正常";
                                model.f_bjztid   = "1";
                                model.f_bjnr     = dr["f_bjxx"].ToString();
                                sbmodel.f_bjzt   = "正常";
                                sbmodel.f_bjztid = "1";
                                sbmodel.f_bjnr   = dr["f_bjxx"].ToString();
                                _idal_tbl_ld_sbb.Update(sbmodel, "f_bjzt,f_bjztid,f_bjnr", t);
                            }
                            else
                            {
                                model.f_bjzt     = "报警";
                                model.f_bjztid   = "2";
                                model.f_bjnr     = dr["f_bjxx"].ToString();
                                sbmodel.f_bjzt   = "报警";
                                sbmodel.f_bjztid = "2";
                                sbmodel.f_bjnr   = dr["f_bjxx"].ToString();
                                _idal_tbl_ld_sbb.Update(sbmodel, "f_bjzt,f_bjztid,f_bjnr", t);
                            }

                            _idal_tbl_ld_sbbj.Add(model, t);
                        }



                        #endregion
                    }
                }
                #region 增加通送信息
                //获取报警水表数
                string count = _idal_tbl_ld_sbb.GetCount("f_bjztid='2'", t);
                if (int.Parse(count) > 0)
                {
                    sara.dd.ldsw.model.tbl_notice noticemodel = new sara.dd.ldsw.model.tbl_notice();
                    DateTime currentTime = System.DateTime.Now;
                    noticemodel.sys_creatuserid      = "74";
                    noticemodel.sys_creatusername    = "******";
                    noticemodel.sys_creatdate        = currentTime;
                    noticemodel.sys_lastedituserid   = "74";
                    noticemodel.sys_lasteditusername = "******";
                    noticemodel.sys_lasteditdate     = currentTime;
                    noticemodel.sys_deldate          = DateTime.Parse("1900-01-01");
                    noticemodel.sys_delflag          = "0";
                    noticemodel.f_title     = "水表报警";
                    noticemodel.f_content   = "<a href=\"http://127.0.0.1/sara.dd.ldsw/ui/tbl_ld_sbbj/tbl_ld_sbbj_list.html?listtype=1&amp;uid=1519\">水表报警(" + count + ")</a>";
                    noticemodel.f_startdate = currentTime;
                    noticemodel.f_edndate   = currentTime;
                    noticemodel.f_group     = "张建东";
                    noticemodel.f_groupid   = "1519";

                    _idal_tbl_notice.Add(noticemodel, t);
                }


                #endregion

                t.getTrans().commit();
            }
            catch (Exception ex)
            {
                t.getTrans().rollback();
                return("程序异常" + ex.Message);
            }

            return("true");
        }
Example #4
0
        /// <summary>
        /// //projclass = 3时进行的归档操作,执行落数程序
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_facterid"></param>
        /// <param name="ds_facter"></param>
        /// <param name="str_txt_bak_message"></param>
        /// <param name="clientInf"></param>
        /// <returns></returns>
        public string set_complete(string sys_ids, string str_facterid, DataSet ds_facter, string str_txt_bak_message, string clientInf)
        {
            /*
             * all_result返回参数的整理:
             * 1、"{\"result\":\"true\",\"message\":\"\"}"----》第二次点击落地按钮,(理论上不应该出现这个情况,有可能是第一次操作时整个操作流程没有完成,所以造成用户可以点击这个按钮,所以此处的操作仅实现状态修改,返回值为true)
             * 2、"{\"result\":\"submit\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,shpid|path
             * 3、"{\"result\":\"false\",\"message\":\"" + messageString + "\"}";----》此时message是一个字符串,异常信息。
             * 4、"{\"result\":\"submitqueue\",\"message\":\"\"}"----》成功加入队列
             *
             */
            IDictionary <string, string> clientInfoDic = Eva.Library.Format.FormatEntityTool.FormatJsonToDic(clientInf);
            string userid   = clientInfoDic["userid"];
            string username = clientInfoDic["username"];


            string all_result = "";

            string[] sys_idss = sys_ids.Split(',');
            for (int i = 0; i < sys_idss.Length; i++)
            {
                try
                {
                    _model_tbl_maintable = _idal_itbl_maintable.GetList(" sys_id='" + sys_idss[i].ToString() + "'", "", "*", "", "", null)[0];


                    if (all_result == "")
                    {
                        string result = "";
                        string sql    = "";
                        _t = commonclass.CreateIAccessDataTrans();
                        _t.getTrans().begin();

                        #region businesscode
                        //businesscode
                        //在此处添加针对projclassid = 3的业务代码
                        //更改水表表,用户表,客户表的状态,抄本信息(多个客户)
                        //置空客户表f_value1,f_value2的状态
                        //更新本表的状态
                        model_tbl_ld_xhhbt = idal_tbl_ld_xhhbt.GetList(" fk_tbl_maintable_sys_id='" + sys_idss[i].ToString() + "'", "", "*", "", "", null)[0];

                        model_tbl_ld_cben = idal_tbl_ld_cben.GetList("f_cbmc ='QH023'", "", "*", "", "", null)[0];

                        IList <sara.dd.ldsw.model.tbl_ld_xhhbtzb> model_tbl_ld_xhhbtzb = idal_tbl_ld_xhhbtzb.GetList(" fk_tbl_ld_xhhbt_sys_id='" + model_tbl_ld_xhhbt.sys_id + "'", "", "*", "", "", null);

                        foreach (sara.dd.ldsw.model.tbl_ld_xhhbtzb model in model_tbl_ld_xhhbtzb)
                        {
                            model_tbl_ld_khb = idal_tbl_ld_khb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            string   khfz      = model_tbl_ld_khb.f_khfz;
                            string   khfzid    = model_tbl_ld_khb.f_khfzid;
                            string[] khfzarr   = khfz.Split(',');
                            string[] khfzidarr = khfzid.Split(',');
                            string   newkhfz   = "";
                            string   newkhfzid = "";
                            if (khfz == "")
                            {
                                newkhfz   = "龙达水务清户表";
                                newkhfzid = "4059";
                            }
                            else
                            {
                                for (int a = 0; a < khfzarr.Length; a++)
                                {
                                    if (khfzarr[a] == "龙达水务新立户表" || khfzarr[a] == "客服中心总表" || khfzarr[a] == "客服中心大用户表" || khfzarr[a] == "经营中心考核表" || khfzarr[a] == "经营中心排子表" || khfzarr[a] == "经营中心远传表" || khfzarr[a] == "经营中心居民表")
                                    {
                                    }
                                    else
                                    {
                                        newkhfz   += khfzarr[a] + ',';
                                        newkhfzid += khfzidarr[a] + ',';
                                    }
                                }
                                newkhfz   = newkhfz.TrimEnd(',') + "," + "龙达水务清户表";
                                newkhfzid = newkhfzid.TrimEnd(',') + "," + "4059";
                            }
                            sql  = " update tbl_ld_khb set f_zt = '销户' , f_ztid ='1',f_value1='',f_value2='',";
                            sql += "f_cbbh='" + model_tbl_ld_cben.f_cbbh + "',f_cbbhid='" + model_tbl_ld_cben.sys_id + "',";
                            sql += "f_cbyxm='" + model_tbl_ld_cben.f_cbymc + "',f_cbyid='" + model_tbl_ld_cben.f_cbyid + "',";
                            sql += "f_khfz='" + newkhfz + "',f_khfzid='" + newkhfzid + "',";
                            sql += "f_cbzq='" + model_tbl_ld_cben.f_cbzq + "',f_cbmc='" + model_tbl_ld_cben.f_cbmc + "' where sys_id ='" + model.f_khbhid + "'";
                            _t.ExecuteSql(sql);

                            //在客户表中加日志
                            List <IDictionary <string, string> > array = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_khb.f_zt != "销户")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_khb.f_zt);
                                temp.Add("newvalue", "销户");
                                temp.Add("name", "状态");
                                array.Add(temp);
                            }
                            if (model_tbl_ld_khb.f_khfz != newkhfz)
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_khfz");
                                temp.Add("oldvalue", model_tbl_ld_khb.f_khfz);
                                temp.Add("newvalue", newkhfz);
                                temp.Add("name", "客户分组");
                                array.Add(temp);
                            }

                            if (model_tbl_ld_cben.f_cbbh != model_tbl_ld_khb.f_cbbh)
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_cbbh");
                                temp.Add("oldvalue", model_tbl_ld_khb.f_cbbh);
                                temp.Add("newvalue", model_tbl_ld_cben.f_cbbh);
                                temp.Add("name", "抄本编号");
                                array.Add(temp);
                            }

                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", model_tbl_ld_khb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户销户", array, clientInf, _t);

                            model_tbl_ld_sbb = idal_tbl_ld_sbb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            string   sbfz      = model_tbl_ld_sbb.f_sbfz;
                            string   sbfzid    = model_tbl_ld_khb.f_sbfzid;
                            string[] sbfzarr   = sbfz.Split(',');
                            string[] sbfzidarr = sbfzid.Split(',');
                            string   newsbfz   = "";
                            string   newsbfzid = "";
                            if (sbfz == "")
                            {
                                newsbfz   = "龙达水务清户表";
                                newsbfzid = "4100";
                            }
                            else
                            {
                                for (int a = 0; a < sbfzarr.Length; a++)
                                {
                                    if (sbfzarr[a] == "龙达水务新立户表" || sbfzarr[a] == "客服中心总表" || sbfzarr[a] == "客服中心大用户表" || sbfzarr[a] == "经营中心考核表" || sbfzarr[a] == "经营中心排子表" || sbfzarr[a] == "经营中心远传表" || sbfzarr[a] == "经营中心居民表")
                                    {
                                    }
                                    else
                                    {
                                        newsbfz   += sbfzarr[a] + ',';
                                        newsbfzid += sbfzidarr[a] + ',';
                                    }
                                }
                                newsbfz   = newsbfz.TrimEnd(',') + "," + "龙达水务清户表";
                                newsbfzid = newsbfzid.TrimEnd(',') + "," + "4100";
                            }
                            sql = " update tbl_ld_sbb set f_zt = '销户' , f_ztid ='1',f_sbfz='" + newsbfz + "',f_sbfzid='" + newsbfzid + "' where f_khbh ='" + model.f_khbh + "'";
                            _t.ExecuteSql(sql);

                            //在水表表中加日志
                            List <IDictionary <string, string> > array1 = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_sbb.f_zt != "销户")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_sbb.f_zt);
                                temp.Add("newvalue", "销户");
                                temp.Add("name", "状态");
                                array1.Add(temp);
                            }
                            if (model_tbl_ld_sbb.f_sbfz != newsbfz)
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_khfz");
                                temp.Add("oldvalue", model_tbl_ld_sbb.f_sbfz);
                                temp.Add("newvalue", newsbfz);
                                temp.Add("name", "水表分组");
                                array1.Add(temp);
                            }
                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_sbb", model_tbl_ld_sbb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户销户", array1, clientInf, _t);

                            model_tbl_ld_yhb = idal_tbl_ld_yhb.GetList(" f_khbh='" + model.f_khbh + "'", "", "*", "", "", null)[0];
                            string   yhfz      = model_tbl_ld_yhb.f_yhfz;
                            string   yhfzid    = model_tbl_ld_khb.f_yhfzid;
                            string[] yhfzarr   = yhfz.Split(',');
                            string[] yhfzidarr = yhfzid.Split(',');
                            string   newyhfz   = "";
                            string   newyhfzid = "";
                            if (yhfz == "")
                            {
                                newyhfz   = "龙达水务清户表";
                                newyhfzid = "4138";
                            }
                            else
                            {
                                for (int a = 0; a < sbfzarr.Length; a++)
                                {
                                    if (yhfzarr[a] == "龙达水务新立户表" || yhfzarr[a] == "客服中心总表" || yhfzarr[a] == "客服中心大用户表" || yhfzarr[a] == "经营中心考核表" || yhfzarr[a] == "经营中心排子表" || yhfzarr[a] == "经营中心远传表" || yhfzarr[a] == "经营中心居民表")
                                    {
                                    }
                                    else
                                    {
                                        newyhfz   += yhfzarr[a] + ',';
                                        newyhfzid += yhfzidarr[a] + ',';
                                    }
                                }
                                newyhfz   = newyhfz.TrimEnd(',') + "," + "龙达水务清户表";
                                newyhfzid = newyhfzid.TrimEnd(',') + "," + "4138";
                            }
                            sql = " update tbl_ld_yhb set f_zt = '销户' , f_ztid ='3',f_yhfz='" + newyhfz + "',f_yhfzid='" + newyhfzid + "' where f_khbh ='" + model.f_khbh + "'";
                            _t.ExecuteSql(sql);

                            //在用户表中加日志
                            List <IDictionary <string, string> > array2 = new List <IDictionary <string, string> >();

                            if (model_tbl_ld_yhb.f_zt != "销户")
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_zt");
                                temp.Add("oldvalue", model_tbl_ld_yhb.f_zt);
                                temp.Add("newvalue", "销户");
                                temp.Add("name", "状态");
                                array2.Add(temp);
                            }
                            if (model_tbl_ld_yhb.f_yhfz != newsbfz)
                            {
                                IDictionary <string, string> temp = new Dictionary <string, string>();
                                temp.Add("key", "f_khfz");
                                temp.Add("oldvalue", model_tbl_ld_yhb.f_yhfz);
                                temp.Add("newvalue", newyhfz);
                                temp.Add("name", "用户分组");
                                array2.Add(temp);
                            }
                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_yhb", model_tbl_ld_yhb.sys_id.ToString(), "tbl_ld_xhhbt_detail", "用户销户", array2, clientInf, _t);

                            sql = " update tbl_ld_xhhbt set f_zt = '归档' , f_ztid ='2',f_czr='" + username + "',f_czrid='" + userid + "',f_czsj=to_date('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd hh24:mi:ss')  where  sys_id ='" + model_tbl_ld_xhhbt.sys_id + "'";
                            _t.ExecuteSql(sql);
                        }

                        #endregion

                        //调整数据状态

                        NameValueCollection nvc_maintableparameters = new NameValueCollection();
                        nvc_maintableparameters.Add("sys_processnextuser", "^nextuser");
                        nvc_maintableparameters.Add("fk_tbl_maintable_sys_id", "^null");
                        nvc_maintableparameters.Add("fk_workflow_sys_id", "^null");
                        result = _hic.NextStateItemNew(sys_idss[i].ToString(), nvc_maintableparameters, str_facterid, ds_facter, str_txt_bak_message, "", "", clientInf, _t);


                        if (result == "")
                        {
                            _t.getTrans().commit();
                        }
                        else
                        {
                            _t.getTrans().rollback();
                            all_result = "{\"result\":\"false\",\"message\":\"" + result + "\"}";
                        }
                    }
                }
                catch (Exception ex)
                {
                    all_result = "{\"result\":\"false\",\"message\":\"" + ex.Message + "\"}";
                }
            }
            if (all_result == "")
            {
                // all_result = "{\"result\":\"true\",\"message\":\"\"}";
            }
            return(all_result);
        }