Commit 6aeff272 authored by liudong1993's avatar liudong1993
parents a12d3514 1ab24d35
......@@ -351,6 +351,18 @@ namespace Mall.Common
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("sTenpayRechargeNotify").Value;
}
}
/// <summary>
/// 微信购买支付成功接口处理地址
/// </summary>
public static string sTenpayMemberBuyNotify
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("sTenpayMemberBuyNotify").Value;
}
}
/// <summary>
/// 网络主管的id,用于新建供应商账户的时候的创建人
/// </summary>
......@@ -361,6 +373,48 @@ namespace Mall.Common
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("NetworkDirector").Value;
}
}
/// <summary>
/// 收款创建人的id,用于新建供应商账户的时候的创建人
/// </summary>
public static string IncomeDirector
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IncomeDirector").Value;
}
}
/// <summary>
/// 收款创建人公司id
/// </summary>
public static string IncomeBranchId
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("IncomeBranchId").Value;
}
}
/// <summary>
/// 付款创建人的id,用于新建供应商账户的时候的创建人
/// </summary>
public static string ExpendDirector
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("ExpendDirector").Value;
}
}
/// <summary>
/// 付款创建人公司id
/// </summary>
public static string ExpendBranchId
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("ExpendBranchId").Value;
}
}
/// <summary>
/// 数据库地址
......
......@@ -63,6 +63,11 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 支付状态 0-未支付,1-已支付
/// </summary>
public int PayState { get; set; }
/// <summary>
/// 支付时间
/// </summary>
......@@ -103,5 +108,15 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 支付类型 枚举 1微信 2支付宝 3银行卡
/// </summary>
public Common.Enum.Goods.OrderPayTypeEnum? PayWay
{
get;
set;
}
}
}
......@@ -140,5 +140,10 @@ namespace Mall.Model.Extend.Product
public int IsPublic { get; set; }
#endregion
/// <summary>
/// 供应商名称
/// </summary>
public string SupplierName { get; set; }
}
}
......@@ -5029,14 +5029,14 @@ namespace Mall.Module.Product
item.IsPublic = 8;//默认原路退款
var financeObj = new
{
CreateBy = Config.NetworkDirector,
CreateBy = Config.ExpendDirector,
item.IsPublic,
ClientType = 0,
ClientID = 0,
item.CurrencyId,
WBMoney = Money,
PayDate = DateTime.Now.ToString("yyyy-MM-dd"),
Config.RB_Branch_Id,
RB_Branch_Id=Config.ExpendBranchId,
TemplateId = item.WorkFlowId,
OrderSource = 16,
OtherType = 12,
......@@ -5975,14 +5975,14 @@ namespace Mall.Module.Product
}
var financeObj = new
{
CreateBy = Config.NetworkDirector,
CreateBy = Config.ExpendDirector,
item.IsPublic,
ClientType = 0,
ClientID = 0,
item.CurrencyId,
WBMoney = Money,
PayDate = DateTime.Now.ToString("yyyy-MM-dd"),
Config.RB_Branch_Id,
RB_Branch_Id= Config.ExpendBranchId,
TemplateId = item.WorkFlowId,
OrderSource = 16,
OtherType = 14,
......
......@@ -56,6 +56,8 @@ namespace Mall.Module.User
private readonly MiniProgramMsgModule appletWeChatModule = new MiniProgramMsgModule();
/// <summary>
/// 初始化分销基础配置
/// </summary>
......
......@@ -19,6 +19,7 @@ using Mall.Common.API;
using Newtonsoft.Json.Linq;
using System.Threading;
using Mall.Repository.Finance;
using NPOI.SS.Formula.Functions;
namespace Mall.Module.User
{
......@@ -131,6 +132,10 @@ namespace Mall.Module.User
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 会员购买仓储层
/// </summary>
private RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
#region 基础配置
......@@ -1414,7 +1419,8 @@ namespace Mall.Module.User
}
};
bool flag = distributor_InfoRepository.Update(keyValues, wheres);
if (flag) {
if (flag)
{
//修改用户表状态
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Member_User.IsDistributor),1}
......@@ -1451,7 +1457,8 @@ namespace Mall.Module.User
}
};
bool flag = distributor_InfoRepository.Update(keyValues, wheres);
if (flag) {
if (flag)
{
var umodel = GetMemberUserInfo(disModel.UserId ?? 0);
if (umodel != null)
{
......@@ -2172,14 +2179,14 @@ namespace Mall.Module.User
item.IsPublic = 5;//默认平台虚拟账户
var financeObj = new
{
CreateBy = Config.NetworkDirector,
CreateBy = Config.ExpendDirector,
item.IsPublic,
ClientType = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FinanceSetting")["RemitTypeId"]),
ClientID = Convert.ToInt32(new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("FinanceSetting")["RemitAccountId"]),
item.CurrencyId,
WBMoney = Money,
PayDate = DateTime.Now.ToString("yyyy-MM-dd"),
Config.RB_Branch_Id,
RB_Branch_Id= Config.ExpendBranchId,
TemplateId = item.WorkFlowId,
OrderSource = 16,
OtherType = 11,
......@@ -4515,5 +4522,108 @@ namespace Mall.Module.User
}
#endregion
#region 会员购买
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_Buy_Extend> GetMemberBuyPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_Buy_Extend dmodel)
{
return memberBuyRepository.GetPageList(pageIndex, pageSize, out rowCount, dmodel);
}
/// <summary>
/// 新增会员购买记录
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int AddMemberBuy(RB_Member_Buy_Extend model)
{
int id = 0;
if (model.Id == 0)
{
id = memberBuyRepository.Insert(model);
}
return id;
}
/// <summary>
/// 修改会员购买
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool UpdateMemberBuy(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, decimal Money, DateTime Time_End)
{
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null)
{
return false;
}
//判断订单状态是否是待支付 2020-06-16 Add By:W
var model = memberBuyRepository.GetEntity(OrderId);
if (model == null)
{
return false;
}
if (model.PayState != 0)
{
return false;
}
if (model.Money != Money)
{
return false;
}
var trans = memberBuyRepository.DbTransaction;
try
{
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Member_Buy.PayTime),Time_End},
{ nameof(RB_Member_Buy.PayState),1}
};
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper{
FiledName=nameof(RB_Member_Footmark.Id),
FiledValue=OrderId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = memberBuyRepository.Update(keyValues, wheres, trans);//更新会员购买记录
Dictionary<string, object> keyValuesMember = new Dictionary<string, object>() {
{ nameof(RB_Member_User.MemberGrade),model.GradeId}
};
List<WhereHelper> wheresMember = new List<WhereHelper>() {
new WhereHelper{
FiledName=nameof(RB_Member_User.Id),
FiledValue=model.UserId,
OperatorEnum=OperatorEnum.Equal
}
};
flag = member_UserRepository.Update(keyValuesMember, wheresMember, trans);//更新会员购买记录
memberBuyRepository.DBSession.Commit();
}
catch (Exception ex)
{
LogHelper.Write(ex, "UpdateMemberBuy");
memberBuyRepository.DBSession.Rollback("UpdateMemberBuy");
return false;
}
return flag;
}
#endregion
}
}
......@@ -27,42 +27,42 @@ namespace Mall.Repository.Product
string where = $" 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderDetailIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
where += $@" and a.{nameof(RB_Goods_OrderDetail.Id)} in({dmodel.OrderDetailIds})";
}
if (dmodel.OrderId > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderType > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderType)}={(int)dmodel.OrderType}";
}
if (dmodel.IsComment > 0)
{
where += $@" and {nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
where += $@" and a.{nameof(RB_Goods_OrderDetail.IsComment)}={(int)dmodel.IsComment}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and {nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
where += $@" and a.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and {nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
where += $@" and a.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and {nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
}
string sql = $@"SELECT * FROM rb_goods_orderdetail where {where} order by Id asc";
string sql = $@"SELECT a.*,b.`Name` as SupplierName FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID where {where} order by a.Id asc";
return Get<RB_Goods_OrderDetail_Extend>(sql).ToList();
}
......
......@@ -35,6 +35,10 @@ namespace Mall.Repository.User
{
where += $@" and b.{nameof(RB_Member_Buy_Extend.Id)}={dmodel.Id}";
}
if (dmodel.PayState > -1)
{
where += $@" and b.{nameof(RB_Member_Buy_Extend.PayState)}={dmodel.PayState}";
}
if (dmodel.UserId > 0)
{
where += $@" and b.{nameof(RB_Member_Buy_Extend.UserId)}={dmodel.UserId}";
......@@ -43,7 +47,8 @@ namespace Mall.Repository.User
{
where += $@" and u.{nameof(RB_Member_User.Name)} like '%{dmodel.UserName}%'";
}
if (!string.IsNullOrEmpty(dmodel.StartTime)) {
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and b.{nameof(RB_Member_Buy_Extend.PayTime)} >= '{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
......
This diff is collapsed.
......@@ -27,6 +27,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
UserCommonModule userCommonModule = new UserCommonModule();
//public UserModule userModule = new UserModule();
Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
private IHttpContextAccessor _accessor;
......@@ -92,7 +93,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <summary>
/// 订单支付回调
/// 会员充值支付回调
/// </summary>
/// <returns></returns>
[HttpGet]
......@@ -142,5 +143,57 @@ namespace Mall.WebApi.Controllers.AppletWeChat
// return ApiResult.Failed("", reqXmlFAIL);
}
}
///// <summary>
///// 会员购买支付回调
///// </summary>
///// <returns></returns>
//[HttpGet]
//[HttpPost]
//public string MemberBuyNotify()
//{
// var req = new RequestHandler();
// App_Code.PayUtil PayUtil = new App_Code.PayUtil();
// var result = PayUtil.Notify(_accessor);
// if (result.IsSuccess)
// {
// var dic = ((Dictionary<string, string>)result.Data);
// //开始回写订单状态
// lock (_lock)
// {
// string sOrderNo = dic["sOrderNo"];//订单号 时间挫+OrderId
// int OrderId = Convert.ToInt32(sOrderNo[17..]);
// decimal dPaid = Convert.ToDecimal(dic["dPrice"]) / 100;
// string sPayerOpenID = dic["sPayerOpenID"];
// int UserId = Convert.ToInt32(dic["bIsRecharge"]);
// string TransactionId = dic["sTradeNo"];
// string PayType = dic["OrderPayType"];
// DateTime PayDate = DateTime.ParseExact(dic["PayDate"], "yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture);//转换时间
// #region 修改会员购买支付信息
// userModule.UpdateMemberBuy(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, dPaid, PayDate);
// #endregion
// }
// //告诉微信我们已经处理成功,不需要再调用我们的接口了
// req.SetParameter("return_code", "SUCCESS");
// req.SetParameter("return_msg", "OK");
// var reqXml = req.ParseXml();
// return reqXml;
// // return ApiResult.Success("", reqXml);
// }
// else
// {
// req.SetParameter("return_code", "FAIL");
// req.SetParameter("return_msg", "订单失败");
// var reqXmlFAIL = req.ParseXml();
// LogHelper.Write(null, "Notify返回信息:" + reqXmlFAIL);
// return reqXmlFAIL;
// // return ApiResult.Failed("", reqXmlFAIL);
// }
//}
}
}
\ No newline at end of file
......@@ -192,6 +192,95 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#region 会员购买
/// <summary>
/// 微信支付
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public ApiResult GetMemberBuyPayInfo()
{
var request = RequestParm;
var userInfo = AppletUserInfo;
if (userInfo == null)
{
return ApiResult.Failed("请登录");
}
RB_Member_Buy_Extend demodel = JsonConvert.DeserializeObject<RB_Member_Buy_Extend>(request.msg.ToString());
string sPayInfo = string.Empty;
if (!demodel.PayWay.HasValue)
{
return ApiResult.Failed("请选择支付方式");
}
//查询充值信息
if (!demodel.GradeId.HasValue)
{
return ApiResult.Failed("请选择您需要购买的会员等级");
}
//查询用户的openId
var userModel = userModule.GetMemberUserEntityModule(new RB_Member_User_Extend { MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId, Id = userInfo.UserId });
if (userModel == null)
{
return ApiResult.Failed("用户不存在");
}
string payGoodsName = "会员等级购买";
var rechargeRulesModel = userModule.GetMemberGradeList(new RB_Member_Grade_Extend { MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId, Grade = demodel.GradeId }).FirstOrDefault();
if (rechargeRulesModel == null)
{
return ApiResult.Failed("您选择的会员等级不存在");
}
if (userModel.MemberGrade >= rechargeRulesModel.Grade)
{
return ApiResult.Failed("购买会员等级低于您当前会员等级");
}
if (rechargeRulesModel.IsMemberBuy == 1)
{
if (rechargeRulesModel.MemberBuyMoney != demodel.Money)
{
return ApiResult.Failed("会员购买支付金额有误,请稍后重试");
}
demodel.GradeName = rechargeRulesModel.Name;
}
else
{
return ApiResult.Failed("当前会员等级不能购买");
}
Random R = new Random();
int Rstr = R.Next(111, 999);
demodel.OrderNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + Rstr;
demodel.UserId = userInfo.UserId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.TenantId = userInfo.TenantId;
demodel.PayState = 0;
demodel.Status = 0;
demodel.CreateDate = DateTime.Now;
//新增充值记录
int memberBuyId = userModule.AddMemberBuy(demodel);
if (memberBuyId == 0)
{
return ApiResult.Failed("购买会员失败");
}
string sOrderNo = (System.DateTime.Now.ToString("yyyyMMddHHmmssfff")) + memberBuyId;
//根据订单号获取微信支付配置信息
RB_MiniProgram_Extend miniProgram = new RB_MiniProgram_Extend(); //2020年5月26号新增
miniProgram = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { MallBaseId = userInfo.MallBaseId, TenantId = userInfo.TenantId });
App_Code.PayUtil payUtil = new App_Code.PayUtil();
switch ((int)demodel.PayWay)
{
case 1://微信支付
sPayInfo = App_Code.PayUtil.GetMinUnifiedOrder(sOrderNo, payGoodsName, Convert.ToDecimal(rechargeRulesModel.MemberBuyMoney), userInfo.UserId.ToString(), userModel.OpenId, Config.sTenpayMemberBuyNotify, miniProgram, _accessor, System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList.FirstOrDefault(address => address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)?.ToString());
break;
default:
break;
}
return ApiResult.Success("", sPayInfo);
}
#endregion
......
......@@ -9,6 +9,7 @@ using Mall.Model.Query;
using System;
using Mall.Common.Plugin;
using System.Collections.Generic;
using Mall.Module.User;
namespace Mall.WebApi.Controllers.MarketingCenter
{
......@@ -19,7 +20,6 @@ namespace Mall.WebApi.Controllers.MarketingCenter
public class StatisticsController : BaseController
{
public StatisticsModule statisticsModule = new StatisticsModule();
#region 数据统计
/// <summary>
/// 数据概况
......
......@@ -79,6 +79,7 @@ namespace Mall.WebApi.Controllers.MallBase
PaymentWayName = x.PaymentWay.GetEnumName(),
DetailList = x.DetailList.Select(y => new
{
y.SupplierName,
y.FreightCostMoney,
y.FreightMoney,
y.CostMoney,
......
......@@ -32,7 +32,7 @@ namespace Mall.WebApi.Controllers.User
private readonly Module.MarketingCenter.CouponModule couponModule = new Module.MarketingCenter.CouponModule();
private readonly Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
private readonly MiniProgramModule appletWeChatModule = new MiniProgramModule();
#region 收货地址
/// <summary>
......@@ -1119,56 +1119,6 @@ namespace Mall.WebApi.Controllers.User
#endregion
#region 直播房间信息
[HttpPost]
[Obsolete]
public ApiResult GetLiveHouseList()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
Model.Entity.AppletWeChat.RB_Live_House demodel = JsonConvert.DeserializeObject<Model.Entity.AppletWeChat.RB_Live_House>(RequestParm.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
var list = appletWeChatModule.GetLiveHousePageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.roomid,
x.name,
x.anchor_img,
x.anchor_name,
x.cover_img,
x.live_status,
start_time = GetTime(x.start_time),
end_time = GetTime(x.end_time),
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name="timeStamp">Unix时间戳格式</param>
/// <returns>C#格式时间</returns>
[Obsolete]
public static string GetTime(string timeStamp)
{
try
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime);
return dtStart.Add(toNow).ToString("yyyy-MM-dd HH:mm:ss");
}
catch (Exception)
{
return "";
}
}
#endregion
}
}
\ No newline at end of file
......@@ -102,10 +102,10 @@ namespace Mall.WebApi.Controllers.User
{
return ApiResult.Failed("请填写卡号!");
}
if (supplierModule.ExistsClientAccount(demodel.ClientBankAccount.ID, demodel.ClientBankAccount.CardNum, 2, Convert.ToInt32(Config.RB_Branch_Id)))
{
return ApiResult.Failed("卡号重复!");
}
//if (supplierModule.ExistsClientAccount(demodel.ClientBankAccount.ID, demodel.ClientBankAccount.CardNum, 2, Convert.ToInt32(Config.RB_Branch_Id)))
//{
// return ApiResult.Failed("卡号重复!");
//}
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.CreateDate = DateTime.Now;
......@@ -319,13 +319,13 @@ namespace Mall.WebApi.Controllers.User
});
var financeObj = new
{
CreateBy = Config.NetworkDirector,
CreateBy = Config.ExpendDirector,
IsPublic = demodel.IsPublic,// supplierModel.ClientBankAccount.AccountType, //financeConfigurineModel.AccountType,
ClientType = supplierModel.ClientBankAccount.Type,
ClientID = supplierModel.BankAccountId,
CurrencyId = financeConfigurineModel.CurrencyId,
WBMoney = result.Sum(x => ((x.CostMoney ?? 0) * (x.Number ?? 0)) + (x.FreightCostMoney ?? 0)),
RB_Branch_Id = Config.RB_Branch_Id,
RB_Branch_Id = Config.ExpendBranchId,
PayDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
TemplateId = financeConfigurineModel.WorkFlowId,
OrderSource = 16,
......
......@@ -705,6 +705,36 @@ namespace Mall.WebApi.Controllers.User
}
}
/// <summary>
/// 获取用户分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetMemberBuyUserPageList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Member_Buy_Extend demodel = JsonConvert.DeserializeObject<RB_Member_Buy_Extend>(parms.msg.ToString());
demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId;
demodel.PayState = 1;
var list = userModule.GetMemberBuyPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.OrderNo,
x.UserName,
x.Money,
x.GradeName,
PayTime = x.PayTime.HasValue ? x.PayTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
return ApiResult.Success("", pagelist);
}
#endregion
#region 分销商基础
......@@ -1362,6 +1392,7 @@ namespace Mall.WebApi.Controllers.User
}));
}
#endregion
#region 分销商申请管理
......@@ -1874,7 +1905,8 @@ namespace Mall.WebApi.Controllers.User
string msg = userModule.SetDistributorRemitAudit(RemitId, Type, Remark, re.uid, re.MallBaseId);
if (msg == "")
{
if (Type == 3) {
if (Type == 3)
{
var umodel = userModule.GetMemberUserInfo(model.UserId ?? 0);
new MiniProgramMsgModule().SendWithdrawFailMsg(model.TenantId, model.MallBaseId, umodel.OpenId, (model.RemitMoney ?? 0).ToString(), "提现申请已被拒绝");
}
......@@ -2082,7 +2114,7 @@ namespace Mall.WebApi.Controllers.User
pagelist.pageData = list.Select(x => new
{
x.Id,
AliasName= x.Name,
AliasName = x.Name,
x.Photo,
x.Price,
x.Source,
......
......@@ -22,6 +22,7 @@
"ImKey": "b612b31e837c79c68f141aeb719d2b20",
"ImSecret": "66000451fb72",
"Mongo": "mongodb://192.168.2.214:27017",
//"Mongo": "mongodb://47.96.25.130:27017",
"MongoDBName": "Mall",
"ProjectUrl": "D:/project/GitProject/mallapp",
"DeveloperKitsPort": "15720",
......@@ -29,8 +30,14 @@
"ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send",
"sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信商品回调地址
"sTenpayRechargeNotify": "http://mallapi.oytour.com/api/WeChatNotify/RechargeNotify", //微信充值回调地址
"sTenpayMemberBuyNotify": "http://mallapi.oytour.com/api/WeChatNotify/MemberBuyNotify", //微信充值回调地址
"NetworkDirector": 1756, //网络主管的id,用于新建供应商账户的时候的创建人
"RB_Branch_Id": 49, //所属公司id
"IncomeDirector": 1756, //财务收入创建人
"IncomeBranchId": 49, //财务收入创建人公司
"ExpendDirector": 1756, //财务支出创建人
"ExpendBranchId": 49, //财务支出创建人公司
"RebornDMC": "reborn_dmc",
"IncomeFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallIn",
"PaymentFinanceApi": "http://192.168.2.16:8083/api/Mall/InsertFinanceBatchForMallOut",
......@@ -41,6 +48,11 @@
"RedisPort": "6379",
"RedisPwd": "123456"
},
//"RedisSetting": {
// "RedisServer": "47.96.23.199",
// "RedisPort": "6379",
// "RedisPwd": "Viitto2018"
//},
"VirtualDirectory": "WebFile",
"FileService": "2",
"IsNormalServer": 2,
......
......@@ -245,12 +245,12 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
});
var financeObj = new
{
CreateBy = Config.NetworkDirector,
CreateBy = Config.IncomeDirector,
item.IsPublic,
BType = item.AccountType,
AccountId = item.AccountId,
WBMoney = (result.Sum(x => x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FreightMoney ?? 0)))- OriginalFee,
RB_Branch_Id = Config.RB_Branch_Id,
RB_Branch_Id = Config.IncomeBranchId,
RemitterName = item.RemitterName,
TradeDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
AccountNumber = System.DateTime.Now.ToString("yyyyMMdd"),
......
......@@ -28,6 +28,10 @@
"FirstPage": "pages/index/index.html",
"ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send",
"sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信回调地址
"IncomeDirector": 1756, //财务收入创建人
"IncomeBranchId": 49, //财务收入创建人公司
"ExpendDirector": 1756, //财务支出创建人
"ExpendBranchId": 49, //财务支出创建人公司
"NetworkDirector": 1756, //网络主管的id,用于新建供应商账户的时候的创建人
"RB_Branch_Id": 49, //所属公司id
"RebornDMC": "reborn_dmc",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment