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
a04a38fb
Commit
a04a38fb
authored
Aug 12, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
8a298d62
253f1731
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
495 additions
and
208 deletions
+495
-208
RB_Groupbuy_Activity_Specificationprice.cs
...Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
+9
-0
RB_Groupbuy_Activity_Step_Price.cs
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Step_Price.cs
+50
-0
RB_Groupbuy_Activity_Step_Extend.cs
....Model/Extend/Product/RB_Groupbuy_Activity_Step_Extend.cs
+11
-3
RB_Groupbuy_Activity_Step_Price_Extend.cs
.../Extend/Product/RB_Groupbuy_Activity_Step_Price_Extend.cs
+20
-0
GroupBuyActivityModule.cs
Mall.Module.Product/GroupBuyActivityModule.cs
+170
-73
SmallShopsModule.cs
Mall.Module.User/SmallShopsModule.cs
+3
-3
RB_Groupbuy_ActivityRepository.cs
Mall.Repository/Product/RB_Groupbuy_ActivityRepository.cs
+23
-124
RB_Groupbuy_Activity_SpecificationRepository.cs
...y/Product/RB_Groupbuy_Activity_SpecificationRepository.cs
+131
-0
RB_Groupbuy_Activity_Step_PriceRepository.cs
...tory/Product/RB_Groupbuy_Activity_Step_PriceRepository.cs
+47
-0
RB_SmallShops_PriceRepository.cs
Mall.Repository/User/RB_SmallShops_PriceRepository.cs
+2
-2
GroupBuyController.cs
Mall.WebApi/Controllers/Product/GroupBuyController.cs
+29
-3
No files found.
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
View file @
a04a38fb
...
@@ -139,5 +139,14 @@ namespace Mall.Model.Entity.Product
...
@@ -139,5 +139,14 @@ namespace Mall.Model.Entity.Product
set
;
set
;
}
}
/// <summary>
/// 规格Id
/// </summary>
public
int
SpecificationId
{
get
;
set
;
}
/// <summary>
/// 规格值Id
/// </summary>
public
int
SpecificationValueId
{
get
;
set
;
}
}
}
}
}
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Step_Price.cs
0 → 100644
View file @
a04a38fb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 拼团价格实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 阶梯编号
/// </summary>
public
int
StepId
{
get
;
set
;
}
/// <summary>
/// 商品编号
/// </summary>
public
int
GoodId
{
get
;
set
;
}
/// <summary>
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序编号
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 拼团价格
/// </summary>
public
decimal
PinTuanPrice
{
get
;
set
;
}
/// <summary>
/// 拼团库存
/// </summary>
public
int
PinTuanStock
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Step_Extend.cs
View file @
a04a38fb
using
System
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.Product
namespace
Mall.Model.Entity.Product
{
{
/// <summary>
/// <summary>
...
@@ -8,11 +11,16 @@ namespace Mall.Model.Entity.Product
...
@@ -8,11 +11,16 @@ namespace Mall.Model.Entity.Product
/// </summary>
/// </summary>
[
Serializable
]
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Extend
:
RB_Groupbuy_Activity_Step
public
class
RB_Groupbuy_Activity_Step_Extend
:
RB_Groupbuy_Activity_Step
{
{
/// <summary>
/// <summary>
/// 商品编号
/// 商品编号
/// </summary>
/// </summary>
public
string
GoodIds
{
get
;
set
;
}
public
string
GoodIds
{
get
;
set
;
}
/// <summary>
/// 阶梯价格列表
/// </summary>
public
List
<
RB_Groupbuy_Activity_Step_Price_Extend
>
StepPriceList
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Step_Price_Extend.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 拼团价格扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Groupbuy_Activity_Step_Price_Extend
:
RB_Groupbuy_Activity_Step_Price
{
/// <summary>
/// 商品编号
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Module.Product/GroupBuy
Config
ActivityModule.cs
→
Mall.Module.Product/GroupBuyActivityModule.cs
View file @
a04a38fb
...
@@ -5,13 +5,14 @@ using VT.FW.DB;
...
@@ -5,13 +5,14 @@ using VT.FW.DB;
using
System.Linq
;
using
System.Linq
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Product
;
using
Mall.AOP.CustomerAttribute
;
using
Mall.AOP.CustomerAttribute
;
using
System
;
namespace
Mall.Module.Product
namespace
Mall.Module.Product
{
{
/// <summary>
/// <summary>
/// 拼团活动处理类
/// 拼团活动处理类
/// </summary>
/// </summary>
public
class
GroupBuy
Config
ActivityModule
public
class
GroupBuyActivityModule
{
{
/// <summary>
/// <summary>
/// 拼团活动仓储层对象
/// 拼团活动仓储层对象
...
@@ -38,6 +39,21 @@ namespace Mall.Module.Product
...
@@ -38,6 +39,21 @@ namespace Mall.Module.Product
/// </summary>
/// </summary>
private
RB_Groupbuy_Activity_StepRepository
stepRepository
=
new
RB_Groupbuy_Activity_StepRepository
();
private
RB_Groupbuy_Activity_StepRepository
stepRepository
=
new
RB_Groupbuy_Activity_StepRepository
();
/// <summary>
/// 拼团活动商品阶梯价格仓储层对象
/// </summary>
private
RB_Groupbuy_Activity_Step_PriceRepository
groupbuy_Activity_Step_PriceRepository
=
new
RB_Groupbuy_Activity_Step_PriceRepository
();
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Step_Price_Extend
>
GetGroupbuyActivitySpecificationpriceListModule
(
RB_Groupbuy_Activity_Step_Price_Extend
query
)
{
return
groupbuy_Activity_Step_PriceRepository
.
GetGroupbuyActivitySpecificationpriceListRepository
(
query
);
}
/// <summary>
/// <summary>
/// 获取拼团活动阶梯价列表
/// 获取拼团活动阶梯价列表
/// </summary>
/// </summary>
...
@@ -93,20 +109,20 @@ namespace Mall.Module.Product
...
@@ -93,20 +109,20 @@ namespace Mall.Module.Product
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ActivityId
));
string
Ids
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
ActivityId
));
List
<
RB_Groupbuy_Activity_Step_Extend
>
groupList
=
new
List
<
RB_Groupbuy_Activity_Step_Extend
>();
//
List<RB_Groupbuy_Activity_Step_Extend> groupList = new List<RB_Groupbuy_Activity_Step_Extend>();
if
(!
string
.
IsNullOrEmpty
(
Ids
))
//
if (!string.IsNullOrEmpty(Ids))
{
//
{
groupList
=
GetGroupBuyActivityListModule
(
new
RB_Groupbuy_Activity_Step_Extend
()
// groupList
= GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
{
//
{
MallBaseId
=
query
.
MallBaseId
,
//
MallBaseId = query.MallBaseId,
TenantId
=
query
.
TenantId
,
//
TenantId = query.TenantId,
GoodIds
=
Ids
//
GoodIds = Ids
});
//
});
}
//
}
foreach
(
var
item
in
list
)
//
foreach (var item in list)
{
//
{
item
.
GroupList
=
groupList
?.
Where
(
qitem
=>
qitem
.
GoodId
==
item
.
GoodId
)?.
ToList
()
??
new
List
<
RB_Groupbuy_Activity_Step_Extend
>();
//
item.GroupList = groupList?.Where(qitem => qitem.GoodId == item.GoodId)?.ToList() ?? new List<RB_Groupbuy_Activity_Step_Extend>();
}
//
}
}
}
return
list
;
return
list
;
}
}
...
@@ -124,6 +140,10 @@ namespace Mall.Module.Product
...
@@ -124,6 +140,10 @@ namespace Mall.Module.Product
{
{
extModel
=
new
RB_Groupbuy_Activity_Extend
();
extModel
=
new
RB_Groupbuy_Activity_Extend
();
}
}
if
(!
string
.
IsNullOrWhiteSpace
(
extModel
.
GoodsService
))
{
extModel
.
ServiceList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_ImageCommonModel
>>(
extModel
.
GoodsService
);
}
if
(
isGetSpec
)
if
(
isGetSpec
)
{
{
//获取规格列表
//获取规格列表
...
@@ -148,24 +168,46 @@ namespace Mall.Module.Product
...
@@ -148,24 +168,46 @@ namespace Mall.Module.Product
item
.
SpecificationValueList
=
specificationvalueList
?.
Where
(
qitem
=>
qitem
.
SpecificationId
==
item
.
Id
)?.
ToList
()
??
new
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>();
item
.
SpecificationValueList
=
specificationvalueList
?.
Where
(
qitem
=>
qitem
.
SpecificationId
==
item
.
Id
)?.
ToList
()
??
new
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>();
}
}
}
}
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
specPriceList
=
GetGroupbuyActivitySpecificationpriceListModule
(
new
RB_Groupbuy_Activity_Specificationprice_Extend
()
//拼团价格列表
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
specificationpriceList
=
GetGroupbuyActivitySpecificationpriceListModule
(
new
RB_Groupbuy_Activity_Specificationprice_Extend
()
{
{
MallBaseId
=
query
.
MallBaseId
,
MallBaseId
=
query
.
MallBaseId
,
TenantId
=
query
.
TenantId
,
TenantId
=
query
.
TenantId
,
GoodsId
=
extModel
.
GoodId
,
GoodsId
=
extModel
.
GoodId
,
});
});
//拼团阶梯价格列表
if
(
specPriceList
!=
null
&&
specPriceList
.
Count
>
0
)
List
<
RB_Groupbuy_Activity_Step_Extend
>
groupStepList
=
GetGroupBuyActivityListModule
(
new
RB_Groupbuy_Activity_Step_Extend
()
{
{
MallBaseId
=
query
.
MallBaseId
,
foreach
(
var
item
in
specPriceList
)
TenantId
=
query
.
TenantId
,
{
GoodId
=
extModel
.
GoodId
,
List
<
object
>
AttrList
=
new
List
<
object
>();
});
var
smodel
=
specificationList
?.
Where
(
qitem
=>
qitem
.
Id
==
item
.
SpecificationId
)?.
FirstOrDefault
()
??
new
RB_Groupbuy_Activity_Specification_Extend
();
var
svmodel
=
specificationvalueList
.
Where
(
qitem
=>
qitem
.
Id
==
item
.
SpecificationValueId
)?.
FirstOrDefault
()
??
new
RB_Groupbuy_Activity_Specificationvalue_Extend
();
AttrList
.
Add
(
new
{
SName
=
smodel
.
Name
,
SId
=
smodel
.
Id
,
SVId
=
svmodel
.
Sort
,
SVName
=
svmodel
.
Name
});
item
.
AttrList
=
AttrList
;
}
}
////拼团价格列表
//List<RB_Groupbuy_Activity_Specificationprice_Extend> specificationpriceList = GetGroupbuyActivitySpecificationpriceListModule(new RB_Groupbuy_Activity_Specificationprice_Extend()
//{
// MallBaseId = query.MallBaseId,
// TenantId = query.TenantId,
// GoodsId = extModel.GoodId,
//});
////拼团阶梯价格列表
//List<RB_Groupbuy_Activity_Step_Extend> groupStepList = GetGroupBuyActivityListModule(new RB_Groupbuy_Activity_Step_Extend()
//{
// MallBaseId = query.MallBaseId,
// TenantId = query.TenantId,
// GoodId = extModel.GoodId,
//});
extModel
.
SpecificationList
=
specificationList
;
extModel
.
SpecificationList
=
specificationList
;
extModel
.
SpecificationPriceList
=
spec
ificationp
riceList
;
extModel
.
SpecificationPriceList
=
spec
P
riceList
;
extModel
.
GroupList
=
groupStepList
;
//
extModel.GroupList = groupStepList;
}
}
return
extModel
;
return
extModel
;
}
}
...
@@ -228,11 +270,10 @@ namespace Mall.Module.Product
...
@@ -228,11 +270,10 @@ namespace Mall.Module.Product
}
}
if
(
flag
)
if
(
flag
)
{
{
flag
=
SetGoodsSpecificationModule
(
extModel
);
flag
=
SetGoodsSpecificationModule
(
extModel
);
flag
=
SetGoodGroupStepModule
(
extModel
);
//flag
= SetGoodGroupStepModule(extModel);
}
}
flag
=
false
;
return
flag
;
return
flag
;
}
}
...
@@ -246,56 +287,78 @@ namespace Mall.Module.Product
...
@@ -246,56 +287,78 @@ namespace Mall.Module.Product
bool
flag
=
false
;
bool
flag
=
false
;
if
(
extModel
.
IsCustomSpecification
==
1
)
if
(
extModel
.
IsCustomSpecification
==
1
)
{
{
var
oldSpecList
=
GetGroupbuyActivitySpecificationListModule
(
new
RB_Groupbuy_Activity_Specification_Extend
()
foreach
(
var
specItem
in
extModel
.
SpecificationList
)
{
MallBaseId
=
extModel
.
MallBaseId
,
TenantId
=
extModel
.
TenantId
,
GoodsId
=
extModel
.
GoodId
,
});
if
(
oldSpecList
.
Count
()
!=
extModel
.
SpecificationList
.
Count
()
||
oldSpecList
.
Count
()
!=
extModel
.
SpecificationList
.
Where
(
x
=>
x
.
Id
>
0
).
Count
())
{
{
//删除规格
specItem
.
TenantId
=
extModel
.
TenantId
;
IList
<
WhereHelper
>
specWheres
=
new
List
<
WhereHelper
>()
specItem
.
MallBaseId
=
extModel
.
MallBaseId
;
{
specItem
.
GoodsId
=
extModel
.
GoodId
;
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
),
extModel
.
TenantId
),
specItem
.
Status
=
0
;
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
specItem
.
CreateDate
=
DateTime
.
Now
;
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
),
extModel
.
GoodId
),
if
(
specItem
.
Id
>
0
)
};
groupbuy_Activity_SpecificationRepository
.
Delete
(
specWheres
);
//删除值
IList
<
WhereHelper
>
specValuesWheres
=
new
List
<
WhereHelper
>()
{
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
),
extModel
.
TenantId
),
flag
=
groupbuy_Activity_SpecificationRepository
.
Update
(
specItem
);
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
}
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
),
extModel
.
GoodId
),
else
};
groupbuy_Activity_SpecificationValueRepository
.
Delete
(
specValuesWheres
);
foreach
(
var
specItem
in
extModel
.
SpecificationList
)
{
{
specItem
.
TenantId
=
extModel
.
TenantId
;
specItem
.
MallBaseId
=
extModel
.
MallBaseId
;
specItem
.
GoodsId
=
extModel
.
GoodId
;
var
newSpecId
=
groupbuy_Activity_SpecificationRepository
.
Insert
(
specItem
);
var
newSpecId
=
groupbuy_Activity_SpecificationRepository
.
Insert
(
specItem
);
specItem
.
Id
=
newSpecId
;
specItem
.
Id
=
newSpecId
;
if
(
specItem
.
SpecificationValueList
!=
null
&&
specItem
.
SpecificationValueList
.
Count
>
0
)
flag
=
newSpecId
>
0
;
}
if
(
specItem
.
SpecificationValueList
!=
null
&&
specItem
.
SpecificationValueList
.
Count
>
0
)
{
foreach
(
var
specValueItem
in
specItem
.
SpecificationValueList
)
{
{
foreach
(
var
specValueItem
in
specItem
.
SpecificationValueList
)
specValueItem
.
MallBaseId
=
extModel
.
MallBaseId
;
specValueItem
.
TenantId
=
extModel
.
TenantId
;
specValueItem
.
SpecificationId
=
specItem
.
Id
;
specValueItem
.
GoodsId
=
extModel
.
GoodId
;
specValueItem
.
CreateDate
=
DateTime
.
Now
;
specValueItem
.
Status
=
0
;
if
(
specValueItem
.
Id
>
0
)
{
flag
=
groupbuy_Activity_SpecificationValueRepository
.
Update
(
specValueItem
);
}
else
{
{
specValueItem
.
MallBaseId
=
extModel
.
MallBaseId
;
var
specValueId
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
);
specValueItem
.
TenantId
=
extModel
.
TenantId
;
specValueItem
.
Id
=
specValueId
;
specValueItem
.
SpecificationId
=
newSpecId
;
flag
=
specValueId
>
0
;
specValueItem
.
GoodsId
=
extModel
.
GoodId
;
flag
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
)
>
0
;
}
}
}
}
}
}
}
}
else
{
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
priceItem
.
TenantId
=
extModel
.
TenantId
;
priceItem
.
GoodsId
=
extModel
.
GoodId
;
priceItem
.
Status
=
0
;
priceItem
.
CreateDate
=
DateTime
.
Now
;
priceItem
.
UpdateDate
=
DateTime
.
Now
;
var
specArray
=
priceItem
.
SpecificationSort
.
Split
(
":"
);
if
(
specArray
!=
null
&&
specArray
.
Length
>
0
)
{
int
.
TryParse
(
specArray
[
0
],
out
int
specIndex
);
int
specValueIndex
=
1
;
if
(
specArray
.
Length
==
2
)
{
int
.
TryParse
(
specArray
[
1
],
out
specValueIndex
);
}
priceItem
.
SpecificationId
=
extModel
?.
SpecificationList
[
specIndex
-
1
]?.
Id
??
0
;
priceItem
.
SpecificationValueId
=
extModel
?.
SpecificationList
[
specIndex
-
1
]?.
SpecificationValueList
[
specValueIndex
-
1
]?.
Id
??
0
;
}
if
(
priceItem
.
Id
>
0
)
{
flag
=
groupbuy_Activity_SpecificationPriceRepository
.
Update
(
priceItem
);
}
else
{
flag
=
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
)>
0
;
}
}
}
}
}
return
flag
;
return
flag
;
}
}
...
@@ -319,18 +382,52 @@ namespace Mall.Module.Product
...
@@ -319,18 +382,52 @@ namespace Mall.Module.Product
flag
=
newGroupId
>
0
;
flag
=
newGroupId
>
0
;
if
(
newGroupId
>
0
)
if
(
newGroupId
>
0
)
{
{
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
if
(
groupItem
.
StepPriceList
!=
null
&&
groupItem
.
StepPriceList
.
Count
>
0
)
{
{
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
//添加会员价格
priceItem
.
TenantId
=
extModel
.
TenantId
;
foreach
(
var
subItem
in
groupItem
.
StepPriceList
)
priceItem
.
GoodsId
=
extModel
.
GoodId
;
{
//priceItem.StepId = newGroupId;
subItem
.
MallBaseId
=
extModel
.
MallBaseId
;
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
);
subItem
.
TenantId
=
extModel
.
TenantId
;
subItem
.
GoodId
=
extModel
.
GoodId
;
var
stepPriceId
=
groupbuy_Activity_Step_PriceRepository
.
Insert
(
subItem
);
}
}
}
}
}
}
}
}
}
return
flag
;
return
flag
;
}
}
/// <summary>
/// 根据编号删除活动商品规格
/// </summary>
/// <returns></returns>
public
bool
RemoveGroupBuySpecificationModule
(
object
Id
)
{
//根据商品规格删除商品价格
List
<
WhereHelper
>
specValues
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
SpecificationId
),
Id
)
};
groupbuy_Activity_SpecificationPriceRepository
.
Delete
(
specValues
);
return
groupbuy_Activity_SpecificationPriceRepository
.
Delete
(
Id
)>
0
;
}
/// <summary>
/// 根据编号删除活动商品规格值
/// </summary>
/// <returns></returns>
public
bool
RemoveGroupBuySpecificationValueModule
(
object
Id
)
{
//根据规格值删除价格
List
<
WhereHelper
>
specValues
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
SpecificationValueId
),
Id
)
};
groupbuy_Activity_SpecificationPriceRepository
.
Delete
(
specValues
);
return
groupbuy_Activity_SpecificationValueRepository
.
Delete
(
Id
)
>
0
;
}
}
}
}
}
Mall.Module.User/SmallShopsModule.cs
View file @
a04a38fb
...
@@ -248,9 +248,9 @@ namespace Mall.Module.User
...
@@ -248,9 +248,9 @@ namespace Mall.Module.User
{
{
//查询出所有商品id
//查询出所有商品id
string
goodsIds
=
string
.
Join
(
","
,
goodsList
.
Select
(
x
=>
x
.
GoodsId
??
0
).
Distinct
());
string
goodsIds
=
string
.
Join
(
","
,
goodsList
.
Select
(
x
=>
x
.
GoodsId
??
0
).
Distinct
());
var
glist
=
goodsRepository
.
GetSingleListForGoodsId
(
new
RB_Goods_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
glist
)
var
glist
=
goodsRepository
.
GetSingleList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
goodsIds
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
{
foreach
(
var
item
in
glist
)
{
item
.
CoverImage
=
""
;
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
{
...
...
Mall.Repository/Product/RB_Groupbuy_ActivityRepository.cs
View file @
a04a38fb
...
@@ -30,6 +30,14 @@ WHERE 1=1
...
@@ -30,6 +30,14 @@ WHERE 1=1
"
);
"
);
if
(
query
!=
null
)
if
(
query
!=
null
)
{
{
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
TenantId
),
query
.
TenantId
);
}
//时间范围
//时间范围
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
)
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
QEndDate
))
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
)
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
QEndDate
))
{
{
...
@@ -67,131 +75,22 @@ SELECT *
...
@@ -67,131 +75,22 @@ SELECT *
FROM RB_Groupbuy_Activity
FROM RB_Groupbuy_Activity
WHERE 1=1
WHERE 1=1
"
);
"
);
return
Get
<
RB_Groupbuy_Activity_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
if
(
query
!=
null
)
}
}
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationPriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationprice
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Specificationprice_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationprice where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationprice_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationValueRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationvalue
>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>
GetGroupbuyActivitySpecificationValueListRepository
(
RB_Groupbuy_Activity_Specificationvalue_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
SpecificationId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
SpecificationId
)}
=
{
dmodel
.
SpecificationId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationvalue where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specification
>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specification_Extend
>
GetGroupbuyActivitySpecificationListRepository
(
RB_Groupbuy_Activity_Specification_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
TenantId
),
query
.
TenantId
);
}
if
(
query
.
ActivityId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Groupbuy_Activity_Extend
.
ActivityId
),
query
.
ActivityId
);
}
}
}
return
Get
<
RB_Groupbuy_Activity_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
string
sql
=
$@"select * from rb_groupbuy_activity_specification where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specification_Extend
>(
sql
).
ToList
();
}
}
}
}
}
}
\ No newline at end of file
Mall.Repository/Product/RB_Groupbuy_Activity_SpecificationRepository.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 拼团商品关联规格价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationPriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationprice
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Specificationprice_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationprice_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationprice where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationprice_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团活动商品关联规格值仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationValueRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specificationvalue
>
{
/// <summary>
/// 获取拼团活动商品关联规格值列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>
GetGroupbuyActivitySpecificationValueListRepository
(
RB_Groupbuy_Activity_Specificationvalue_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
SpecificationId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
SpecificationId
)}
=
{
dmodel
.
SpecificationId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specificationvalue where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specificationvalue_Extend
>(
sql
).
ToList
();
}
}
/// <summary>
/// 拼团商品关联规格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_SpecificationRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Specification
>
{
/// <summary>
/// 获取拼团商品关联规格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Specification_Extend
>
GetGroupbuyActivitySpecificationListRepository
(
RB_Groupbuy_Activity_Specification_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from rb_groupbuy_activity_specification where
{
where
}
order by Id asc"
;
return
Get
<
RB_Groupbuy_Activity_Specification_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Groupbuy_Activity_Step_PriceRepository.cs
0 → 100644
View file @
a04a38fb
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 拼团活动商品阶梯价格仓储层
/// </summary>
public
class
RB_Groupbuy_Activity_Step_PriceRepository
:
BaseRepository
<
RB_Groupbuy_Activity_Step_Price
>
{
/// <summary>
/// 获取拼团活动商品规格价格列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Groupbuy_Activity_Step_Price_Extend
>
GetGroupbuyActivitySpecificationpriceListRepository
(
RB_Groupbuy_Activity_Step_Price_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
)}
=
{
dmodel
.
GoodId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Groupbuy_Activity_Step_Price_Extend
.
GoodId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from RB_Groupbuy_Activity_Step_Price where
{
where
}
order by Id desc"
;
return
Get
<
RB_Groupbuy_Activity_Step_Price_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_SmallShops_PriceRepository.cs
View file @
a04a38fb
...
@@ -41,7 +41,7 @@ namespace Mall.Repository.User
...
@@ -41,7 +41,7 @@ namespace Mall.Repository.User
}
}
string
sql
=
$@"select di.* from RB_SmallShops_Price
_Extend
di
string
sql
=
$@"select di.* from RB_SmallShops_Price di
where
{
where
}
order by di.Id desc"
;
where
{
where
}
order by di.Id desc"
;
return
Get
<
RB_SmallShops_Price_Extend
>(
sql
).
ToList
();
return
Get
<
RB_SmallShops_Price_Extend
>(
sql
).
ToList
();
}
}
...
@@ -77,7 +77,7 @@ where {where} order by di.Id desc";
...
@@ -77,7 +77,7 @@ where {where} order by di.Id desc";
string
sql
=
$@"
string
sql
=
$@"
SELECT sp.GoodsId FROM rb_smallshops_price sp
SELECT sp.GoodsId FROM rb_smallshops_price sp
INNER JOIN rb_goods g on sp.GoodsId=g.Id
INNER JOIN rb_goods g on sp.GoodsId=g.Id
{
where
}
where
{
where
}
GROUP BY sp.GoodsId ORDER BY sp.CreateDate DESC
GROUP BY sp.GoodsId ORDER BY sp.CreateDate DESC
"
;
"
;
return
GetPage
<
RB_SmallShops_Price_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
return
GetPage
<
RB_SmallShops_Price_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
...
...
Mall.WebApi/Controllers/Product/GroupBuyController.cs
View file @
a04a38fb
...
@@ -4,6 +4,7 @@ using System.Linq;
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Mall.AOP
;
using
Mall.AOP
;
using
Mall.Common.API
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Extend.User
;
using
Mall.Module.Product
;
using
Mall.Module.Product
;
...
@@ -12,6 +13,7 @@ using Mall.WebApi.Filter;
...
@@ -12,6 +13,7 @@ using Mall.WebApi.Filter;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.Product
namespace
Mall.WebApi.Controllers.Product
{
{
...
@@ -24,14 +26,14 @@ namespace Mall.WebApi.Controllers.Product
...
@@ -24,14 +26,14 @@ namespace Mall.WebApi.Controllers.Product
/// <summary>
/// <summary>
/// 拼团配置处理类对象
/// 拼团配置处理类对象
/// </summary>
/// </summary>
private
readonly
GroupBuyConfigModule
groupBuyConfigModule
=
new
GroupBuyConfigModule
();
private
readonly
Module
.
User
.
GroupBuyConfigModule
groupBuyConfigModule
=
new
Module
.
User
.
GroupBuyConfigModule
();
/// <summary>
/// <summary>
/// 拼团活动
/// 拼团活动
/// </summary>
/// </summary>
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
GroupBuyConfig
ActivityModule
>();
private
readonly
Module
.
Product
.
GroupBuyActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
Module
.
Product
.
GroupBuy
ActivityModule
>();
#
region
拼团配置设置
#
region
拼团配置设置
/// <summary>
/// <summary>
...
@@ -115,7 +117,7 @@ namespace Mall.WebApi.Controllers.Product
...
@@ -115,7 +117,7 @@ namespace Mall.WebApi.Controllers.Product
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Groupbuy_Activity_Extend
>(
RequestParm
.
msg
.
ToString
());
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Groupbuy_Activity_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
var
extModel
=
groupBuyConfigActivityModule
.
GetGroupbuyActivityEntityModule
(
query
);
var
extModel
=
groupBuyConfigActivityModule
.
GetGroupbuyActivityEntityModule
(
query
,
isGetSpec
:
true
);
return
ApiResult
.
Success
(
data
:
extModel
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
}
...
@@ -135,5 +137,29 @@ namespace Mall.WebApi.Controllers.Product
...
@@ -135,5 +137,29 @@ namespace Mall.WebApi.Controllers.Product
bool
flag
=
groupBuyConfigActivityModule
.
SetGroupbuyActivityModule
(
extModel
);
bool
flag
=
groupBuyConfigActivityModule
.
SetGroupbuyActivityModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 删除规格
/// </summary>
/// <returns></returns>
public
ApiResult
DeleteSpec
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
);
bool
flag
=
groupBuyConfigActivityModule
.
RemoveGroupBuySpecificationModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除规格值
/// </summary>
/// <returns></returns>
public
ApiResult
DeleteSpecValue
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
);
bool
flag
=
groupBuyConfigActivityModule
.
RemoveGroupBuySpecificationValueModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
}
}
\ No newline at end of file
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