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
2b858bc0
Commit
2b858bc0
authored
Oct 30, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
814e647d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1119 additions
and
5 deletions
+1119
-5
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+1092
-0
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+26
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+0
-4
OSGoodsController.cs
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
+1
-1
No files found.
Mall.Module.Product/ProductModule.cs
View file @
2b858bc0
...
@@ -2559,6 +2559,1098 @@ namespace Mall.Module.Product
...
@@ -2559,6 +2559,1098 @@ namespace Mall.Module.Product
#
endregion
#
endregion
}
}
/// <summary>
/// 获取线下服务商品预定详情
/// </summary>
/// <param name="goodsId">商品编号</param>
/// <param name="UserId">用户编号</param>
/// <param name="SmallShopsId">微店编号</param>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <param name="storeId">门店编号</param>
/// <returns></returns>
public
object
GetAppletOfflineGoodsInfoModule
(
int
goodsId
,
int
UserId
,
int
SmallShopsId
,
int
TenantId
,
int
MallBaseId
,
int
storeId
=
0
)
{
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
)
{
return
null
;
}
else
{
model
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
CarouselImage
);
//封面图
model
.
CoverImage
=
CarouselIdList
[
0
];
}
}
//小程序名称
model
.
MallName
=
programRepository
.
GetEntity
(
model
.
MallBaseId
)?.
MallName
??
""
;
RB_Member_User_Extend
userModel
=
new
RB_Member_User_Extend
();
if
(
UserId
>
0
)
{
userModel
=
GetMemberUserInfo
(
UserId
);
if
(
SmallShopsId
==
0
)
{
SmallShopsId
=
userModel
.
SmallShopId
;
}
}
#
region
基本信息
//查询分类
model
.
CategoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
//2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W
#
region
微店价格
RB_SmallShops_Info
smallModel
=
new
RB_SmallShops_Info
();
List
<
RB_SmallShops_Price_Extend
>
smallPList
=
new
List
<
RB_SmallShops_Price_Extend
>();
if
(
SmallShopsId
>
0
)
{
smallModel
=
smallShops_InfoRepository
.
GetEntity
(
SmallShopsId
);
smallPList
=
smallShops_PriceRepository
.
GetList
(
new
RB_SmallShops_Price_Extend
()
{
SmallShopsId
=
SmallShopsId
,
GoodsId
=
goodsId
});
if
(((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
UpPrice
>
0
).
Any
()))
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
model
.
SellingPrice
=
(
model
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
model
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
model
.
OriginalPrice
=
(
model
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
model
.
OriginalPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
model
.
SellingPrice
=
(
model
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
model
.
OriginalPrice
=
(
model
.
OriginalPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
model
.
SellingPrice
=
(
model
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
model
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
model
.
OriginalPrice
=
(
model
.
OriginalPrice
??
0
)
+
Math
.
Ceiling
((
model
.
OriginalPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
model
.
SellingPrice
=
(
model
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
model
.
OriginalPrice
=
(
model
.
OriginalPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
#
endregion
//最大售价
decimal
MaxSellMoney
=
model
.
SellingPrice
??
0
;
model
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
model
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
model
.
IsCustomSpecification
==
1
)
{
model
.
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
model
.
SpecificationList
.
Any
())
{
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
svlist
)
{
item
.
ImagePath
=
item
.
Image
;
}
foreach
(
var
item
in
model
.
SpecificationList
)
{
item
.
SpecificationValueList
=
svlist
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
ToList
();
}
}
model
.
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
UpPrice
>
0
).
Any
())
{
foreach
(
var
item
in
model
.
SpecificationPriceList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
item
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
MaxSellMoney
=
model
.
SpecificationPriceList
.
Max
(
x
=>
x
.
SellingPrice
??
0
);
model
.
SellingPrice
=
model
.
SpecificationPriceList
.
Min
(
x
=>
x
.
SellingPrice
??
0
);
decimal
MaxPrice
=
MaxSellMoney
+
Math
.
Ceiling
(
MaxSellMoney
/
10
);
if
(
MaxPrice
>
model
.
OriginalPrice
)
{
model
.
OriginalPrice
=
MaxPrice
;
}
}
//区域
model
.
AreaList
=
new
List
<
RB_Goods_Area_Extend
>();
if
(
model
.
IsAreaBuy
==
1
)
{
model
.
AreaList
=
goods_AreaRepository
.
GetList
(
new
RB_Goods_Area_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
//返佣
model
.
DistributionCommissionList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
if
(
model
.
SeparateDistribution
==
1
)
{
model
.
DistributionCommissionList
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
//会员价格
model
.
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
model
.
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
#
region
微店处理会员价格
if
(
model
.
MemberPriceList
.
Any
()
&&
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
UpPrice
>
0
).
Any
())
{
foreach
(
var
item
in
model
.
MemberPriceList
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
SpecificationKey
==
item
.
SpecificationSort
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
MemberPrice
=
(
item
.
MemberPrice
??
0
)
+
Math
.
Ceiling
((
item
.
MemberPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
MemberPrice
=
(
item
.
MemberPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
MemberPrice
=
(
item
.
MemberPrice
??
0
)
+
Math
.
Ceiling
((
item
.
MemberPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
MemberPrice
=
(
item
.
MemberPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
}
#
endregion
//轮播
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrWhiteSpace
(
model
.
VideoAddress
))
{
model
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
0
,
Name
=
""
,
Type
=
1
,
Path
=
model
.
VideoAddress
});
}
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
CarouselImage
);
//轮播图
foreach
(
var
item
in
CarouselIdList
)
{
model
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
0
,
Name
=
""
,
Path
=
item
});
}
}
model
.
CustomShareImagePath
=
model
.
CustomShareImage
;
//服务列表
model
.
ServiceList
=
new
List
<
RB_ImageCommonModel
>();
if
(
model
.
IsDefaultService
==
2
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
GoodsService
)
&&
model
.
GoodsService
!=
"[]"
)
{
List
<
int
>
ServiceIds
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
model
.
GoodsService
);
var
slist
=
product_ServiceRepository
.
GetList
(
new
RB_Product_Service_Extend
()
{
ServiceIds
=
string
.
Join
(
","
,
ServiceIds
),
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
slist
)
{
model
.
ServiceList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
item
.
Id
,
Name
=
item
.
Name
});
}
}
}
else
if
(
model
.
IsDefaultService
==
1
)
{
var
slist
=
product_ServiceRepository
.
GetList
(
new
RB_Product_Service_Extend
()
{
IsDefault
=
1
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
slist
)
{
model
.
ServiceList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
item
.
Id
,
Name
=
item
.
Name
});
}
}
//表单
if
(
model
.
FormsId
>
0
)
{
model
.
FormsName
=
"未建表"
;
}
else
{
model
.
FormsName
=
"默认表单"
;
}
#
endregion
#
region
是否收藏
model
.
Favorite
=
false
;
if
(
UserId
>
0
)
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Collection_Extend
.
UserId
),
FiledValue
=
UserId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Collection_Extend
.
GoodsId
),
FiledValue
=
goodsId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Collection_Extend
.
TenantId
),
FiledValue
=
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Member_Collection_Extend
.
MallBaseId
),
FiledValue
=
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
};
if
(
member_CollectionRepository
.
Exists
(
wheres
))
{
model
.
Favorite
=
true
;
}
}
#
endregion
#
region
快递费用
//运费
Model
.
Entity
.
BaseSetUp
.
RB_Logistics_Rules
rulesModel
=
new
Model
.
Entity
.
BaseSetUp
.
RB_Logistics_Rules
();
if
(
model
.
FreightId
>
0
)
{
rulesModel
=
logistics_RulesRepository
.
GetEntity
(
model
.
FreightId
);
model
.
FreightName
=
rulesModel
?.
RulesName
??
""
;
}
else
{
model
.
FreightName
=
"默认运费"
;
}
model
.
Express
=
0
;
if
(
UserId
>
0
&&
model
.
FreightId
>=
0
)
{
int
FreightId
=
model
.
FreightId
??
0
;
if
(
model
.
FreightId
==
0
)
{
//查询默认
FreightId
=
logistics_RulesRepository
.
GetLogisticsRulesList
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_Rules_Extend
()
{
IsDefault
=
1
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
()?.
ID
??
0
;
}
if
(
FreightId
>
0
)
{
var
samodel
=
member_ShippingAddressRepository
.
GetList
(
new
RB_Member_ShippingAddress_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
UserId
,
IsDefault
=
1
}).
FirstOrDefault
();
List
<
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
>
priceList1
=
logistics_RulesPriceRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesPrice_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
RulesId
=
FreightId
});
if
(
priceList1
.
Any
()
&&
samodel
!=
null
)
{
string
priceIds
=
string
.
Join
(
","
,
priceList1
.
Select
(
x
=>
x
.
ID
));
var
regionList
=
logistics_RulesRegionRepository
.
GetListRepository
(
new
Model
.
Extend
.
BaseSetUp
.
RB_Logistics_RulesRegion_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
PriceIds
=
priceIds
});
List
<
int
>
disList
=
new
List
<
int
>();
disList
.
Add
(
samodel
.
Province
??
0
);
disList
.
Add
(
samodel
.
City
??
0
);
disList
.
Add
(
samodel
.
District
??
0
);
var
regionModel
=
regionList
.
Where
(
x
=>
disList
.
Contains
(
x
.
RegionId
)).
FirstOrDefault
();
if
(
regionModel
!=
null
)
{
var
pmodel
=
priceList1
.
Where
(
x
=>
x
.
ID
==
regionModel
.
RulesPriceId
).
FirstOrDefault
();
if
(
pmodel
!=
null
&&
rulesModel
!=
null
)
{
if
(
rulesModel
.
ChargeMode
==
Common
.
Enum
.
MallBase
.
ChargeModeEnum
.
Num
)
{
model
.
Express
=
pmodel
.
FirstPrice
;
}
else
{
//重量计费
int
TotalW
=
model
.
GoodsWeight
??
0
;
if
(
TotalW
<=
pmodel
.
First
)
{
model
.
Express
=
pmodel
.
FirstPrice
;
}
else
{
if
(
pmodel
.
Second
>
0
)
{
if
((
TotalW
-
pmodel
.
First
)
%
pmodel
.
Second
==
0
)
{
model
.
Express
=
pmodel
.
FirstPrice
+
((
TotalW
-
pmodel
.
First
)
/
pmodel
.
Second
)
*
pmodel
.
SecondPrice
;
}
else
{
model
.
Express
=
pmodel
.
FirstPrice
+
((
TotalW
-
pmodel
.
First
)
/
pmodel
.
Second
+
1
)
*
pmodel
.
SecondPrice
;
}
}
else
{
model
.
Express
=
pmodel
.
FirstPrice
;
}
}
}
}
}
}
}
}
#
endregion
#
region
最高返佣
model
.
MaxShare
=
0
;
decimal
MyBuyCommission
=
0
;
//自购返利
var
BasicsModel
=
distributor_BasicsRepository
.
GetList
(
new
RB_Distributor_Basics_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
UserId
>
0
)
{
//获取分销商信息
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
UserId
=
UserId
,
AuditStatus
=
Common
.
Enum
.
User
.
DistributorAuditStatusEnum
.
Audited
}).
FirstOrDefault
();
if
(
disModel
!=
null
)
{
if
((
BasicsModel
?.
IsEnableFXGrade
??
2
)
==
1
)
{
if
((
model
.
PresentFXGrade
??
0
)
==
0
)
{
var
FXList
=
distributor_FXGradeRepository
.
GetList
(
new
RB_Distributor_FXGrade_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
FXList
.
Any
()
&&
FXList
.
Where
(
x
=>
x
.
IsGuest
==
1
).
Any
())
{
var
FXModel
=
FXList
.
Where
(
x
=>
x
.
Id
==
disModel
.
FXGradeId
).
FirstOrDefault
();
var
PModel
=
FXList
.
Where
(
x
=>
x
.
IsGuest
==
1
).
FirstOrDefault
();
if
(
FXModel
!=
null
&&
PModel
!=
null
)
{
decimal
CRate
=
0
;
if
(
FXModel
.
Id
==
PModel
.
Id
)
{
CRate
=
FXModel
.
SiblingRatio
??
0
;
}
else
{
CRate
=
(
FXModel
.
CommissionRatio
??
0
)
-
(
PModel
.
CommissionRatio
??
0
);
}
if
(
model
.
IsCustomSpecification
==
1
)
{
var
dcModel
=
model
.
SpecificationPriceList
.
OrderByDescending
(
x
=>
x
.
Commission
).
FirstOrDefault
();
if
(
dcModel
.
Commission
>
0
)
{
if
(
FXModel
.
DecimalType
==
1
)
{
model
.
MaxShare
=
Math
.
Ceiling
(
dcModel
.
Commission
*
CRate
/
100
);
MyBuyCommission
=
Math
.
Ceiling
(
dcModel
.
Commission
*
(
FXModel
.
CommissionRatio
??
0
)
/
100
);
}
else
{
model
.
MaxShare
=
Math
.
Ceiling
(
dcModel
.
Commission
*
CRate
)
/
100
;
MyBuyCommission
=
Math
.
Ceiling
(
dcModel
.
Commission
*
(
FXModel
.
CommissionRatio
??
0
))
/
100
;
}
}
}
else
{
if
(
model
.
Commission
>
0
)
{
if
(
FXModel
.
DecimalType
==
1
)
{
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
Commission
*
CRate
/
100
);
MyBuyCommission
=
Math
.
Ceiling
(
model
.
Commission
*
(
FXModel
.
CommissionRatio
??
0
)
/
100
);
}
else
{
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
Commission
*
CRate
)
/
100
;
MyBuyCommission
=
Math
.
Ceiling
(
model
.
Commission
*
(
FXModel
.
CommissionRatio
??
0
))
/
100
;
}
}
}
}
}
}
else
{
//是否展示分享vip佣金
var
fxcommissionList
=
distributor_FXCommissionRepository
.
GetFXCommissionList
(
new
RB_Distributor_FXCommission_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
FXGradeId
=
disModel
.
FXGradeId
??
0
});
if
(
fxcommissionList
.
Any
())
{
model
.
MaxShare
=
fxcommissionList
.
Max
(
x
=>
x
.
CommissionPrice
??
0
);
}
}
}
else
{
//判断是否开启和平返佣
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_HPCommission
.
Status
),
FiledValue
=
0
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_HPCommission
.
Enabled
),
FiledValue
=
1
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_HPCommission
.
TenantId
),
FiledValue
=
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_HPCommission
.
MallBaseId
),
FiledValue
=
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
if
(
distributor_HPCommissionRepository
.
Exists
(
wheres
))
{
//获取和平分销返佣
if
(
disModel
.
HPGradeId
>
0
&&
model
.
CostPrice
>
0
)
{
string
categoryids
=
string
.
Join
(
","
,
model
.
CategoryList
.
Select
(
x
=>
x
.
CategoryId
));
var
hpcList
=
distributor_HPCommissionRepository
.
GetList
(
new
RB_Distributor_HPCommission_Extend
()
{
Enabled
=
1
,
CategoryIdsT
=
categoryids
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
hpcList
.
Any
())
{
RB_Distributor_HPCommission_Extend
hpcModel
;
if
(
hpcList
.
Where
(
x
=>
x
.
IsCommon
!=
1
).
Any
())
{
//有使用非通用返佣
hpcModel
=
hpcList
.
Where
(
x
=>
x
.
IsCommon
!=
1
).
FirstOrDefault
();
}
else
{
//查询通用返佣
hpcModel
=
hpcList
.
Where
(
x
=>
x
.
IsCommon
==
1
).
FirstOrDefault
();
}
//查询所有返佣比例
var
gList
=
distributor_HPGradeRatioRepository
.
GetList
(
new
RB_Distributor_HPGradeRatio_Extend
()
{
CommissionId
=
hpcModel
.
Id
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
var
ratioModel
=
gList
.
Where
(
x
=>
x
.
GradeId
==
disModel
.
HPGradeId
).
FirstOrDefault
();
decimal
MPrice
=
(
model
.
CostPrice
??
0
)
/
(
1
-
((
ratioModel
.
CommissionRatio
??
0
)
/
100
));
model
.
MaxShare
=
MaxSellMoney
-
MPrice
>
0
?
MaxSellMoney
-
MPrice
:
0
;
if
(
hpcModel
.
DecimalType
==
1
)
{
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShare
);
}
else
if
(
hpcModel
.
DecimalType
==
2
)
{
model
.
MaxShare
=
Math
.
Ceiling
(
model
.
MaxShare
*
100
)
/
100
;
}
}
}
}
else
{
if
(
model
.
SeparateDistribution
==
1
)
{
var
dcList
=
model
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
disModel
.
GradeId
).
ToList
();
//if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
//{
// model.MaxShare = dcList.Max(x => (x.OneCommission ?? 0) + (x.TwoCommission ?? 0) + (x.ThreeCommission ?? 0));
//}
//else
//{
model
.
MaxShare
=
dcList
.
Max
(
x
=>
x
.
OneCommission
??
0
);
//}
// 这里需注意,可能需要分销 是否提所有返佣控制
if
(
model
.
SeparateDistributionMoneyType
==
1
)
{
model
.
MaxShare
=
Math
.
Round
(
model
.
MaxShare
*
MaxSellMoney
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
else
{
if
(
disModel
.
GradeId
==
0
)
{
//拿分销基础配置
//if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
//{
// model.MaxShare = (BasicsModel?.OneCommission ?? 0) + (BasicsModel?.TwoCommission ?? 0) + (BasicsModel?.ThreeCommission ?? 0);
//}
//else
//{
model
.
MaxShare
=
BasicsModel
?.
OneCommission
??
0
;
//}
if
((
BasicsModel
?.
DistributorCommissionType
??
2
)
==
1
)
{
model
.
MaxShare
=
Math
.
Round
(
model
.
MaxShare
*
MaxSellMoney
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
else
if
(
disModel
.
GradeId
>
0
)
{
//获取分销商等级
var
disgradeModel
=
distributor_GradeRepository
.
GetEntity
(
disModel
.
GradeId
);
if
(
disgradeModel
!=
null
)
{
//if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
//{
// model.MaxShare = (disgradeModel?.OneCommission ?? 0) + (disgradeModel?.TwoCommission ?? 0) + (disgradeModel?.ThreeCommission ?? 0);
//}
//else
//{
model
.
MaxShare
=
disgradeModel
?.
OneCommission
??
0
;
//}
if
((
disgradeModel
?.
DistributionCommissionType
??
2
)
==
1
)
{
model
.
MaxShare
=
Math
.
Round
(
model
.
MaxShare
*
MaxSellMoney
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
}
}
}
}
}
}
#
endregion
#
region
最外层组装参数
List
<
RB_Member_Grade_Extend
>
memeberList
=
new
List
<
RB_Member_Grade_Extend
>();
if
(
UserId
>
0
)
{
if
(
userModel
.
MemberGrade
>
0
)
{
memeberList
=
GetMemberGradeList
(
new
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
}
#
region
组装价格
List
<
object
>
priceList
=
new
List
<
object
>();
if
(
model
.
IsCustomSpecification
==
1
)
{
if
(
model
.
SpecificationPriceList
.
Any
()
&&
model
.
SpecificationList
.
Any
())
{
List
<
RB_Goods_Specification_Extend
>
SpecificationListToPrice
=
new
List
<
RB_Goods_Specification_Extend
>();
List
<
RB_Goods_SpecificationValue_Extend
>
SpecificationValueListToPrice
=
new
List
<
RB_Goods_SpecificationValue_Extend
>();
bool
IsHaveSellingPriceZero
=
false
;
if
(
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Count
()
!=
model
.
SpecificationPriceList
.
Count
())
{
//有数量为0的
IsHaveSellingPriceZero
=
true
;
}
foreach
(
var
item
in
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
))
{
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
];
if
(
IsHaveSellingPriceZero
&&
!
SpecificationListToPrice
.
Where
(
x
=>
x
.
Id
==
smodel
.
Id
).
Any
())
{
SpecificationListToPrice
.
Add
(
smodel
);
}
var
svmodel
=
smodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Sort
==
Convert
.
ToInt32
(
ssarr
[
i
])).
FirstOrDefault
();
if
(
IsHaveSellingPriceZero
&&
!
SpecificationValueListToPrice
.
Where
(
x
=>
x
.
Id
==
svmodel
.
Id
).
Any
())
{
SpecificationValueListToPrice
.
Add
(
svmodel
);
}
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
;
//未设会员价格的话 就为销售价格
List
<
object
>
member_price_list
=
new
List
<
object
>();
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
).
ToList
();
foreach
(
var
qitem
in
mlist
)
{
member_price_list
.
Add
(
new
{
member_grade
=
qitem
.
MemberGrade
,
member_price
=
qitem
.
MemberPrice
});
}
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
else
{
price_member
=
mlist
.
Max
(
x
=>
x
.
MemberPrice
??
0
);
}
}
}
else
{
//根据会员等级查找会员价格
foreach
(
var
qitem
in
memeberList
)
{
var
mprice
=
Math
.
Round
((
item
.
SellingPrice
??
0
)
*
(
qitem
.
Discount
??
0
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
member_price_list
.
Add
(
new
{
member_grade
=
qitem
.
Grade
,
member_price
=
mprice
});
}
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
&&
memeberList
.
Any
())
{
var
gmodel
=
memeberList
.
Where
(
x
=>
x
.
Grade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
gmodel
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
else
if
(
memeberList
.
Any
())
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memeberList
.
Max
(
x
=>
x
.
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
,
member_price_list
});
}
//当只有一组规格项目时
if
(
IsHaveSellingPriceZero
&&
SpecificationListToPrice
.
Any
()
&&
model
.
SpecificationList
.
Count
()
==
1
)
{
foreach
(
var
item
in
SpecificationListToPrice
)
{
item
.
SpecificationValueList
=
SpecificationValueListToPrice
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
OrderBy
(
x
=>
x
.
Sort
).
ToList
();
}
SpecificationListToPrice
=
SpecificationListToPrice
.
Where
(
x
=>
x
.
SpecificationValueList
.
Any
()).
ToList
();
//有价格小于等于0的 在前端展示时 需屏蔽掉
model
.
SpecificationList
=
SpecificationListToPrice
;
}
}
}
else
{
decimal
price_member
=
model
.
SellingPrice
??
0
;
//未设会员价格的话 就为销售价格
List
<
object
>
member_price_list
=
new
List
<
object
>();
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
)
{
if
(
model
.
MemberPriceList
.
Any
())
{
var
mlist
=
model
.
MemberPriceList
;
foreach
(
var
qitem
in
mlist
)
{
member_price_list
.
Add
(
new
{
member_grade
=
qitem
.
MemberGrade
,
member_price
=
qitem
.
MemberPrice
});
}
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
)
{
var
gmodel
=
mlist
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
gmodel
.
MemberPrice
??
0
;
}
else
{
price_member
=
mlist
.
Max
(
x
=>
x
.
MemberPrice
??
0
);
}
}
}
else
{
//根据会员等级查找会员价格
foreach
(
var
qitem
in
memeberList
)
{
var
mprice
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
qitem
.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
member_price_list
.
Add
(
new
{
member_grade
=
qitem
.
Grade
,
member_price
=
mprice
});
}
if
(
UserId
>
0
&&
userModel
.
MemberGrade
>
0
&&
memeberList
.
Any
())
{
var
gmodel
=
memeberList
.
Where
(
x
=>
x
.
Grade
==
userModel
.
MemberGrade
).
FirstOrDefault
();
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
gmodel
?.
Discount
??
10
)
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
}
else
if
(
memeberList
.
Any
())
{
price_member
=
Math
.
Round
((
model
.
SellingPrice
??
0
)
*
(
memeberList
.
Max
(
x
=>
x
.
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
List
<
object
>(){
new
{
attr_group_name
=
"规格"
,
attr_group_id
=
0
,
attr_id
=
0
,
attr_name
=
model
.
DefaultSpecificationName
}
},
price_member
,
member_price_list
});
}
#
endregion
#
region
赠送积分
int
Integral
=
0
;
if
(
model
.
IntegralPresent
>
0
)
{
Integral
=
model
.
IntegralPresent
??
0
;
if
(
model
.
IntegralPresentType
==
1
)
{
Integral
=
Convert
.
ToInt32
(
Math
.
Floor
((
model
.
SellingPrice
??
0
)
*
(
model
.
IntegralPresent
??
0
)
/
100
));
}
}
int
CommentIntegral
=
0
;
if
(
model
.
IntegralComment
>
0
)
{
CommentIntegral
=
model
.
IntegralComment
??
0
;
if
(
model
.
IntegralCommentType
==
1
)
{
CommentIntegral
=
Convert
.
ToInt32
(
Math
.
Floor
((
model
.
SellingPrice
??
0
)
*
(
model
.
IntegralComment
??
0
)
/
100
));
}
}
#
endregion
#
region
赠送
vip
会员
string
PresentFXGradeMsg
=
""
;
if
((
BasicsModel
?.
IsEnableFXGrade
??
2
)
==
1
)
{
if
(
model
.
PresentFXGrade
>
0
)
{
var
fxmodel
=
distributor_FXGradeRepository
.
GetEntity
(
model
.
PresentFXGrade
);
if
(
fxmodel
!=
null
)
{
PresentFXGradeMsg
=
"购买后赠送"
+
fxmodel
.
GradeName
+
" "
;
if
(
model
.
PresentFXMonth
>
0
)
{
PresentFXGradeMsg
+=
(
model
.
PresentFXMonth
??
0
)
+
"个月"
;
}
}
}
}
#
endregion
#
region
会员价格
decimal
price_member_max
=
0
,
price_member_min
=
0
,
price_min
=
0
,
price_max
=
0
;
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
&&
model
.
MemberPriceList
.
Any
())
{
price_member_min
=
model
.
MemberPriceList
.
Min
(
x
=>
x
.
MemberPrice
??
0
);
price_member_max
=
model
.
MemberPriceList
.
Max
(
x
=>
x
.
MemberPrice
??
0
);
if
(
userModel
.
MemberGrade
>
0
)
{
price_min
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
Min
(
x
=>
x
.
MemberPrice
??
0
);
price_max
=
model
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
userModel
.
MemberGrade
).
Max
(
x
=>
x
.
MemberPrice
??
0
);
}
}
else
{
if
(
model
.
IsCustomSpecification
==
1
)
{
price_member_min
=
price_min
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Min
(
x
=>
x
.
SellingPrice
??
0
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Max
(
x
=>
x
.
SellingPrice
??
0
);
}
else
{
price_member_min
=
price_member_max
=
price_min
=
price_max
=
model
.
SellingPrice
??
0
;
}
if
(
memeberList
.
Any
())
{
List
<
decimal
>
pricelist
=
new
List
<
decimal
>();
foreach
(
var
item
in
memeberList
)
{
pricelist
.
Add
(
price_member_min
*
(
item
.
Discount
??
10
)
/
10
);
pricelist
.
Add
(
price_member_max
*
(
item
.
Discount
??
10
)
/
10
);
}
price_member_min
=
pricelist
.
Min
(
x
=>
x
);
price_member_max
=
pricelist
.
Max
(
x
=>
x
);
if
(
userModel
.
MemberGrade
>
0
)
{
if
(
price_min
>
(
model
.
SellingPrice
??
0
))
{
price_min
=
model
.
SellingPrice
??
0
;
}
if
(
price_max
<
(
model
.
SellingPrice
??
0
))
{
price_max
=
model
.
SellingPrice
??
0
;
}
price_min
=
price_member_min
*
(
memeberList
.
Where
(
x
=>
x
.
Id
==
userModel
.
MemberGrade
).
FirstOrDefault
()?.
Discount
??
10
)
/
10
;
price_max
=
price_member_max
*
(
memeberList
.
Where
(
x
=>
x
.
Id
==
userModel
.
MemberGrade
).
FirstOrDefault
()?.
Discount
??
10
)
/
10
;
}
}
}
price_member_max
=
Math
.
Round
(
price_member_max
,
2
,
MidpointRounding
.
AwayFromZero
);
price_member_min
=
Math
.
Round
(
price_member_min
,
2
,
MidpointRounding
.
AwayFromZero
);
//price_min = Math.Round(price_min, 2, MidpointRounding.AwayFromZero);
//price_max = Math.Round(price_max, 2, MidpointRounding.AwayFromZero);//先使用会员的
price_min
=
price_member_min
;
price_max
=
price_member_max
;
#
endregion
#
region
订单信息
int
payment_people
=
0
,
payment_num
=
0
,
payment_order
=
0
;
//订单用户 商品数量 订单数量
decimal
payment_amount
=
0
;
//订单总金额
GetGoodsOrderPeopleInfo
(
out
payment_amount
,
out
payment_num
,
out
payment_order
,
out
payment_people
,
goodsId
);
#
endregion
#
region
返回参数
string
shipping
=
""
;
if
(
model
.
FullNumPinkage
>
0
)
{
shipping
+=
"单品满"
+
model
.
FullNumPinkage
+
"件包邮"
;
}
if
(
model
.
FullMoneyPinkage
>
0
)
{
if
(
model
.
FullNumPinkage
>
0
)
{
shipping
+=
",单品满¥"
+
model
.
FullMoneyPinkage
.
Value
.
ToString
(
"#0.00"
)
+
"包邮"
;
}
else
{
shipping
+=
"单品满¥"
+
model
.
FullMoneyPinkage
.
Value
.
ToString
(
"#0.00"
)
+
"包邮"
;
}
}
string
limit
=
""
;
if
(
model
.
AreaList
.
Any
())
{
limit
=
"仅限"
+
string
.
Join
(
","
,
model
.
AreaList
.
Select
(
x
=>
x
.
AreaName
))
+
"购买"
;
}
int
IsAllowShare
=
1
;
if
(
model
.
CategoryList
.
Where
(
x
=>
x
.
IsForeignShare
==
2
).
Any
())
{
IsAllowShare
=
2
;
}
if
((
model
.
IsCustomSpecification
??
2
)
!=
1
)
{
var
VauleL
=
new
List
<
RB_Goods_SpecificationValue_Extend
>
{
new
RB_Goods_SpecificationValue_Extend
()
{
Sort
=
0
,
Name
=
model
.
DefaultSpecificationName
,
ImagePath
=
""
}
};
model
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>
{
new
RB_Goods_Specification_Extend
()
{
Sort
=
0
,
Name
=
"规格"
,
SpecificationValueList
=
VauleL
}
};
}
return
new
{
goods
=
new
{
id
=
model
.
Id
,
mall_id
=
model
.
MallBaseId
,
mch_id
=
model
.
TenantId
,
//暂 商户id
//goods_warehouse_id = 0,//
status
=
model
.
GoodsStatus
,
isAllowShare
=
IsAllowShare
,
//是否可以分享
advertising
=
model
.
Advertising
,
//广告词
price
=
model
.
SellingPrice
,
sendArea
=
model
.
SendArea
,
use_attr
=
model
.
IsCustomSpecification
,
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
})
}),
goods_stock
=
model
.
InventoryNum
,
virtual_sales
=
(
model
.
SalesNum
??
0
),
confine_count
=
model
.
LimitBuyGoodsNum
,
pieces
=
model
.
FullNumPinkage
,
//满件包邮
forehead
=
model
.
FullMoneyPinkage
,
//满额包邮
freight_id
=
model
.
FreightId
,
give_integral
=
model
.
IntegralPresent
,
give_integral_type
=
model
.
IntegralPresentType
,
forehead_integral
=
model
.
PointsDeduction
,
//暂 积分抵扣
forehead_integral_type
=
model
.
PointsDeductionType
,
//暂 积分抵扣类型
accumulative
=
model
.
IsMultipleDeduction
,
//多件抵扣
individual_share
=
userModel
?.
IsDistributor
??
2
,
// 是否分销商
attr_setting_type
=
model
.
SeparateDistributionType
,
//分销类型
is_level
=
model
.
EnjoyMember
,
//是否销售会员价格
is_level_alone
=
model
.
SeparateSetMember
,
//是否单独设置会员价
share_type
=
model
.
SeparateDistributionMoneyType
,
//分销佣金类型
//sign = "",
app_share_pic
=
model
.
CustomShareImagePath
,
app_share_title
=
model
.
CustomShareTitles
,
is_default_services
=
model
.
IsDefaultService
,
sort
=
model
.
Sort
,
created_at
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
updated_at
=
model
.
UpdateDate
.
HasValue
?
model
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
//deleted_at = "",
is_delete
=
model
.
Status
,
payment_people
,
//用户数量
payment_num
,
//商品数量
payment_amount
,
//销售总额
payment_order
,
//订单数量
confine_order_count
=
model
.
LimitBuyOrderNum
,
is_area_limit
=
model
.
IsAreaBuy
,
area_limit
=
new
List
<
object
>()
{
new
{
list
=
model
.
AreaList
.
Select
(
x
=>
new
{
area_id
=
x
.
AreaId
,
area_name
=
x
.
AreaName
,
area_type
=
x
.
AreaType
})
}
},
form_id
=
model
.
FormsId
,
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
name
=
model
.
Name
,
original_price
=
model
.
OriginalPrice
,
cover_pic
=
model
.
CoverImage
,
unit
=
model
.
Unit
,
detail
=
model
.
GoodsDetails
,
video_url
=
model
.
VideoAddress
,
level_show
=
(
userModel
?.
MemberGrade
??
0
)
>
0
?
1
:
2
,
//是否显示会员价
is_sales
=
model
.
GoodsStatus
==
1
&&
model
.
InventoryNum
>
0
?
1
:
2
,
//是否可购买
attr
=
priceList
,
//goods_num = model.InventoryNum,
goods_no
=
model
.
GoodsNumbers
,
goods_weight
=
model
.
GoodsWeight
,
services
=
model
.
ServiceList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
name
=
x
.
Name
}),
price_min
,
price_max
,
pic_url
=
model
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
pic_url
=
x
.
Path
,
type
=
x
.
Type
}),
share
=
model
.
MaxShare
,
//分销佣金
myBuyCommission
=
MyBuyCommission
,
//粉象模式 自购返利
favorite
=
model
.
Favorite
,
//是否收藏
goods_marketing
=
new
{
limit
,
pickup
=
""
,
shipping
},
goods_marketing_award
=
new
{
integral
=
new
{
title
=
Integral
>
0
?
"购买可得"
+
Integral
+
"积分"
:
""
},
commentIntegral
=
new
{
title
=
CommentIntegral
>
0
?
"购买并评论可得"
+
Integral
+
"积分"
:
""
},
PresentFXGradeMsg
},
//plugin_extra = new List<object>(),
express
=
model
.
Express
,
//快递费用 读取默认收货地址 如果没有为0 如果有 根据商品运费匹配 找出快递费用
price_member_max
,
price_member_min
,
extra_quick_share
=
new
{
share_pic
=
model
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
pic_url
=
x
.
Path
}),
share_text
=
model
.
Name
,
mall_name
=
model
.
MallName
,
format_time
=
model
.
UpdateDate
.
HasValue
?
model
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
},
is_quick_shop
=
model
.
IsQuickBuy
,
is_sell_well
=
model
.
IsSellWell
,
is_negotiable
=
model
.
IsGoodsNegotiable
,
freeShippingName
=
model
.
FreeShippingModel
.
Name
,
fullMoneyPinkage
=
model
.
FreeShippingModel
.
FullMoneyPinkage
??
0
,
fullNumPinkage
=
model
.
FreeShippingModel
.
FullNumPinkage
??
0
,
freeShippingUrl
=
model
.
FreeShippingModel
.
FreeShippingUrl
,
marketingLogo
=
model
.
MarketingLogo
,
//分类
cats
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
CategoryId
,
x
.
CategoryName
}),
video_type
=
model
.
VideoType
,
},
delivery
=
""
};
#
endregion
#
endregion
}
/// <summary>
/// <summary>
/// 获取小程序商品视频分页列表
/// 获取小程序商品视频分页列表
/// </summary>
/// </summary>
...
...
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
2b858bc0
...
@@ -405,6 +405,32 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -405,6 +405,32 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
Success
(
""
,
Robj
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
}
/// <summary>
/// 预定页面详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletOfflineGoodsInfo
(
object
requestMsg
)
{
var
req
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
req
.
MallBaseId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
JObject
prams
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
prams
.
GetInt
(
"GoodsId"
,
0
);
int
StoreId
=
prams
.
GetInt
(
"StoreId"
,
0
);
if
(
GoodsId
<=
0
||
StoreId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
int
UserId
=
req
.
UserId
;
var
Robj
=
productModule
.
GetAppletOfflineGoodsInfoModule
(
GoodsId
,
UserId
,
req
.
SmallShopsId
,
req
.
TenantId
,
req
.
MallBaseId
,
storeId
:
StoreId
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
/// <summary>
/// <summary>
/// 获取小程序商品详情备份
/// 获取小程序商品详情备份
/// </summary>
/// </summary>
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
2b858bc0
...
@@ -704,10 +704,6 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -704,10 +704,6 @@ namespace Mall.WebApi.Controllers.MallBase
var
req
=
RequestParm
;
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
userInfo
=
AppletUserInfo
;
RB_Goods_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Order_Extend
>(
req
.
msg
.
ToString
());
RB_Goods_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Order_Extend
>(
req
.
msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
demodel
.
Consignee
))
{
return
ApiResult
.
ParamIsNull
(
"请传递联系人"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Mobile
))
if
(
string
.
IsNullOrEmpty
(
demodel
.
Mobile
))
{
{
return
ApiResult
.
ParamIsNull
(
"请传递联系人手机号码"
);
return
ApiResult
.
ParamIsNull
(
"请传递联系人手机号码"
);
...
...
Mall.WebApi/Controllers/Reserve/OSGoodsController.cs
View file @
2b858bc0
...
@@ -532,7 +532,7 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -532,7 +532,7 @@ namespace Mall.WebApi.Controllers.Reserve
}
}
foreach
(
var
item
in
MGradeList
)
foreach
(
var
item
in
MGradeList
)
{
{
var
defaultModel
=
demodel
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
item
.
Id
).
FirstOrDefault
();
var
defaultModel
=
demodel
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
item
.
Grade
).
FirstOrDefault
();
if
(
defaultModel
==
null
)
if
(
defaultModel
==
null
)
{
{
return
ApiResult
.
ParamIsNull
(
"会员价格"
+
item
.
Name
+
"不存在"
);
return
ApiResult
.
ParamIsNull
(
"会员价格"
+
item
.
Name
+
"不存在"
);
...
...
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