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
818850ce
Commit
818850ce
authored
Aug 05, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单品包邮
parent
80f3c96f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
194 additions
and
178 deletions
+194
-178
RB_Goods_OrderDetail_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
+4
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+190
-178
No files found.
Mall.Model/Extend/Product/RB_Goods_OrderDetail_Extend.cs
View file @
818850ce
...
...
@@ -103,6 +103,10 @@ namespace Mall.Model.Extend.Product
/// 佣金金额
/// </summary>
public
decimal
CommissionPrice
{
get
;
set
;
}
/// <summary>
/// 正常商品金额
/// </summary>
public
decimal
NorGoodsMoney
{
get
;
set
;
}
/// <summary>
/// 积分赠送
...
...
Mall.Module.Product/OrderModule.cs
View file @
818850ce
...
...
@@ -1400,6 +1400,8 @@ namespace Mall.Module.Product
item
.
Final_Price
=
gmodel
.
MemberPrice
*
(
item
.
Number
??
0
);
item
.
NorGoodsMoney
=
item
.
Final_Price
??
0
;
//计算运费用
#
region
积分
if
(
umodel
.
Integral
>
0
&&
gmodel
.
PointsDeduction
>
0
&&
integralModel
.
IntegralNum
>
0
)
{
...
...
@@ -1556,95 +1558,6 @@ namespace Mall.Module.Product
}
#
endregion
#
region
运费
decimal
Express
=
0
;
if
(
defModel
.
Id
>
0
&&
demodel
.
DeliveryMethod
==
OrderDeliveryMethodEnum
.
ExpressDistribution
)
{
if
(!((
gmodel
.
FullNumPinkage
>
0
&&
item
.
Number
>=
gmodel
.
FullNumPinkage
)
||
(
gmodel
.
FullMoneyPinkage
>
0
&&
item
.
Final_Price
>=
gmodel
.
FullMoneyPinkage
)))
{
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
Total_integral_price
+=
(
item
.
IntegralMoney
??
0
);
Total_use_integral
+=
(
item
.
IntegralNumber
??
0
);
TotalGoodsMoney
+=
item
.
Final_Price
??
0
;
...
...
@@ -1653,8 +1566,7 @@ namespace Mall.Module.Product
item
.
Unit_Price
=
gmodel
.
SellingPrice
??
0
;
item
.
Original_Price
=
gmodel
.
OriginalPrice
??
0
;
item
.
MemberPrice
=
gmodel
.
MemberPrice
;
item
.
GoodsWeight
=
GoodsWeight
;
item
.
Express
=
Express
;
item
.
GoodsWeight
=
GoodsWeight
;
item
.
IntegralMoney
=
integral_price
;
item
.
IntegralNumber
=
use_integral
;
item
.
Attr_list
=
attr_list
;
...
...
@@ -1744,6 +1656,99 @@ namespace Mall.Module.Product
TotalGoodsMoney
-=
couponMoney
;
//总价格需减去优惠券金额
}
#
region
运费
decimal
Express
=
0
;
if
(
defModel
.
Id
>
0
&&
demodel
.
DeliveryMethod
==
OrderDeliveryMethodEnum
.
ExpressDistribution
)
{
//计算总和
int
exNum
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
Sum
(
x
=>
x
.
Number
??
0
);
decimal
exMoney
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
Sum
(
x
=>
x
.
NorGoodsMoney
);
if
(!((
gmodel
.
FullNumPinkage
>
0
&&
exNum
>=
gmodel
.
FullNumPinkage
)
||
(
gmodel
.
FullMoneyPinkage
>
0
&&
exMoney
>=
gmodel
.
FullMoneyPinkage
)))
{
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
)
*
(
item
.
GoodsWeight
??
0
);
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
;
item
.
Express
=
Express
;
#
endregion
var
areaGoods
=
AreaList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
();
bool
address_disabled
=
false
;
if
(
demodel
.
DeliveryMethod
!=
OrderDeliveryMethodEnum
.
VerificationShop
)
...
...
@@ -2414,95 +2419,10 @@ namespace Mall.Module.Product
item
.
Final_Price
=
(
gmodel
.
SellingPrice
??
0
)
*
(
item
.
Number
??
0
);
}
#
endregion
#
region
运费
decimal
Express
=
0
;
if
(
demodel
.
DeliveryMethod
==
OrderDeliveryMethodEnum
.
ExpressDistribution
)
{
if
(!((
gmodel
.
FullNumPinkage
>
0
&&
item
.
Number
>=
gmodel
.
FullNumPinkage
)
||
(
gmodel
.
FullMoneyPinkage
>
0
&&
item
.
Final_Price
>=
gmodel
.
FullMoneyPinkage
)))
{
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
;
#
endregion
item
.
NorGoodsMoney
=
item
.
Final_Price
??
0
;
//用于计算 运费的 202-08-05 ld
item
.
GoodsWeight
=
GoodsWeight
;
item
.
FreightMoney
=
Express
;
item
.
Unit_Price
=
gmodel
.
SellingPrice
??
0
;
item
.
Original_Price
=
(
item
.
Unit_Price
)
*
(
item
.
Number
);
...
...
@@ -2735,6 +2655,98 @@ namespace Mall.Module.Product
TotalMoney
-=
(
item
.
CouponMoney
??
0
);
//总价格需减去优惠券金额
item
.
Final_Price
-=
(
item
.
CouponMoney
??
0
);
}
#
region
运费
decimal
Express
=
0
;
if
(
demodel
.
DeliveryMethod
==
OrderDeliveryMethodEnum
.
ExpressDistribution
)
{
//计算总和
int
exNum
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
Sum
(
x
=>
x
.
Number
??
0
);
decimal
exMoney
=
demodel
.
DetailList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
Sum
(
x
=>
x
.
NorGoodsMoney
);
if
(!((
gmodel
.
FullNumPinkage
>
0
&&
exNum
>=
gmodel
.
FullNumPinkage
)
||
(
gmodel
.
FullMoneyPinkage
>
0
&&
exMoney
>=
gmodel
.
FullMoneyPinkage
)))
{
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
)
*
(
item
.
GoodsWeight
??
0
);
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
;
#
endregion
item
.
FreightMoney
=
Express
;
}
}
if
(
demodel
.
FreightMoney
!=
TotalExpress
)
...
...
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