| | |
| | | private List<GwOpGroup> _GroupList; |
| | | private List<GwProduct> _ProductList; //产品及产品分类 |
| | | //private List<GwProduct> _ProductClassList; //产品分类 |
| | | |
| | | private int _userId = -1; |
| | | private int _userType = -1; |
| | | private string _account = ""; |
| | | |
| | | public override JsonPageResult ProcessRequestInternal(PageContext<SysUser> context) |
| | | { |
| | | string @string = context.GetString("action"); |
| | | _userId = context.SessionObject.UserID; |
| | | _userType = context.SessionObject.UserType; |
| | | _account = context.SessionObject.Account; |
| | | |
| | | switch (@string) |
| | | { |
| | | case "delete": |
| | |
| | | int recordCount = 0; |
| | | int pageSize = context.GetInt("pageSize", 50); |
| | | int pageIndex = context.GetInt("pageIndex", 1); |
| | | |
| | | string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); |
| | | |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount); |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount); |
| | | |
| | | string str1 = ""; |
| | | if (list != null && list.Count > 0) |
| | |
| | | str1 = str1 + "<td>" + bean.GivingNum + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000))); |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>"; |
| | | str1 = str1 + "<td>" + bean.Creator + "</td>"; |
| | | str1 = str1 + "<td>" + bean.CreateTime + "</td>"; |
| | |
| | | } |
| | | } |
| | | else |
| | | str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | |
| | | return new JsonPageResult(true, new |
| | | { |
| | |
| | | int recordCount = 0; |
| | | int pageSize = context.GetInt("pageSize", 50); |
| | | int pageIndex = context.GetInt("pageIndex", 1); |
| | | |
| | | string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); |
| | | |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount); |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, permissionsSQL, out recordCount); |
| | | |
| | | string str1 = ""; |
| | | if (list != null && list.Count > 0) |
| | |
| | | str1 = str1 + "<td>" + bean.GivingNum + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000))); |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>"; |
| | | str1 = str1 + "<td>" + bean.Creator + "</td>"; |
| | | str1 = str1 + "<td>" + bean.CreateTime + "</td>"; |
| | |
| | | } |
| | | } |
| | | else |
| | | str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | |
| | | return new JsonPageResult(true, new |
| | | { |
| | |
| | | string clientId = context.GetString("clientId"); |
| | | string clientName = context.GetString("clientName"); |
| | | int flag = context.GetInt("flag"); |
| | | //string startDate = context.GetString("startDate"); |
| | | //string endDate = context.GetString("endDate"); |
| | | DateTime startDate = context.GetDateTime("startDate"); |
| | | DateTime endDate = context.GetDateTime("endDate"); |
| | | |
| | | int recordCount = 0; |
| | | int pageSize = context.GetInt("pageSize", 50); |
| | | int pageIndex = context.GetInt("pageIndex", 1); |
| | | |
| | | string permissionsSQL = new GwClientDao().GetClientPermissions(_userId, _userType, "GWC"); |
| | | |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate, pageSize, pageIndex, out recordCount); |
| | | //List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate).AddDays(1.0), pageSize, pageIndex, out recordCount); |
| | | List<GwOrder> list = _Dao.LoadInfoList(spId, clientId, clientName, flag, startDate, endDate.AddDays(1.0), pageSize, pageIndex, permissionsSQL, out recordCount); |
| | | |
| | | string str1 = ""; |
| | | if (list != null && list.Count > 0) |
| | |
| | | str1 = str1 + "<td>" + bean.GivingNum + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元/条</td>", (object)(Convert.ToDecimal(bean.Price) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.OrderNumTotal + "</td>"; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000)));; |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.OrderAmountTotal) / new Decimal(1000))); |
| | | str1 = str1 + string.Format("<td>{0}元</td>", (object)(Convert.ToDecimal(bean.PayAmount) / new Decimal(1000))); |
| | | str1 = str1 + "<td>" + bean.BeforeBalanceNum + "</td>"; |
| | | str1 = str1 + "<td>" + bean.Creator + "</td>"; |
| | | str1 = str1 + "<td>" + bean.CreateTime + "</td>"; |
| | |
| | | } |
| | | } |
| | | else |
| | | str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">暂无信息</td></tr>"; |
| | | |
| | | return new JsonPageResult(true, new |
| | | { |
| | |
| | | int givingNum = context.GetInt("givingNum"); |
| | | string clientId = ""; |
| | | int payAmount = 0; |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | payAmount = tmpPayAmount; |
| | | //double price = context.GetDecimal(price); |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | string remark = context.GetString("remark"); |
| | | int status = context.GetInt("status"); //0-审核不通过;1-审核通过 |
| | | string auditReason = context.GetString("auditReason"); |
| | |
| | | int topUpAmountTotal = 0; |
| | | if (string.IsNullOrEmpty(nextFlowCode)) |
| | | { |
| | | orderStatus = 2; |
| | | orderStatus = 2; |
| | | |
| | | //获取账号信息 |
| | | GwSp gwSp = _GwSpDao.Get(spId); |
| | |
| | | topUpAmountTotal = int.Parse(gwClient.Top_up_Amount_Total.ToString() ); |
| | | |
| | | //为1-预付费 |
| | | if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | { |
| | | throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!"); |
| | | } |
| | |
| | | //gwSp.Balance = balance - num * basicNum; |
| | | //gwSp.BasicNum = beforeBasicNum + basicNum; |
| | | //gwSp.GivingNum = beforeGivingNum + givingNum; |
| | | |
| | | _GwSpDao.UpdateBalanceByOrder(balance - num * basicNum |
| | | , beforeBasicNum + basicNum |
| | | , beforeGivingNum + givingNum |
| | | , spId |
| | | ); |
| | | //更新账号充值数据 |
| | | _GwSpDao.UpdateBalanceByOrder( payAmount, basicNum , givingNum , spId ); |
| | | |
| | | |
| | | //有充值金额时,更新客户累计充值金额(厘) |
| | | if (payAmount > 0) { |
| | | if (payAmount > 0 || basicNum > 0 ) { |
| | | //GwClient gwClient = new GwClient(); |
| | | gwClient = new GwClient(); |
| | | gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount; //累计金额:单位(厘) |
| | | gwClient.Balance = ((balance + payAmount) - num * basicNum) ; //账户余额:单位(厘) |
| | | gwClient.ClientID = clientId; |
| | | |
| | | _GwClientDao.UpdateClientAmount(gwClient); |
| | | //gwClient = new GwClient(); |
| | | //gwClient.Balance = ((balance + payAmount) - num * basicNum) ; //充值余额:单位(厘) |
| | | //gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount; //充值金额:单位(厘) |
| | | //gwClient.ClientID = clientId; |
| | | |
| | | //更新客户充值数据 |
| | | _GwClientDao.UpdateClientAmount(payAmount-( num * basicNum), payAmount, clientId ); |
| | | } |
| | | } |
| | | else |
| | |
| | | DateTime createTime = DateTime.Now; |
| | | string creator = context.OperatorID; |
| | | |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | payAmount = tmpPayAmount; |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | price = num; |
| | | |
| | | //校验 |
| | |
| | | balance = int.Parse(gwClient.Balance.ToString() ); |
| | | |
| | | //为1-预付费 |
| | | if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum) |
| | | { |
| | | throw new ArgumentException("客户余额及充值金额不足购买,请调整后提交!"); |
| | | } |
| | |
| | | DateTime createTime = DateTime.Now; |
| | | string creator = context.OperatorID; |
| | | |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | payAmount = tmpPayAmount; |
| | | |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1); |
| | | int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0); |
| | | price = num; |
| | | |
| | | //校验 |