Exemplo n.º 1
0
 /*
  * #################################    艾众管家    #########################################
  */
 public void ButlerSync(string opration, string userName)
 {
     try
     {
         if (ConfigurationManager.AppSettings["IsPutGJ"].ToString().Equals("Y"))
         {
             ButlerSrv.AppService service = new ButlerSrv.AppService
             {
                 Timeout = 5000,
                 Url     = ConfigurationManager.AppSettings["ButlerUrl"].ToString()
             };
             if (opration.Equals("insert"))
             {
                 service.SetCustomer(Entity.CustNo, Entity.CustName, Entity.CustShortName, Entity.CustType, Entity.Representative,
                                     Entity.BusinessScope, Entity.CustLicenseNo, Entity.RepIDCard, Entity.CustContact, Entity.CustTel,
                                     Entity.CustContactMobile, Entity.CustEmail, Entity.CustBankTitle, Entity.CustBankAccount, Entity.CustBank,
                                     Entity.IsExternal, userName, "insert", "5218E3ED752A49D4");
             }
             else
             {
                 service.SetCustomer(Entity.CustNo, Entity.CustName, Entity.CustShortName, Entity.CustType, Entity.Representative,
                                     Entity.BusinessScope, Entity.CustLicenseNo, Entity.RepIDCard, Entity.CustContact, Entity.CustTel,
                                     Entity.CustContactMobile, Entity.CustEmail, Entity.CustBankTitle, Entity.CustBankAccount, Entity.CustBank,
                                     Entity.IsExternal, userName, "update", "5218E3ED752A49D4");
             }
         }
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 2
0
        private string refundaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
                setting.load("CurrParkNo");

                ButlerSrv.AppService service = new ButlerSrv.AppService();
                string str1 = service.CRDispositLoad(jp.getValue("id"), "5218E3ED752A49D4");

                Entity.Op.EntityPayment ot = new project.Entity.Op.EntityPayment();
                object oj = JsonToObject(str1, ot);
                Entity.Op.EntityPayment bc = (Entity.Op.EntityPayment)oj;

                if (bc.ARState != "0")
                {
                    flag = "3";
                    collection.Add(new JsonStringValue("info", "客服尚未申请退押金,当前状态不允许退押金!"));
                }
                else
                {
                    RefundReturn rt = Refund(bc.TransactionId, bc.PayNo,
                                             (ParseDecimalForString(bc.Amount) * 100).ToString("0"),
                                             (ParseDecimalForString(bc.RefundAmount) * 100).ToString("0"));
                    if (rt.ResultCode == "SUCCESS")
                    {
                        string InfoMsg = service.Refund_Disposrit(jp.getValue("id"), "5218E3ED752A49D4");
                        if (InfoMsg != "")
                        {
                            flag = "3";
                            collection.Add(new JsonStringValue("info", "退押金成功,服务申请状态修改异常!"));
                        }
                        else
                        {
                            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("MinDate"), jp.getValue("MaxDate"),
                                                                                     jp.getValue("PayState"), ParseIntForString(jp.getValue("page")))));
                        }
                    }
                    else
                    {
                        flag = "3";
                        collection.Add(new JsonStringValue("info", rt.ErrCodeDes));
                    }
                }
            }
            catch (Exception ex)
            {
                flag = "3";
                collection.Add(new JsonStringValue("info", ex.ToString()));
            }

            collection.Add(new JsonStringValue("type", "refund"));
            collection.Add(new JsonStringValue("flag", flag));

            return(collection.ToString());
        }
Exemplo n.º 3
0
        private string refundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.ContractStartDate >= Convert.ToDateTime(jp.getValue("RefundDate")))
                {
                    flag = "2";
                }
                else if (bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    string InfoBar = refund(jp.getValue("id"), jp.getValue("RefundDate"), user.Entity.UserName);
                    if (InfoBar != "")
                    {
                        flag = "4";
                        collection.Add(new JsonStringValue("InfoBar", InfoBar));
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));

                        #region  步到管家
                        try
                        {
                            string status = string.Empty;
                            string date   = string.Empty;
                            bc.CheckCustStatus(out status, out date);
                            ButlerSrv.AppService appService = new ButlerSrv.AppService {
                                Timeout = 5000
                            };
                            appService.UpdateCustomer(bc.Entity.ContractCustNo, status, date);
                        }
                        catch (Exception ex)
                        {
                            collection.Add(new JsonStringValue("syncButlerException", ex.ToString()));
                        }
                        #endregion
                    }
                }
            }
            catch { flag = "99"; }

            collection.Add(new JsonStringValue("type", "refundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
Exemplo n.º 4
0
        private string createList(string MinDate, string MaxDate, string PayState, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='10%'>支付单号</th>");
            sb.Append("<th width='12%'>会议室名称</th>");
            sb.Append("<th width='13%'>申请客户</th>");
            sb.Append("<th width='10%'>申请人</th>");
            sb.Append("<th width='10%'>租赁时间</th>");
            sb.Append("<th width='10%'>支付金额</th>");
            sb.Append("<th width='10%'>租金</th>");
            sb.Append("<th width='10%'>押金</th>");
            sb.Append("<th width='10%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
            setting.load("CurrParkNo");

            ButlerSrv.AppService service = new ButlerSrv.AppService();
            string str1 = service.GetCRDispositList(setting.Entity.StringValue, MinDate, MaxDate, PayState, page, 15, "5218E3ED752A49D4");

            PaymentInfo ot = new PaymentInfo();
            object      oj = JsonToObject(str1, ot);

            foreach (Entity.Op.EntityPayment it in ((PaymentInfo)oj).list)
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.PayNo + "</td>");
                sb.Append("<td>" + it.CRName + "</td>");
                sb.Append("<td>" + it.ApplyCustName + "</td>");
                sb.Append("<td>" + it.ApplyUserName + "</td>");
                sb.Append("<td>" + it.ReservedTime + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.Amount).ToString("0.##") + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.RentAmount).ToString("0.##") + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.Disposit).ToString("0.##") + "</td>");
                sb.Append("<td><span class=\"label " + (it.ARState == "1" ? "label-success" : "") + " radius\">" + it.ARStateName + "</span></td>");

                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(service.GetCRDispositCount(setting.Entity.StringValue, MinDate, MaxDate, PayState, "5218E3ED752A49D4"), pageSize, page, 7));
            return(sb.ToString());
        }
Exemplo n.º 5
0
        private string createList(string MinApplyDate, string MaxApplyDate, string State, int page)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder("");

            sb.Append("<table class=\"table table-border table-bordered table-hover table-bg table-sort\" id=\"tablelist\">");
            sb.Append("<thead>");
            sb.Append("<tr class=\"text-c\">");
            sb.Append("<th width=\"5%\">序号</th>");
            sb.Append("<th width='13%'>申请单号</th>");
            sb.Append("<th width='13%'>申请日期</th>");
            sb.Append("<th width='13%'>申请客户</th>");
            sb.Append("<th width='13%'>申请人</th>");
            sb.Append("<th width='18%'>租赁时间</th>");
            sb.Append("<th width='13%'>金额</th>");
            sb.Append("<th width='12%'>状态</th>");
            sb.Append("</tr>");
            sb.Append("</thead>");

            int r = 1;

            sb.Append("<tbody>");
            Business.Base.BusinessSetting setting = new Business.Base.BusinessSetting();
            setting.load("CurrParkNo");

            ButlerSrv.AppService service = new ButlerSrv.AppService();
            string str1 = service.GetRefundList(setting.Entity.StringValue, MinApplyDate, MaxApplyDate, State, page, 15, "5218E3ED752A49D4");

            ApplyRefundInfo ot = new ApplyRefundInfo();
            object          oj = JsonToObject(str1, ot);

            foreach (Entity.Op.EntityApplyRefund it in ((ApplyRefundInfo)oj).list)
            {
                sb.Append("<tr class=\"text-c\" id=\"" + it.RowPointer + "\">");
                sb.Append("<td style=\"text-align:center;\">" + r.ToString() + "</td>");
                sb.Append("<td>" + it.ARNo + "</td>");
                sb.Append("<td>" + ParseDateForString(it.ApplyDate).ToString("yyyy-MM-dd HH:mm") + "</td>");
                sb.Append("<td>" + it.ApplyCustName + "</td>");
                sb.Append("<td>" + it.ApplyUserName + "</td>");
                sb.Append("<td>" + it.LeaseTime + "</td>");
                sb.Append("<td>" + ParseDecimalForString(it.RefundAmount).ToString("0.##") + "</td>");
                sb.Append("<td><span class=\"label " + (it.ARState == "0" ? "" : "label-success") + " radius\">" + (it.ARState == "0" ? "未退款" : "已退款") + "</span></td>");

                sb.Append("</tr>");
                r++;
            }
            sb.Append("</tbody>");
            sb.Append("</table>");

            sb.Append(Paginat(service.GetRefundCount(setting.Entity.StringValue, MinApplyDate, MaxApplyDate, "5218E3ED752A49D4"), pageSize, page, 7));
            return(sb.ToString());
        }
Exemplo n.º 6
0
        private string refundsubmitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                DateTime leaveDate = Convert.ToDateTime(jp.getValue("RefundDate"));
                Business.Op.BusinessContract bc = new Business.Op.BusinessContract();
                bc.load(jp.getValue("id"));
                if (bc.Entity.ContractStartDate >= leaveDate)
                {
                    flag = "2";
                }
                else if (bc.Entity.ContractStatus != "2")
                {
                    flag = "3";
                }
                else
                {
                    string infoMsg = bc.ConfirmLeaveWithNoFee(leaveDate);
                    if (infoMsg != "")
                    {
                        collection.Add(new JsonStringValue("InfoBar", infoMsg));
                        flag = "4";
                    }
                    else
                    {
                        collection.Add(new JsonStringValue("liststr", createList(jp.getValue("ContractNoS"), jp.getValue("ContractNoManualS"), jp.getValue("ContractTypeS"),
                                                                                 jp.getValue("ContractSPNoS"), jp.getValue("ContractCustNoS"), jp.getValue("MinContractSignedDate"), jp.getValue("MaxContractSignedDate"),
                                                                                 jp.getValue("MinContractEndDate"), jp.getValue("MaxContractEndDate"), jp.getValue("OffLeaseStatusS"), jp.getValue("MinOffLeaseActulDate"),
                                                                                 jp.getValue("MaxOffLeaseActulDate"), ParseIntForString(jp.getValue("page")))));


                        #region  步到管家
                        try
                        {
                            string status = string.Empty;
                            string date   = string.Empty;
                            bc.CheckCustStatus(out status, out date);
                            ButlerSrv.AppService appService = new ButlerSrv.AppService {
                                Timeout = 5000
                            };
                            appService.UpdateCustomer(bc.Entity.ContractCustNo, status, date);
                        }
                        catch (Exception ex)
                        {
                            collection.Add(new JsonStringValue("syncButlerException", ex.ToString()));
                        }
                        #endregion

                        #region  步到资源系统
                        string syncResult = string.Empty;
                        try
                        {
                            ResourceService.ResourceService srv = new ResourceService.ResourceService
                            {
                                Timeout = 5000,
                                Url     = ConfigurationManager.AppSettings["ResourceServiceUrl"].ToString()
                            };
                            string Items = "";
                            Business.Base.BusinessCustomer cust = new Business.Base.BusinessCustomer();
                            cust.load(bc.Entity.ContractCustNo);
                            var dt = obj.PopulateDataSet("SELECT WPNo FROM Op_ContractWPRentalDetail WHERE RefRP='" + bc.Entity.RowPointer + "' GROUP BY WPNo").Tables[0];
                            foreach (DataRow dr in dt.Rows)
                            {
                                SycnResourceStatus rs = new SycnResourceStatus();
                                rs.SysID         = 1; //1.订单
                                rs.ResourceID    = dr["WPNo"].ToString();
                                rs.BusinessID    = bc.Entity.RowPointer;
                                rs.BusinessNo    = bc.Entity.ContractNo;
                                rs.BusinessType  = 1;//1租赁,2物业
                                rs.RentBeginTime = bc.Entity.FeeStartDate;
                                rs.RentEndTime   = leaveDate;
                                rs.Status        = 2;
                                rs.RentType      = 1;
                                rs.UpdateTime    = GetDate();
                                rs.UpdateUser    = user.Entity.UserName;
                                Items           += (Items == "" ? "" : ",") + JsonConvert.SerializeObject(rs);
                            }
                            syncResult = srv.LeaseOut("[" + Items + "]");
                        }
                        catch (Exception ex)
                        {
                            syncResult = ex.ToString();
                        }
                        collection.Add(new JsonStringValue("sync", syncResult));
                        #endregion
                    }
                }
            }
            catch { }

            collection.Add(new JsonStringValue("type", "refundsubmit"));
            collection.Add(new JsonStringValue("flag", flag));
            return(collection.ToString());
        }
Exemplo n.º 7
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Base.BusinessCustomer bc = new project.Business.Base.BusinessCustomer();
                if (jp.getValue("tp") == "update")
                {
                    bc.load(jp.getValue("id"));
                    bc.Entity.CustName          = jp.getValue("CustName");
                    bc.Entity.CustShortName     = jp.getValue("CustShortName");
                    bc.Entity.CustType          = jp.getValue("CustType");
                    bc.Entity.Representative    = jp.getValue("Representative");
                    bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                    bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                    bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                    bc.Entity.CustContact       = jp.getValue("CustContact");
                    bc.Entity.CustTel           = jp.getValue("CustTel");
                    bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                    bc.Entity.CustEmail         = jp.getValue("CustEmail");
                    bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                    bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                    bc.Entity.CustBank          = jp.getValue("CustBank");
                    bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");

                    int r = bc.Save("update");

                    if (r <= 0)
                    {
                        flag = "2";
                    }
                    else
                    {
                        try
                        {
                            //同步艾众管家
                            ButlerSrv.AppService service = new ButlerSrv.AppService();
                            service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                user.Entity.UserName, "update", "5218E3ED752A49D4");

                            WOService.WebService service1 = new WOService.WebService();
                            service1.Url = wopath;
                            service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                 bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                 bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                 user.Entity.UserName, "update", "5218E3ED752A49D4");
                        }
                        catch { }
                    }
                }
                else
                {
                    Data      obj = new Data();
                    DataTable dt  = obj.PopulateDataSet("select cnt=COUNT(*) from Mstr_Customer where CustNo='" + jp.getValue("CustNo") + "'").Tables[0];
                    if (int.Parse(dt.Rows[0]["cnt"].ToString()) > 0)
                    {
                        flag = "3";
                    }
                    else
                    {
                        bc.Entity.CustNo            = jp.getValue("CustNo");
                        bc.Entity.CustName          = jp.getValue("CustName");
                        bc.Entity.CustShortName     = jp.getValue("CustShortName");
                        bc.Entity.CustType          = jp.getValue("CustType");
                        bc.Entity.Representative    = jp.getValue("Representative");
                        bc.Entity.BusinessScope     = jp.getValue("BusinessScope");
                        bc.Entity.CustLicenseNo     = jp.getValue("CustLicenseNo");
                        bc.Entity.RepIDCard         = jp.getValue("RepIDCard");
                        bc.Entity.CustContact       = jp.getValue("CustContact");
                        bc.Entity.CustTel           = jp.getValue("CustTel");
                        bc.Entity.CustContactMobile = jp.getValue("CustContactMobile");
                        bc.Entity.CustEmail         = jp.getValue("CustEmail");
                        bc.Entity.CustBankTitle     = jp.getValue("CustBankTitle");
                        bc.Entity.CustBankAccount   = jp.getValue("CustBankAccount");
                        bc.Entity.CustBank          = jp.getValue("CustBank");
                        bc.Entity.IsExternal        = (jp.getValue("IsExternal") == "1");

                        bc.Entity.CustStatus     = "3";
                        bc.Entity.CustCreator    = user.Entity.UserName;
                        bc.Entity.CustCreateDate = GetDate();

                        int r = bc.Save("insert");
                        if (r <= 0)
                        {
                            flag = "2";
                        }
                        else
                        {
                            try
                            {
                                //同步艾众管家
                                ButlerSrv.AppService service = new ButlerSrv.AppService();
                                service.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                    bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                    bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                    user.Entity.UserName, "insert", "5218E3ED752A49D4");

                                WOService.WebService service1 = new WOService.WebService();
                                service1.Url = wopath;
                                service1.SetCustomer(bc.Entity.CustNo, bc.Entity.CustName, bc.Entity.CustShortName, bc.Entity.CustType, bc.Entity.Representative,
                                                     bc.Entity.BusinessScope, bc.Entity.CustLicenseNo, bc.Entity.RepIDCard, bc.Entity.CustContact, bc.Entity.CustTel,
                                                     bc.Entity.CustContactMobile, bc.Entity.CustEmail, bc.Entity.CustBankTitle, bc.Entity.CustBankAccount, bc.Entity.CustBank, bc.Entity.IsExternal,
                                                     user.Entity.UserName, "insert", "5218E3ED752A49D4");
                            }
                            catch { }
                        }
                    }
                }
            }
            catch { flag = "2"; }


            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));
            collection.Add(new JsonStringValue("liststr", createList(jp.getValue("CustNoS"), jp.getValue("CustNameS"), jp.getValue("CustTypeS"), jp.getValue("CustStatusS"), ParseIntForString(jp.getValue("page")))));

            return(collection.ToString());
        }