Commit a0237677 authored by liudong1993's avatar liudong1993
parents f8616a0c f4b92651
This diff is collapsed.
This diff is collapsed.
......@@ -44,20 +44,25 @@ namespace Mall.Module.User
/// 订单信息
/// </summary>
private readonly RB_Goods_OrderRepository goods_OrderRepository = new RB_Goods_OrderRepository();
/// <summary>
/// 订单商品信息
/// </summary>
private readonly RB_Goods_OrderDetailRepository goodsOrderDetailRepository = new RB_Goods_OrderDetailRepository();
/// <summary>
/// 会员信息
/// </summary>
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
private readonly MiniProgramModule appletWeChatModule = new MiniProgramModule();
/// <summary>
/// 初始化分销基础配置
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public bool InitializeDistributorBasicsInfo(int TenantId,int MallBaseId)
public bool InitializeDistributorBasicsInfo(int TenantId, int MallBaseId)
{
var OModel = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend() { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
if (OModel == null)
......@@ -93,7 +98,8 @@ namespace Mall.Module.User
HpReferralsGradeAudit = 2
}) > 0;
}
else {
else
{
return true;
}
}
......@@ -112,7 +118,7 @@ namespace Mall.Module.User
{
Id = 0,
ApplicationAgreement = "分销申请协议",
HeadImage =Common.Config.GetFileUrl("/Upload/Set/1587968479000.png"),
HeadImage = Common.Config.GetFileUrl("/Upload/Set/1587968479000.png"),
BottomImage = Common.Config.GetFileUrl("/Upload/Set/1587968716000.png"),
ButtonColor = "#FF4544",
ButtonFilletPX = 40,
......@@ -149,7 +155,8 @@ namespace Mall.Module.User
UpdateDate = DateTime.Now
}) > 0;
}
else {
else
{
return true;
}
}
......@@ -160,7 +167,8 @@ namespace Mall.Module.User
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public bool InitializeCategoryStyleInfo(int TenantId, int MallBaseId) {
public bool InitializeCategoryStyleInfo(int TenantId, int MallBaseId)
{
var OModel = product_CategoryStyleRepository.GetList(new RB_Product_CategoryStyle_Extend() { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
if (OModel == null)
{
......@@ -177,7 +185,8 @@ namespace Mall.Module.User
UpdateDate = DateTime.Now
}) > 0;
}
else {
else
{
return true;
}
}
......@@ -188,7 +197,8 @@ namespace Mall.Module.User
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public bool InitializeProductRecommendInfo(int TenantId, int MallBaseId) {
public bool InitializeProductRecommendInfo(int TenantId, int MallBaseId)
{
var oModel = product_RecommendRepository.GetList(new RB_Product_Recommend_Extend() { TenantId = TenantId, MallBaseId = MallBaseId }).FirstOrDefault();
if (oModel == null)
{
......@@ -209,7 +219,8 @@ namespace Mall.Module.User
UpdateDate = DateTime.Now
}) > 0;
}
else {
else
{
return true;
}
}
......@@ -226,11 +237,28 @@ namespace Mall.Module.User
/// <param name="Money">金额</param>
/// <param name="Pay_Result">状态</param>
/// <returns></returns>
public bool InsertOrderPayInfo(int UserId, int OrderId,string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, string PayType, decimal Money,DateTime Time_End, int Pay_Result) {
public bool InsertOrderPayInfo(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, string PayType, decimal Money, DateTime Time_End, int Pay_Result)
{
var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null) {
if (umodel == null)
{
return false;
}
//判断订单状态是否是待支付 2020-06-16 Add By:W
var oldOrder = goods_OrderRepository.GetEntity(OrderId);
if (oldOrder == null)
{
return false;
}
if (oldOrder.OrderStatus != Common.Enum.Goods.OrderStatusEnum.NonPayment)
{
return false;
}
//获取订单商品
var orderGoodsList = goodsOrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend { TenantId = oldOrder.TenantId, MallBaseId = oldOrder.MallBaseId, OrderId = oldOrder.OrderId });
bool flag = goods_Online_TradeRepository.Insert(new Model.Entity.Product.RB_Goods_Online_Trade()
{
Id = 0,
......@@ -254,7 +282,8 @@ namespace Mall.Module.User
Transaction_Id = Transaction_Id,
Type = 1
}) > 0;
if (flag) {
if (flag)
{
//更新订单信息
Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_Order_Extend.OrderStatus),Common.Enum.Goods.OrderStatusEnum.WaitSendGoods},
......@@ -287,6 +316,20 @@ namespace Mall.Module.User
};
member_UserRepository.Update(keyValues1, wheres1);
}
//发送订阅消息
string goodsName = orderGoodsList.FirstOrDefault().GoodsName;
if (orderGoodsList.Count > 1)
{
goodsName += "等" + orderGoodsList.Count + "件商品";
}
appletWeChatModule.SendOrderSucceedMsg(oldOrder.TenantId, oldOrder.MallBaseId, umodel.OpenId, oldOrder.OrderNo, oldOrder.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"), "微信", goodsName);
}
return flag;
}
......
......@@ -157,16 +157,16 @@ namespace Mall.Repository.MarketingCenter
}
if (!string.IsNullOrWhiteSpace(goodsClassWhere))
{
goodsClassWhere += $" or (c.ProductId = {item.Key} and a.MinConsumePrice<= {nowPrice}) ";
goodsClassWhere += $" or (c.ProductId = {item.Key} and b.MinConsumePrice<= {nowPrice}) ";
}
else
{
goodsClassWhere += $" (c.ProductId = {item.Key} and a.MinConsumePrice<= {nowPrice}) ";
goodsClassWhere += $" (c.ProductId = {item.Key} and b.MinConsumePrice<= {nowPrice}) ";
}
}
goodsClassWhere = " and (" + goodsClassWhere + ")";
decimal allPrice = query.ProductList.Sum(x => x.GoodsPrice);
allWhere = $" and a.MinConsumePrice<= {allPrice} ";
allWhere = $" and b.MinConsumePrice<= {allPrice} ";
}
}
......
......@@ -68,6 +68,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#region 新增订单支付信息
userCommonModule.InsertOrderPayInfo(UserId, OrderId, sOrderNo, TransactionId, Common.Enum.Goods.OrderPayTypeEnum.WeChatPay, PayType, dPaid, PayDate, 0);
#endregion
}
//告诉微信我们已经处理成功,不需要再调用我们的接口了
......@@ -75,7 +77,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
req.SetParameter("return_msg", "OK");
var reqXml = req.ParseXml();
return reqXml;
// return ApiResult.Success("", reqXml);
// return ApiResult.Success("", reqXml);
}
else
{
......
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