示例#1
0
        public string ycDHPay(string paynostr, string wdstr, string sfystr, string gmrq, string khbh, decimal je)
        {
            try
            {
                sara.dd.ldsw.idal.Itbl_ld_cbiao        _idal_tbl_ld_cbiao = new sara.dd.ldsw.dal.tbl_ld_cbiao();
                sara.dd.ldsw.idal.Itbl_ld_khb          _idal_tbl_ld_khb   = new sara.dd.ldsw.dal.tbl_ld_khb();
                sara.dd.ldsw.idal.Itbl_ld_jfb          idal_tbl_ld_jfb    = new sara.dd.ldsw.dal.tbl_ld_jfb();
                List <sara.dd.ldsw.model.tbl_ld_cbiao> modellist          = _idal_tbl_ld_cbiao.GetList(" f_khbh='" + khbh + "' and f_ztid='2' and (f_cbbh like 'DH%' or f_cbbh like 'ZB%')", "false", "", "*", "", "", null);
                List <sara.dd.ldsw.model.tbl_ld_khb>   khmodellist        = _idal_tbl_ld_khb.GetList(" f_khbh='" + khbh + "'", "", "*", "", "", null);

                if (modellist.Count == 1 && Eva.Library.Text.NumberTool.Parse(modellist[0].f_bqje) == (double)je)
                {
                    sara.dd.ldsw.model.tbl_ld_cbiao model   = modellist[0];
                    sara.dd.ldsw.model.tbl_ld_khb   khmodel = khmodellist[0];


                    #region 创建缴费记录
                    //时间信息
                    DateTimeFormatInfo dtFormat = new DateTimeFormatInfo();

                    dtFormat.ShortDatePattern = "yyyy/MM/dd";

                    System.DateTime currentTime = new System.DateTime();
                    currentTime = System.DateTime.Now;

                    DateTime blankTime = DateTime.Parse("1900-01-01");
                    sara.dd.ldsw.model.tbl_ld_jfb jfmodel = new model.tbl_ld_jfb();
                    //jfmodel.sys_id = int.Parse(idal_tbl_ld_jfb.GetMaxId(null));
                    jfmodel.sys_creatuserid      = "1564";
                    jfmodel.sys_creatusername    = "******";
                    jfmodel.sys_creatdate        = currentTime;
                    jfmodel.sys_lastedituserid   = "1564";
                    jfmodel.sys_lasteditusername = "******";
                    jfmodel.sys_lasteditdate     = currentTime;
                    jfmodel.sys_deldate          = blankTime;
                    jfmodel.sys_delflag          = "0";
                    jfmodel.f_jfbh       = commonclass.commonclass.getBusinessNum("JF", "", null);
                    jfmodel.f_jfrq       = currentTime;
                    jfmodel.f_jffs       = "邮储代缴大用户";
                    jfmodel.f_jffsid     = "05740014";
                    jfmodel.f_jcfs       = "全额找零";
                    jfmodel.f_jcfsid     = "05750001";
                    jfmodel.f_yyy        = "PBT";
                    jfmodel.f_yyyid      = "1564";
                    jfmodel.f_czsj       = currentTime;
                    jfmodel.f_sfykfp     = "false";
                    jfmodel.f_zt         = "已提交";
                    jfmodel.f_ztid       = "2";
                    jfmodel.f_khbh       = khmodel.f_khbh;
                    jfmodel.f_khbhid     = khmodel.sys_id.ToString();
                    jfmodel.f_yhbh       = khmodel.f_yhbh;
                    jfmodel.f_yhbhid     = khmodel.f_yhbhid;
                    jfmodel.f_yhm        = khmodel.f_yhm;
                    jfmodel.f_jfm        = khmodel.f_jfm;
                    jfmodel.f_dh         = khmodel.f_dh;
                    jfmodel.f_dz         = khmodel.f_dz;
                    jfmodel.f_dy         = khmodel.f_dy;
                    jfmodel.f_dyid       = khmodel.f_dyid;
                    jfmodel.f_sc         = khmodel.f_sc;
                    jfmodel.f_scid       = khmodel.f_scid;
                    jfmodel.f_qy         = khmodel.f_qy;
                    jfmodel.f_qyid       = khmodel.f_qyid;
                    jfmodel.f_pq         = khmodel.f_pq;
                    jfmodel.f_pqid       = khmodel.f_pqid;
                    jfmodel.f_sbbh       = khmodel.f_sbbh;
                    jfmodel.f_sbbhid     = khmodel.f_sbbhid;
                    jfmodel.f_sblx       = khmodel.f_sblx;
                    jfmodel.f_sblxid     = khmodel.f_sblxid;
                    jfmodel.f_yslx       = khmodel.f_yslx;
                    jfmodel.f_yslxid     = khmodel.f_yslxid;
                    jfmodel.f_lxtkhh     = khmodel.f_lxth;
                    jfmodel.f_rs         = khmodel.f_rs;
                    jfmodel.f_cbbh       = model.f_cb_cbbh;
                    jfmodel.f_cbbhid     = model.sys_id.ToString();
                    jfmodel.f_cbyslj     = model.f_bqje;
                    jfmodel.f_sllj       = model.f_bqsl;
                    jfmodel.f_sflj       = model.f_sf;
                    jfmodel.f_pwflj      = model.f_pwf;
                    jfmodel.f_dj         = Eva.Library.Text.NumberTool.GetNumberByLength(Eva.Library.Text.NumberTool.Parse(jfmodel.f_cbyslj) / Eva.Library.Text.NumberTool.Parse(jfmodel.f_sllj), 2);
                    jfmodel.f_jmhyslj    = model.f_bqje;
                    jfmodel.f_khytjjzsf  = khmodel.f_tjjzsf;
                    jfmodel.f_khytjjzpwf = khmodel.f_tjjzpwf;
                    jfmodel.f_sfsytjjz   = "false";
                    jfmodel.f_sytjjzsf   = "0";
                    jfmodel.f_sytjjzpwf  = "0";
                    jfmodel.f_syhtjjzsf  = khmodel.f_tjjzsf;
                    jfmodel.f_syhtjjzpwf = khmodel.f_tjjzpwf;
                    jfmodel.f_khyye      = khmodel.f_ycje;
                    jfmodel.f_sfsyye     = "false";
                    jfmodel.f_syye       = "0";
                    jfmodel.f_yhye       = khmodel.f_ycje;
                    jfmodel.f_shys       = model.f_bqje;
                    jfmodel.f_shss       = model.f_bqje;
                    jfmodel.f_hszl       = "0";
                    jfmodel.f_shssdx     = sara.dd.ldsw.commonclass.commonclass.num2String((Eva.Library.Text.NumberTool.Parse(jfmodel.f_cbyslj)));
                    jfmodel.f_khfz       = khmodel.f_khfz;
                    jfmodel.f_khfzid     = khmodel.f_khfzid;
                    jfmodel.f_cbenbh     = khmodel.f_cbbh;
                    jfmodel.f_cbenbhid   = khmodel.f_cbbhid;
                    jfmodel.f_ljqf       = khmodel.f_ljqf;
                    jfmodel.f_jmjelj     = "0";
                    jfmodel.f_ly         = "邮储银行缴费";
                    jfmodel.f_lyid       = "08080008";
                    jfmodel.f_sfjl       = model.f_sfjl;

                    //插入缴费表
                    string jfsysid = idal_tbl_ld_jfb.Add(jfmodel, null);


                    #endregion

                    #region 更新抄表表
                    model.f_zt     = "已缴费";
                    model.f_ztid   = "3";
                    model.f_jfbh   = jfmodel.f_jfbh;
                    model.f_jfbhid = jfsysid;
                    model.f_jfsj   = jfmodel.f_jfrq;
                    _idal_tbl_ld_cbiao.Update(model, "f_zt,f_ztid,f_jfbh,f_jfbhid,f_jfsj", null);
                    #endregion

                    #region 更新客户表
                    khmodel.f_ljqf = "0";
                    _idal_tbl_ld_khb.Update(khmodel, "f_ljqf", null);

                    List <IDictionary <string, string> > array = new List <IDictionary <string, string> >();
                    IDictionary <string, string>         temp  = null;
                    temp = new Dictionary <string, string>();
                    temp.Add("key", "f_ljqf");
                    temp.Add("oldvalue", khmodel.f_ljqf);
                    temp.Add("newvalue", "0");
                    temp.Add("name", "累计欠费");
                    array.Add(temp);
                    sara.dd.ldsw.commonclass.commonclass.addUpdateLog("tbl_ld_khb", model.f_khbhid.ToString(), "tbl_ld_jfb_detail", "邮储代缴大用户", array, "", null);
                    #endregion

                    #region 增加对账记录
                    _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();

                    string sql = "insert into TBL_LD_YCXZJL (f_lsh,f_wd,f_sfy,f_gmrq,f_khbh,f_gmsl,f_sfje,f_lx,sys_id) VALUES ('" + paynostr + "','" + wdstr + "','" + sfystr + "','" + gmrq + "','" + khbh + "','" + model.f_bqsl + "','" + je + "','DH',SEQ_TBL_LD_YCXZJL.nextval)";
                    int    ins = _iAccessData.ExecuteSql(sql);

                    if (ins > 0)
                    {
                        return("true");
                    }
                    else
                    {
                        return("false");
                    }
                    #endregion
                }
                else
                {
                    //销账状态
                    return("false");
                }
            }
            catch (Exception ex)
            {
                //程序异常

                return("error");
            }
        }
示例#2
0
        public string ycDHQuery(string khbh)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            try
            {
                _iAccessData = sara.dd.ldsw.commonclass.commonclass.CreateIAccessData();

                //判断该用户是否处于建行托收
                string sql   = "select count(*) as count from TBL_LD_JFB  where f_lyid='08080002' and f_ztid='0' and f_khbh='" + khbh + "'";
                string count = _iAccessData.GetSingle(sql).ToString();

                if (Eva.Library.Text.NumberTool.Parse(count) > 0)
                {
                    //处于建行托收不能缴费
                    result["ret"] = "50";
                }
                else
                {
                    sara.dd.ldsw.idal.Itbl_ld_cbiao _idal_tbl_ld_cbiao = new sara.dd.ldsw.dal.tbl_ld_cbiao();
                    //sara.dd.ldsw.idal.Itbl_ld_khb _idal_tbl_ld_khb = new sara.dd.ldsw.dal.tbl_ld_khb();
                    List <sara.dd.ldsw.model.tbl_ld_cbiao> modellist = _idal_tbl_ld_cbiao.GetList(" f_khbh='" + khbh + "' and f_ztid='2' and (f_cbbh like 'DH%' or f_cbbh like 'ZB%')", "false", "", "*", "", "", null);
                    //List<sara.dd.ldsw.model.tbl_ld_khb> khmodellist = _idal_tbl_ld_khb.GetList(" f_khbh='" + khbh + "'", "", "*", "", "", null);

                    if (modellist.Count == 1)
                    {
                        sara.dd.ldsw.model.tbl_ld_cbiao model = modellist[0];


                        //客户名
                        result["custname"] = model.f_yhm;

                        //地址
                        result["custaddr"] = model.f_dz;


                        double bqje    = Eva.Library.Text.NumberTool.Parse(model.f_bqje);
                        string bqjestr = Eva.Library.Text.NumberTool.GetNumberByLength((bqje * 100), 0);
                        //应收金额
                        result["amount"] = model.f_bqje;


                        double sl     = Eva.Library.Text.NumberTool.Parse(model.f_bqsl);
                        double sf     = Eva.Library.Text.NumberTool.Parse(model.f_sf);
                        string sfstr  = Eva.Library.Text.NumberTool.GetNumberByLength(sf * 100, 0);
                        double pwf    = Eva.Library.Text.NumberTool.Parse(model.f_pwf);
                        string pwfstr = Eva.Library.Text.NumberTool.GetNumberByLength(pwf * 100, 0);
                        string sfdj   = Eva.Library.Text.NumberTool.GetNumberByLength((sf / sl), 0);
                        string pwfdj  = Eva.Library.Text.NumberTool.GetNumberByLength((pwf / sl), 0);

                        result["begincode"] = model.f_sqzm;
                        result["endcode"]   = model.f_bqzm;
                        result["wateruse"]  = model.f_bqsl;
                        result["wateramt"]  = sfdj;
                        result["pwamt"]     = pwfdj;
                        result["ret"]       = "49";
                    }
                    else
                    {
                        //抄表记录不唯一
                        //返回码不存在
                        result["ret"] = "50";
                    }
                }

                return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(result));
            }
            catch (Exception ex)
            {
                //程序异常
                result["ret"] = "50";
                return(Eva.Library.Format.FormatEntityTool.FormatDicToJson(result));
            }
        }