public string Update(string json, string columns, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                sara.dd.ldsw.model.tbl_maintable model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_maintable>(json);

                columns              = FormatColumns(columns).Replace("^", ",");
                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_maintable.Update(model, columns, null);

                NewLog("数据更新成功,更新的数据为:json:" + json + ",columns:" + columns, "sql_update", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);

                NewLog("数据更新失败,更新的数据为:json:" + json + ",columns:" + columns + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_update", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 执行删除
        /// </summary>
        /// <param name="sys_ids"></param>
        /// <param name="str_name"></param>
        /// <returns></returns>
        public string set_del(string sys_ids, string str_name)
        {
            string[] sys_idss       = System.Text.RegularExpressions.Regex.Split(sys_ids, ",");
            string   str_result_all = "";

            for (int i = 0; i < sys_idss.Length; i++)
            {
                string result = "";
                try
                {
                    _model_tbl_maintable = _idal_itbl_maintable.GetList("sys_id='" + sys_idss[i] + "'", "", "*", "", "", null)[0];
                    _t = commonclass.CreateIAccessDataTrans();
                    _t.getTrans().begin();
                    #region businesscode
                    //businesscode
                    //在此处添加针对projclassid = 3的业务代码
                    #endregion

                    if (result == "")
                    {
                        result = _hic.DelItem(sys_idss[i].ToString(), str_name, _t);
                    }
                    if (result == "")
                    {
                        _t.getTrans().commit();
                    }
                    else
                    {
                        _t.getTrans().rollback();
                        str_result_all += result;
                    }
                }
                catch (Exception ex)
                {
                    _t.getTrans().rollback();
                    result          = ex.ToString();
                    str_result_all += result;
                }
            }
            return(str_result_all);
        }
        public string Add(string json, string clientInf)
        {
            Dictionary <string, string> resultDic = new Dictionary <string, string>();

            resultDic["result"]  = "";
            resultDic["message"] = "";
            try
            {
                sara.dd.ldsw.model.tbl_maintable model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_maintable>(json);
                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_maintable.Add(model, null);

                NewLog("数据创建成功,创建的数据为:" + json, "sql_insert", clientInf);
            }
            catch (Exception ex)
            {
                resultDic["result"]  = "false";
                resultDic["message"] = Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace);
                NewLog("数据创建失败,创建的数据为:" + json + ",异常信息:" + Eva.Library.Format.FormatTextTool.ErrorMessageFormat(ex.Message + ex.StackTrace), "sql_insert", clientInf);
            }
            return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(resultDic));
        }
Exemplo n.º 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 = "";
                        _t = commonclass.CreateIAccessDataTrans();
                        _t.getTrans().begin();

                        #region businesscode
                        //businesscode
                        //businesscode
                        //注意此处时多个客户
                        //更新水表表,客户表的本期止码
                        //把客户表的f_value1,f_value2置空
                        //更新修改水表底数表的状态,操作人,操作时间等字段
                        //增加日志
                        string sql = "";
                        sql = "select f_khbh,f_sbbh,f_xsbds,f_ysbds from tbl_ld_xgsbdszb where fk_tbl_ld_xgsbds_sys_id= (select sys_id from tbl_ld_xgsbds where fk_tbl_maintable_sys_id='" + sys_idss[i].ToString() + "') ";
                        DataTable dt = _t.Query(sql).Tables[0];
                        for (int j = 0; j < dt.Rows.Count; j++)
                        {
                            DataRow dr = dt.Rows[j];

                            model_tbl_ld_khb = idal_tbl_ld_khb.GetList("f_khbh='" + dr["f_khbh"].ToString() + "'", "", "*", "", "", null)[0];

                            sql = "update tbl_ld_khb set f_bqzm='" + dr["f_xsbds"].ToString() + "',f_value1='',f_value2='' where  f_khbh='" + dr["f_khbh"].ToString() + "' ";
                            _t.ExecuteSql(sql);

                            List <IDictionary <string, string> > array = new List <IDictionary <string, string> >();
                            IDictionary <string, string>         temp  = new Dictionary <string, string>();
                            temp.Add("key", "f_bqzm");
                            temp.Add("oldvalue", dr["f_ysbds"].ToString());
                            temp.Add("newvalue", dr["f_xsbds"].ToString());
                            temp.Add("name", "本期止码");
                            array.Add(temp);
                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", model_tbl_ld_khb.sys_id.ToString(), "tbl_ld_xgsbds_detail", "修改水表底数", array, clientInf, _t);

                            sql = "update tbl_ld_sbb set f_bqzm='" + dr["f_xsbds"].ToString() + "' where  f_khbh='" + dr["f_khbh"].ToString() + "' ";
                            _t.ExecuteSql(sql);

                            List <IDictionary <string, string> > array1 = new List <IDictionary <string, string> >();
                            IDictionary <string, string>         temp1  = new Dictionary <string, string>();
                            temp1.Add("key", "f_bqzm");
                            temp1.Add("oldvalue", dr["f_ysbds"].ToString());
                            temp1.Add("newvalue", dr["f_xsbds"].ToString());
                            temp1.Add("name", "本期止码");
                            array1.Add(temp1);
                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_sbb", model_tbl_ld_khb.f_sbbhid.ToString(), "tbl_ld_xgsbds_detail", "修改水表底数", array1, clientInf, _t);
                        }

                        sql  = " update tbl_ld_xgsbds 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')  ";
                        sql += ",f_drr='" + username + "',f_drrid='" + userid + "',f_drsj=to_date('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','yyyy-MM-dd hh24:mi:ss')  ";
                        sql += "  where  fk_tbl_maintable_sys_id ='" + sys_idss[i].ToString() + "'";
                        _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);
        }
Exemplo n.º 5
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\":\"\"}"----》成功加入队列
             *
             */



            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的业务代码
                        #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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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
                        //businesscode
                        //注意此处时多个客户
                        //更新减免标记
                        //增加日志

                        model_tbl_ld_yqjm = idal_tbl_ld_yqjm.GetList(" fk_tbl_maintable_sys_id = '" + sys_idss[i].ToString() + "' ", "", "*", "", "", null)[0];

                        List<sara.dd.ldsw.model.tbl_ld_khb> khmodellist = idal_tbl_ld_khb.GetList(" f_khbh in ('" + model_tbl_ld_yqjm.f_khbh.Replace(",", "','") + "')", "", "*", "", "", null);

                        for(int ii=0;ii< khmodellist.Count; ii++)
                        {



                            List<IDictionary<string, string>> array = new List<IDictionary<string, string>>();
                            IDictionary<string, string> temp = new Dictionary<string, string>();
                            temp.Add("key", "f_yqjmsf");
                            temp.Add("oldvalue", khmodellist[ii].f_yqjmsf);
                            temp.Add("newvalue", model_tbl_ld_yqjm.f_yqjmsf);
                            temp.Add("name", "疫情减免水费");
                            array.Add(temp);

                            temp = new Dictionary<string, string>();
                            temp.Add("key", "f_yqjmpwf");
                            temp.Add("oldvalue", khmodellist[ii].f_yqjmpwf);
                            temp.Add("newvalue", model_tbl_ld_yqjm.f_yqjmpwf);
                            temp.Add("name", "疫情减免污水处理费");
                            array.Add(temp);


                            sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", khmodellist[ii].sys_id.ToString(), "tbl_ld_yqjm_detail", "申请疫情减免", array, clientInf, _t);

                            khmodellist[ii].f_yqjmsf = model_tbl_ld_yqjm.f_yqjmsf;
                            khmodellist[ii].f_yqjmpwf = model_tbl_ld_yqjm.f_yqjmpwf;
                        }

                        idal_tbl_ld_khb.UpdateList(khmodellist, "f_yqjmsf,f_yqjmpwf", _t);

                        model_tbl_ld_yqjm.f_zt = "归档";
                        model_tbl_ld_yqjm.f_ztid = "2";
                        #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;
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        private sara.dd.ldsw.idal.Itbl_maintable _idal_tbl_maintable  = commonclass.dalfactory.Create <sara.dd.ldsw.idal.Itbl_maintable>(); //new sara.dd.ldsw.dal.tbl_maintable();

        #endregion

        #region 公有方法
        /// <summary>
        ///
        /// </summary>
        /// <param name="fk_tbl_maintable_sys_id"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        public string ReportWord(string fk_tbl_maintable_sys_id)
        {
            #region 执行操作

            #region 报表导出
            //数据项
            DataSet ds_base = new DataSet();
            //合并单元格
            DataSet ds_merge = new DataSet();
            //表格
            DataSet ds_table = new DataSet();
            //报表名称(唯一标识)
            string reportname = "40_tbl_maintable";

            //传入值:是否需要html预览(true,false);传出值:html文件路径或false
            string html = "false";
            //要导出文件名(用于对导出的文件命名)
            string outfilename = "";
            //错误代码:为空时:说明成功;不为空时:请查阅错误表
            string errormessage = "";
            //文件路径:用于接受要导出文件的全路径
            string filepath = "";

            #region 组织数据
            _model_tbl_maintable = _idal_tbl_maintable.GetList(" sys_id='" + fk_tbl_maintable_sys_id + "'", "", "*", "", "", null)[0];

            //数据项
            #region 数据项


            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("DATANAME"));       //数据项名称
            dt.Columns.Add(new DataColumn("DATAVALUE"));      //数据据项值(如果数据项是值,此处填写数据项的值,否则为空)
            dt.Columns.Add(new DataColumn("TABLENAME"));      //数据据项关联表名(如果数据项是表格,此处填写表格名称,否则为空)
            dt.Columns.Add(new DataColumn("LOCATION"));       //定位信息:一般为空,在报表服务中设置
            dt.Columns.Add(new DataColumn("STYLE"));          //样式信息:一般为空,在报表服务中设置


            //项目名称
            DataRow dr = dt.NewRow();
            dr["DATANAME"]  = "<@_TBL_MAINTABLE_XMMC_@>";
            dr["DATAVALUE"] = _model_tbl_maintable.xmmc;
            dr["TABLENAME"] = "";
            dt.Rows.Add(dr);


            //单位名称
            dr              = dt.NewRow();
            dr["DATANAME"]  = "<@_TBL_MAINTABLE_DWMC_@>";
            dr["DATAVALUE"] = _model_tbl_maintable.dwmc;
            dr["TABLENAME"] = "";
            dt.Rows.Add(dr);


            ds_base.Tables.Add(dt);
            #endregion

            //表格
            #region 表格

            //DataTable dt_data = _bll_tbl_100_xm_qsqk_xx.GetList(" fk_tbl_maintable_sys_id='" + fk_tbl_maintable_sys_id + "'").Tables[0];
            //DataTable dt_table = dt_data.Clone();
            ////第一行用于存列数据类型
            //dr = dt_table.NewRow();
            //dt_table.Rows.Add(dr);
            //dt_table.TableName = "TBL_100_XM_QSQK_XX_MODALPOPUPLIST";               //与上文(1)处的表格名称相对应
            //ds_table.Tables.Add(dt_table);           //与上文(1)处的表格名称相对应
            #endregion

            //合并单元格
            #region 合并单元格
            DataTable dt_merge = new DataTable("TBL_MAINTABLE");//与上文(1)处的表格名称相对应
            dt_merge.Columns.Add(new DataColumn("startrow"));
            dt_merge.Columns.Add(new DataColumn("startcolumn"));
            dt_merge.Columns.Add(new DataColumn("endrow"));
            dt_merge.Columns.Add(new DataColumn("endcolumn"));
            //DataRow dr_merge;

            //从下向上,从右向左,录入合并信息

            ds_merge.Tables.Add(dt_merge);

            #endregion

            #endregion
            #endregion
            _cc.ClearReportFile();
            if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll")
            {
                filepath = sara.platform.service.report.Service.CreatReport(ds_base, ds_table, ds_merge, reportname, ref html, ref outfilename, ref errormessage);
            }
            else
            {
                filepath = _ir.CreatReport(ds_base, ds_table, ds_merge, reportname, ref html, ref outfilename, ref errormessage);
            }
            if (errormessage == "")
            {
                string path     = filepath;
                string filename = "";
                int    count    = path.LastIndexOf('\\');
                filename = path.Substring(count, path.Length - count);
                filename = filename.TrimStart('\\');
                return(Eva.Library.Configuration.ConfigurationManager.AppSettings["ReportFileDownLoadLoadRootPath"].ToString() + filename);
            }
            else
            {
                throw new Exception(errormessage);
            }
            #endregion
        }
Exemplo n.º 11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fk_tbl_maintable_sys_id"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        public string ReportExcelBig(string fk_tbl_maintable_sys_id)
        {
            string filepath = Eva.Library.Configuration.ConfigurationManager.AppSettings[HttpContext.Current.Request.PhysicalApplicationPath + "EasyFrameServiceReport.config", "40_reportdownloadpath"].ToString();

            //  /sara.dd.ldsw.file/reports/reportfile/
            filepath = HttpContext.Current.Server.MapPath(filepath);

            string filename = DateTime.Now.Ticks.ToString() + ".csv";

            FileStream fs = new FileStream(filepath + filename, System.IO.FileMode.Create, System.IO.FileAccess.Write);
            //StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.Default);
            StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.UTF8);

            _model_tbl_maintable = _idal_tbl_maintable.GetList(" sys_id='" + fk_tbl_maintable_sys_id + "'", "", "*", "", "", null)[0];

            DataTable dt = new DataTable();

            for (int i = 0; i < 20; i++)
            {
                dt.Columns.Add("XMMC" + (i + 1).ToString());
            }
            //输入数据
            DataRow dr_temp;

            for (int i = 0; i < 20000; i++)
            {
                dr_temp = dt.NewRow();
                for (int j = 1; j <= 20; j++)
                {
                    dr_temp["XMMC" + j.ToString()] = _model_tbl_maintable.xmmc + "_" + j.ToString();
                }
                dt.Rows.Add(dr_temp);
            }

            string data = "";

            //写出列名称
            for (int i = 0; i < dt.Columns.Count; i++)
            {
                data += dt.Columns[i].ColumnName.ToString();
                if (i < dt.Columns.Count - 1)
                {
                    data += ",";
                }
            }
            sw.WriteLine(data);
            //写出各行数据
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                data = "";
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    string str = dt.Rows[i][j].ToString();
                    str = str.Replace("\"", "\"\"");//替换英文冒号 英文冒号需要换成两个冒号
                    var reg = new System.Text.RegularExpressions.Regex("^[1234567890.,,]+$");
                    if (reg.IsMatch(str))
                    {
                        str = "\t" + str;
                    }
                    if (str.Contains(",") || str.Contains("\"") ||
                        str.Contains("\r") || str.Contains("\n"))    //含逗号 冒号 换行符的需要放到引号中
                    {
                        str = string.Format("\"{0}\"", str);
                    }

                    data += str;
                    if (j < dt.Columns.Count - 1)
                    {
                        data += ",";
                    }
                }
                sw.WriteLine(data);
            }
            sw.Close();
            fs.Close();


            return(Eva.Library.Configuration.ConfigurationManager.AppSettings["ReportFileDownLoadLoadRootPath"].ToString() + filename);
        }
Exemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fk_tbl_maintable_sys_id"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        public string ReportExcel(string fk_tbl_maintable_sys_id)
        {
            #region 执行操作

            #region 报表导出
            //数据项
            DataSet ds_base = new DataSet();
            //合并单元格
            DataSet ds_merge = new DataSet();
            //表格
            DataSet ds_table = new DataSet();
            //报表名称(唯一标识)
            string reportname = "40_tbl_maintable_excel";

            //传入值:是否需要html预览(true,false);传出值:html文件路径或false
            string html = "false";
            //要导出文件名(用于对导出的文件命名)
            string outfilename = "";
            //错误代码:为空时:说明成功;不为空时:请查阅错误表
            string errormessage = "";
            //文件路径:用于接受要导出文件的全路径
            string filepath = "";


            #region 组织数据

            #region 获取数据
            _model_tbl_maintable = _idal_tbl_maintable.GetList(" sys_id='" + fk_tbl_maintable_sys_id + "'", "", "*", "", "", null)[0];

            #endregion

            //数据项
            #region 数据项

            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("DATANAME"));       //数据项名称
            dt.Columns.Add(new DataColumn("DATAVALUE"));      //数据据项值(如果数据项是值,此处填写数据项的值,否则为空)
            dt.Columns.Add(new DataColumn("TABLENAME"));      //数据据项关联表名(如果数据项是表格,此处填写表格名称,否则为空)
            dt.Columns.Add(new DataColumn("LOCATION"));       //定位信息:一般为空,在报表服务中设置
            dt.Columns.Add(new DataColumn("STYLE"));          //样式信息:一般为空,在报表服务中设置
            DataRow dr;
            #region 数据

            //表格
            dr              = dt.NewRow();
            dr["DATANAME"]  = "<@_TABLE_@>";
            dr["DATAVALUE"] = "";
            dr["TABLENAME"] = "TABLE";
            dt.Rows.Add(dr);

            ds_base.Tables.Add(dt);
            #endregion

            //表格
            DataTable dt_table = new DataTable();
            for (int i = 0; i < 20; i++)
            {
                dt_table.Columns.Add("XMMC" + (i + 1).ToString());
            }
            //第一行用于存列数据类型
            dr = dt_table.NewRow();
            dt_table.Rows.Add(dr);
            //输入数据
            DataRow dr_temp;
            for (int i = 0; i < 20; i++)
            {
                dr_temp = dt_table.NewRow();
                for (int j = 1; j <= 20; j++)
                {
                    dr_temp["XMMC" + j.ToString()] = _model_tbl_maintable.xmmc + "_" + j.ToString();
                }
                dt_table.Rows.Add(dr_temp);
            }
            dt_table.TableName = "TABLE";               //与上文(1)处的表格名称相对应
            ds_table.Tables.Add(dt_table);

            //合并单元格
            #region 合并单元格
            DataTable dt_merge = new DataTable("TABLE");//与上文(1)处的表格名称相对应
            dt_merge.Columns.Add(new DataColumn("startrow"));
            dt_merge.Columns.Add(new DataColumn("startcolumn"));
            dt_merge.Columns.Add(new DataColumn("endrow"));
            dt_merge.Columns.Add(new DataColumn("endcolumn"));
            DataRow dr_merge;

            ////从下向上,从右向左,录入合并信息
            //int count_datasource = datasource.Rows.Count;
            ////合计
            //dr_merge = dt_merge.NewRow();
            //dr_merge["startrow"] = count_datasource.ToString();
            //dr_merge["startcolumn"] = "1";
            //dr_merge["endrow"] = count_datasource.ToString();
            //dr_merge["endcolumn"] = "2";
            //dt_merge.Rows.Add(dr_merge);



            ds_merge.Tables.Add(dt_merge);
            #endregion


            #endregion

            #endregion


            #endregion

            _cc.ClearReportFile();
            if (sara.dd.ldsw.commonclass.commonclass.GetPlatformServiceModel() == "dll")
            {
                filepath = sara.platform.service.report.Service.CreatReport(ds_base, ds_table, ds_merge, reportname, ref html, ref outfilename, ref errormessage);
            }
            else
            {
                filepath = _ir.CreatReport(ds_base, ds_table, ds_merge, reportname, ref html, ref outfilename, ref errormessage);
            }
            if (errormessage == "")
            {
                string path     = filepath;
                string filename = "";
                int    count    = path.LastIndexOf('\\');
                filename = path.Substring(count, path.Length - count);
                filename = filename.TrimStart('\\');
                return(Eva.Library.Configuration.ConfigurationManager.AppSettings["ReportFileDownLoadLoadRootPath"].ToString() + filename);
            }
            else
            {
                throw new Exception(errormessage);
            }
            #endregion
        }
Exemplo n.º 13
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);
        }