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
2641c431
Commit
2641c431
authored
Sep 03, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sdzq-ld' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq
parents
7b0ab343
03d46a8d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
643 additions
and
3 deletions
+643
-3
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+1
-1
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+606
-0
AppletGuideCarController.cs
Mall.WebApi/Controllers/Product/AppletGuideCarController.cs
+34
-0
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+2
-2
No files found.
Mall.Model/Entity/Product/RB_Goods.cs
View file @
2641c431
...
...
@@ -494,7 +494,7 @@ namespace Mall.Model.Entity.Product
/// <summary>
/// 使用日期 天
/// </summary>
public
decimal
?
Use
r
Day
{
get
;
set
;
}
public
decimal
?
UseDay
{
get
;
set
;
}
/// <summary>
/// 线路名称
/// </summary>
...
...
Mall.Module.Product/GuideCarModule.cs
View file @
2641c431
...
...
@@ -1076,7 +1076,613 @@ namespace Mall.Module.Product
#
endregion
#
region
小程序商品
/// <summary>
/// 获取小程序商品详情
/// </summary>
/// <param name="goodsId"></param>
/// <param name="UserId"></param>
/// <param name="SmallShopsId"></param>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
object
GetAppletGoodsInfo_V2
(
int
goodsId
,
int
UserId
,
int
SmallShopsId
,
int
TenantId
,
int
MallBaseId
)
{
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
=
member_UserRepository
.
GetEntity
<
RB_Member_User_Extend
>(
UserId
);
if
(
SmallShopsId
==
0
)
{
SmallShopsId
=
userModel
.
SmallShopId
;
}
}
#
region
基本信息
//查询分类
model
.
CategoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
#
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
.
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
;
#
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
.
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
{
if
(
model
.
SeparateDistribution
==
1
)
{
var
dcList
=
model
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
disModel
.
GradeId
).
ToList
();
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
)
{
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
)
{
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
>();
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
=
""
,
price
=
model
.
SellingPrice
??
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
==
2
)
{
Integral
=
Convert
.
ToInt32
(
Math
.
Floor
((
model
.
SellingPrice
??
0
)
*
(
model
.
IntegralPresent
??
0
)
/
100
));
}
}
#
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
司导商品
string
SiteName
=
SiteRepository
.
GetGuideCarSiteList
(
new
RB_GuideCar_Site_Extend
()
{
ID
=
model
.
SiteId
??
0
}).
FirstOrDefault
()?.
SiteName
??
""
;
string
GuideName
=
GuideRepository
.
GetGuideCarGuideList
(
new
RB_GuideCar_Guide_Extend
()
{
ID
=
model
.
GuideId
??
0
}).
FirstOrDefault
()?.
Name
??
""
;
string
CarName
=
GuideCarRepository
.
GetGuideCarCarList
(
new
RB_GuideCar_Car_Extend
()
{
ID
=
model
.
GuideId
??
0
}).
FirstOrDefault
()?.
Name
??
""
;
string
CarColorName
=
CarColorRepository
.
GetCarColorList
(
new
RB_GuideCar_CarColor_Extend
()
{
ID
=
model
.
CarColorId
??
0
}).
FirstOrDefault
()?.
ColorName
??
""
;
model
.
LineDescriptionList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
model
.
LineDescriptionList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
LineDescription
);
}
#
endregion
#
region
返回参数
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
;
}
return
new
{
goods
=
new
{
id
=
model
.
Id
,
mall_id
=
model
.
MallBaseId
,
mch_id
=
model
.
TenantId
,
//暂 商户id
status
=
model
.
GoodsStatus
,
isAllowShare
=
IsAllowShare
,
//是否可以分享
advertising
=
model
.
Advertising
,
//广告词
price
=
model
.
SellingPrice
,
member_price
=
price_member_max
,
site_name
=
SiteName
,
site_id
=
model
.
SiteId
,
guide_name
=
GuideName
,
guide_id
=
model
.
GuideId
,
car_name
=
CarName
,
car_id
=
model
.
CarId
,
carcolor_name
=
CarColorName
,
carcolor_id
=
model
.
CarColorId
,
car_number
=
model
.
CarNumber
,
car_buyyear
=
model
.
CarBuyYear
,
car_type
=
model
.
CarType
,
car_type_name
=
model
.
CarType
.
GetEnumName
(),
use_day
=
model
.
UseDay
,
line_name
=
model
.
LineName
,
line_descriptionlist
=
model
.
LineDescriptionList
,
is_spell
=
model
.
IsSpell
,
ride_num
=
model
.
RideNum
,
// 哪天 再加个剩余座位数
advance_day
=
model
.
AdvanceDay
,
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
,
//分销佣金类型
app_share_pic
=
model
.
CustomShareImagePath
,
app_share_title
=
model
.
CustomShareTitles
,
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"
)
:
""
,
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
})
}
},
name
=
model
.
Name
,
original_price
=
model
.
OriginalPrice
,
cover_pic
=
model
.
CoverImage
,
detail
=
model
.
GoodsDetails
,
video_url
=
model
.
VideoAddress
,
level_show
=
(
userModel
?.
MemberGrade
??
0
)
>
0
?
1
:
2
,
//是否显示会员价
is_sales
=
model
.
GoodsStatus
,
//是否可购买 ______根据日期判断 。。。。。。。。。。。。。。。。。。。。。。。。。。
attr
=
priceList
,
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
},
goods_marketing_award
=
new
{
integral
=
new
{
title
=
Integral
>
0
?
"购买可得"
+
Integral
+
"积分"
:
""
}
},
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"
)
:
""
},
marketingLogo
=
model
.
MarketingLogo
,
cats
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
CategoryId
,
x
.
CategoryName
})
//分类
},
delivery
=
""
};
#
endregion
#
endregion
}
#
endregion
#
region
站点配置
/// <summary>
...
...
Mall.WebApi/Controllers/Product/AppletGuideCarController.cs
View file @
2641c431
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Extend.GuideCar
;
using
Mall.Module.Product
;
using
Mall.WebApi.Filter
;
...
...
@@ -10,6 +11,7 @@ using Microsoft.AspNetCore.Cors;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.Product
{
...
...
@@ -22,6 +24,38 @@ namespace Mall.WebApi.Controllers.Product
{
private
readonly
GuideCarModule
guideCarModule
=
new
GuideCarModule
();
#
region
商品详情
/// <summary>
/// 获取小程序商品详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletSDGoodsInfo
(
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
);
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
int
UserId
=
req
.
UserId
;
var
Robj
=
guideCarModule
.
GetAppletGoodsInfo_V2
(
GoodsId
,
UserId
,
req
.
SmallShopsId
,
req
.
TenantId
,
req
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
#
endregion
#
region
订单信息
#
endregion
/// <summary>
/// 获取详情
/// </summary>
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
2641c431
...
...
@@ -352,7 +352,7 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
CarBuyYear
,
model
?.
CarType
,
CarTypeName
=
model
?.
CarType
.
GetEnumName
(),
model
?.
Use
r
Day
,
model
?.
UseDay
,
model
?.
LineName
,
model
?.
LineDescriptionList
,
model
?.
IsSpell
,
...
...
@@ -437,7 +437,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
if
(
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
SQ
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
ZB
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
Line
)
{
if
((
demodel
.
Use
r
Day
??
0
)
<=
0
)
if
((
demodel
.
UseDay
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入使用时间"
);
}
...
...
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