Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
b26e595d
Commit
b26e595d
authored
May 26, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序下单调整 临时提交
parent
c0ae62ab
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1629 additions
and
26 deletions
+1629
-26
OrderPaymentTypeEnum.cs
Mall.Common/Enum/Goods/OrderPaymentTypeEnum.cs
+8
-3
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+12
-2
RB_Goods_Order_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
+35
-0
RB_Member_ShippingAddress_Extend.cs
Mall.Model/Extend/User/RB_Member_ShippingAddress_Extend.cs
+14
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+730
-3
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+229
-3
UserModule.cs
Mall.Module.User/UserModule.cs
+104
-4
RB_Material_InfoRepository.cs
Mall.Repository/Product/RB_Material_InfoRepository.cs
+1
-1
RB_Distributor_InfoRepository.cs
Mall.Repository/User/RB_Distributor_InfoRepository.cs
+1
-1
RB_Distributor_RemitRepository.cs
Mall.Repository/User/RB_Distributor_RemitRepository.cs
+3
-0
RB_Member_GradeRepository.cs
Mall.Repository/User/RB_Member_GradeRepository.cs
+35
-0
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+397
-4
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+32
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+6
-1
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+22
-4
No files found.
Mall.Common/Enum/Goods/OrderPaymentTypeEnum.cs
View file @
b26e595d
...
@@ -18,9 +18,14 @@ namespace Mall.Common.Enum.Goods
...
@@ -18,9 +18,14 @@ namespace Mall.Common.Enum.Goods
[
EnumField
(
"在线支付"
)]
[
EnumField
(
"在线支付"
)]
OnlinePayment
=
1
,
OnlinePayment
=
1
,
/// <summary>
/// <summary>
///
线下支付
///
货到付款
/// </summary>
/// </summary>
[
EnumField
(
"线下支付"
)]
[
EnumField
(
"货到付款"
)]
OfflinePayment
=
2
OfflinePayment
=
2
,
/// <summary>
/// 余额支付
/// </summary>
[
EnumField
(
"余额支付"
)]
YEPayment
=
3
}
}
}
}
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
View file @
b26e595d
...
@@ -175,8 +175,18 @@ namespace Mall.Model.Entity.Product
...
@@ -175,8 +175,18 @@ namespace Mall.Model.Entity.Product
/// 运费
/// 运费
/// </summary>
/// </summary>
public
decimal
?
FreightMoney
{
get
;
set
;
}
public
decimal
?
FreightMoney
{
get
;
set
;
}
/// <summary>
/// 使用积分数量
/// </summary>
public
int
?
IntegralNumber
{
get
;
set
;
}
/// <summary>
/// 积分抵扣金额
/// </summary>
public
decimal
?
IntegralMoney
{
get
;
set
;
}
/// <summary>
/// 优惠券使用金额
/// </summary>
public
decimal
?
CouponMoney
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
View file @
b26e595d
...
@@ -95,5 +95,40 @@ namespace Mall.Model.Extend.Product
...
@@ -95,5 +95,40 @@ namespace Mall.Model.Extend.Product
/// 区域地址
/// 区域地址
/// </summary>
/// </summary>
public
string
DistrictAddress
{
get
;
set
;
}
public
string
DistrictAddress
{
get
;
set
;
}
/// <summary>
/// 收货地址id
/// </summary>
public
int
?
AddressId
{
get
;
set
;
}
/// <summary>
/// 使用积分
/// </summary>
public
int
?
Use_Integral
{
get
;
set
;
}
/// <summary>
/// 使用优惠卷id
/// </summary>
public
int
?
User_Coupon_Id
{
get
;
set
;
}
}
/// <summary>
/// 订单优惠金额
/// </summary>
public
class
RB_Goods_CouponModel
{
/// <summary>
/// 商品id
/// </summary>
public
int
GoodsId
{
get
;
set
;
}
/// <summary>
/// key
/// </summary>
public
string
Key
{
get
;
set
;
}
/// <summary>
/// 商品总价格(包含减积分)
/// </summary>
public
decimal
TotalMoney
{
get
;
set
;
}
/// <summary>
/// 优惠券金额
/// </summary>
public
decimal
CouponMoney
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/User/RB_Member_ShippingAddress_Extend.cs
View file @
b26e595d
...
@@ -17,5 +17,19 @@ namespace Mall.Model.Extend.User
...
@@ -17,5 +17,19 @@ namespace Mall.Model.Extend.User
/// 区域地址
/// 区域地址
/// </summary>
/// </summary>
public
string
DistrictAddress
{
get
;
set
;
}
public
string
DistrictAddress
{
get
;
set
;
}
/// <summary>
/// 省名称
/// </summary>
public
string
PName
{
get
;
set
;
}
/// <summary>
/// 市名称
/// </summary>
public
string
CName
{
get
;
set
;
}
/// <summary>
/// 区名称
/// </summary>
public
string
DName
{
get
;
set
;
}
}
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
b26e595d
...
@@ -156,6 +156,14 @@ namespace Mall.Module.Product
...
@@ -156,6 +156,14 @@ namespace Mall.Module.Product
/// 用户积分
/// 用户积分
/// </summary>
/// </summary>
private
readonly
RB_Member_IntegralRepository
member_IntegralRepository
=
new
RB_Member_IntegralRepository
();
private
readonly
RB_Member_IntegralRepository
member_IntegralRepository
=
new
RB_Member_IntegralRepository
();
/// <summary>
/// 积分规则
/// </summary>
private
readonly
RB_Integral_SettingsRepository
integral_SettingsRepository
=
new
RB_Integral_SettingsRepository
();
/// <summary>
/// 小程序
/// </summary>
private
readonly
RB_MiniProgramRepository
miniProgramRepository
=
new
RB_MiniProgramRepository
();
#
region
购物车
#
region
购物车
...
@@ -895,6 +903,717 @@ namespace Mall.Module.Product
...
@@ -895,6 +903,717 @@ namespace Mall.Module.Product
});
});
}
}
/// <summary>
/// 获取小程序结算页面详情
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
ApiResult
GetAppletGoodsSettlementInfoForZY
(
RB_Goods_Order_Extend
demodel
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
demodel
.
UserId
);
if
(
umodel
==
null
)
{
return
ApiResult
.
Failed
(
"用户不存在"
);
}
//积分
Model
.
Entity
.
MarketingCenter
.
RB_Integral_Settings
integralModel
=
new
Model
.
Entity
.
MarketingCenter
.
RB_Integral_Settings
();
if
(
demodel
.
Use_Integral
==
1
&&
umodel
.
Integral
>
0
)
{
integralModel
=
integral_SettingsRepository
.
GetIntegralSettingsList
(
new
Model
.
Entity
.
MarketingCenter
.
RB_Integral_Settings
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
}
//获取用户的默认收货地址
RB_Member_ShippingAddress_Extend
defModel
=
new
RB_Member_ShippingAddress_Extend
();
if
(
demodel
.
AddressId
>
0
)
{
defModel
=
member_ShippingAddressRepository
.
GetEntity
<
RB_Member_ShippingAddress_Extend
>(
demodel
.
AddressId
);
}
else
{
defModel
=
member_ShippingAddressRepository
.
GetList
(
new
RB_Member_ShippingAddress_Extend
()
{
UserId
=
demodel
.
UserId
,
IsDefault
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
}
List
<
int
>
disList
=
new
List
<
int
>();
if
(
defModel
.
Id
>
0
)
{
string
areaIds
=
(
defModel
.
Province
??
0
)
+
","
+
(
defModel
.
City
??
0
)
+
","
+
(
defModel
.
District
??
0
);
var
arealist
=
destinationRepository
.
GetDictvalueListForIds
(
areaIds
);
defModel
.
PName
=
(
arealist
.
Where
(
x
=>
x
.
ID
==
defModel
.
Province
).
FirstOrDefault
()?.
Name
??
""
);
defModel
.
CName
=
(
arealist
.
Where
(
x
=>
x
.
ID
==
defModel
.
City
).
FirstOrDefault
()?.
Name
??
""
);
defModel
.
DName
=
(
arealist
.
Where
(
x
=>
x
.
ID
==
defModel
.
District
).
FirstOrDefault
()?.
Name
??
""
);
defModel
.
DistrictAddress
=
defModel
.
PName
+
" "
+
defModel
.
CName
+
" "
+
defModel
.
DName
;
disList
.
Add
(
defModel
.
Province
??
0
);
disList
.
Add
(
defModel
.
City
??
0
);
disList
.
Add
(
defModel
.
District
??
0
);
}
List
<
object
>
DList
=
new
List
<
object
>();
decimal
TotalExpress
=
0
,
TotalGoodsMoney
=
0
;
int
DefFreightId
=
0
;
decimal
member_discount
=
0
;
List
<
object
>
goods_list
=
new
List
<
object
>();
if
(
demodel
.
DetailList
.
Any
())
{
string
GoodsIds
=
string
.
Join
(
","
,
demodel
.
DetailList
.
Select
(
x
=>
x
.
GoodsId
));
var
gList
=
goodsRepository
.
GetList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
GoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
GoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
var
speciList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_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
mpriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsIds
=
GoodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
//返佣
var
DistributionCommissionList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
if
(
demodel
.
DetailList
.
Where
(
x
=>
x
.
SeparateDistribution
==
1
).
Any
())
{
string
goodsIds
=
string
.
Join
(
","
,
demodel
.
DetailList
.
Where
(
x
=>
x
.
SeparateDistribution
==
1
).
Select
(
x
=>
x
.
GoodsId
));
DistributionCommissionList
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_Rules_Extend
>
rulesList
=
new
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_Rules_Extend
>();
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
>
priceList
=
new
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
>();
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesRegion_Extend
>
regionList
=
new
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesRegion_Extend
>();
if
(
gList
.
Any
()
&&
defModel
.
Id
>
0
)
{
List
<
int
>
FreightIdList
=
new
List
<
int
>();
if
(
gList
.
Where
(
x
=>
x
.
FreightId
>
0
).
Any
())
{
FreightIdList
.
AddRange
(
gList
.
Where
(
x
=>
x
.
FreightId
>
0
).
Select
(
x
=>
x
.
FreightId
??
0
).
ToList
());
}
if
(
gList
.
Where
(
x
=>
x
.
FreightId
==
0
).
Any
())
{
//查询默认
DefFreightId
=
logistics_RulesRepository
.
GetLogisticsRulesList
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_Rules_Extend
()
{
IsDefault
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
()?.
ID
??
0
;
FreightIdList
.
Add
(
DefFreightId
);
}
if
(
FreightIdList
.
Any
())
{
rulesList
=
logistics_RulesRepository
.
GetLogisticsRulesList
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_Rules_Extend
()
{
RulesIds
=
string
.
Join
(
","
,
FreightIdList
),
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
priceList
=
logistics_RulesPriceRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
RulesIds
=
string
.
Join
(
","
,
FreightIdList
)
});
if
(
priceList
.
Any
())
{
string
priceIds
=
string
.
Join
(
","
,
priceList
.
Select
(
x
=>
x
.
ID
));
regionList
=
logistics_RulesRegionRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesRegion_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
PriceIds
=
priceIds
});
}
}
}
#
region
优惠卷初始化
List
<
RB_Member_DiscountCoupon_Extend
>
cList
=
new
List
<
RB_Member_DiscountCoupon_Extend
>();
List
<
Model
.
Extend
.
MarketingCenter
.
RB_DiscountCoupon_Extend
>
dcList
=
new
List
<
Model
.
Extend
.
MarketingCenter
.
RB_DiscountCoupon_Extend
>();
List
<
Model
.
Extend
.
MarketingCenter
.
RB_DiscountCoupon_Product_Extend
>
dcpList
=
new
List
<
Model
.
Extend
.
MarketingCenter
.
RB_DiscountCoupon_Product_Extend
>();
if
(
demodel
.
User_Coupon_Id
>
0
)
{
demodel
.
CouponsIds
=
demodel
.
User_Coupon_Id
.
ToString
();
if
(!
string
.
IsNullOrEmpty
(
demodel
.
CouponsIds
))
{
cList
=
member_CouponRepository
.
GetList
(
new
RB_Member_DiscountCoupon_Extend
()
{
UseState
=
0
,
CouponIds
=
demodel
.
CouponsIds
,
UserId
=
umodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
string
[]
arr
=
demodel
.
CouponsIds
.
Split
(
","
);
foreach
(
var
item
in
arr
)
{
if
(!
string
.
IsNullOrEmpty
(
item
))
{
if
(!
cList
.
Where
(
x
=>
x
.
CouponId
==
Convert
.
ToInt32
(
item
)).
Any
())
{
return
ApiResult
.
Failed
(
"优惠券不存在,请核实后再试"
);
}
}
}
if
(
cList
.
Any
())
{
dcList
=
discountCouponRepository
.
GetDiscountCouponList
(
new
Model
.
Extend
.
MarketingCenter
.
RB_DiscountCoupon_Extend
()
{
CouponIds
=
demodel
.
CouponsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
dcpList
=
discountCoupon_ProductRepository
.
GetListByDiscountCouponIds
(
new
Model
.
Entity
.
MarketingCenter
.
RB_DiscountCoupon
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
},
demodel
.
CouponsIds
);
}
}
}
#
endregion
List
<
RB_Goods_CouponModel
>
GoodsCouponList
=
new
List
<
RB_Goods_CouponModel
>();
foreach
(
var
item
in
demodel
.
DetailList
)
{
var
gmodel
=
gList
.
Where
(
x
=>
x
.
Id
==
item
.
GoodsId
).
FirstOrDefault
();
if
(
gmodel
==
null
||
gmodel
.
GoodsStatus
!=
1
)
{
continue
;
}
int
GoodsWeight
=
gmodel
.
GoodsWeight
??
0
;
//商品重量
var
categoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
();
#
region
图片
gmodel
.
CoverImage
=
""
;
//轮播
gmodel
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrEmpty
(
gmodel
.
CarouselImage
)
&&
gmodel
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
gmodel
.
CarouselImage
);
//封面图
//gmodel.CoverImage = material_InfoRepository.GetEntity(CarouselIdList[0])?.Path ?? "";
//轮播图
var
mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
MaterialIds
=
string
.
Join
(
","
,
CarouselIdList
),
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
qitem
in
CarouselIdList
)
{
var
cmodel
=
mlist
.
Where
(
x
=>
x
.
Id
==
qitem
).
FirstOrDefault
();
gmodel
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
qitem
,
Name
=
cmodel
?.
Name
??
""
,
Path
=
cmodel
?.
Path
??
""
});
}
//封面图
gmodel
.
CoverImage
=
mlist
.
Where
(
x
=>
x
.
Id
==
CarouselIdList
[
0
]).
FirstOrDefault
()?.
Path
??
""
;
}
#
endregion
#
region
规格
//验证规格是否已失效
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
;
}
}
//规格赋值
gmodel
.
SpecificationNameList
=
new
List
<
string
>();
List
<
object
>
attr_list
=
new
List
<
object
>();
if
(
string
.
IsNullOrEmpty
(
item
.
SpecificationSort
))
{
gmodel
.
SpecificationNameList
.
Add
(
"规格:"
+
gmodel
.
DefaultSpecificationName
);
if
(
item
.
Number
>
gmodel
.
InventoryNum
)
{
return
ApiResult
.
Failed
(
"商品库存不足:"
+
gmodel
.
Name
);
}
attr_list
=
new
List
<
object
>(){
new
{
attr_group_name
=
"规格"
,
attr_group_id
=
0
,
attr_id
=
0
,
attr_name
=
gmodel
.
DefaultSpecificationName
}
};
}
else
{
var
KeyArr
=
item
.
SpecificationSort
.
Split
(
':'
);
for
(
var
i
=
0
;
i
<
KeyArr
.
Length
;
i
++)
{
if
(!
string
.
IsNullOrEmpty
(
KeyArr
[
i
]))
{
var
sModel
=
speciList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
()[
i
];
var
svModel
=
speciVList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
&&
x
.
SpecificationId
==
sModel
.
Id
&&
x
.
Sort
==
Convert
.
ToInt32
(
KeyArr
[
i
])).
FirstOrDefault
();
gmodel
.
SpecificationNameList
.
Add
(
sModel
.
Name
+
":"
+
svModel
.
Name
);
attr_list
.
Add
(
new
{
attr_group_name
=
sModel
.
Name
,
attr_group_id
=
sModel
.
Sort
,
attr_id
=
svModel
.
Id
,
attr_name
=
svModel
.
Name
});
}
}
var
speciPModel
=
speciPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
&&
x
.
SpecificationSort
==
item
.
SpecificationSort
).
FirstOrDefault
();
gmodel
.
SellingPrice
=
speciPModel
?.
SellingPrice
??
0
;
gmodel
.
InventoryNum
=
speciPModel
?.
InventoryNum
??
0
;
gmodel
.
GoodsNumbers
=
speciPModel
?.
GoodsNumbers
??
""
;
GoodsWeight
=
speciPModel
?.
GoodsWeight
??
0
;
if
(
item
.
Number
>
speciPModel
.
InventoryNum
)
{
return
ApiResult
.
Failed
(
"商品库存不足:"
+
gmodel
.
Name
);
}
}
#
endregion
#
region
会员价格
gmodel
.
MemberPrice
=
gmodel
.
SellingPrice
??
0
;
List
<
object
>
discounts
=
new
List
<
object
>();
if
(
umodel
.
MemberGrade
>
0
)
{
if
(
gmodel
.
EnjoyMember
==
1
&&
gmodel
.
SeparateSetMember
==
1
)
{
gmodel
.
MemberPrice
=
mpriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
&&
x
.
MemberGrade
==
umodel
.
MemberGrade
&&
x
.
SpecificationSort
==
item
.
SpecificationSort
).
FirstOrDefault
()?.
MemberPrice
??
0
;
}
else
{
//求会员等级折扣
var
gradeModel
=
member_GradeRepository
.
GetList
(
new
RB_Member_Grade_Extend
()
{
Grade
=
umodel
.
MemberGrade
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
gmodel
.
MemberPrice
=
Math
.
Round
((
gmodel
.
SellingPrice
??
0
)
*
(
gradeModel
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
discounts
.
Add
(
new
{
name
=
"会员优惠价格"
,
value
=
(
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
))
-
((
gmodel
.
SellingPrice
??
0
)
*
(
item
.
Number
??
0
))
});
member_discount
+=
(
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
))
-
((
gmodel
.
SellingPrice
??
0
)
*
(
item
.
Number
??
0
));
}
#
endregion
item
.
Final_Price
=
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
);
#
region
运费
decimal
Express
=
0
;
if
(
defModel
.
Id
>
0
&&
demodel
.
DeliveryMethod
!=
OrderDeliveryMethodEnum
.
VerificationShop
)
{
int
FreightId2
=
gmodel
.
FreightId
??
0
;
if
(
gmodel
.
FreightId
==
0
)
{
FreightId2
=
DefFreightId
;
}
if
(
FreightId2
>
0
)
{
var
rulesModel
=
rulesList
.
Where
(
x
=>
x
.
ID
==
FreightId2
).
FirstOrDefault
();
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
>
priceList2
=
priceList
.
Where
(
x
=>
x
.
RulesId
==
FreightId2
).
ToList
();
if
(
priceList2
.
Any
())
{
var
priceIds
=
priceList2
.
Select
(
x
=>
x
.
ID
).
ToList
();
var
regionList2
=
regionList
.
Where
(
x
=>
priceIds
.
Contains
(
x
.
RulesPriceId
)).
ToList
();
var
regionModel
=
regionList2
.
Where
(
x
=>
disList
.
Contains
(
x
.
RegionId
)).
FirstOrDefault
();
if
(
regionModel
!=
null
)
{
var
pmodel
=
priceList2
.
Where
(
x
=>
x
.
ID
==
regionModel
.
RulesPriceId
).
FirstOrDefault
();
if
(
pmodel
!=
null
&&
rulesModel
!=
null
)
{
if
(
rulesModel
.
ChargeMode
==
Common
.
Enum
.
MallBase
.
ChargeModeEnum
.
Num
)
{
//按件计费
if
(
item
.
Number
<=
pmodel
.
First
)
{
Express
=
pmodel
.
FirstPrice
;
}
else
{
if
(
pmodel
.
Second
>
0
)
{
if
(((
item
.
Number
??
0
)
-
pmodel
.
First
)
%
pmodel
.
Second
==
0
)
{
Express
=
pmodel
.
FirstPrice
+
(((
item
.
Number
??
0
)
-
pmodel
.
First
)
/
pmodel
.
Second
)
*
pmodel
.
SecondPrice
;
}
else
{
Express
=
pmodel
.
FirstPrice
+
(((
item
.
Number
??
0
)
-
pmodel
.
First
)
/
pmodel
.
Second
+
1
)
*
pmodel
.
SecondPrice
;
}
}
else
{
Express
=
pmodel
.
FirstPrice
;
}
}
}
else
{
//重量计费
int
TotalW
=
(
item
.
Number
??
0
)
*
GoodsWeight
;
if
(
TotalW
<=
pmodel
.
First
)
{
Express
=
pmodel
.
FirstPrice
;
}
else
{
if
(
pmodel
.
Second
>
0
)
{
if
((
TotalW
-
pmodel
.
First
)
%
pmodel
.
Second
==
0
)
{
Express
=
pmodel
.
FirstPrice
+
((
TotalW
-
pmodel
.
First
)
/
pmodel
.
Second
)
*
pmodel
.
SecondPrice
;
}
else
{
Express
=
pmodel
.
FirstPrice
+
((
TotalW
-
pmodel
.
First
)
/
pmodel
.
Second
+
1
)
*
pmodel
.
SecondPrice
;
}
}
else
{
Express
=
pmodel
.
FirstPrice
;
}
}
}
}
}
}
}
}
TotalExpress
+=
Express
;
item
.
Final_Price
+=
Express
;
#
endregion
#
region
积分
if
(
umodel
.
Integral
>
0
&&
gmodel
.
PointsDeduction
>
0
&&
integralModel
.
IntegralNum
>
0
)
{
decimal
SingleMaxMoney
=
0
,
MultMaxMoney
=
0
;
if
(
gmodel
.
PointsDeductionType
==
1
)
{
SingleMaxMoney
=
Math
.
Round
(
gmodel
.
MemberPrice
*
(
gmodel
.
PointsDeduction
??
0
)
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
MultMaxMoney
=
Math
.
Round
(
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
)
*
(
gmodel
.
PointsDeduction
??
0
)
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
if
(
gmodel
.
IsMultipleDeduction
==
1
)
{
//可以多件商品可累计抵扣
if
(
gmodel
.
PointsDeductionType
==
1
)
{
int
MaxInterral
=
Convert
.
ToInt32
(
MultMaxMoney
*
integralModel
.
IntegralNum
);
//最多可抵扣积分
if
(
umodel
.
Integral
>
MaxInterral
)
{
item
.
IntegralNumber
=
MaxInterral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
MaxInterral
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
-=
MaxInterral
;
}
else
{
item
.
IntegralNumber
=
umodel
.
Integral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
umodel
.
Integral
??
0
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
=
0
;
}
}
else
{
int
MaxInterral
=
Convert
.
ToInt32
((
gmodel
.
PointsDeduction
??
0
)
*
integralModel
.
IntegralNum
*
(
item
.
Number
??
0
));
//最多可抵扣积分
if
(
umodel
.
Integral
>
MaxInterral
)
{
item
.
IntegralNumber
=
MaxInterral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
MaxInterral
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
-=
MaxInterral
;
}
else
{
item
.
IntegralNumber
=
umodel
.
Integral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
umodel
.
Integral
??
0
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
=
0
;
}
}
}
else
{
//单件商品
if
(
gmodel
.
PointsDeductionType
==
1
)
{
int
MaxInterral
=
Convert
.
ToInt32
(
SingleMaxMoney
*
integralModel
.
IntegralNum
);
//最多可抵扣积分
if
(
umodel
.
Integral
>
MaxInterral
)
{
item
.
IntegralNumber
=
MaxInterral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
MaxInterral
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
-=
MaxInterral
;
}
else
{
item
.
IntegralNumber
=
umodel
.
Integral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
umodel
.
Integral
??
0
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
=
0
;
}
}
else
{
int
MaxInterral
=
Convert
.
ToInt32
((
gmodel
.
PointsDeduction
??
0
)
*
integralModel
.
IntegralNum
);
//最多可抵扣积分
if
(
umodel
.
Integral
>
MaxInterral
)
{
item
.
IntegralNumber
=
MaxInterral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
MaxInterral
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
-=
MaxInterral
;
}
else
{
item
.
IntegralNumber
=
umodel
.
Integral
;
item
.
IntegralMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
umodel
.
Integral
??
0
)
/
integralModel
.
IntegralNum
,
2
,
MidpointRounding
.
AwayFromZero
);
umodel
.
Integral
=
0
;
}
}
}
}
decimal
integral_price
=
0
;
int
use_integral
=
0
;
if
(
demodel
.
Use_Integral
==
1
)
{
integral_price
=
item
.
IntegralMoney
??
0
;
use_integral
=
item
.
IntegralNumber
??
0
;
item
.
Final_Price
-=
integral_price
;
}
#
endregion
#
region
优惠券
//decimal CouponsMoney = 0;
if
(
demodel
.
User_Coupon_Id
>
0
)
{
string
couponItem
=
demodel
.
User_Coupon_Id
.
ToString
();
if
(!
string
.
IsNullOrEmpty
(
couponItem
))
{
var
dcModel
=
dcList
.
Where
(
x
=>
x
.
ID
==
Convert
.
ToInt32
(
couponItem
)).
FirstOrDefault
();
if
(
dcModel
==
null
)
{
return
ApiResult
.
Failed
(
"优惠卷不存在,亲核实后再试"
);
}
dcModel
.
DiscountsPrice
=
dcModel
.
DiscountsPrice
==
0
?
10
:
dcModel
.
DiscountsPrice
;
if
(
dcModel
.
UseType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Category
)
//指定分类
{
var
categoryList1
=
dcpList
.
Where
(
x
=>
x
.
DiscountCouponId
==
Convert
.
ToInt32
(
couponItem
)
&&
x
.
DiscountCouponType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Category
).
Select
(
x
=>
x
.
ProductId
).
ToList
();
//获取特殊优惠卷
if
(
categoryList
.
Select
(
x
=>
x
.
Id
).
Where
(
x
=>
categoryList1
.
Contains
(
x
)).
Any
())
{
GoodsCouponList
.
Add
(
new
RB_Goods_CouponModel
()
{
GoodsId
=
item
.
GoodsId
??
0
,
Key
=
item
.
SpecificationSort
,
TotalMoney
=
item
.
Final_Price
??
0
,
CouponMoney
=
0
});
}
}
else
if
(
dcModel
.
UseType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Product
)
//指定商品
{
var
goodsList
=
dcpList
.
Where
(
x
=>
x
.
DiscountCouponId
==
Convert
.
ToInt32
(
couponItem
)
&&
x
.
DiscountCouponType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Product
).
Select
(
x
=>
x
.
ProductId
).
ToList
();
//获取特殊优惠卷
if
(
goodsList
.
Contains
(
item
.
GoodsId
??
0
))
{
GoodsCouponList
.
Add
(
new
RB_Goods_CouponModel
()
{
GoodsId
=
item
.
GoodsId
??
0
,
Key
=
item
.
SpecificationSort
,
TotalMoney
=
item
.
Final_Price
??
0
,
CouponMoney
=
0
});
}
}
else
{
GoodsCouponList
.
Add
(
new
RB_Goods_CouponModel
()
{
GoodsId
=
item
.
GoodsId
??
0
,
Key
=
item
.
SpecificationSort
,
TotalMoney
=
item
.
Final_Price
??
0
,
CouponMoney
=
0
});
}
}
}
#
endregion
TotalGoodsMoney
+=
item
.
Final_Price
??
0
;
goods_list
.
Add
(
new
{
id
=
gmodel
.
Id
,
name
=
gmodel
.
Name
,
num
=
item
.
Number
,
forehead_integral
=
gmodel
.
PointsDeduction
,
forehead_integral_type
=
gmodel
.
PointsDeductionType
,
accumulative
=
gmodel
.
IsMultipleDeduction
,
//累计多件抵扣
pieces
=
gmodel
.
FullNumPinkage
,
//满件包邮
forehead
=
gmodel
.
FullMoneyPinkage
,
//满额包邮
freight_id
=
gmodel
.
FreightId
,
express_price
=
Express
,
unit_price
=
gmodel
.
SellingPrice
,
total_original_price
=
(
gmodel
.
SellingPrice
??
0
)*(
item
.
Number
??
0
),
total_price
=
"7995.10"
,
//优惠券(有平摊情况) 积分抵扣 (默认从第一个商品抵扣)
goods_attr
=
new
{
id
=
0
,
goods_id
=
gmodel
.
Id
,
sign_id
=
item
.
SpecificationSort
,
stock
=
gmodel
.
InventoryNum
,
price
=
gmodel
.
MemberPrice
,
original_price
=
gmodel
.
SellingPrice
??
0
,
no
=
gmodel
.
GoodsNumbers
,
weight
=
GoodsWeight
,
pic_url
=
gmodel
.
CoverImage
,
individual_share
=
umodel
?.
IsDistributor
??
2
,
// 是否分销商
share_type
=
gmodel
.
SeparateDistributionMoneyType
,
//分销佣金类型,
member_price
=
gmodel
.
MemberPrice
,
integral_price
,
//积分抵扣金额
use_integral
,
//discount= [],
//extra= [],
//goods_warehouse_id = 19813,
name
=
gmodel
.
Name
,
cover_pic
=
gmodel
.
CoverImage
,
detail
=
gmodel
.
GoodsDetails
,
pic_list
=
gmodel
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
pic_url
=
x
.
Path
}),
number
=
item
.
Number
,
goods_share_level
=
DistributionCommissionList
.
Where
(
x
=>
x
.
GoodsId
==
gmodel
.
Id
).
Select
(
x
=>
new
{
share_commission_first
=
x
.
OneCommission
,
share_commission_second
=
x
.
TwoCommission
,
share_commission_third
=
x
.
ThreeCommission
,
level
=
x
.
DistributorGrade
}),
attr_setting_type
=
gmodel
.
SeparateDistributionType
},
attr_list
,
discounts
,
member_discount
=
((
gmodel
.
SellingPrice
??
0
)
*
(
item
.
Number
??
0
))
-
(
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
)),
cover_pic
=
gmodel
.
CoverImage
,
is_level_alone
=
gmodel
.
SeparateSetMember
,
//是否单独设置会员价
//custom_currency= [],
is_level
=
gmodel
.
EnjoyMember
,
//是否销售会员价格
//goods_warehouse_id = 19813,
sign
=
""
,
confine_order_count
=
gmodel
.
LimitBuyOrderNum
,
//限制订单数量
form_id
=
gmodel
.
FormsId
,
//表单id
//goodsWarehouse = new
//{
// id = 19813,
// mall_id = 1285,
// name = "测试商品【勿拍】",
// original_price = "100000.00",
// cost_price = "0.00",
// detail = "<p>测试</p>",
// cover_pic = "https://cdnimg.iotweixin.com/uploads/mall1285/20200303/0729b37fd19a002733018a1ece30ca55.jpg",
// pic_url = "[{\"id=\"77531\",\"pic_url=\"https:\\/\\/cdnimg.iotweixin.com\\/uploads\\/mall1285\\/20200303\\/0729b37fd19a002733018a1ece30ca55.jpg\"},{\"id=\"77530\",\"pic_url=\"https:\\/\\/cdnimg.iotweixin.com\\/uploads\\/mall1285\\/20200303\\/8eebc4fc427d7d2bbd2625f5f3448c5b.jpg\"}]",
// video_url = "https://cdnimg.iotweixin.com/uploads/mall1285/20200303/5f26c823c9118e7646681152ef441fd7.mp4",
// unit = "件",
// created_at = "2020-05-25 16:05:02",
// updated_at = "2020-05-25 16:05:02",
// deleted_at = "0000-00-00 00:00:00",
// is_delete = 0
//},
//form_data= null,
//form= null
});
}
decimal
CouponsMoney
=
0
;
//优惠总金额
if
(
demodel
.
User_Coupon_Id
>
0
&&
GoodsCouponList
.
Any
())
{
decimal
FinalMoney
=
GoodsCouponList
.
Sum
(
x
=>
x
.
TotalMoney
);
var
dcModel
=
dcList
.
Where
(
x
=>
x
.
ID
==
demodel
.
User_Coupon_Id
).
FirstOrDefault
();
if
(
dcModel
==
null
)
{
return
ApiResult
.
Failed
(
"优惠卷不存在,亲核实后再试"
);
}
if
(
dcModel
.
MinConsumePrice
>
0
)
{
if
(
FinalMoney
<
dcModel
.
MinConsumePrice
)
{
FinalMoney
=
0
;
}
}
if
(
dcModel
.
CouponType
==
Common
.
Enum
.
MarketingCenter
.
CouponTypeEnum
.
FullReduction
&&
FinalMoney
>
0
)
{
CouponsMoney
=
dcModel
.
DiscountsPrice
;
}
else
if
(
dcModel
.
CouponType
==
Common
.
Enum
.
MarketingCenter
.
CouponTypeEnum
.
Discount
&&
FinalMoney
>
0
)
{
decimal
disMoney
=
Math
.
Round
(
FinalMoney
*
(
10
-
dcModel
.
DiscountsPrice
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
if
(
dcModel
.
MaxDiscountsPrice
>
0
&&
dcModel
.
MaxDiscountsPrice
<
disMoney
)
{
disMoney
=
dcModel
.
MaxDiscountsPrice
;
}
CouponsMoney
=
disMoney
;
}
//每个商品优惠券分摊金额
if
(
CouponsMoney
>
0
)
{
foreach
(
var
item
in
GoodsCouponList
)
{
item
.
CouponMoney
=
Math
.
Round
((
item
.
TotalMoney
/
FinalMoney
)
*
CouponsMoney
,
2
,
MidpointRounding
.
AwayFromZero
);
}
if
(
CouponsMoney
!=
GoodsCouponList
.
Sum
(
x
=>
x
.
CouponMoney
))
{
//四舍五入存在差值
}
}
}
}
List
<
object
>
mch_list
=
new
List
<
object
>();
var
minModel
=
miniProgramRepository
.
GetEntity
(
demodel
.
MallBaseId
);
mch_list
.
Add
(
new
{
mch
=
new
{
id
=
minModel
?.
MallBaseId
??
0
,
name
=
minModel
?.
MallName
??
""
},
goods_list
,
express_price
=
TotalExpress
,
remark
=
""
,
//order_form_data= [],
total_goods_price
=
"15999.10"
,
total_goods_original_price
=
"16004.00"
,
member_discount
,
coupon
=
new
{
enabled
=
true
,
use
=
true
,
coupon_discount
=
"20.00"
,
user_coupon_id
=
70285
},
integral
=
new
{
can_use
=
true
,
use
=
true
,
use_num
=
49
,
deduction_price
=
"4.90"
},
delivery
=
new
{
send_type
=
"express"
,
disabled
=
false
,
send_type_list
=
new
List
<
object
>()
{
new
{
name
=
"快递配送"
,
value
=
"express"
}
}
},
//store= null,
store_select_enable
=
true
,
total_price
=
"16049.10"
,
//pick_up_enable= true,
//pick_up_price= null,
//diff_goods_form_count= 0,
//has_goods_form= false
});
var
Robj
=
new
{
mch_list
,
total_price
=
"16049.10"
,
price_enable
=
true
,
address
=
new
{
id
=
defModel
?.
Id
??
0
,
user_id
=
demodel
.
UserId
,
name
=
defModel
?.
Name
??
""
,
province_id
=
defModel
?.
Province
??
0
,
province
=
defModel
?.
PName
??
""
,
city_id
=
defModel
?.
City
??
0
,
city
=
defModel
?.
CName
??
""
,
district_id
=
defModel
?.
District
??
0
,
district
=
defModel
?.
DName
??
""
,
mobile
=
defModel
?.
Mobile
??
""
,
detail
=
defModel
?.
Address
??
""
,
is_default
=
defModel
?.
IsDefault
??
2
,
lonlat
=
defModel
?.
Lonlat
},
address_enable
=
true
,
//has_ziti= false,
//custom_currency_all= [],
//allZiti= false,
//hasCity= false,
template_message_list
=
new
List
<
string
>()
{
"WPELErDfYO3JnizA5Zikta6Y8qrBBAgecuj2aLoucuY"
,
"pCmTJwvTqNpyRREo7vvqIYBcrATNWoitfbLS61fLhzU"
,
"i6QPsaOHgfNwlIRMwmvFGSCqX28g0cRa8XaLZ5_gpgc"
}
};
return
ApiResult
.
Success
(
""
,
new
{
ShippingAddressModel
=
new
{
defModel
.
Id
,
defModel
.
Name
,
defModel
.
Mobile
,
defModel
.
DistrictAddress
,
defModel
.
Address
,
defModel
.
Province
,
defModel
.
City
,
defModel
.
District
},
DetailList
=
DList
,
TotalExpress
,
umodel
.
MemberGrade
,
DeliveryMethod
=
(
int
)
OrderDeliveryMethodEnum
.
ExpressDistribution
,
Level_Show
=
umodel
.
MemberGrade
>
0
?
1
:
2
});
}
/// <summary>
/// <summary>
/// 获取结算页面 快递修改后 快递费用
/// 获取结算页面 快递修改后 快递费用
/// </summary>
/// </summary>
...
@@ -1575,12 +2294,20 @@ namespace Mall.Module.Product
...
@@ -1575,12 +2294,20 @@ namespace Mall.Module.Product
switch
(
i
)
switch
(
i
)
{
{
case
1
:
case
1
:
if
(
umodel
.
IsDistributor
!=
1
)
{
OneUserId
=
umodel
.
SuperiorId
??
0
;
}
else
{
OneUserId
=
umodel
.
Id
;
}
if
(
umodel
.
IsDistributor
!=
1
||
basicModel
.
InPurchasing
!=
1
)
{
OneUserId
=
umodel
.
SuperiorId
??
0
;
}
else
{
OneUserId
=
umodel
.
Id
;
}
break
;
break
;
case
2
:
case
2
:
if
(
OneUserId
>
0
)
if
(
OneUserId
>
0
)
{
{
if
(
umodel
.
IsDistributor
!=
1
)
{
TwoUserId
=
member_UserRepository
.
GetEntity
(
OneUserId
).
SuperiorId
??
0
;
}
else
{
TwoUserId
=
umodel
.
SuperiorId
??
0
;
}
if
(
umodel
.
IsDistributor
!=
1
||
basicModel
.
InPurchasing
!=
1
)
{
TwoUserId
=
member_UserRepository
.
GetEntity
(
OneUserId
).
SuperiorId
??
0
;
}
else
{
TwoUserId
=
umodel
.
SuperiorId
??
0
;
}
}
}
break
;
break
;
case
3
:
case
3
:
...
@@ -2733,7 +3460,7 @@ namespace Mall.Module.Product
...
@@ -2733,7 +3460,7 @@ namespace Mall.Module.Product
item
.
ShoppingAddress
=
areaName
+
" "
+
item
.
ShoppingAddress
;
item
.
ShoppingAddress
=
areaName
+
" "
+
item
.
ShoppingAddress
;
item
.
OrderCommissionList
=
oclist
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
ToList
();
item
.
OrderCommissionList
=
oclist
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
ToList
();
item
.
IsOrderCommission
=
item
.
OrderCommissionList
.
FirstOrDefault
().
IsGoodsDistribution
??
2
;
item
.
IsOrderCommission
=
item
.
OrderCommissionList
.
FirstOrDefault
()
?
.
IsGoodsDistribution
??
2
;
}
}
}
}
return
list
;
return
list
;
...
...
Mall.Module.Product/ProductModule.cs
View file @
b26e595d
...
@@ -169,6 +169,79 @@ namespace Mall.Module.Product
...
@@ -169,6 +169,79 @@ namespace Mall.Module.Product
return
list
;
return
list
;
}
}
/// <summary>
/// 获取小程序商品列表(赞羊)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetAppletGoodsPageListForZY
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
var
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
var
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
list
.
Where
(
x
=>
x
.
IsCustomSpecification
==
1
).
Any
())
{
string
goodsIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
IsCustomSpecification
==
1
).
Select
(
x
=>
x
.
Id
));
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
SpecificationList
.
Any
())
{
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Any
())
{
string
imgIds
=
string
.
Join
(
","
,
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Select
(
x
=>
x
.
Image
).
Distinct
());
var
mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
MaterialIds
=
imgIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
svlist
.
Where
(
x
=>
x
.
Image
>
0
))
{
item
.
ImagePath
=
mlist
.
Where
(
x
=>
x
.
Id
==
item
.
Image
).
FirstOrDefault
()?.
Path
??
""
;
}
}
foreach
(
var
item
in
SpecificationList
)
{
item
.
SpecificationValueList
=
svlist
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
ToList
();
}
}
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
//会员价格
var
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
if
(
list
.
Where
(
x
=>
x
.
EnjoyMember
==
1
&&
x
.
SeparateSetMember
==
1
).
Any
())
{
string
goodsIds
=
string
.
Join
(
","
,
list
.
Where
(
x
=>
x
.
EnjoyMember
==
1
&&
x
.
SeparateSetMember
==
1
).
Select
(
x
=>
x
.
Id
));
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
string
goodsIds2
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
List
<
RB_Goods_Order_Extend
>
orderlist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
goodsIds
:
goodsIds2
);
foreach
(
var
item
in
list
)
{
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
material_InfoRepository
.
GetEntity
(
CarouselIdList
[
0
])?.
Path
??
""
;
}
item
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
item
.
IsCustomSpecification
==
1
)
{
item
.
SpecificationList
=
SpecificationList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
item
.
SpecificationPriceList
=
SpecificationPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
}
if
(
item
.
EnjoyMember
==
1
&&
item
.
SeparateSetMember
==
1
)
{
item
.
MemberPriceList
=
MemberPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
}
item
.
SalesNum
+=
(
orderlist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
);
}
}
return
list
;
}
/// <summary>
/// <summary>
/// 获取商品推荐列表
/// 获取商品推荐列表
/// </summary>
/// </summary>
...
@@ -272,6 +345,161 @@ namespace Mall.Module.Product
...
@@ -272,6 +345,161 @@ namespace Mall.Module.Product
return
RList
;
return
RList
;
}
}
/// <summary>
/// 获取商品推荐列表(赞羊字段)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="RecommendStatus"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetAppletGoodsRecommendListForZY
(
int
pageIndex
,
int
pageSize
,
out
int
RecommendStatus
,
RB_Goods_Extend
demodel
)
{
var
rmodel
=
product_RecommendRepository
.
GetList
(
new
RB_Product_Recommend_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
RecommendStatus
=
2
;
if
(
rmodel
==
null
)
{
return
new
List
<
RB_Goods_Extend
>();
}
pageSize
=
rmodel
.
DetailRecommendNum
??
0
;
if
(
demodel
.
RecommendType
==
1
)
{
RecommendStatus
=
rmodel
.
DetailRecommendStatus
??
2
;
if
(
rmodel
.
DetailRecommendStatus
!=
1
)
{
return
new
List
<
RB_Goods_Extend
>();
}
}
else
if
(
demodel
.
RecommendType
==
2
)
{
RecommendStatus
=
rmodel
.
OrderCompleteStatus
??
2
;
if
(
rmodel
.
OrderCompleteStatus
!=
1
)
{
return
new
List
<
RB_Goods_Extend
>();
}
if
(
rmodel
.
IsOrderRecommend
==
1
)
{
pageSize
=
20
;
if
(!
string
.
IsNullOrEmpty
(
rmodel
.
OrderProductIds
))
{
demodel
.
GoodsIds
=
rmodel
.
OrderProductIds
;
}
}
}
else
if
(
demodel
.
RecommendType
==
3
)
{
RecommendStatus
=
rmodel
.
CommentRecommentStatus
??
2
;
if
(
rmodel
.
CommentRecommentStatus
!=
1
)
{
return
new
List
<
RB_Goods_Extend
>();
}
if
(
rmodel
.
IsCommentRecommend
==
1
)
{
pageSize
=
20
;
if
(!
string
.
IsNullOrEmpty
(
rmodel
.
CommentProductIds
))
{
demodel
.
GoodsIds
=
rmodel
.
CommentProductIds
;
}
}
}
var
list
=
goodsRepository
.
GetAppletGoodsPageList
(
pageIndex
,
pageSize
,
out
long
count
,
demodel
);
List
<
RB_Goods_Extend
>
RList
=
list
;
if
(
list
.
Any
())
{
if
(
demodel
.
RecommendType
==
2
&&
rmodel
.
IsOrderRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
rmodel
.
OrderProductIds
))
{
List
<
int
>
gidList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
rmodel
.
OrderProductIds
);
var
gList
=
gidList
.
Where
(
x
=>
list
.
Select
(
y
=>
y
.
Id
).
Contains
(
x
)).
Take
(
10
).
ToList
();
if
(
gList
.
Any
())
{
RList
=
new
List
<
RB_Goods_Extend
>();
foreach
(
var
item
in
gList
)
{
RList
.
Add
(
list
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
());
}
}
}
else
if
(
demodel
.
RecommendType
==
3
&&
rmodel
.
IsCommentRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
rmodel
.
CommentProductIds
))
{
List
<
int
>
gidList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
rmodel
.
CommentProductIds
);
var
gList
=
gidList
.
Where
(
x
=>
list
.
Select
(
y
=>
y
.
Id
).
Contains
(
x
)).
Take
(
10
).
ToList
();
if
(
gList
.
Any
())
{
RList
=
new
List
<
RB_Goods_Extend
>();
foreach
(
var
item
in
gList
)
{
RList
.
Add
(
list
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
());
}
}
}
var
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
var
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
RList
.
Where
(
x
=>
x
.
IsCustomSpecification
==
1
).
Any
())
{
string
goodsIds
=
string
.
Join
(
","
,
RList
.
Where
(
x
=>
x
.
IsCustomSpecification
==
1
).
Select
(
x
=>
x
.
Id
));
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
SpecificationList
.
Any
())
{
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Any
())
{
string
imgIds
=
string
.
Join
(
","
,
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Select
(
x
=>
x
.
Image
).
Distinct
());
var
mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
MaterialIds
=
imgIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
svlist
.
Where
(
x
=>
x
.
Image
>
0
))
{
item
.
ImagePath
=
mlist
.
Where
(
x
=>
x
.
Id
==
item
.
Image
).
FirstOrDefault
()?.
Path
??
""
;
}
}
foreach
(
var
item
in
SpecificationList
)
{
item
.
SpecificationValueList
=
svlist
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
ToList
();
}
}
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
//会员价格
var
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
if
(
RList
.
Where
(
x
=>
x
.
EnjoyMember
==
1
&&
x
.
SeparateSetMember
==
1
).
Any
())
{
string
goodsIds
=
string
.
Join
(
","
,
RList
.
Where
(
x
=>
x
.
EnjoyMember
==
1
&&
x
.
SeparateSetMember
==
1
).
Select
(
x
=>
x
.
Id
));
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
string
goodsIds2
=
string
.
Join
(
","
,
RList
.
Select
(
x
=>
x
.
Id
));
List
<
RB_Goods_Order_Extend
>
orderlist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
goodsIds
:
goodsIds2
);
foreach
(
var
item
in
RList
)
{
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
material_InfoRepository
.
GetEntity
(
CarouselIdList
[
0
])?.
Path
??
""
;
}
item
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
item
.
IsCustomSpecification
==
1
)
{
item
.
SpecificationList
=
SpecificationList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
item
.
SpecificationPriceList
=
SpecificationPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
}
if
(
item
.
EnjoyMember
==
1
&&
item
.
SeparateSetMember
==
1
)
{
item
.
MemberPriceList
=
MemberPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
}
item
.
SalesNum
+=
(
orderlist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
);
}
}
return
RList
;
}
/// <summary>
/// <summary>
/// 获取小程序商品详情
/// 获取小程序商品详情
/// </summary>
/// </summary>
...
@@ -641,8 +869,7 @@ namespace Mall.Module.Product
...
@@ -641,8 +869,7 @@ namespace Mall.Module.Product
#
region
基本信息
#
region
基本信息
//查询分类
//查询分类
item
.
CategoryList
=
categoryList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
item
.
CategoryList
=
categoryList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
//最大售价
decimal
MaxSellMoney
=
item
.
SellingPrice
??
0
;
item
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
item
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
item
.
IsCustomSpecification
==
1
)
if
(
item
.
IsCustomSpecification
==
1
)
...
@@ -666,7 +893,6 @@ namespace Mall.Module.Product
...
@@ -666,7 +893,6 @@ namespace Mall.Module.Product
}
}
}
}
item
.
SpecificationPriceList
=
speciPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
item
.
SpecificationPriceList
=
speciPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
MaxSellMoney
=
item
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
}
}
if
(
item
.
CustomShareImage
>
0
)
if
(
item
.
CustomShareImage
>
0
)
...
...
Mall.Module.User/UserModule.cs
View file @
b26e595d
...
@@ -348,6 +348,17 @@ namespace Mall.Module.User
...
@@ -348,6 +348,17 @@ namespace Mall.Module.User
return
list
;
return
list
;
}
}
/// <summary>
/// 获取会员等级列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Member_Grade_Extend
>
GetMemberGrade
(
RB_Member_Grade_Extend
dmodel
)
{
var
list
=
member_GradeRepository
.
GetGrade
(
dmodel
);
return
list
;
}
/// <summary>
/// <summary>
/// 新增会员等级
/// 新增会员等级
/// </summary>
/// </summary>
...
@@ -485,6 +496,41 @@ namespace Mall.Module.User
...
@@ -485,6 +496,41 @@ namespace Mall.Module.User
}
}
}
}
/// <summary>
/// 验证会员等级是否存在
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
ValidateMemberGrade
(
RB_Member_Grade_Extend
demodel
)
{
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Grade
.
Grade
),
FiledValue
=
demodel
.
Grade
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Grade
.
TenantId
),
FiledValue
=
demodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Grade
.
MallBaseId
),
FiledValue
=
demodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
if
(
demodel
.
Id
>
0
)
{
whereHelpers
.
Add
(
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Member_Grade
.
Id
),
FiledValue
=
demodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
NotEqual
});
}
return
member_GradeRepository
.
Exists
(
whereHelpers
);
}
/// <summary>
/// <summary>
/// 获取会员等级
/// 获取会员等级
/// </summary>
/// </summary>
...
@@ -1953,13 +1999,67 @@ namespace Mall.Module.User
...
@@ -1953,13 +1999,67 @@ namespace Mall.Module.User
{
{
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
var
model
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
model
==
null
)
if
(
model
==
null
)
{
var
basicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
bool
flag
=
true
;
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
GMSP
)
{
//验证购买商品
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
UserId
),
FiledValue
=
userId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
TenantId
),
FiledValue
=
tenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
MallBaseId
),
FiledValue
=
mallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
Recycled
),
FiledValue
=
2
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
Status
),
FiledValue
=
0
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order_Extend
.
OrderStatus
),
FiledValue
=
"2,3,4,5,6"
,
OperatorEnum
=
OperatorEnum
.
IN
},
};
flag
=
goods_OrderRepository
.
Exists
(
whereHelpers
);
}
else
if
(
basicsModel
.
DistributorCondition
==
DistributorConditionEnum
.
DCXF
){
//单次消费 充值也算 (货到付款这种怎么处理)
}
if
(
flag
)
{
{
return
new
return
new
{
{
Status
=
1
,
Status
=
1
,
Msg
=
"未申请成为分销商"
Msg
=
"未申请成为分销商"
,
basicsModel
.
ApplyFor
,
ApplyForName
=
basicsModel
.
ApplyFor
.
GetEnumName
()
};
}
else
{
return
new
{
Status
=
0
,
Msg
=
"未满足申请成为分销商条件:"
+
basicsModel
.
DistributorCondition
.
GetEnumName
()
};
};
}
}
}
if
(
model
.
AuditStatus
==
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Reject
)
if
(
model
.
AuditStatus
==
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Reject
)
{
{
return
new
return
new
...
...
Mall.Repository/Product/RB_Material_InfoRepository.cs
View file @
b26e595d
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
{
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
string
where
=
$" 1=1 and
Id>100 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
if
(
dmodel
.
Id
>=
100
)
if
(
dmodel
.
Id
>=
100
)
{
{
if
(
dmodel
.
TenantId
>
0
)
if
(
dmodel
.
TenantId
>
0
)
...
...
Mall.Repository/User/RB_Distributor_InfoRepository.cs
View file @
b26e595d
...
@@ -44,7 +44,7 @@ namespace Mall.Repository.User
...
@@ -44,7 +44,7 @@ namespace Mall.Repository.User
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
}
if
(
dmodel
.
Source
>
0
)
{
if
(
dmodel
.
Source
>
0
)
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Source
)}
=
{
dmodel
.
Source
}
"
;
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Source
)}
=
{
(
int
)
dmodel
.
Source
}
"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
NickName
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
NickName
))
{
{
...
...
Mall.Repository/User/RB_Distributor_RemitRepository.cs
View file @
b26e595d
...
@@ -36,6 +36,9 @@ namespace Mall.Repository.User
...
@@ -36,6 +36,9 @@ namespace Mall.Repository.User
if
(
dmodel
.
AuditStatus
>
0
)
{
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
string
sql
=
$@"select r.*,u.Name as UserName,u.Photo,u.Source from RB_Distributor_Remit r
string
sql
=
$@"select r.*,u.Name as UserName,u.Photo,u.Source from RB_Distributor_Remit r
left join rb_member_user u on r.UserId = u.Id
left join rb_member_user u on r.UserId = u.Id
...
...
Mall.Repository/User/RB_Member_GradeRepository.cs
View file @
b26e595d
...
@@ -60,6 +60,9 @@ namespace Mall.Repository.User
...
@@ -60,6 +60,9 @@ namespace Mall.Repository.User
{
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Id
)}
=
{(
int
)
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
Grade
>
0
)
if
(
dmodel
.
Grade
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Grade
)}
=
{(
int
)
dmodel
.
Grade
}
"
;
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Grade
)}
=
{(
int
)
dmodel
.
Grade
}
"
;
...
@@ -75,5 +78,37 @@ namespace Mall.Repository.User
...
@@ -75,5 +78,37 @@ namespace Mall.Repository.User
string
sql
=
$@"select * from RB_Member_Grade where
{
where
}
order by Grade asc"
;
string
sql
=
$@"select * from RB_Member_Grade where
{
where
}
order by Grade asc"
;
return
Get
<
RB_Member_Grade_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Member_Grade_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Member_Grade_Extend
>
GetGrade
(
RB_Member_Grade_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Member_Grade
.
Status
)}
=0 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Grade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Grade
)}
=
{(
int
)
dmodel
.
Grade
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
Enabled
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_Grade
.
Enabled
)}
=
{(
int
)
dmodel
.
Enabled
}
"
;
}
string
sql
=
$@"select Grade from RB_Member_Grade where
{
where
}
order by Grade asc"
;
return
Get
<
RB_Member_Grade_Extend
>(
sql
).
ToList
();
}
}
}
}
}
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
b26e595d
...
@@ -152,6 +152,198 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -152,6 +152,198 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
Success
(
""
,
pagelist
);
return
ApiResult
.
Success
(
""
,
pagelist
);
}
}
/// <summary>
/// 小程序分页列表(赞羊)
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsPageListForZY
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
GoodsStatus
=
1
;
//只查询销售中的
var
list
=
productModule
.
GetAppletGoodsPageListForZY
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
List
<
object
>
RList
=
new
List
<
object
>();
int
UserId
=
demodel
.
UserId
??
0
;
RB_Member_User_Extend
userModel
=
new
RB_Member_User_Extend
();
RB_Member_Grade_Extend
memberGrade
=
new
RB_Member_Grade_Extend
();
if
(
UserId
>
0
)
{
userModel
=
productModule
.
GetMemberUserInfo
(
UserId
);
if
(
userModel
.
MemberGrade
>
0
)
{
memberGrade
=
productModule
.
GetMemberGradeList
(
new
RB_Member_Grade_Extend
()
{
Id
=
userModel
.
MemberGrade
??
0
,
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
}
}
if
(
list
.
Any
())
{
foreach
(
var
model
in
list
)
{
#
region
组装价格
List
<
object
>
priceList
=
new
List
<
object
>();
if
(
model
.
IsCustomSpecification
==
1
)
{
if
(
model
.
SpecificationPriceList
.
Any
()
&&
model
.
SpecificationList
.
Any
())
{
foreach
(
var
item
in
model
.
SpecificationPriceList
)
{
var
ssarr
=
item
.
SpecificationSort
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
string
pic_url
=
model
.
SpecificationList
[
0
].
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Sort
).
FirstOrDefault
()?.
ImagePath
;
List
<
object
>
attr_list
=
new
List
<
object
>();
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
attr_list
.
Add
(
new
{
attr_group_name
=
smodel
.
Name
,
attr_group_id
=
smodel
.
Sort
,
attr_id
=
svmodel
.
Id
,
attr_name
=
svmodel
.
Name
});
}
decimal
price_member
=
item
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
).
ToList
();
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
}
}
else
{
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memberGrade
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
priceList
.
Add
(
new
{
id
=
item
.
Id
,
goods_id
=
model
.
Id
,
sign_id
=
item
.
SpecificationSort
,
stock
=
item
.
InventoryNum
,
price
=
item
.
SellingPrice
,
no
=
item
.
GoodsNumbers
,
weight
=
item
.
GoodsWeight
,
pic_url
,
is_delete
=
item
.
Status
,
attr_list
,
price_member
});
}
}
}
else
{
decimal
price_member
=
model
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
;
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
}
}
else
{
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memberGrade
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
priceList
.
Add
(
new
{
id
=
0
,
goods_id
=
model
.
Id
,
sign_id
=
""
,
stock
=
model
.
InventoryNum
,
price
=
model
.
SellingPrice
??
0
,
no
=
model
.
GoodsNumbers
,
weight
=
model
.
GoodsWeight
,
pic_url
=
""
,
is_delete
=
0
,
attr_list
=
new
{
attr_group_name
=
"规格"
,
attr_group_id
=
0
,
attr_id
=
0
,
attr_name
=
model
.
DefaultSpecificationName
},
price_member
});
}
#
endregion
#
region
会员价格
decimal
memberprice
=
model
.
SellingPrice
??
0
;
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
&&
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
&&
model
.
MemberPriceList
.
Any
())
{
memberprice
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
Min
(
x
=>
x
.
MemberPrice
??
0
);
}
else
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
memberprice
=
memberprice
*
(
memberGrade
?.
Discount
??
10
)
/
10
;
}
#
endregion
RList
.
Add
(
new
{
id
=
model
.
Id
,
sign
=
""
,
name
=
model
.
Name
,
cover_pic
=
model
.
CoverImage
,
video_url
=
model
.
VideoAddress
,
original_price
=
model
.
OriginalPrice
,
unit
=
model
.
Unit
,
page_url
=
"/pages/goods/goods?id="
+
model
.
Id
,
is_negotiable
=
model
.
IsGoodsNegotiable
,
is_level
=
model
.
EnjoyMember
,
level_price
=
memberprice
,
price
=
(
model
.
SellingPrice
??
0
).
ToString
(
"#0.00"
),
price_content
=
"¥"
+
(
model
.
SellingPrice
??
0
).
ToString
(
"#0.00"
),
is_sales
=
model
.
GoodsStatus
,
sales
=
"已售"
+
model
.
SalesNum
+
"件"
,
attr_groups
=
model
.
SpecificationList
.
Select
(
x
=>
new
{
attr_group_id
=
x
.
Sort
,
attr_group_name
=
x
.
Name
,
attr_list
=
x
.
SpecificationValueList
.
Select
(
z
=>
new
{
attr_id
=
z
.
Sort
,
attr_name
=
z
.
Name
,
pic_url
=
z
.
ImagePath
})
}),
attr
=
priceList
,
goods_stock
=
model
.
InventoryNum
,
goods_num
=
model
.
InventoryNum
});
}
}
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
RList
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// <summary>
/// 获取小程序商品详情
/// 获取小程序商品详情
/// </summary>
/// </summary>
...
@@ -174,7 +366,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -174,7 +366,7 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
UserId
>
0
)
{
if
(
UserId
>
0
)
{
userModel
=
productModule
.
GetMemberUserInfo
(
UserId
);
userModel
=
productModule
.
GetMemberUserInfo
(
UserId
);
if
(
userModel
.
MemberGrade
>
0
)
{
if
(
userModel
.
MemberGrade
>
0
)
{
memeberList
=
productModule
.
GetMemberGradeList
(
new
RB_Member_Grade_Extend
()
{
TenantId
=
req
.
TenantId
,
MallBaseId
=
req
.
MallBaseId
});
memeberList
=
productModule
.
GetMemberGradeList
(
new
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
req
.
TenantId
,
MallBaseId
=
req
.
MallBaseId
});
}
}
}
}
...
@@ -329,13 +521,13 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -329,13 +521,13 @@ namespace Mall.WebApi.Controllers.MallBase
weight
=
model
.
GoodsWeight
,
weight
=
model
.
GoodsWeight
,
pic_url
=
""
,
pic_url
=
""
,
is_delete
=
0
,
is_delete
=
0
,
attr_list
=
new
attr_list
=
new
List
<
object
>(){
new
{
{
attr_group_name
=
"规格"
,
attr_group_name
=
"规格"
,
attr_group_id
=
0
,
attr_group_id
=
0
,
attr_id
=
0
,
attr_id
=
0
,
attr_name
=
model
.
DefaultSpecificationName
attr_name
=
model
.
DefaultSpecificationName
},
}
}
,
price_member
,
price_member
,
member_price_list
member_price_list
});
});
...
@@ -435,7 +627,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -435,7 +627,7 @@ namespace Mall.WebApi.Controllers.MallBase
give_integral_type
=
model
.
IntegralPresentType
,
give_integral_type
=
model
.
IntegralPresentType
,
forehead_integral
=
model
.
PointsDeduction
,
//暂 积分抵扣
forehead_integral
=
model
.
PointsDeduction
,
//暂 积分抵扣
forehead_integral_type
=
model
.
PointsDeductionType
,
//暂 积分抵扣类型
forehead_integral_type
=
model
.
PointsDeductionType
,
//暂 积分抵扣类型
//accumulative = 0,//
accumulative
=
model
.
IsMultipleDeduction
,
//多件抵扣
individual_share
=
userModel
?.
IsDistributor
??
2
,
// 是否分销商
individual_share
=
userModel
?.
IsDistributor
??
2
,
// 是否分销商
attr_setting_type
=
model
.
SeparateDistributionType
,
//分销类型
attr_setting_type
=
model
.
SeparateDistributionType
,
//分销类型
is_level
=
model
.
EnjoyMember
,
//是否销售会员价格
is_level
=
model
.
EnjoyMember
,
//是否销售会员价格
...
@@ -701,6 +893,207 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -701,6 +893,207 @@ namespace Mall.WebApi.Controllers.MallBase
});
});
}
}
/// <summary>
/// 小程序获取推荐商品列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsRecommendListForZY
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
if
(!
demodel
.
RecommendType
.
HasValue
&&
demodel
.
RecommendType
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递推荐类型"
);
}
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
GoodsStatus
=
1
;
//只查询销售中的
var
list
=
productModule
.
GetAppletGoodsRecommendListForZY
(
1
,
10
,
out
int
RecommendStatus
,
demodel
);
List
<
object
>
RList
=
new
List
<
object
>();
int
UserId
=
demodel
.
UserId
??
0
;
RB_Member_User_Extend
userModel
=
new
RB_Member_User_Extend
();
RB_Member_Grade_Extend
memberGrade
=
new
RB_Member_Grade_Extend
();
if
(
UserId
>
0
)
{
userModel
=
productModule
.
GetMemberUserInfo
(
UserId
);
if
(
userModel
.
MemberGrade
>
0
)
{
memberGrade
=
productModule
.
GetMemberGradeList
(
new
RB_Member_Grade_Extend
()
{
Id
=
userModel
.
MemberGrade
??
0
,
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
}
}
if
(
list
.
Any
())
{
foreach
(
var
model
in
list
)
{
#
region
组装价格
List
<
object
>
priceList
=
new
List
<
object
>();
if
(
model
.
IsCustomSpecification
==
1
)
{
if
(
model
.
SpecificationPriceList
.
Any
()
&&
model
.
SpecificationList
.
Any
())
{
foreach
(
var
item
in
model
.
SpecificationPriceList
)
{
var
ssarr
=
item
.
SpecificationSort
.
Split
(
':'
);
int
Sort
=
Convert
.
ToInt32
(
ssarr
[
0
]);
string
pic_url
=
model
.
SpecificationList
[
0
].
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Sort
).
FirstOrDefault
()?.
ImagePath
;
List
<
object
>
attr_list
=
new
List
<
object
>();
for
(
int
i
=
0
;
i
<
ssarr
.
Length
;
i
++)
{
var
smodel
=
model
.
SpecificationList
[
i
];
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
attr_list
.
Add
(
new
{
attr_group_name
=
smodel
.
Name
,
attr_group_id
=
smodel
.
Sort
,
attr_id
=
svmodel
.
Id
,
attr_name
=
svmodel
.
Name
});
}
decimal
price_member
=
item
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
).
ToList
();
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
}
}
else
{
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memberGrade
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
priceList
.
Add
(
new
{
id
=
item
.
Id
,
goods_id
=
model
.
Id
,
sign_id
=
item
.
SpecificationSort
,
stock
=
item
.
InventoryNum
,
price
=
item
.
SellingPrice
,
no
=
item
.
GoodsNumbers
,
weight
=
item
.
GoodsWeight
,
pic_url
,
is_delete
=
item
.
Status
,
attr_list
,
price_member
});
}
}
}
else
{
decimal
price_member
=
model
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
;
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
}
}
else
{
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memberGrade
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
priceList
.
Add
(
new
{
id
=
0
,
goods_id
=
model
.
Id
,
sign_id
=
""
,
stock
=
model
.
InventoryNum
,
price
=
model
.
SellingPrice
??
0
,
no
=
model
.
GoodsNumbers
,
weight
=
model
.
GoodsWeight
,
pic_url
=
""
,
is_delete
=
0
,
attr_list
=
new
{
attr_group_name
=
"规格"
,
attr_group_id
=
0
,
attr_id
=
0
,
attr_name
=
model
.
DefaultSpecificationName
},
price_member
});
}
#
endregion
#
region
会员价格
decimal
memberprice
=
model
.
SellingPrice
??
0
;
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
&&
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
&&
model
.
MemberPriceList
.
Any
())
{
memberprice
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
Min
(
x
=>
x
.
MemberPrice
??
0
);
}
else
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
memberprice
=
memberprice
*
(
memberGrade
?.
Discount
??
10
)
/
10
;
}
#
endregion
RList
.
Add
(
new
{
id
=
model
.
Id
,
sign
=
""
,
name
=
model
.
Name
,
cover_pic
=
model
.
CoverImage
,
video_url
=
model
.
VideoAddress
,
original_price
=
model
.
OriginalPrice
,
unit
=
model
.
Unit
,
page_url
=
"/pages/goods/goods?id="
+
model
.
Id
,
is_negotiable
=
model
.
IsGoodsNegotiable
,
is_level
=
model
.
EnjoyMember
,
level_price
=
memberprice
,
price
=
(
model
.
SellingPrice
??
0
).
ToString
(
"#0.00"
),
price_content
=
"¥"
+
(
model
.
SellingPrice
??
0
).
ToString
(
"#0.00"
),
is_sales
=
model
.
GoodsStatus
,
sales
=
"已售"
+
model
.
SalesNum
+
"件"
,
attr_groups
=
model
.
SpecificationList
.
Select
(
x
=>
new
{
attr_group_id
=
x
.
Sort
,
attr_group_name
=
x
.
Name
,
attr_list
=
x
.
SpecificationValueList
.
Select
(
z
=>
new
{
attr_id
=
z
.
Sort
,
attr_name
=
z
.
Name
,
pic_url
=
z
.
ImagePath
})
}),
attr
=
priceList
,
goods_stock
=
model
.
InventoryNum
,
goods_num
=
model
.
InventoryNum
});
}
}
return
ApiResult
.
Success
(
""
,
new
{
RecommendStatus
,
List
=
RList
});
}
#
endregion
#
endregion
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
b26e595d
...
@@ -282,6 +282,38 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -282,6 +282,38 @@ namespace Mall.WebApi.Controllers.MallBase
return
orderModule
.
GetAppletGoodsSettlementInfo
(
demodel
);
return
orderModule
.
GetAppletGoodsSettlementInfo
(
demodel
);
}
}
/// <summary>
/// 结算页面详情(赞羊字段)
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsSettlementInfoForZY
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Goods_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Order_Extend
>(
req
.
msg
.
ToString
());
if
(
demodel
.
DetailList
==
null
||
!
demodel
.
DetailList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递商品信息"
);
}
foreach
(
var
item
in
demodel
.
DetailList
)
{
if
((
item
.
GoodsId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
if
((
item
.
Number
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品数量"
);
}
}
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
return
orderModule
.
GetAppletGoodsSettlementInfoForZY
(
demodel
);
}
/// <summary>
/// <summary>
/// 结算页面修改快递,获取快递费用
/// 结算页面修改快递,获取快递费用
/// </summary>
/// </summary>
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
b26e595d
...
@@ -1383,6 +1383,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1383,6 +1383,7 @@ namespace Mall.WebApi.Controllers.MallBase
List
<
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
>
MGradeList
=
null
;
List
<
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
>
MGradeList
=
null
;
if
(
demodel
.
IsCustomSpecification
==
1
)
if
(
demodel
.
IsCustomSpecification
==
1
)
{
{
demodel
.
InventoryNum
=
0
;
if
(
demodel
.
SpecificationList
==
null
||
!
demodel
.
SpecificationList
.
Any
())
{
if
(
demodel
.
SpecificationList
==
null
||
!
demodel
.
SpecificationList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递规格列表"
);
return
ApiResult
.
ParamIsNull
(
"请传递规格列表"
);
}
}
...
@@ -1455,7 +1456,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1455,7 +1456,8 @@ namespace Mall.WebApi.Controllers.MallBase
pricemodel
.
GoodsWeight
??=
0
;
pricemodel
.
GoodsWeight
??=
0
;
demodel
.
InventoryNum
+=
(
pricemodel
.
InventoryNum
??
0
);
demodel
.
InventoryNum
+=
(
pricemodel
.
InventoryNum
??
0
);
}
}
//主表价格 如果有自定义规格,直接取最小值
demodel
.
SellingPrice
=
demodel
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
//分销佣金
//分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
if
(
demodel
.
SeparateDistribution
==
1
)
{
if
(
DGradeList
==
null
)
if
(
DGradeList
==
null
)
...
@@ -1527,6 +1529,9 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1527,6 +1529,9 @@ namespace Mall.WebApi.Controllers.MallBase
//普通设置 直接根据等级验证数量
//普通设置 直接根据等级验证数量
if
(
DGradeList
.
Count
()
*
TotalNum
!=
demodel
.
DistributionCommissionList
.
Count
())
if
(
DGradeList
.
Count
()
*
TotalNum
!=
demodel
.
DistributionCommissionList
.
Count
())
{
{
LogHelper
.
Write
(
DGradeList
.
Count
().
ToString
()
+
"|||"
+
JsonConvert
.
SerializeObject
(
DGradeList
));
LogHelper
.
Write
(
"TotalNum:"
+
TotalNum
.
ToString
());
LogHelper
.
Write
(
JsonConvert
.
SerializeObject
(
demodel
.
DistributionCommissionList
));
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
}
}
foreach
(
var
item
in
DGradeList
)
foreach
(
var
item
in
DGradeList
)
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
b26e595d
...
@@ -381,6 +381,22 @@ namespace Mall.WebApi.Controllers.User
...
@@ -381,6 +381,22 @@ namespace Mall.WebApi.Controllers.User
}));
}));
}
}
/// <summary>
/// 获取会员等级
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMemberGrade
()
{
var
parms
=
RequestParm
;
RB_Member_Grade_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_Grade_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
userModule
.
GetMemberGrade
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
x
.
Grade
).
ToList
());
}
/// <summary>
/// <summary>
/// 新增会员等级
/// 新增会员等级
/// </summary>
/// </summary>
...
@@ -490,6 +506,9 @@ namespace Mall.WebApi.Controllers.User
...
@@ -490,6 +506,9 @@ namespace Mall.WebApi.Controllers.User
demodel
.
Status
=
0
;
demodel
.
Status
=
0
;
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
if
(
userModule
.
ValidateMemberGrade
(
demodel
))
{
return
ApiResult
.
Failed
(
"该等级已存在,请重新选择等级"
);
}
bool
flag
=
userModule
.
SetMemberGradeInfo
(
demodel
);
bool
flag
=
userModule
.
SetMemberGradeInfo
(
demodel
);
if
(
flag
)
if
(
flag
)
{
{
...
@@ -526,7 +545,6 @@ namespace Mall.WebApi.Controllers.User
...
@@ -526,7 +545,6 @@ namespace Mall.WebApi.Controllers.User
}
}
}
}
/// <summary>
/// <summary>
/// 获取会用户积分分页列表
/// 获取会用户积分分页列表
/// </summary>
/// </summary>
...
@@ -1859,15 +1877,15 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1859,15 +1877,15 @@ namespace Mall.WebApi.Controllers.User
case
6
:
case
6
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
BankName
??
""
)
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
BankName
??
""
)
{
});
break
;
case
7
:
case
7
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AccountNumber
)
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AccountNumber
??
""
)
{
});
break
;
case
8
:
case
8
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AccountName
)
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AccountName
??
""
)
{
});
break
;
case
9
:
case
9
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AuditStatus
.
GetEnumName
())
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
AuditStatus
.
GetEnumName
())
{
});
break
;
case
10
:
case
10
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
WithdrawalWay
.
GetEnumName
())
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
WithdrawalWay
.
GetEnumName
())
{
});
break
;
case
11
:
case
11
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
RemitDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
)
{
});
break
;
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
RemitDate
.
HasValue
?
item
.
RemitDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
):
""
)
{
});
break
;
}
}
}
}
slist
.
Add
(
datarow
);
slist
.
Add
(
datarow
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment