Exemplo n.º 1
0
        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_ld_xhhbt model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_ld_xhhbt>(json);

                columns              = FormatColumns(columns).Replace("^", ",");
                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_ld_xhhbt.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
        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_ld_xhhbt model = Eva.Library.Format.FormatEntityTool.FormatJsonToModel <sara.dd.ldsw.model.tbl_ld_xhhbt>(json);
                resultDic["result"]  = "true";
                resultDic["message"] = _idal_tbl_ld_xhhbt.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.º 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];

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


            string all_result = "";

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        #endregion

                        //调整数据状态

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


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