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
8fc11fff
Commit
8fc11fff
authored
Aug 18, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
af4e004f
82fae002
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
38 deletions
+52
-38
GroupBuyActivityModule.cs
Mall.Module.Product/GroupBuyActivityModule.cs
+52
-38
No files found.
Mall.Module.Product/GroupBuyActivityModule.cs
View file @
8fc11fff
...
...
@@ -358,8 +358,8 @@ namespace Mall.Module.Product
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
.
Sort
,
SVName
=
svmodel
.
Name
SVId
=
svmodel
?.
Sort
??
0
,
SVName
=
svmodel
?.
Name
??
""
,
});
}
}
...
...
@@ -461,11 +461,11 @@ namespace Mall.Module.Product
{
isChange
=
true
;
//删除规格
groupbuy_Activity_SpecificationRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_Activity_SpecificationRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
),
extModel
.
GoodId
));
//删除规格值
groupbuy_Activity_SpecificationValueRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_Activity_SpecificationValueRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
),
extModel
.
GoodId
));
//删除规格价格
groupbuy_Activity_SpecificationPriceRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_Activity_SpecificationPriceRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
//新增规格和规格值
foreach
(
var
specItem
in
extModel
.
SpecificationList
)
...
...
@@ -545,15 +545,15 @@ namespace Mall.Module.Product
var
supmodel
=
extModel
.
SpecificationList
.
Where
(
x
=>
x
.
Id
==
item
.
Id
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_G
oods_Specification
.
EnabledImage
),
supmodel
.
EnabledImage
},
{
nameof
(
RB_G
oods_Specification
.
Name
),
supmodel
.
Name
},
{
nameof
(
RB_G
oods_Specification
.
Sort
),
supmodel
.
Sort
}
{
nameof
(
RB_G
roupbuy_Activity_Specification_Extend
.
EnabledImage
),
supmodel
.
EnabledImage
},
{
nameof
(
RB_G
roupbuy_Activity_Specification_Extend
.
Name
),
supmodel
.
Name
},
{
nameof
(
RB_G
roupbuy_Activity_Specification_Extend
.
Sort
),
supmodel
.
Sort
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_G
oods_Specification
.
Id
),
FiledName
=
nameof
(
RB_G
roupbuy_Activity_Specification_Extend
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
...
...
@@ -590,15 +590,15 @@ namespace Mall.Module.Product
var
supModel1
=
supmodel
.
SpecificationValueList
.
Where
(
x
=>
x
.
Id
==
qitem
.
Id
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_G
oods_SpecificationValue
.
Image
),
supModel1
.
Image
},
{
nameof
(
RB_G
oods_SpecificationValue
.
Name
),
supModel1
.
Name
},
{
nameof
(
RB_G
oods_SpecificationValue
.
Sort
),
supModel1
.
Sort
}
{
nameof
(
RB_G
roupbuy_Activity_Specificationvalue_Extend
.
Image
),
supModel1
.
Image
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationvalue_Extend
.
Name
),
supModel1
.
Name
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationvalue_Extend
.
Sort
),
supModel1
.
Sort
}
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_G
oods_Specification
.
Id
),
FiledName
=
nameof
(
RB_G
roupbuy_Activity_Specificationvalue_Extend
.
Id
),
FiledValue
=
qitem
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
...
...
@@ -614,7 +614,7 @@ namespace Mall.Module.Product
{
isChange
=
true
;
//删除规格价格
groupbuy_Activity_SpecificationPriceRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_Activity_SpecificationPriceRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
var
priceModel
=
new
RB_Groupbuy_Activity_Specificationprice_Extend
()
...
...
@@ -646,20 +646,20 @@ namespace Mall.Module.Product
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_G
oods_SpecificationPrice
.
SellingPrice
),
pupmodel
.
SellingPrice
},
{
nameof
(
RB_G
oods_SpecificationPrice
.
InventoryNum
),
pupmodel
.
InventoryNum
},
{
nameof
(
RB_G
oods_SpecificationPrice
.
GoodsWeight
),
pupmodel
.
GoodsWeight
},
{
nameof
(
RB_G
oods_SpecificationPrice
.
GoodsNumbers
),
pupmodel
.
GoodsNumbers
},
{
nameof
(
RB_G
oods_SpecificationPrice
.
Commission
),
pupmodel
.
Commission
},
{
nameof
(
RB_G
oods_SpecificationPrice
.
CostMoney
),
pupmodel
.
CostMoney
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
SellingPrice
),
pupmodel
.
SellingPrice
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
InventoryNum
),
pupmodel
.
InventoryNum
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
GoodsWeight
),
pupmodel
.
GoodsWeight
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
GoodsNumbers
),
pupmodel
.
GoodsNumbers
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
Commission
),
pupmodel
.
Commission
},
{
nameof
(
RB_G
roupbuy_Activity_Specificationprice_Extend
.
CostMoney
),
pupmodel
.
CostMoney
},
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Goods_SpecificationPrice
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
FiledName
=
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
groupbuy_Activity_SpecificationPriceRepository
.
Update
(
keyValues1
,
wheres1
);
...
...
@@ -684,10 +684,10 @@ namespace Mall.Module.Product
var
stepList
=
stepRepository
.
GetGroupBuyActivityListRepository
(
new
RB_Groupbuy_Activity_Step_Extend
()
{
GoodId
=
extModel
.
GoodId
,
MallBaseId
=
extModel
.
MallBaseId
,
TenantId
=
extModel
.
TenantId
});
if
(
isChange
||
(
stepList
.
Count
()
!=
extModel
.
GroupList
.
Count
()
||
stepList
.
Count
()
!=
extModel
.
GroupList
.
Where
(
qitem
=>
qitem
.
StepId
>
0
).
Count
()))
{
stepRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Extend
.
GoodId
),
extModel
.
GoodId
));
groupbuy_Activity_Step_PriceRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
),
extModel
.
GoodId
));
groupBuy_DistributioncommissionRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_MemberpriceRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
stepRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Extend
.
GoodId
),
extModel
.
GoodId
));
groupbuy_Activity_Step_PriceRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
),
extModel
.
GoodId
));
groupBuy_DistributioncommissionRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_MemberpriceRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
foreach
(
var
groupItem
in
extModel
.
GroupList
)
{
var
groupModel
=
new
RB_Groupbuy_Activity_Step_Extend
()
...
...
@@ -796,7 +796,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
PinTuanStock
),
subItem
.
PinTuanStock
},
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
SortNum
),
subItem
.
SortNum
},
};
flag
=
groupbuy_Activity_Step_PriceRepository
.
Update
(
stepPriceFileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
),
subItem
.
Id
));
flag
=
groupbuy_Activity_Step_PriceRepository
.
Update
(
stepPriceFileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
Id
),
subPriceModel
.
Id
));
}
//更新会员价
...
...
@@ -805,17 +805,32 @@ namespace Mall.Module.Product
foreach
(
var
childItem
in
subItem
.
GradeMemberPriceList
)
{
var
memberPriceModel
=
memberPriceList
.
Where
(
qitem
=>
qitem
.
StepId
==
item
.
StepId
&&
qitem
.
SpecificationSort
==
subItem
.
SpecificationSort
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
memberPriceFileds
=
new
Dictionary
<
string
,
object
>(
)
if
(
memberPriceModel
!=
null
)
{
{
nameof
(
RB_Groupbuy_Memberprice_Extend
.
MemberGrade
),
childItem
.
MemberGrade
},
{
nameof
(
RB_Groupbuy_Memberprice_Extend
.
MemberPrice
),
childItem
.
MemberPrice
},
};
flag
=
groupbuy_MemberpriceRepository
.
Update
(
memberPriceFileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
),
childItem
.
Id
));
Dictionary
<
string
,
object
>
memberPriceFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Groupbuy_Memberprice_Extend
.
MemberGrade
),
childItem
.
MemberGrade
},
{
nameof
(
RB_Groupbuy_Memberprice_Extend
.
MemberPrice
),
childItem
.
MemberPrice
},
};
flag
=
groupbuy_MemberpriceRepository
.
Update
(
memberPriceFileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
.
Id
),
memberPriceModel
.
Id
));
}
else
{
childItem
.
SpecificationSort
=
subItem
.
SpecificationSort
;
childItem
.
GoodsId
=
extModel
.
GoodId
;
childItem
.
Status
=
0
;
childItem
.
TenantId
=
extModel
.
TenantId
;
childItem
.
MallBaseId
=
extModel
.
MallBaseId
;
childItem
.
StepId
=
item
.
StepId
;
childItem
.
CreateDate
=
DateTime
.
Now
;
childItem
.
UpdateDate
=
DateTime
.
Now
;
flag
=
groupbuy_MemberpriceRepository
.
Insert
(
childItem
)
>
0
;
}
}
}
if
(
oldSeparateDistributionType
!=
extModel
.
SeparateDistributionType
)
{
groupbuy_MemberpriceRepository
.
Delete
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
groupbuy_MemberpriceRepository
.
Delete
One
(
new
WhereHelper
(
nameof
(
RB_Groupbuy_Memberprice_Extend
.
GoodsId
),
extModel
.
GoodId
));
//设置分销佣金
SetDistributioncommissionModule
(
extModel
,
stepModel
,
item
.
StepId
,
isCreate
:
true
);
}
...
...
@@ -940,12 +955,11 @@ namespace Mall.Module.Product
foreach
(
var
childItem
in
subItem
.
GradeCommissionList
)
{
var
oldModel
=
distributionList
.
Where
(
qitem
=>
qitem
.
StepId
==
childItem
.
StepId
&&
qitem
.
SpecificationSort
==
subItem
.
SpecificationSort
&&
qitem
.
DistributorGrade
==
childItem
.
DistributorGrade
).
FirstOrDefault
();
var
defaultModel
=
groupItem
.
DistributioncommissionList
.
Where
(
qitem
=>
qitem
.
StepId
==
childItem
.
StepId
&&
qitem
.
SpecificationSort
==
subItem
.
SpecificationSort
&&
qitem
.
DistributorGrade
==
childItem
.
DistributorGrade
).
FirstOrDefault
();
Dictionary
<
string
,
object
>
comFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
OneCommission
),
defaultModel
.
OneCommission
},
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
TwoCommission
),
defaultModel
.
TwoCommission
},
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
ThreeCommission
),
defaultModel
.
ThreeCommission
},
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
OneCommission
),
childItem
.
OneCommission
},
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
TwoCommission
),
childItem
.
TwoCommission
},
{
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
ThreeCommission
),
childItem
.
ThreeCommission
},
};
flag
=
groupBuy_DistributioncommissionRepository
.
Update
(
comFileds
,
new
WhereHelper
(
nameof
(
RB_GroupBuy_Distributioncommission_Extend
.
Id
),
oldModel
.
Id
));
}
...
...
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