Commit 30ad235b authored by 黄奎's avatar 黄奎
parents 829b68cc 4bec7a05
...@@ -342,7 +342,16 @@ namespace Mall.Common ...@@ -342,7 +342,16 @@ namespace Mall.Common
} }
} }
/// <summary>
/// 网络主管的id,用于新建供应商账户的时候的创建人
/// </summary>
public static string NetworkDirector
{
get
{
return new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json" }).Build().GetSection("NetworkDirector").Value;
}
}
} }
} }
\ No newline at end of file
...@@ -185,6 +185,10 @@ namespace Mall.Module.Product ...@@ -185,6 +185,10 @@ namespace Mall.Module.Product
/// 和平等级 /// 和平等级
/// </summary> /// </summary>
private readonly RB_Distributor_HPGradeInfoRepository distributor_HPGradeInfoRepository = new RB_Distributor_HPGradeInfoRepository(); private readonly RB_Distributor_HPGradeInfoRepository distributor_HPGradeInfoRepository = new RB_Distributor_HPGradeInfoRepository();
/// <summary>
/// 商品限购区域
/// </summary>
private readonly RB_Goods_AreaRepository goods_AreaRepository = new RB_Goods_AreaRepository();
#region 购物车 #region 购物车
...@@ -999,6 +1003,7 @@ namespace Mall.Module.Product ...@@ -999,6 +1003,7 @@ namespace Mall.Module.Product
int Total_use_integral = 0;//总积分 int Total_use_integral = 0;//总积分
decimal CouponsMoney = 0;//优惠总金额 decimal CouponsMoney = 0;//优惠总金额
bool IsPointsDeduction = false;//是否有商品可使用积分抵扣 bool IsPointsDeduction = false;//是否有商品可使用积分抵扣
bool address_enable = true;//地址Ok
List<object> goods_list = new List<object>(); List<object> goods_list = new List<object>();
if (demodel.DetailList.Any()) if (demodel.DetailList.Any())
{ {
...@@ -1010,6 +1015,8 @@ namespace Mall.Module.Product ...@@ -1010,6 +1015,8 @@ namespace Mall.Module.Product
var speciVList = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var speciVList = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var speciPList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var speciPList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var mpriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
//区域
var AreaList = goods_AreaRepository.GetList(new RB_Goods_Area_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
//返佣 //返佣
var DistributionCommissionList = new List<RB_Goods_DistributionCommission_Extend>(); var DistributionCommissionList = new List<RB_Goods_DistributionCommission_Extend>();
if (demodel.DetailList.Where(x=>x.SeparateDistribution == 1).Any()) if (demodel.DetailList.Where(x=>x.SeparateDistribution == 1).Any())
...@@ -1089,7 +1096,7 @@ namespace Mall.Module.Product ...@@ -1089,7 +1096,7 @@ namespace Mall.Module.Product
continue; continue;
} }
int GoodsWeight = gmodel.GoodsWeight ?? 0;//商品重量 int GoodsWeight = gmodel.GoodsWeight ?? 0;//商品重量
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList(); var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
#region 图片 #region 图片
gmodel.CoverImage = ""; gmodel.CoverImage = "";
...@@ -1463,6 +1470,7 @@ namespace Mall.Module.Product ...@@ -1463,6 +1470,7 @@ namespace Mall.Module.Product
item.Discounts = discounts; item.Discounts = discounts;
Total_integral_price += integral_price; Total_integral_price += integral_price;
Total_use_integral += use_integral; Total_use_integral += use_integral;
item.CategoryIdList = categoryList.Select(x => x.CategoryId ?? 0).ToList();
} }
if (demodel.User_Coupon_Id > 0 && GoodsCouponList.Any()) { if (demodel.User_Coupon_Id > 0 && GoodsCouponList.Any()) {
...@@ -1514,21 +1522,51 @@ namespace Mall.Module.Product ...@@ -1514,21 +1522,51 @@ namespace Mall.Module.Product
{ {
continue; continue;
} }
//验证规格是否已失效
if (gmodel.IsCustomSpecification == 1)
{
if (string.IsNullOrEmpty(item.SpecificationSort))
{
continue;
}
if (!speciPList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationSort == item.SpecificationSort).Any())
{
continue;
}
}
else
{
if (!string.IsNullOrEmpty(item.SpecificationSort))
{
continue;
}
}
decimal couponMoney = 0;//优惠金额 decimal couponMoney = 0;//优惠金额
var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault(); var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault();
if (couponModel != null) { if (couponModel != null) {
couponMoney = couponModel.CouponMoney; couponMoney = couponModel.CouponMoney;
TotalGoodsMoney -= couponMoney;//总价格需减去优惠券金额 TotalGoodsMoney -= couponMoney;//总价格需减去优惠券金额
} }
var areaGoods = AreaList.Where(x => x.GoodsId == item.GoodsId).ToList();
bool address_disabled = false;
if (!areaGoods.Where(x => disList.Contains(x.AreaId ?? 0)).Any()) {
address_disabled = true;
address_enable = false;
}
goods_list.Add(new goods_list.Add(new
{ {
id = gmodel.Id, id = gmodel.Id,
name = gmodel.Name, name = gmodel.Name,
categoryIdList = item.CategoryIdList,
num = item.Number, num = item.Number,
forehead_integral = gmodel.PointsDeduction, forehead_integral = gmodel.PointsDeduction,
forehead_integral_type = gmodel.PointsDeductionType, forehead_integral_type = gmodel.PointsDeductionType,
accumulative = gmodel.IsMultipleDeduction,//累计多件抵扣 accumulative = gmodel.IsMultipleDeduction,//累计多件抵扣
address_disabled,
pieces = gmodel.FullNumPinkage,//满件包邮 pieces = gmodel.FullNumPinkage,//满件包邮
forehead = gmodel.FullMoneyPinkage,//满额包邮 forehead = gmodel.FullMoneyPinkage,//满额包邮
freight_id = gmodel.FreightId, freight_id = gmodel.FreightId,
...@@ -1668,7 +1706,7 @@ namespace Mall.Module.Product ...@@ -1668,7 +1706,7 @@ namespace Mall.Module.Product
is_default= defModel?.IsDefault??2, is_default= defModel?.IsDefault??2,
lonlat = defModel?.Lonlat lonlat = defModel?.Lonlat
}, },
address_enable= true, address_enable,
//has_ziti= false, //has_ziti= false,
//custom_currency_all= [], //custom_currency_all= [],
//allZiti= false, //allZiti= false,
...@@ -4804,6 +4842,51 @@ namespace Mall.Module.Product ...@@ -4804,6 +4842,51 @@ namespace Mall.Module.Product
TenantId = tenantId, TenantId = tenantId,
Type = 1 Type = 1
}); });
//更新返佣为已返佣
var ocList = goods_OrderCommissionRepository.GetListGroupByUser(new RB_Goods_OrderCommission_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
if (ocList.Any()) {
foreach (var item in ocList) {
//查询是否有申请退款
var afterSaleList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = item.OrderDetailId, Type = 1, MallBaseId = mallBaseId, TenantId = tenantId });
if (!afterSaleList.Any())
{
//获取分销商信息
var disInfo = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { UserId = item.UserId, TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault();
if (disInfo != null && disInfo.AuditStatus == DistributorAuditStatusEnum.Audited)
{
//更新分销商佣金
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Info_Extend.TotalCommission),(disInfo.TotalCommission??0)+(item.Commission??0)},
{ nameof(RB_Distributor_Info_Extend.CommissionWithdrawal),(disInfo.CommissionWithdrawal??0)+(item.Commission??0)},
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Distributor_Info_Extend.Id),
FiledValue=disInfo.Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag1 = goods_OrderCommissionRepository.Update(keyValues2, wheres2);
if (flag1)
{
//更新返佣状态
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderCommission_Extend.CommissionState),2},
{ nameof(RB_Goods_OrderCommission_Extend.UpdateDate),DateTime.Now},
};
List<WhereHelper> wheres1 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderCommission_Extend.Id),
FiledValue=item.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_OrderCommissionRepository.Update(keyValues1, wheres1);
}
}
}
}
}
} }
return flag; return flag;
} }
...@@ -5335,6 +5418,54 @@ namespace Mall.Module.Product ...@@ -5335,6 +5418,54 @@ namespace Mall.Module.Product
} }
}; };
goods_OrderRepository.Update(keyValues1, wheres1); goods_OrderRepository.Update(keyValues1, wheres1);
//更新返佣为已返佣
var ocList = goods_OrderCommissionRepository.GetListGroupByUser(new RB_Goods_OrderCommission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderId = OrderId });
if (ocList.Any())
{
foreach (var item in ocList)
{
//查询是否有申请退款
var afterSaleList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetialId = item.OrderDetailId, Type = 1, MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId });
if (!afterSaleList.Any())
{
//获取分销商信息
var disInfo = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { UserId = item.UserId, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }).FirstOrDefault();
if (disInfo != null && disInfo.AuditStatus == DistributorAuditStatusEnum.Audited)
{
//更新分销商佣金
Dictionary<string, object> keyValues2 = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Info_Extend.TotalCommission),(disInfo.TotalCommission??0)+(item.Commission??0)},
{ nameof(RB_Distributor_Info_Extend.CommissionWithdrawal),(disInfo.CommissionWithdrawal??0)+(item.Commission??0)},
};
List<WhereHelper> wheres2 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Distributor_Info_Extend.Id),
FiledValue=disInfo.Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag1 = goods_OrderCommissionRepository.Update(keyValues2, wheres2);
if (flag1)
{
//更新返佣状态
Dictionary<string, object> keyValues3 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderCommission_Extend.CommissionState),2},
{ nameof(RB_Goods_OrderCommission_Extend.UpdateDate),DateTime.Now},
};
List<WhereHelper> wheres3 = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_OrderCommission_Extend.Id),
FiledValue=item.Id,
OperatorEnum=OperatorEnum.Equal
}
};
goods_OrderCommissionRepository.Update(keyValues3, wheres3);
}
}
}
}
}
} }
} }
} }
......
...@@ -162,6 +162,10 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId ...@@ -162,6 +162,10 @@ INNER JOIN rb_member_user mu on mu.Id=oas.UserId
{ {
where += $" and oas.{nameof(RB_Goods_OrderAfterSale.OrderDetialId)}={dmodel.OrderDetialId}"; where += $" and oas.{nameof(RB_Goods_OrderAfterSale.OrderDetialId)}={dmodel.OrderDetialId}";
} }
if (dmodel.Type > 0)
{
where += $" and oas.{nameof(RB_Goods_OrderAfterSale.Type)}={dmodel.Type}";
}
if (!string.IsNullOrEmpty(dmodel.ReOrderNo)) if (!string.IsNullOrEmpty(dmodel.ReOrderNo))
{ {
where += $" and oas.{nameof(RB_Goods_OrderAfterSale.ReOrderNo)} like '%{dmodel.ReOrderNo}%'"; where += $" and oas.{nameof(RB_Goods_OrderAfterSale.ReOrderNo)} like '%{dmodel.ReOrderNo}%'";
......
...@@ -189,21 +189,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter ...@@ -189,21 +189,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
x.MaxDiscountsPrice, x.MaxDiscountsPrice,
x.UseType x.UseType
}); });
return ApiResult.Success("", result);
//var result = list.Select(x => new
//{
// x.ID,
// StartDate = x.StartDate.HasValue ? x.StartDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
// EndDate = x.EndDate.HasValue ? x.EndDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
// x.Name,
// x.Describe,
// x.MinConsumePrice,
// x.CouponType,
// x.MaxDiscountsPrice,
// x.UseType
//});
return ApiResult.Success("", data: JsonHelper.GetCamelCaseResultJson(result));
} }
} }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Mall.WebApi.Controllers.User
{
public class SupplierController : Controller
{
public IActionResult Index()
{
return View();
}
}
}
\ No newline at end of file
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_mall;CharSet=utf8; Convert Zero Datetime=true; ", "DefaultConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_mall;CharSet=utf8; Convert Zero Datetime=true; ",
"DefaultConnectionPName": "MySql.Data.MySqlClient" "DefaultConnectionPName": "MySql.Data.MySqlClient",
"FinanceConnection": "server=192.168.2.214;user id=reborn;password=Reborn@2018;database=reborn_finance;CharSet=utf8; Convert Zero Datetime=true; ",
"FinanceConnectionPName": "MySql.Data.MySqlClient"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
...@@ -26,6 +28,7 @@ ...@@ -26,6 +28,7 @@
"FirstPage": "pages/index/index.html", "FirstPage": "pages/index/index.html",
"ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send", "ByteDanceSendTemplate": "https://developer.toutiao.com/api/apps/game/template/send",
"sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信回调地址 "sTenpayNotify": "http://mallapi.oytour.com/api/WeChatNotify/Notify", //微信回调地址
"NetworkDirector": 1756, //网络主管的id,用于新建供应商账户的时候的创建人
"RedisSetting": { "RedisSetting": {
"RedisServer": "192.168.2.214", "RedisServer": "192.168.2.214",
"RedisPort": "6379", "RedisPort": "6379",
......
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