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
d0082dbe
Commit
d0082dbe
authored
Aug 12, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
4fc29488
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
27 deletions
+102
-27
RB_Groupbuy_Activity.cs
Mall.Model/Entity/Product/RB_Groupbuy_Activity.cs
+5
-0
RB_Groupbuy_Activity_Specificationprice.cs
...Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
+1
-5
RB_Groupbuy_Activity_Extend.cs
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Extend.cs
+4
-1
GroupBuyConfigActivityModule.cs
Mall.Module.Product/GroupBuyConfigActivityModule.cs
+79
-20
Mall.Module.Product.csproj
Mall.Module.Product/Mall.Module.Product.csproj
+1
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+4
-0
GroupBuyController.cs
Mall.WebApi/Controllers/Product/GroupBuyController.cs
+8
-1
No files found.
Mall.Model/Entity/Product/RB_Groupbuy_Activity.cs
View file @
d0082dbe
...
...
@@ -193,5 +193,10 @@ namespace Mall.Model.Entity.Product
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 是否自定义规格 1是 2否
/// </summary>
public
int
IsCustomSpecification
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Groupbuy_Activity_Specificationprice.cs
View file @
d0082dbe
...
...
@@ -138,10 +138,6 @@ namespace Mall.Model.Entity.Product
get
;
set
;
}
/// <summary>
/// 阶梯编号
/// </summary>
public
int
StepId
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Groupbuy_Activity_Extend.cs
View file @
d0082dbe
...
...
@@ -127,6 +127,9 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
List
<
RB_Groupbuy_Activity_Specificationprice_Extend
>
SpecificationPriceList
{
get
;
set
;
}
/// <summary>
/// 服务列表
/// </summary>
public
List
<
RB_ImageCommonModel
>
ServiceList
{
get
;
set
;
}
}
}
Mall.Module.Product/GroupBuyConfigActivityModule.cs
View file @
d0082dbe
using
Mall.Model.Extend.Product
;
using
Mall.Repository.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
System.Linq
;
using
Mall.Model.Entity.Product
;
using
Mall.AOP.CustomerAttribute
;
namespace
Mall.Module.Product
{
...
...
@@ -176,7 +175,8 @@ namespace Mall.Module.Product
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetGroupbuyActivityModule
(
RB_Groupbuy_Activity_Extend
extModel
)
[
TransactionCallHandler
]
public
virtual
bool
SetGroupbuyActivityModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
ActivityId
>
0
)
...
...
@@ -216,6 +216,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Groupbuy_Activity_Extend
.
CardIds
),
extModel
.
CardIds
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
App_share_title
),
extModel
.
App_share_title
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
App_share_pic
),
extModel
.
App_share_pic
},
{
nameof
(
RB_Groupbuy_Activity_Extend
.
IsCustomSpecification
),
extModel
.
IsCustomSpecification
},
};
flag
=
groupbuy_ActivityRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Extend
.
ActivityId
),
extModel
.
ActivityId
));
}
...
...
@@ -227,14 +228,57 @@ namespace Mall.Module.Product
}
if
(
flag
)
{
if
(
extModel
.
SpecificationList
!=
null
&&
extModel
.
SpecificationList
.
Count
>
0
)
flag
=
SetGoodsSpecificationModule
(
extModel
);
flag
=
SetGoodGroupStepModule
(
extModel
);
}
flag
=
false
;
return
flag
;
}
/// <summary>
/// 添加修改商品规格
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private
bool
SetGoodsSpecificationModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
IsCustomSpecification
==
1
)
{
var
oldSpecList
=
GetGroupbuyActivitySpecificationListModule
(
new
RB_Groupbuy_Activity_Specification_Extend
()
{
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
())
{
//删除规格
IList
<
WhereHelper
>
specWheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
TenantId
),
extModel
.
TenantId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specification_Extend
.
GoodsId
),
extModel
.
GoodId
),
};
groupbuy_Activity_SpecificationRepository
.
Delete
(
specWheres
);
//删除值
IList
<
WhereHelper
>
specValuesWheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
TenantId
),
extModel
.
TenantId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
MallBaseId
),
extModel
.
MallBaseId
),
new
WhereHelper
(
nameof
(
RB_Groupbuy_Activity_Specificationvalue_Extend
.
GoodsId
),
extModel
.
GoodId
),
};
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
);
specItem
.
Id
=
newSpecId
;
if
(
specItem
.
SpecificationValueList
!=
null
&&
specItem
.
SpecificationValueList
.
Count
>
0
)
{
foreach
(
var
specValueItem
in
specItem
.
SpecificationValueList
)
...
...
@@ -243,30 +287,45 @@ namespace Mall.Module.Product
specValueItem
.
TenantId
=
extModel
.
TenantId
;
specValueItem
.
SpecificationId
=
newSpecId
;
specValueItem
.
GoodsId
=
extModel
.
GoodId
;
var
newSpecValueId
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
)
;
flag
=
groupbuy_Activity_SpecificationValueRepository
.
Insert
(
specValueItem
)
>
0
;
}
}
}
}
else
{
}
}
return
flag
;
}
if
(
extModel
.
GroupList
!=
null
&&
extModel
.
GroupList
.
Count
>
0
)
/// <summary>
/// 新增修改阶梯团价
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
private
bool
SetGoodGroupStepModule
(
RB_Groupbuy_Activity_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
GroupList
!=
null
&&
extModel
.
GroupList
.
Count
>
0
)
{
foreach
(
var
groupItem
in
extModel
.
GroupList
)
{
foreach
(
var
groupItem
in
extModel
.
GroupList
)
groupItem
.
TenantId
=
extModel
.
TenantId
;
groupItem
.
MallBaseId
=
extModel
.
MallBaseId
;
groupItem
.
GoodId
=
extModel
.
GoodId
;
var
newGroupId
=
stepRepository
.
Insert
(
groupItem
);
flag
=
newGroupId
>
0
;
if
(
newGroupId
>
0
)
{
groupItem
.
TenantId
=
extModel
.
TenantId
;
groupItem
.
MallBaseId
=
extModel
.
MallBaseId
;
groupItem
.
GoodId
=
extModel
.
GoodId
;
var
newGroupId
=
stepRepository
.
Insert
(
groupItem
);
if
(
newGroupId
>
0
)
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
foreach
(
var
priceItem
in
extModel
.
SpecificationPriceList
)
{
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
priceItem
.
TenantId
=
extModel
.
TenantId
;
priceItem
.
GoodsId
=
extModel
.
GoodId
;
priceItem
.
StepId
=
newGroupId
;
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
);
}
priceItem
.
MallBaseId
=
extModel
.
MallBaseId
;
priceItem
.
TenantId
=
extModel
.
TenantId
;
priceItem
.
GoodsId
=
extModel
.
GoodId
;
//priceItem.StepId = newGroupId;
groupbuy_Activity_SpecificationPriceRepository
.
Insert
(
priceItem
);
}
}
}
...
...
Mall.Module.Product/Mall.Module.Product.csproj
View file @
d0082dbe
...
...
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
d0082dbe
...
...
@@ -75,6 +75,10 @@ namespace Mall.WebApi.Controllers
//背景插件
case
"background"
:
var
backgroundData
=
subItem
.
data
as
backgroundItem
;
if
(
backgroundData
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
backgroundData
.
backgroundPicUrl
))
{
backgroundData
.
backgroundPicUrl
=
Common
.
Config
.
GetFileUrl
(
backgroundData
.
backgroundPicUrl
);
}
obj
=
new
{
id
=
subItem
.
Id
,
...
...
Mall.WebApi/Controllers/Product/GroupBuyController.cs
View file @
d0082dbe
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.AOP
;
using
Mall.Common.API
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
...
...
@@ -25,10 +26,12 @@ namespace Mall.WebApi.Controllers.Product
/// </summary>
private
readonly
GroupBuyConfigModule
groupBuyConfigModule
=
new
GroupBuyConfigModule
();
/// <summary>
/// 拼团活动
/// </summary>
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
new
GroupBuyConfigActivityModule
();
private
readonly
GroupBuyConfigActivityModule
groupBuyConfigActivityModule
=
AOPHelper
.
CreateAOPObject
<
GroupBuyConfigActivityModule
>
();
#
region
拼团配置设置
/// <summary>
...
...
@@ -125,6 +128,10 @@ namespace Mall.WebApi.Controllers.Product
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Groupbuy_Activity_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
if
(
extModel
.
ServiceList
!=
null
&&
extModel
.
ServiceList
.
Count
>
0
)
{
extModel
.
GoodsService
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
extModel
.
ServiceList
);
}
bool
flag
=
groupBuyConfigActivityModule
.
SetGroupbuyActivityModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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