/// <summary> /// 调度实现 /// </summary> static public void Dispatcher(string jsonText) { string om = DNTRequest.GetString("om"); if (string.IsNullOrEmpty(om)) { om = JsonRequest.GetJsonKeyVal(jsonText, "om"); } if (!string.IsNullOrEmpty(om)) { #region 实现 switch (om) { case "regionhelper": IRegion.Implementation(jsonText); break; case "jobhelper": IJob.Implementation(jsonText); break; } #endregion } }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { #region 实现 switch (action) { case "heartbeatcheck": HttpContext.Current.Response.Write(HeartbeatCheck()); break; case "getheartbeatinterval": HttpContext.Current.Response.Write(GetHeartbeatInterval()); break; } #endregion } }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { #region 实现 switch (action) { case "test": HttpContext.Current.Response.Write(Test()); break; case "jqgrid": HttpContext.Current.Response.Write(GetJqGrid()); break; case "writecookie": HttpContext.Current.Response.Write(WriteCookie()); break; case "getcookie": HttpContext.Current.Response.Write(GetCookie()); break; } #endregion } }
/// <summary> /// 调度 /// </summary> static public void Dispatcher() { string op = DNTRequest.GetString("op"); string jsonText = string.Empty; if (string.IsNullOrEmpty(op)) { op = JsonRequest.GetJsonKeyVal("op", ref jsonText); } if (!string.IsNullOrEmpty(op)) { switch (op) { case "bwjs": BWJSDispatcherServices.Dispatcher(jsonText); break; case "mofang": MofangDispatcherServices.Dispatcher(jsonText); break; default: break; } } }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { #region 实现 switch (action) { case "getR": HttpContext.Current.Response.Write(GetRegion()); break; case "getProductPropertyArea": HttpContext.Current.Response.Write(GetProductPropertyArea()); break; } #endregion } }
/// <summary> /// 调度 /// </summary> static public void Dispatcher(string jsonText) { string om = DNTRequest.GetString("om"); if (string.IsNullOrEmpty(om)) { om = JsonRequest.GetJsonKeyVal(jsonText, "om"); } if (!string.IsNullOrEmpty(om)) { #region 实现 switch (om) { case "test": ITest.Implementation(jsonText); break; case "gl": IGL.Implementation(jsonText); break; case "func": IFunction.Implementation(jsonText); break; case "netloan": INetLoan.Implementation(jsonText); break; case "newnetloan": INewNetLoan.Implementation(jsonText); break; case "menu": ILeftMenu.Implementation(jsonText); break; case "heartbeat": IHeartbeat.Implementation(jsonText); break; case "settlement": ISettlement.Implementation(jsonText); break; case "product": IProduct.Implementation(jsonText); break; } #endregion } }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { switch (action) { case "test": //HttpContext.Current.Response.Write(test()); break; } } }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { #region 实现 switch (action) { case "getsettlementlist": HttpContext.Current.Response.Write(GetSettlementList()); break; case "queryOrder": HttpContext.Current.Response.Write(QueryOrderList()); break; case "applysettlement": HttpContext.Current.Response.Write(ApplySettlement()); break; case "getsettlementmodel": HttpContext.Current.Response.Write(GetSettlementModel()); break; case "confirmsettlement": HttpContext.Current.Response.Write(ConfirmSettlement()); break; } #endregion } }
static public Object SupplierInfo() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; #region 搜索 StringBuilder sqlSearch = new StringBuilder(); string SignName = DNTRequest.GetString("SignName"); string UserName = DNTRequest.GetString("UserName"); string UserMobile = DNTRequest.GetString("UserMobile"); if (string.IsNullOrEmpty(SignName)) { SignName = JsonRequest.GetJsonKeyVal(jsonText, "SignName"); SignName = System.Web.HttpContext.Current.Server.UrlDecode(SignName); } if (string.IsNullOrEmpty(UserName)) { UserName = JsonRequest.GetJsonKeyVal(jsonText, "UserName"); UserName = System.Web.HttpContext.Current.Server.UrlDecode(UserName); } if (string.IsNullOrEmpty(UserMobile)) { UserMobile = JsonRequest.GetJsonKeyVal(jsonText, "UserMobile"); UserMobile = System.Web.HttpContext.Current.Server.UrlDecode(UserMobile); } if (!string.IsNullOrEmpty(SignName)) { sqlSearch.AppendFormat(" and SignName like'{0}%' ", SignName); } if (!string.IsNullOrEmpty(UserName)) { sqlSearch.AppendFormat(" and UserName like'{0}%' ", UserName); } if (!string.IsNullOrEmpty(UserMobile)) { sqlSearch.AppendFormat(" and UserMobile ='{0}' ", UserMobile); } #endregion string orderBy = string.Empty; string sql = ""; int zys = 0; int sumcount = 0; SupplierInfoBLL op = new SupplierInfoBLL(); List <SupplierInfo> list = new List <SupplierInfo>(); StringBuilder where = new StringBuilder(); where.Append("State=0"); where.Append(sqlSearch); DataTable dt = op.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount); object obj = new { result = true, code = "", msg = "", recordsTotal = sumcount, recordsFiltered = sumcount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho, }; result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "获取商户信息异常,请稍后再试", null); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }
/// <summary> /// 获取结算申请列表 /// </summary> static public Object GetSettlementList() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; StringBuilder where = new StringBuilder(); where.Append("a.IsDeleted=0 "); #region 权限 if (ComPage.CurrentAdmin.UserType != 1) { where.Append("AND a.UserID IN (select ID from [dbo].[GetChildrenRole](" + ComPage.CurrentAdmin.UserID + "))"); } #endregion #region 条件搜索 #region 结算方式 string settlementMethod = DNTRequest.GetString("settlementMethod"); if (string.IsNullOrEmpty(settlementMethod)) { settlementMethod = JsonRequest.GetJsonKeyVal(jsonText, "settlementMethod"); } if (!string.IsNullOrEmpty(settlementMethod)) { where.AppendFormat(" and a.SettlementMethod={0}", settlementMethod); } #endregion #region 支付方式 string paymentMethod = DNTRequest.GetString("paymentMethod"); if (string.IsNullOrEmpty(paymentMethod)) { paymentMethod = JsonRequest.GetJsonKeyVal(jsonText, "paymentMethod"); } if (!string.IsNullOrEmpty(paymentMethod)) { where.AppendFormat(" and a.PaymentMethod={0}", paymentMethod); } #endregion #region 结算状态 string status = DNTRequest.GetString("status"); if (string.IsNullOrEmpty(status)) { status = JsonRequest.GetJsonKeyVal(jsonText, "status"); } if (!string.IsNullOrEmpty(status)) { where.AppendFormat(" and a.ApplyStatus={0}", status); } #endregion #region 商家 string merchantName = DNTRequest.GetString("merchantName"); if (string.IsNullOrEmpty(merchantName)) { merchantName = JsonRequest.GetJsonKeyVal(jsonText, "merchantName"); merchantName = System.Web.HttpContext.Current.Server.UrlDecode(merchantName); } if (!string.IsNullOrEmpty(merchantName)) { where.AppendFormat(" and b.UserName like'%{0}%'", merchantName); } #endregion #region 开户行 string openingBank = DNTRequest.GetString("openingBank"); if (string.IsNullOrEmpty(openingBank)) { openingBank = JsonRequest.GetJsonKeyVal(jsonText, "openingBank"); openingBank = System.Web.HttpContext.Current.Server.UrlDecode(openingBank); } if (!string.IsNullOrEmpty(openingBank)) { where.AppendFormat(" and a.OpeningBank like'%{0}%'", openingBank); } #endregion #region 持卡人 string cardHolder = DNTRequest.GetString("cardHolder"); if (string.IsNullOrEmpty(cardHolder)) { cardHolder = JsonRequest.GetJsonKeyVal(jsonText, "cardHolder"); cardHolder = System.Web.HttpContext.Current.Server.UrlDecode(cardHolder); } if (!string.IsNullOrEmpty(cardHolder)) { where.AppendFormat(" and a.CardHolder like'%{0}%'", cardHolder); } #endregion #region 卡号 string cardNumber = DNTRequest.GetString("cardNumber"); if (string.IsNullOrEmpty(cardNumber)) { cardNumber = JsonRequest.GetJsonKeyVal(jsonText, "cardNumber"); cardNumber = System.Web.HttpContext.Current.Server.UrlDecode(cardNumber); } if (!string.IsNullOrEmpty(cardNumber)) { where.AppendFormat(" and a.CardNumber like '%{0}%'", cardNumber); } #endregion #region 备注 string remark = DNTRequest.GetString("remark"); if (string.IsNullOrEmpty(remark)) { remark = JsonRequest.GetJsonKeyVal(jsonText, "remark"); remark = System.Web.HttpContext.Current.Server.UrlDecode(remark); } if (!string.IsNullOrEmpty(remark)) { where.AppendFormat(" and a.Remark like '%{0}%'", remark); } #endregion #region 结算金额 string applyMoney = DNTRequest.GetString("applyMoney"); if (string.IsNullOrEmpty(applyMoney)) { applyMoney = JsonRequest.GetJsonKeyVal(jsonText, "applyMoney"); applyMoney = System.Web.HttpContext.Current.Server.UrlDecode(applyMoney); } if (!string.IsNullOrEmpty(applyMoney)) { where.AppendFormat(" and (a.ApplyMoney={0} or a.ActualMoney={0})", applyMoney); } #endregion #region 结算周期 string startDate = DNTRequest.GetString("startDate"); if (string.IsNullOrEmpty(applyMoney)) { startDate = JsonRequest.GetJsonKeyVal(jsonText, "startDate"); startDate = System.Web.HttpContext.Current.Server.UrlDecode(startDate); } string endDate = DNTRequest.GetString("endDate"); if (string.IsNullOrEmpty(endDate)) { endDate = JsonRequest.GetJsonKeyVal(jsonText, "endDate"); endDate = System.Web.HttpContext.Current.Server.UrlDecode(endDate); } if (!string.IsNullOrEmpty(startDate) && !string.IsNullOrEmpty(endDate)) { where.AppendFormat(" and (a.StartDate>='{0} 00:00:00' and a.EndDate<='{1} 23:59:59')", startDate, endDate); } else if (string.IsNullOrEmpty(startDate) && !string.IsNullOrEmpty(endDate)) { where.AppendFormat(" and (a.StartDate>='{0} 00:00:00' and a.EndDate<='{1} 23:59:59')", endDate, endDate); } else if (!string.IsNullOrEmpty(startDate) && string.IsNullOrEmpty(endDate)) { where.AppendFormat(" and (a.StartDate>='{0} 00:00:00' and a.EndDate<='{1} 23:59:59')", startDate, startDate); } #endregion #endregion #region 排序字段 string iSortCol_0 = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0"); string sSortDir_0 = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0"); int iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols")); string orderBy = string.Empty; if (!string.IsNullOrEmpty(iSortCol_0)) { string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0)); orderBy = string.Format(" {0} {1}", orderField, sSortDir_0); } #endregion #region 分页查询 string sql = ""; int zys = 0; int sumcount = 0; OrderRebateSettlementApplyBLL opOrderRebateSettlementApplyBLL = new OrderRebateSettlementApplyBLL(); DataTable dt = opOrderRebateSettlementApplyBLL.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount); #endregion #region 查询结果 object obj = new { result = true, code = "", msg = "", recordsTotal = sumcount, recordsFiltered = sumcount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho, }; #endregion result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "获取结算申请信息异常,", ex.Message); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }
/// <summary> /// 申请结算提交 /// </summary> /// <returns></returns> static public Object ApplySettlement() { string result = string.Empty; using (TransactionScope ts = new TransactionScope()) { try { string userIdAndDepartmentId = DNTRequest.GetString("userIdAndDepartmentId"); if (string.IsNullOrEmpty(userIdAndDepartmentId)) { return(DNTRequest.GetResultJson(false, "请先选择需要结算的商户", null)); } int userId = 0; int departmentId = 0; if (!string.IsNullOrEmpty(userIdAndDepartmentId)) { string[] userIdAndDepartmentIdList = userIdAndDepartmentId.Split(new char[] { ',' }); userId = ComPage.SafeToInt(userIdAndDepartmentIdList[0]); departmentId = ComPage.SafeToInt(userIdAndDepartmentIdList[1]); } if (userId == 0) { return(DNTRequest.GetResultJson(false, "请先选择需要结算的商户", null)); } //订单返利结算申请表主键 int orderRebateSettlementApplyId = 0; int res01 = 0; int res02 = 0; #region 订单返利结算申请信息入库 string objOrderRebateSettlementApply = DNTRequest.GetString("modelOrderRebateSettlementApply"); OrderRebateSettlementApply postOrderRebateSettlementApply = JsonConvert.DeserializeObject <OrderRebateSettlementApply>(objOrderRebateSettlementApply); OrderRebateSettlementApplyBLL opOrderRebateSettlementApply = new OrderRebateSettlementApplyBLL(); OrderRebateSettlementApply modelOrderRebateSettlementApply = new OrderRebateSettlementApply(); modelOrderRebateSettlementApply.UserId = userId; modelOrderRebateSettlementApply.DepartmentId = departmentId; modelOrderRebateSettlementApply.StartDate = postOrderRebateSettlementApply.StartDate; modelOrderRebateSettlementApply.EndDate = postOrderRebateSettlementApply.EndDate; modelOrderRebateSettlementApply.ApplyMoney = postOrderRebateSettlementApply.ApplyMoney; modelOrderRebateSettlementApply.ActualMoney = postOrderRebateSettlementApply.ActualMoney; modelOrderRebateSettlementApply.ApplyStatus = 0; modelOrderRebateSettlementApply.SettlementMethod = null; modelOrderRebateSettlementApply.SalesPercentage = 0; modelOrderRebateSettlementApply.PaymentMethod = postOrderRebateSettlementApply.PaymentMethod; modelOrderRebateSettlementApply.OpeningBank = postOrderRebateSettlementApply.OpeningBank; modelOrderRebateSettlementApply.CardHolder = postOrderRebateSettlementApply.CardHolder; modelOrderRebateSettlementApply.CardNumber = postOrderRebateSettlementApply.CardNumber; modelOrderRebateSettlementApply.Remark = postOrderRebateSettlementApply.Remark; modelOrderRebateSettlementApply.CreateId = ComPage.CurrentAdmin.UserID; modelOrderRebateSettlementApply.CreateDate = DateTime.Now; modelOrderRebateSettlementApply.EditId = null; modelOrderRebateSettlementApply.EditDate = null; modelOrderRebateSettlementApply.IsDeleted = 0; orderRebateSettlementApplyId = opOrderRebateSettlementApply.Add(modelOrderRebateSettlementApply); #endregion #region 结算申请详情信息入库和修改订单返利结算申请表的结算状态为已申请 if (orderRebateSettlementApplyId > 0) { #region 结算申请详情信息入库和修改订单返利结算申请表的结算状态为已申请 StringBuilder where = new StringBuilder(); where.Append("b.ProductId=0"); #region 获取结算申请列表查询条件 string UserId = DNTRequest.GetString("UserId"); if (string.IsNullOrEmpty(UserId)) { UserId = JsonRequest.GetJsonKeyVal(jsonText, "UserId"); } if (!string.IsNullOrEmpty(UserId)) { where.AppendFormat(" and a.UserId={0}", UserId); } string CompanyId = DNTRequest.GetString("CompanyId"); if (string.IsNullOrEmpty(CompanyId)) { CompanyId = JsonRequest.GetJsonKeyVal(jsonText, "CompanyId"); } if (!string.IsNullOrEmpty(CompanyId)) { where.AppendFormat(" and a.CompanyId={0}", CompanyId); } string StartDate = DNTRequest.GetString("StartDate"); if (string.IsNullOrEmpty(StartDate)) { StartDate = JsonRequest.GetJsonKeyVal(jsonText, "StartDate"); } string EndDate = DNTRequest.GetString("EndDate"); if (string.IsNullOrEmpty(EndDate)) { EndDate = JsonRequest.GetJsonKeyVal(jsonText, "EndDate"); } if (!string.IsNullOrEmpty(StartDate) && !string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate between '{0} 00:00:00' and '{1} 23:59:59'", StartDate, EndDate); } else if (string.IsNullOrEmpty(StartDate) && !string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate<='{0} 23:59:59'", EndDate); } else if (!string.IsNullOrEmpty(StartDate) && string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate >= '{0} 00:00:00'", StartDate); } #endregion where.Append(" and a.IsDeleted=0 and a.PayStatus=1 and a.IsSettled=0 and a.IsCancel=0"); OrderRebateBLL op = new OrderRebateBLL(); op.ApplySettlement(orderRebateSettlementApplyId, ComPage.CurrentAdmin.UserID, where.ToString(), ref res01, ref res02); #endregion } #endregion if (orderRebateSettlementApplyId > 0 && res01 > 0 && res02 > 0) { ts.Complete(); result = DNTRequest.GetResultJson(true, "申请结算成功", null); } else { ts.Dispose(); result = DNTRequest.GetResultJson(false, "申请结算失败,请稍后再试", null); } } catch (Exception ex) { ts.Dispose(); result = DNTRequest.GetResultJson(false, "申请结算异常,请稍后再试", null); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } } return(result); }
/// <summary> /// 查询可结算订单列表 /// </summary> static public Object QueryOrderList() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; #region 获取列表 StringBuilder where = new StringBuilder(); where.Append("b.ProductId=0"); #region 查询条件 #region 商家 string UserId = DNTRequest.GetString("UserId"); if (string.IsNullOrEmpty(UserId)) { UserId = JsonRequest.GetJsonKeyVal(jsonText, "UserId"); } if (!string.IsNullOrEmpty(UserId)) { where.AppendFormat(" and a.UserId={0}", UserId); } #endregion #region 道 string CompanyId = DNTRequest.GetString("CompanyId"); if (string.IsNullOrEmpty(CompanyId)) { CompanyId = JsonRequest.GetJsonKeyVal(jsonText, "CompanyId"); } if (!string.IsNullOrEmpty(CompanyId)) { where.AppendFormat(" and a.CompanyId={0}", CompanyId); } #endregion #region 结算周期 string StartDate = DNTRequest.GetString("StartDate"); if (string.IsNullOrEmpty(StartDate)) { StartDate = JsonRequest.GetJsonKeyVal(jsonText, "StartDate"); } string EndDate = DNTRequest.GetString("EndDate"); if (string.IsNullOrEmpty(EndDate)) { EndDate = JsonRequest.GetJsonKeyVal(jsonText, "EndDate"); } if (!string.IsNullOrEmpty(StartDate) && !string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate between '{0} 00:00:00' and '{1} 23:59:59'", StartDate, EndDate); } else if (string.IsNullOrEmpty(StartDate) && !string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate<='{0} 23:59:59'", EndDate); } else if (!string.IsNullOrEmpty(StartDate) && string.IsNullOrEmpty(EndDate)) { where.AppendFormat(" and a.CreateDate>='{0} 00:00:00'", StartDate); } #endregion #endregion #region 固定的查询条件 where.Append(" and a.IsDeleted=0 and a.PayStatus=1 and a.IsSettled=0 and a.IsCancel=0"); #endregion #region 执行sql OrderRebateBLL op = new OrderRebateBLL(); DataTable dt = op.QueryOrderList(where.ToString()); #endregion #region 结果处理 double sumOrderMoney = 0; double sumMerchantMoney = 0; double sumAgentMoney = 0; double sumHQMoney = 0; double sumNetProfit = 0; double sumApplyMoney = 0; int totalCount = 0; if (dt != null && dt.Rows.Count > 0) { totalCount = dt.Rows.Count; foreach (DataRow dr in dt.Rows) { sumOrderMoney += Math.Round(ComPage.SafeToDouble(dr["sumOrderMoney"]), 2, MidpointRounding.AwayFromZero); sumMerchantMoney += Math.Round(ComPage.SafeToDouble(dr["sumMerchantMoney"]), 2, MidpointRounding.AwayFromZero); sumAgentMoney += Math.Round(ComPage.SafeToDouble(dr["sumAgentMoney"]), 2, MidpointRounding.AwayFromZero); sumHQMoney += Math.Round(ComPage.SafeToDouble(dr["sumHQMoney"]), 2, MidpointRounding.AwayFromZero); sumNetProfit += Math.Round(ComPage.SafeToDouble(dr["sumNetProfit"]), 2, MidpointRounding.AwayFromZero); int settlementMethod = ComPage.SafeToInt(dr["SettlementMethod"]); double salesPercentage = ComPage.SafeToDouble(dr["SalesPercentage"]); int userType = ComPage.SafeToInt(dr["UserType"]); switch (settlementMethod) { case 1: #region 销售额百分比分成 double salesPercentageMoney = (sumOrderMoney * salesPercentage) / 100; sumApplyMoney += Math.Round(salesPercentageMoney, 2, MidpointRounding.AwayFromZero); #endregion break; case 2: #region 单笔结算分成 switch (userType) { case 2: //经销商 sumApplyMoney += Math.Round(sumMerchantMoney, 2, MidpointRounding.AwayFromZero); break; case 3: //代理商 sumApplyMoney += Math.Round(sumAgentMoney, 2, MidpointRounding.AwayFromZero); break; } #endregion break; } } } #endregion #region 拼装返回结果 var obj = new { result = true, code = "", msg = "", sumOrderMoney = sumOrderMoney, sumMerchantMoney = sumMerchantMoney, sumAgentMoney = sumAgentMoney, sumHQMoney = sumHQMoney, sumNetProfit = sumNetProfit, sumApplyMoney = sumApplyMoney, recordsTotal = totalCount, recordsFiltered = totalCount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho }; #endregion result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); #endregion } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "获取结算申请信息异常,", ex.Message); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }
static public void Implementation(string postJsonText) { jsonText = postJsonText; string action = DNTRequest.GetString("action"); if (string.IsNullOrEmpty(action)) { action = JsonRequest.GetJsonKeyVal(jsonText, "action"); } if (!string.IsNullOrEmpty(action)) { #region 实现 switch (action) { case "OrderRebateList": HttpContext.Current.Response.Write(GetOrderRebateList()); break; case "FunctionList": HttpContext.Current.Response.Write(GetFunctionList()); break; case "getfunctionlist": HttpContext.Current.Response.Write(GetFunctionListForZTree()); break; case "getRolelist": HttpContext.Current.Response.Write(GetRoleListForZTree()); break; case "getfunctionmodel": HttpContext.Current.Response.Write(GetFunctionModel()); break; case "RoleList": HttpContext.Current.Response.Write(GetRoleList()); break; case "DepartmentList": HttpContext.Current.Response.Write(GetDepartmentList()); break; case "getDepartmentInfolist": HttpContext.Current.Response.Write(GetDepartmentInfoListForZTree()); break; case "UsersList": HttpContext.Current.Response.Write(GetUsersList()); break; case "CompanyList": HttpContext.Current.Response.Write(GetCompanyList()); break; case "DepartmentInfoListForSelect": HttpContext.Current.Response.Write(DepartmentInfoListForSelect()); break; } #endregion } }
/// <summary> /// 检查是否已登录 /// </summary> /// <returns></returns> static public Object Test() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); string sSearch = JsonRequest.GetJsonKeyVal(jsonText, "sSearch"); string iSortCol_0 = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0"); string sSortDir_0 = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0"); int iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols")); string timeStamp = JsonRequest.GetJsonKeyVal(jsonText, "timeStamp"); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; string orderBy = string.Empty; if (!string.IsNullOrEmpty(iSortCol_0)) { string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0)); orderBy = string.Format(" order by {0} {1}", orderField, sSortDir_0); } List <object> list = new List <object>(); //list.Sort(); int totalCount = 1000; for (int i = 1; i <= totalCount; i++) { if (i > displayStart && i <= (displayStart + displayLength)) { object data = new { Id = i, Name = "hfm" + i.ToString().PadLeft(4, '0'), Sex = new Random().Next(0, 2).ToString(), CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), }; list.Add(data); } } object obj = new { result = true, code = "", msg = "", recordsTotal = totalCount, recordsFiltered = totalCount, data = list, sEcho = sEcho, #region 注释 //iColumns = 6, //sColumns = "", //mDataProp_0 = "Id", //sSearch_0 = "", //bRegex_0 = false, //bSearchable_0 = true, //bSortable_0 = false, //mDataProp_1 = "Id", //sSearch_1 = "", //bRegex_1 = false, //bSearchable_1 = true, //bSortable_1 = true, //mDataProp_2 = "Name", //sSearch_2 = "", //bRegex_2 = false, //bSearchable_2 = true, //bSortable_2 = true, //mDataProp_3 = "Sex", //sSearch_3 = "", //bRegex_3 = false, //bSearchable_3 = true, //bSortable_3 = true, //mDataProp_4 = "CreateDate", //sSearch_4 = "", //bRegex_4 = false, //bSearchable_4 = true, //bSortable_4 = true, //mDataProp_5 = "", //sSearch_5 = "", //bRegex_5 = false, //bSearchable_5 = true, //bSortable_5 = true, //sSearch = "", //bRegex = false, //iSortCol_0 = 0, //sSortDir_0 = "asc", //iSortingCols = 1, #endregion }; result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null); Log.WriteLog(" " + ex); } return(result); }
/// <summary> /// 获取用户列表 /// </summary> static public Object GetUsersList() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; #region 获取列表 StringBuilder where = new StringBuilder(); where.Append("1=1 and u.RecordIsDelete=0 "); DepartmentInfo df = new DepartmentInfo(); DepartmentInfoBLL bll = new DepartmentInfoBLL(); df = bll.GetModel(ComPage.CurrentAdmin.DepartmentID); if (ComPage.CurrentAdmin.UserType != 1) { if ((df == null) || (df != null && df.IsReceiveBusiness != false)) { where.Append(" AND u. UserID IN(select ID from [BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))"); } } #region 条件搜索 string key = DNTRequest.GetString("searchKey"); if (string.IsNullOrEmpty(key)) { key = JsonRequest.GetJsonKeyVal(jsonText, "searchKey"); } string LoginName = DNTRequest.GetString("LoginName"); string UsersName = DNTRequest.GetString("UsersName"); string Mobiles = DNTRequest.GetString("Mobiles"); string DepartmentInfoID = DNTRequest.GetString("DepartmentInfoID"); if (string.IsNullOrEmpty(LoginName)) { LoginName = JsonRequest.GetJsonKeyVal(jsonText, "LoginName"); LoginName = System.Web.HttpContext.Current.Server.UrlDecode(LoginName); } if (string.IsNullOrEmpty(UsersName)) { UsersName = JsonRequest.GetJsonKeyVal(jsonText, "UsersName"); UsersName = System.Web.HttpContext.Current.Server.UrlDecode(UsersName); } if (string.IsNullOrEmpty(Mobiles)) { Mobiles = JsonRequest.GetJsonKeyVal(jsonText, "Mobiles"); Mobiles = System.Web.HttpContext.Current.Server.UrlDecode(Mobiles); } if (string.IsNullOrEmpty(DepartmentInfoID)) { DepartmentInfoID = JsonRequest.GetJsonKeyVal(jsonText, "DepartmentInfoID"); DepartmentInfoID = System.Web.HttpContext.Current.Server.UrlDecode(DepartmentInfoID); } if (!string.IsNullOrEmpty(LoginName)) { where.AppendFormat(" and u.LoginName like'{0}%' ", LoginName); } if (!string.IsNullOrEmpty(UsersName)) { where.AppendFormat(" and u.UserName like'{0}%' ", UsersName); } if (!string.IsNullOrEmpty(Mobiles)) { where.AppendFormat(" and u.Phone like'{0}%' ", Mobiles); } if (!string.IsNullOrEmpty(DepartmentInfoID) && DepartmentInfoID != "undefined" && DepartmentInfoID != "0") { where.AppendFormat(" and u.DepartmentID ={0} ", DepartmentInfoID); } #endregion string iSortCol_0 = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0"); string sSortDir_0 = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0"); int iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols")); string orderBy = string.Empty; if (!string.IsNullOrEmpty(iSortCol_0)) { string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0)); orderBy = string.Format(" {0} {1}", orderField, sSortDir_0); } string sql = ""; int zys = 0; int sumcount = 0; UsersBLL Usersbll = new UsersBLL(); DataTable dt = Usersbll.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount); /* * iTotalRecord = sumcount, * iTotalDisplayRecords = sumcount, */ object obj = new { result = true, code = "", msg = "", recordsTotal = sumcount, recordsFiltered = sumcount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho, }; result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); #endregion } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }
/// <summary> /// 获取渠道列表 /// </summary> static public Object GetCompanyList() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; #region 获取列表 StringBuilder where = new StringBuilder(); where.Append("1=1 and c.IsDeleted=0"); #region 条件搜索 string key = DNTRequest.GetString("searchKey"); if (string.IsNullOrEmpty(key)) { key = JsonRequest.GetJsonKeyVal(jsonText, "searchKey"); } string val = DNTRequest.GetString("searchValue"); if (string.IsNullOrEmpty(val)) { val = JsonRequest.GetJsonKeyVal(jsonText, "searchValue"); val = System.Web.HttpContext.Current.Server.UrlDecode(val); } if (!string.IsNullOrEmpty(val) && val != "undefined") { where.AppendFormat(" and (c.CompanyName like '{0}%')", val); } string CompanyCategoryId = DNTRequest.GetString("CompanyCategoryId"); string CompanyManager = DNTRequest.GetString("CompanyManager"); if (string.IsNullOrEmpty(CompanyCategoryId)) { CompanyCategoryId = JsonRequest.GetJsonKeyVal(jsonText, "CompanyCategoryId"); CompanyCategoryId = System.Web.HttpContext.Current.Server.UrlDecode(CompanyCategoryId); } if (string.IsNullOrEmpty(CompanyManager)) { CompanyManager = JsonRequest.GetJsonKeyVal(jsonText, "CompanyManager"); CompanyManager = System.Web.HttpContext.Current.Server.UrlDecode(CompanyManager); } if (!string.IsNullOrEmpty(CompanyCategoryId) && CompanyCategoryId != "null" && CompanyCategoryId != "undefined") { where.AppendFormat(" and c.CompanyCategoryId ={0} ", CompanyCategoryId); } if (!string.IsNullOrEmpty(CompanyManager) && CompanyManager != "null" && CompanyManager != "undefined") { where.AppendFormat(" and c.CompanyManager like'{0}%' ", CompanyManager); } #endregion string iSortCol_0 = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0"); string sSortDir_0 = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0"); int iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols")); string orderBy = string.Empty; if (!string.IsNullOrEmpty(iSortCol_0)) { string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0)); orderBy = string.Format(" {0} {1}", orderField, sSortDir_0); } string sql = ""; int zys = 0; int sumcount = 0; CompanyBLL companybll = new CompanyBLL(); DataTable dt = companybll.GetNameList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount); /* * iTotalRecord = sumcount, * iTotalDisplayRecords = sumcount, */ object obj = new { result = true, code = "", msg = "", recordsTotal = sumcount, recordsFiltered = sumcount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho, }; result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); #endregion } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }
/// <summary> /// 获取分利列表 /// </summary> static public Object GetOrderRebateList() { string result = string.Empty; try { string sEcho = JsonRequest.GetJsonKeyVal(jsonText, "sEcho"); int displayStart = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayStart")); int displayLength = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iDisplayLength")); int pageIndex = (displayStart / displayLength) + 1; int pageSize = displayLength; #region 获取列表 StringBuilder where = new StringBuilder(); where.Append("1=1 and ort.IsDeleted=0 "); DepartmentInfo df = new DepartmentInfo(); DepartmentInfoBLL bll = new DepartmentInfoBLL(); df = bll.GetModel(ComPage.CurrentAdmin.DepartmentID); if (ComPage.CurrentAdmin.UserType != 1) { if ((df == null) || (df != null && df.IsReceiveBusiness != false)) { //where.Append(" AND moa.UserID IN(select ID from [BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))"); where.Append(" AND moa.UserID IN(SELECT ID from[BWJSDB].dbo.[GetDepartmentChildren](" + ComPage.CurrentAdmin.UserID + "))"); } } #region 条件搜索 string key = DNTRequest.GetString("searchKey"); if (string.IsNullOrEmpty(key)) { key = JsonRequest.GetJsonKeyVal(jsonText, "searchKey"); } string val = DNTRequest.GetString("searchValue"); if (string.IsNullOrEmpty(val)) { val = JsonRequest.GetJsonKeyVal(jsonText, "searchValue"); val = System.Web.HttpContext.Current.Server.UrlDecode(val); } if (!string.IsNullOrEmpty(val)) { where.AppendFormat(" and (moa.InsureNum like'" + val + "%' or ort.TransNo like'" + val + "%') ", val); } #endregion string iSortCol_0 = JsonRequest.GetJsonKeyVal(jsonText, "iSortCol_0"); string sSortDir_0 = JsonRequest.GetJsonKeyVal(jsonText, "sSortDir_0"); int iSortingCols = ComPage.SafeToInt(JsonRequest.GetJsonKeyVal(jsonText, "iSortingCols")); string orderBy = string.Empty; if (!string.IsNullOrEmpty(iSortCol_0)) { string orderField = JsonRequest.GetJsonKeyVal(jsonText, string.Format("mDataProp_{0}", iSortCol_0)); orderBy = string.Format(" {0} {1}", orderField, sSortDir_0); } string sql = ""; int zys = 0; int sumcount = 0; OrderRebateBLL orderRebatebll = new OrderRebateBLL(); DataTable dt = orderRebatebll.GetList(where.ToString(), pageIndex, pageSize, orderBy, ref sql, ref zys, ref sumcount); /* * iTotalRecord = sumcount, * iTotalDisplayRecords = sumcount, */ object obj = new { result = true, code = "", msg = "", recordsTotal = sumcount, recordsFiltered = sumcount, data = ((dt == null) ? (new DataTable()) : (dt)), sEcho = sEcho, }; result = Newtonsoft.Json.JsonConvert.SerializeObject(obj); #endregion } catch (Exception ex) { result = DNTRequest.GetResultJson(false, "操作异常,请稍候再试", null); ExceptionLogBLL.WriteExceptionLogToDB(ex.ToString()); } return(result); }