Commit ac96df28 authored by 吴春's avatar 吴春
parents 9c53baef da7e9a63
...@@ -363,8 +363,9 @@ namespace Mall.Common.Plugin ...@@ -363,8 +363,9 @@ namespace Mall.Common.Plugin
stream = rsp.GetResponseStream(); stream = rsp.GetResponseStream();
return ReadImageForStream_V2(stream, path); return ReadImageForStream_V2(stream, path);
} }
catch catch(Exception ex)
{ {
LogHelper.Write(ex, "GetResponseAsStringBase64_V2");
return ""; return "";
} }
finally finally
......
...@@ -108,7 +108,7 @@ namespace Mall.Model.Entity.Product ...@@ -108,7 +108,7 @@ namespace Mall.Model.Entity.Product
set; set;
} }
/// <summary> /// <summary>
/// 最终价格 /// 最终价格(不包含运费)
/// </summary> /// </summary>
public decimal? Final_Price public decimal? Final_Price
{ {
......
...@@ -672,6 +672,14 @@ namespace Mall.Module.Product ...@@ -672,6 +672,14 @@ namespace Mall.Module.Product
return ApiResult.Failed("未查询到订单商品信息"); return ApiResult.Failed("未查询到订单商品信息");
} }
dModel.CoverImagePath = dModel.CoverImage; dModel.CoverImagePath = dModel.CoverImage;
var omodel = goods_OrderRepository.GetEntity(dModel.OrderId);
if (omodel == null) {
return ApiResult.Failed("未查询到订单信息");
}
decimal Final_Price = dModel.Final_Price ?? 0;
if (omodel.Income < dModel.Final_Price) {
Final_Price = omodel.Income ?? 0;
}
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
DetailId = dModel.Id, DetailId = dModel.Id,
...@@ -680,7 +688,7 @@ namespace Mall.Module.Product ...@@ -680,7 +688,7 @@ namespace Mall.Module.Product
dModel.GoodsName, dModel.GoodsName,
SpecificationList = JsonConvert.DeserializeObject<List<string>>(dModel.Specification), SpecificationList = JsonConvert.DeserializeObject<List<string>>(dModel.Specification),
dModel.Number, dModel.Number,
dModel.Final_Price, Final_Price,
dModel.FreightMoney dModel.FreightMoney
}); });
} }
...@@ -2190,7 +2198,7 @@ namespace Mall.Module.Product ...@@ -2190,7 +2198,7 @@ namespace Mall.Module.Product
item.InventoryNum = gmodel.InventoryNum ?? 0; item.InventoryNum = gmodel.InventoryNum ?? 0;
item.CostMoney = gmodel.CostPrice ?? 0; item.CostMoney = gmodel.CostPrice ?? 0;
item.ProductCode = gmodel.GoodsNumbers; item.ProductCode = gmodel.GoodsNumbers;
item.CategoryIdList = clist.Where(x => x.GoodsId == item.Id).Select(x => x.CategoryId ?? 0).ToList(); item.CategoryIdList = categoryList.Select(x => x.CategoryId ?? 0).ToList();
int GoodsWeight = gmodel.GoodsWeight ?? 0;//商品重量 int GoodsWeight = gmodel.GoodsWeight ?? 0;//商品重量
#region 规格 #region 规格
//验证规格是否已失效 //验证规格是否已失效
...@@ -2574,7 +2582,7 @@ namespace Mall.Module.Product ...@@ -2574,7 +2582,7 @@ namespace Mall.Module.Product
{ {
continue; continue;
} }
//item.SupplierId = gmodel.SpplierID; item.SupplierId = gmodel.SupplierId;
item.CouponMoney = 0; item.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)
...@@ -4220,7 +4228,7 @@ namespace Mall.Module.Product ...@@ -4220,7 +4228,7 @@ namespace Mall.Module.Product
} }
var arealist = destinationRepository.GetDictvalueListForIds(areaIds); var arealist = destinationRepository.GetDictvalueListForIds(areaIds);
//分销情况 //分销情况
; var oclist = goods_OrderCommissionRepository.GetList(new RB_Goods_OrderCommission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) }); var oclist = goods_OrderCommissionRepository.GetListGroupByUser(new RB_Goods_OrderCommission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
if (oclist.Any()) if (oclist.Any())
{ {
//获取用户 //获取用户
...@@ -4851,7 +4859,7 @@ namespace Mall.Module.Product ...@@ -4851,7 +4859,7 @@ namespace Mall.Module.Product
var detailList = new List<object>() { var detailList = new List<object>() {
new new
{ {
CostTypeId = item.RemitCostTypeId, CostTypeId = item.RefundCostTypeId,
Number = 1, Number = 1,
OriginalMoney = Money, OriginalMoney = Money,
UnitPrice = Money, UnitPrice = Money,
...@@ -5519,7 +5527,7 @@ namespace Mall.Module.Product ...@@ -5519,7 +5527,7 @@ namespace Mall.Module.Product
var detailList = new List<object>() { var detailList = new List<object>() {
new new
{ {
CostTypeId = item.RemitCostTypeId, CostTypeId = item.RefundCostTypeId,
Number = 1, Number = 1,
OriginalMoney = Money, OriginalMoney = Money,
UnitPrice = Money, UnitPrice = Money,
......
...@@ -22,29 +22,31 @@ namespace Mall.Repository.Product ...@@ -22,29 +22,31 @@ namespace Mall.Repository.Product
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_OrderCommission_Extend> GetList(RB_Goods_OrderCommission_Extend dmodel) public List<RB_Goods_OrderCommission_Extend> GetList(RB_Goods_OrderCommission_Extend dmodel)
{ {
string where = $" 1=1 "; string where = $" 1=1 and oa.ReOrderId is null";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) if (dmodel.MallBaseId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
} }
if (dmodel.OrderId > 0) if (dmodel.OrderId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}";
} }
if (dmodel.UserId > 0) if (dmodel.UserId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}";
} }
if (!string.IsNullOrEmpty(dmodel.OrderIds)) if (!string.IsNullOrEmpty(dmodel.OrderIds))
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
} }
string sql = $@"SELECT * FROM RB_Goods_OrderCommission where {where} order by Id asc"; string sql = $@"SELECT oc.* FROM RB_Goods_OrderCommission oc
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where {where} order by oc.Id asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList(); return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
} }
...@@ -55,29 +57,31 @@ namespace Mall.Repository.Product ...@@ -55,29 +57,31 @@ namespace Mall.Repository.Product
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_OrderCommission_Extend> GetListGroupByUser(RB_Goods_OrderCommission_Extend dmodel) public List<RB_Goods_OrderCommission_Extend> GetListGroupByUser(RB_Goods_OrderCommission_Extend dmodel)
{ {
string where = $" 1=1 "; string where = $" 1=1 and oa.ReOrderId is null";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) if (dmodel.MallBaseId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
} }
if (dmodel.OrderId > 0) if (dmodel.OrderId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}";
} }
if (dmodel.UserId > 0) if (dmodel.UserId > 0)
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}";
} }
if (!string.IsNullOrEmpty(dmodel.OrderIds)) if (!string.IsNullOrEmpty(dmodel.OrderIds))
{ {
where += $@" and {nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})"; where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
} }
string sql = $@"SELECT OrderId,UserId,Grade,Type,SUM(Commission) as Commission FROM RB_Goods_OrderCommission where {where} group by OrderId,UserId,Grade,Type order by Grade asc"; string sql = $@"SELECT oc.OrderId,oc.UserId,oc.Grade,oc.Type,oc.CommissionState,SUM(oc.Commission) as Commission FROM RB_Goods_OrderCommission oc
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where {where} group by oc.OrderId,oc.UserId,oc.Grade,oc.Type order by oc.Grade asc";
return Get<RB_Goods_OrderCommission_Extend>(sql).ToList(); return Get<RB_Goods_OrderCommission_Extend>(sql).ToList();
} }
......
...@@ -83,7 +83,7 @@ where {where} group by h.Id order by h.Id desc"; ...@@ -83,7 +83,7 @@ where {where} group by h.Id order by h.Id desc";
} }
if (!string.IsNullOrEmpty(dmodel.CategoryIdsT)) if (!string.IsNullOrEmpty(dmodel.CategoryIdsT))
{ {
where += $@" and (c.{nameof(RB_Distributor_HPCategory.CategoryId)} in({dmodel.CategoryIdsT}) or c.{nameof(RB_Distributor_HPCategory.CategoryId)}=-1)"; where += $@" and (c.{nameof(RB_Distributor_HPCategory.CategoryId)} in({dmodel.CategoryIdsT}) or h.{nameof(RB_Distributor_HPCommission.IsCommon)}=1)";
} }
if (!string.IsNullOrEmpty(dmodel.Name)) if (!string.IsNullOrEmpty(dmodel.Name))
{ {
......
...@@ -944,12 +944,13 @@ namespace Mall.WebApi.Controllers.User ...@@ -944,12 +944,13 @@ namespace Mall.WebApi.Controllers.User
{ {
list = menuList; list = menuList;
} }
var newMenuList = list.GroupBy(qitem => new { qitem.MenuId, qitem.MenuLevel, qitem.ParentId, qitem.MenuName, qitem.MenuUrl, qitem.IconClass, qitem.SortNum }).OrderBy(qitem => qitem.Key.SortNum)
var rootList = list.Where(qitem => qitem.MenuLevel == 1).OrderBy(qitem => qitem.SortNum).ToList(); .Select(qitem => new { qitem.Key.MenuId, qitem.Key.MenuLevel, qitem.Key.ParentId, qitem.Key.MenuName, qitem.Key.MenuUrl, qitem.Key.IconClass, qitem.Key.SortNum }).ToList();
var rootList = newMenuList.Where(qitem => qitem.MenuLevel == 1);
foreach (var item in rootList) foreach (var item in rootList)
{ {
List<object> subResultList = new List<object>(); List<object> subResultList = new List<object>();
var subList = list.Where(qitem => qitem.MenuLevel == 2 && qitem.ParentId == item.MenuId).OrderBy(qitem => qitem.SortNum).ToList(); var subList = newMenuList.Where(qitem => qitem.MenuLevel == 2 && qitem.ParentId == item.MenuId).OrderBy(qitem => qitem.SortNum).ToList();
foreach (var subItem in subList) foreach (var subItem in subList)
{ {
List<object> thirdResultList = new List<object>(); List<object> thirdResultList = new List<object>();
...@@ -959,7 +960,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -959,7 +960,7 @@ namespace Mall.WebApi.Controllers.User
subItem.MenuName, subItem.MenuName,
subItem.MenuUrl, subItem.MenuUrl,
subItem.IconClass, subItem.IconClass,
ThirdList = list.Where(qitem => qitem.MenuLevel == 3 && qitem.ParentId == subItem.MenuId).OrderBy(qitem => qitem.SortNum).Select(qitem => new ThirdList = newMenuList.Where(qitem => qitem.MenuLevel == 3 && qitem.ParentId == subItem.MenuId).OrderBy(qitem => qitem.SortNum).Select(qitem => new
{ {
qitem.MenuId, qitem.MenuId,
qitem.MenuName, qitem.MenuName,
......
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