Esempio n. 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);
        }
Esempio n. 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_value状态

                        model_tbl_ld_xzsb = idal_tbl_ld_xzsb.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_xzsb.f_khbhid + "' ", "", "*", "", "", null)[0];
                        _model_tbl_ld_yhb = idal_tbl_ld_yhb.GetList(" sys_id = '" + _model_tbl_ld_khb.f_yhbhid + "' ", "", "*", "", "", null)[0];

                        sara.dd.ldsw.model.tbl_ld_khb model_tbl_ld_khb = new sara.dd.ldsw.model.tbl_ld_khb();
                        model_tbl_ld_khb.f_khbh = sara.dd.ldsw.commonclass.commonclass.getBusinessNum("kh", model_tbl_ld_xzsb.f_sblxid, null);


                        #region 用户表
                        sara.dd.ldsw.model.tbl_ld_yhb model_tbl_ld_yhb = new sara.dd.ldsw.model.tbl_ld_yhb();

                        model_tbl_ld_yhb.sys_id = 0;

                        model_tbl_ld_yhb.sys_orderid = "";

                        model_tbl_ld_yhb.sys_creatuserid = userid;

                        model_tbl_ld_yhb.sys_creatusername = username;

                        model_tbl_ld_yhb.sys_creatdate = DateTime.Now;

                        model_tbl_ld_yhb.sys_lastedituserid = userid;

                        model_tbl_ld_yhb.sys_lasteditusername = username;

                        model_tbl_ld_yhb.sys_lasteditdate = DateTime.Now;

                        model_tbl_ld_yhb.sys_deluserid = "";

                        model_tbl_ld_yhb.sys_delusername = "";

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

                        model_tbl_ld_yhb.sys_delflag = "0";

                        model_tbl_ld_yhb.f_value1 = "";

                        model_tbl_ld_yhb.f_value2 = "";

                        model_tbl_ld_yhb.f_value3 = "";

                        model_tbl_ld_yhb.f_value4 = "";

                        model_tbl_ld_yhb.f_value5 = "";

                        model_tbl_ld_yhb.f_value6 = "";

                        model_tbl_ld_yhb.f_value7 = "";

                        model_tbl_ld_yhb.f_value8 = "";

                        model_tbl_ld_yhb.f_value9 = "";

                        model_tbl_ld_yhb.f_value10  = "";
                        model_tbl_ld_yhb.f_yhbh     = sara.dd.ldsw.commonclass.commonclass.getBusinessNum("yh", model_tbl_ld_xzsb.f_sblxid, null);
                        model_tbl_ld_yhb.f_ztyhh    = "";
                        model_tbl_ld_yhb.f_yhm      = _model_tbl_ld_yhb.f_yhm;
                        model_tbl_ld_yhb.f_jfm      = _model_tbl_ld_yhb.f_jfm;
                        model_tbl_ld_yhb.f_dz       = _model_tbl_ld_yhb.f_dz;
                        model_tbl_ld_yhb.f_yhfz     = _model_tbl_ld_yhb.f_yhfz;
                        model_tbl_ld_yhb.f_yhfzid   = _model_tbl_ld_yhb.f_yhfzid;
                        model_tbl_ld_yhb.f_dh       = _model_tbl_ld_yhb.f_dh;
                        model_tbl_ld_yhb.f_dy       = _model_tbl_ld_yhb.f_dy;
                        model_tbl_ld_yhb.f_dyid     = _model_tbl_ld_yhb.f_dyid;
                        model_tbl_ld_yhb.f_sc       = _model_tbl_ld_yhb.f_sc;
                        model_tbl_ld_yhb.f_scid     = _model_tbl_ld_yhb.f_scid;
                        model_tbl_ld_yhb.f_qy       = _model_tbl_ld_yhb.f_qy;
                        model_tbl_ld_yhb.f_qyid     = _model_tbl_ld_yhb.f_qyid;
                        model_tbl_ld_yhb.f_pq       = _model_tbl_ld_yhb.f_pq;
                        model_tbl_ld_yhb.f_pqid     = _model_tbl_ld_yhb.f_pqid;
                        model_tbl_ld_yhb.f_khrq     = DateTime.Now;
                        model_tbl_ld_yhb.f_sfts     = _model_tbl_ld_yhb.f_sfts;
                        model_tbl_ld_yhb.f_tsyx     = _model_tbl_ld_yhb.f_tsyx;
                        model_tbl_ld_yhb.f_tsyxzh   = _model_tbl_ld_yhb.f_tsyxzh;
                        model_tbl_ld_yhb.f_htbh     = _model_tbl_ld_yhb.f_htbh;
                        model_tbl_ld_yhb.f_htfj     = sara.dd.ldsw.commonclass.filecontrol.GetNewFileId(null);;
                        model_tbl_ld_yhb.f_sfzh     = _model_tbl_ld_yhb.f_sfzh;
                        model_tbl_ld_yhb.f_sfzfj    = sara.dd.ldsw.commonclass.filecontrol.GetNewFileId(null);;
                        model_tbl_ld_yhb.f_sfzzs    = _model_tbl_ld_yhb.f_sfzzs;
                        model_tbl_ld_yhb.f_zt       = _model_tbl_ld_yhb.f_zt;
                        model_tbl_ld_yhb.f_ztid     = _model_tbl_ld_yhb.f_ztid;
                        model_tbl_ld_yhb.f_bz       = _model_tbl_ld_yhb.f_bz;
                        model_tbl_ld_yhb.f_khbh     = model_tbl_ld_khb.f_khbh;
                        model_tbl_ld_yhb.f_wxwybz   = _model_tbl_ld_yhb.f_wxwybz;
                        model_tbl_ld_yhb.f_zfbwybz  = _model_tbl_ld_yhb.f_zfbwybz;
                        model_tbl_ld_yhb.f_gdyxwybz = _model_tbl_ld_yhb.f_gdyxwybz;
                        model_tbl_ld_yhb.f_tsyxid   = _model_tbl_ld_yhb.f_tsyxid;
                        model_tbl_ld_yhb.f_qtfj     = sara.dd.ldsw.commonclass.filecontrol.GetNewFileId(null);;
                        model_tbl_ld_yhb.f_htqdrq   = DateTime.Now;

                        string yhbhid = idal_tbl_ld_yhb.Add(model_tbl_ld_yhb, null);
                        #endregion

                        #region 水表表


                        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_xzsb.f_sblxid, null);
                        model_tbl_ld_sbb.f_ztsbh   = "";
                        model_tbl_ld_sbb.f_lxth    = "";
                        model_tbl_ld_sbb.f_sbfz    = model_tbl_ld_xzsb.f_sbfz;
                        model_tbl_ld_sbb.f_sbfzid  = model_tbl_ld_xzsb.f_sbfzid;
                        model_tbl_ld_sbb.f_sbpp    = model_tbl_ld_xzsb.f_sbpp;
                        model_tbl_ld_sbb.f_mph     = model_tbl_ld_xzsb.f_mph;
                        model_tbl_ld_sbb.f_sbdz    = model_tbl_ld_xzsb.f_sbdz;
                        model_tbl_ld_sbb.f_khbh    = model_tbl_ld_khb.f_khbh;
                        model_tbl_ld_sbb.f_rs      = model_tbl_ld_xzsb.f_rs;
                        model_tbl_ld_sbb.f_sbkj    = model_tbl_ld_xzsb.f_sbkj;
                        model_tbl_ld_sbb.f_sbkjid  = model_tbl_ld_xzsb.f_sbkjid;
                        model_tbl_ld_sbb.f_sblx    = model_tbl_ld_xzsb.f_sblx;
                        model_tbl_ld_sbb.f_sblxid  = model_tbl_ld_xzsb.f_sblxid;
                        model_tbl_ld_sbb.f_jllx    = model_tbl_ld_xzsb.f_jllx;
                        model_tbl_ld_sbb.f_jllxid  = model_tbl_ld_xzsb.f_jllxid;
                        model_tbl_ld_sbb.f_cszm    = model_tbl_ld_xzsb.f_cszm;
                        model_tbl_ld_sbb.f_bqzm    = "0";
                        model_tbl_ld_sbb.f_sqzm    = "0";
                        model_tbl_ld_sbb.f_sqsl    = "0";
                        model_tbl_ld_sbb.f_ljgl    = "0";
                        model_tbl_ld_sbb.f_qsqpjsl = "0";
                        model_tbl_ld_sbb.f_qlqpjsl = "0";
                        model_tbl_ld_sbb.f_zt      = "0";
                        model_tbl_ld_sbb.f_ztid    = "启用";
                        model_tbl_ld_sbb.f_bz      = "";
                        model_tbl_ld_sbb.f_bqsl    = "0";
                        model_tbl_ld_sbb.f_nljgl   = "0";
                        model_tbl_ld_sbb.f_azrq    = model_tbl_ld_xzsb.f_azrq;
                        model_tbl_ld_sbb.f_qfzt    = model_tbl_ld_xzsb.f_qfzt;
                        model_tbl_ld_sbb.f_fj      = model_tbl_ld_xzsb.f_sbfj;
                        model_tbl_ld_sbb.f_synx    = model_tbl_ld_xzsb.f_synx;

                        string sbbhid = idal_tbl_ld_sbb.Add(model_tbl_ld_sbb, null);
                        #endregion

                        #region 客户

                        model_tbl_ld_khb.sys_id = 0;

                        model_tbl_ld_khb.sys_orderid = "";

                        model_tbl_ld_khb.sys_creatuserid = "";

                        model_tbl_ld_khb.sys_creatusername = "";

                        model_tbl_ld_khb.sys_creatdate = DateTime.Now;

                        model_tbl_ld_khb.sys_lastedituserid = "";

                        model_tbl_ld_khb.sys_lasteditusername = "";

                        model_tbl_ld_khb.sys_lasteditdate = DateTime.Now;

                        model_tbl_ld_khb.sys_deluserid = "";

                        model_tbl_ld_khb.sys_delusername = "";

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

                        model_tbl_ld_khb.sys_delflag = "0";

                        model_tbl_ld_khb.f_value1 = "";

                        model_tbl_ld_khb.f_value2 = "";

                        model_tbl_ld_khb.f_value3 = "";

                        model_tbl_ld_khb.f_value4 = "";

                        model_tbl_ld_khb.f_value5 = "";

                        model_tbl_ld_khb.f_value6 = "";

                        model_tbl_ld_khb.f_value7 = "";

                        model_tbl_ld_khb.f_value8 = "";

                        model_tbl_ld_khb.f_value9 = "";

                        model_tbl_ld_khb.f_value10 = "";

                        model_tbl_ld_khb.f_ztkhh    = "";
                        model_tbl_ld_khb.f_khfz     = _model_tbl_ld_khb.f_khfz;
                        model_tbl_ld_khb.f_khfzid   = _model_tbl_ld_khb.f_khfzid;
                        model_tbl_ld_khb.f_ycje     = "";
                        model_tbl_ld_khb.f_yslx     = _model_tbl_ld_khb.f_yslx;
                        model_tbl_ld_khb.f_yslxid   = _model_tbl_ld_khb.f_yslxid;
                        model_tbl_ld_khb.f_tbbh     = _model_tbl_ld_khb.f_tbbh;
                        model_tbl_ld_khb.f_sfjlbjf  = _model_tbl_ld_khb.f_sfjlbjf;
                        model_tbl_ld_khb.f_zt       = _model_tbl_ld_khb.f_zt;
                        model_tbl_ld_khb.f_ztid     = _model_tbl_ld_khb.f_ztid;
                        model_tbl_ld_khb.f_bz       = _model_tbl_ld_khb.f_bz;
                        model_tbl_ld_khb.f_cbbh     = _model_tbl_ld_khb.f_cbbh;
                        model_tbl_ld_khb.f_cbbhid   = _model_tbl_ld_khb.f_cbbhid;
                        model_tbl_ld_khb.f_cbxh     = _model_tbl_ld_khb.f_cbxh + ".5";
                        model_tbl_ld_khb.f_cbyxm    = _model_tbl_ld_khb.f_cbyxm;
                        model_tbl_ld_khb.f_cbyid    = _model_tbl_ld_khb.f_cbyid;
                        model_tbl_ld_khb.f_cbzq     = _model_tbl_ld_khb.f_cbzq;
                        model_tbl_ld_khb.f_cbmc     = _model_tbl_ld_khb.f_cbmc;
                        model_tbl_ld_khb.f_yhbh     = model_tbl_ld_yhb.f_yhbh;
                        model_tbl_ld_khb.f_yhbhid   = yhbhid;
                        model_tbl_ld_khb.f_jfm      = model_tbl_ld_yhb.f_jfm;
                        model_tbl_ld_khb.f_yhfz     = model_tbl_ld_yhb.f_yhfz;
                        model_tbl_ld_khb.f_yhfzid   = model_tbl_ld_yhb.f_yhfzid;
                        model_tbl_ld_khb.f_dz       = model_tbl_ld_yhb.f_dz;
                        model_tbl_ld_khb.f_dh       = model_tbl_ld_yhb.f_dh;
                        model_tbl_ld_khb.f_dy       = model_tbl_ld_yhb.f_dy;
                        model_tbl_ld_khb.f_dyid     = model_tbl_ld_yhb.f_dyid;
                        model_tbl_ld_khb.f_sc       = model_tbl_ld_yhb.f_sc;
                        model_tbl_ld_khb.f_scid     = model_tbl_ld_yhb.f_scid;
                        model_tbl_ld_khb.f_qy       = model_tbl_ld_yhb.f_qy;
                        model_tbl_ld_khb.f_qyid     = model_tbl_ld_yhb.f_qyid;
                        model_tbl_ld_khb.f_pq       = model_tbl_ld_yhb.f_pq;
                        model_tbl_ld_khb.f_pqid     = model_tbl_ld_yhb.f_pqid;
                        model_tbl_ld_khb.f_tsyxzh   = model_tbl_ld_yhb.f_tsyxzh;
                        model_tbl_ld_khb.f_hth      = model_tbl_ld_yhb.f_htbh;
                        model_tbl_ld_khb.f_sfzh     = model_tbl_ld_yhb.f_sfzh;
                        model_tbl_ld_khb.f_khrq     = model_tbl_ld_yhb.f_khrq;
                        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_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;
                        model_tbl_ld_khb.f_tssbbh   = _model_tbl_ld_khb.f_tssbbh;
                        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_ztyhh    = model_tbl_ld_yhb.f_ztyhh;
                        model_tbl_ld_khb.f_wxwybz   = _model_tbl_ld_khb.f_wxwybz;
                        model_tbl_ld_khb.f_zfbwybz  = _model_tbl_ld_khb.f_zfbwybz;
                        model_tbl_ld_khb.f_gdyhwybz = _model_tbl_ld_khb.f_gdyhwybz;
                        model_tbl_ld_khb.f_yhm      = model_tbl_ld_yhb.f_yhm;
                        DateTime DateNow   = DateTime.Now.AddMonths(-1);
                        DateTime DateBegin = new DateTime(DateNow.Year, DateNow.Month, 1);
                        DateTime DateEnd   = DateBegin.AddMonths(1).AddDays(-1);
                        model_tbl_ld_khb.f_zhcbrq   = DateEnd;
                        model_tbl_ld_khb.f_ljqf     = "0";
                        model_tbl_ld_khb.f_tjjzpwf  = "";
                        model_tbl_ld_khb.f_tjjzsf   = "";
                        model_tbl_ld_khb.f_tssbbhid = _model_tbl_ld_khb.f_tssbbhid;
                        model_tbl_ld_khb.f_nljgl    = model_tbl_ld_sbb.f_nljgl;
                        model_tbl_ld_khb.f_sqysl    = "0";
                        model_tbl_ld_khb.f_jhysl    = "0";
                        model_tbl_ld_khb.f_ickljgl  = "0";
                        model_tbl_ld_khb.f_sbdz     = _model_tbl_ld_khb.f_sbdz;
                        idal_tbl_ld_khb.Add(model_tbl_ld_khb, null);
                        #endregion


                        model_tbl_ld_xzsb.f_zt    = "归档";
                        model_tbl_ld_xzsb.f_ztid  = "2";
                        model_tbl_ld_xzsb.f_czr   = username;
                        model_tbl_ld_xzsb.f_czrid = userid;
                        model_tbl_ld_xzsb.f_czsj  = DateTime.Now;
                        idal_tbl_ld_xzsb.Update(model_tbl_ld_xzsb, "f_zt,f_ztid,f_czr,f_czrid,f_czsj", null);

                        _model_tbl_ld_khb.f_value1 = "";
                        _model_tbl_ld_khb.f_value2 = "";
                        idal_tbl_ld_khb.Update(_model_tbl_ld_khb, "f_value1,f_value2", null);
                        #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);
        }
Esempio n. 3
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);
        }