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
b64b5359
Commit
b64b5359
authored
Aug 06, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增配置
parent
2d131a62
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
425 additions
and
96 deletions
+425
-96
Config.cs
Mall.Common/Config.cs
+96
-94
FileCommonHelper.cs
Mall.Common/Plugin/FileCommonHelper.cs
+1
-1
RB_GroupBuyConfig.cs
Mall.Model/Entity/User/RB_GroupBuyConfig.cs
+100
-0
RB_GroupBuyConfig_Extend.cs
Mall.Model/Extend/User/RB_GroupBuyConfig_Extend.cs
+18
-0
GroupBuyConfigModule.cs
Mall.Module.User/GroupBuyConfigModule.cs
+96
-0
RB_GroupBuyConfigRepository.cs
Mall.Repository/User/RB_GroupBuyConfigRepository.cs
+46
-0
TestController.cs
Mall.WebApi/Controllers/CAP/TestController.cs
+1
-0
GroupBuyController.cs
Mall.WebApi/Controllers/Product/GroupBuyController.cs
+65
-0
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+1
-0
Startup.cs
Mall.WebApi/Startup.cs
+1
-1
No files found.
Mall.Common/Config.cs
View file @
b64b5359
This diff is collapsed.
Click to expand it.
Mall.Common/Plugin/FileCommonHelper.cs
View file @
b64b5359
...
...
@@ -6,7 +6,7 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Commo
m
.Plugin
namespace
Mall.Commo
n
.Plugin
{
/// <summary>
/// 公共帮助类
...
...
Mall.Model/Entity/User/RB_GroupBuyConfig.cs
0 → 100644
View file @
b64b5359
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 拼团配置表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_GroupBuyConfig
{
/// <summary>
/// 拼团配置主键编号
/// </summary>
public
int
GroupByConfigId
{
get
;
set
;
}
/// <summary>
/// 是否开启分销(1-开启)
/// </summary>
public
int
Is_Share
{
get
;
set
;
}
/// <summary>
/// 是否开启区域允许购买(1-开启)
/// </summary>
public
int
Is_Territorial_Limitation
{
get
;
set
;
}
/// <summary>
/// 支付方式[online_pay-线上支付,huodao-货到付款,balance-余额支付]
/// </summary>
public
string
Payment_Type
{
get
;
set
;
}
/// <summary>
/// 发货方式[express-快递配送,offline-到店自提,city-同城配送]
/// </summary>
public
string
Send_Type
{
get
;
set
;
}
/// <summary>
/// 优惠券(1-开启)
/// </summary>
public
int
Is_Coupon
{
get
;
set
;
}
/// <summary>
/// 超级会员卡(1-开启)
/// </summary>
public
int
SVIP_Status
{
get
;
set
;
}
/// <summary>
/// 会员价[1-开启]
/// </summary>
public
int
Is_Member_Price
{
get
;
set
;
}
/// <summary>
/// 积分[1-开启]
/// </summary>
public
int
Is_Integral
{
get
;
set
;
}
/// <summary>
/// 活动规则
/// </summary>
public
string
RuleText
{
get
;
set
;
}
/// <summary>
/// 商品海报
/// </summary>
public
string
Goods_Poster
{
get
;
set
;
}
/// <summary>
/// 广告
/// </summary>
public
string
Advertisement
{
get
;
set
;
}
/// <summary>
/// 拼团广告状态(1-开启)
/// </summary>
public
int
Is_Advertisement
{
get
;
set
;
}
/// <summary>
/// 小程序Id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 商户Id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 微信拼团成功通知
/// </summary>
public
string
WeChat_pintuan_success_notice
{
get
;
set
;
}
/// <summary>
/// 微信拼团失败通知
/// </summary>
public
string
WeChat_pintuan_fail_notice
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_GroupBuyConfig_Extend.cs
0 → 100644
View file @
b64b5359
using
Mall.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 拼团配置扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_GroupBuyConfig_Extend
:
RB_GroupBuyConfig
{
}
}
\ No newline at end of file
Mall.Module.User/GroupBuyConfigModule.cs
0 → 100644
View file @
b64b5359
using
Mall.Model.Extend.User
;
using
Mall.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Module.User
{
/// <summary>
/// 拼团配置处理类
/// </summary>
public
class
GroupBuyConfigModule
{
/// <summary>
/// 拼团配置仓储层对象
/// </summary>
private
readonly
RB_GroupBuyConfigRepository
groupBuyConfigRepository
=
new
RB_GroupBuyConfigRepository
();
/// <summary>
/// 添加修改拼团配置
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetGroupBuyConfigModule
(
RB_GroupBuyConfig_Extend
extModel
)
{
bool
flag
=
false
;
var
oldEntity
=
GetGroupBuyConfigModule
(
extModel
);
extModel
.
GroupByConfigId
=
oldEntity
?.
GroupByConfigId
??
0
;
if
(
extModel
.
GroupByConfigId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Share
),
extModel
.
Is_Share
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Territorial_Limitation
),
extModel
.
Is_Territorial_Limitation
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Payment_Type
),
extModel
.
Payment_Type
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Send_Type
),
extModel
.
Send_Type
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Coupon
),
extModel
.
Is_Coupon
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
SVIP_Status
),
extModel
.
SVIP_Status
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Member_Price
),
extModel
.
Is_Member_Price
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Integral
),
extModel
.
Is_Integral
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
RuleText
),
extModel
.
RuleText
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Goods_Poster
),
extModel
.
Goods_Poster
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Advertisement
),
extModel
.
Advertisement
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
Is_Advertisement
),
extModel
.
Is_Advertisement
},
};
flag
=
groupBuyConfigRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_GroupBuyConfig_Extend
.
GroupByConfigId
),
extModel
.
GroupByConfigId
));
}
else
{
var
newId
=
groupBuyConfigRepository
.
Insert
(
extModel
);
extModel
.
GroupByConfigId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 新增修改消息模板
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetGroupBuyConfigMessageModule
(
RB_GroupBuyConfig_Extend
extModel
)
{
bool
flag
=
false
;
var
oldEntity
=
GetGroupBuyConfigModule
(
extModel
);
extModel
.
GroupByConfigId
=
oldEntity
?.
GroupByConfigId
??
0
;
if
(
extModel
.
GroupByConfigId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GroupBuyConfig_Extend
.
WeChat_pintuan_success_notice
),
extModel
.
WeChat_pintuan_success_notice
},
{
nameof
(
RB_GroupBuyConfig_Extend
.
WeChat_pintuan_fail_notice
),
extModel
.
WeChat_pintuan_fail_notice
},
};
flag
=
groupBuyConfigRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_GroupBuyConfig_Extend
.
GroupByConfigId
),
extModel
.
GroupByConfigId
));
}
else
{
var
newId
=
groupBuyConfigRepository
.
Insert
(
extModel
);
extModel
.
GroupByConfigId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 获取拼团配置实体
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
RB_GroupBuyConfig_Extend
GetGroupBuyConfigModule
(
RB_GroupBuyConfig_Extend
query
)
{
return
groupBuyConfigRepository
.
GetGroupBuyConfigRepository
(
query
);
}
}
}
Mall.Repository/User/RB_GroupBuyConfigRepository.cs
0 → 100644
View file @
b64b5359
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 拼团配置仓储层对象
/// </summary>
public
class
RB_GroupBuyConfigRepository
:
BaseRepository
<
RB_GroupBuyConfig
>
{
/// <summary>
/// 获取拼团配置实体
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
RB_GroupBuyConfig_Extend
GetGroupBuyConfigRepository
(
RB_GroupBuyConfig_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_groupbuyconfig
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_GroupBuyConfig_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_GroupBuyConfig_Extend
.
TenantId
),
query
.
TenantId
);
}
if
(
query
.
GroupByConfigId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_GroupBuyConfig_Extend
.
GroupByConfigId
),
query
.
GroupByConfigId
);
}
}
return
Get
<
RB_GroupBuyConfig_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
}
}
}
Mall.WebApi/Controllers/CAP/TestController.cs
View file @
b64b5359
...
...
@@ -22,6 +22,7 @@ namespace Mall.WebApi.Controllers.CAP
public
TestController
(
DotNetCore
.
CAP
.
ICapPublisher
capPublisher
)
{
this
.
_capBus
=
capPublisher
;
}
[
HttpPost
]
...
...
Mall.WebApi/Controllers/Product/GroupBuyController.cs
0 → 100644
View file @
b64b5359
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Model.Extend.User
;
using
Mall.Module.User
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Mall.WebApi.Controllers.Product
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
GroupBuyController
:
BaseController
{
/// <summary>
/// 拼团配置处理类对象
/// </summary>
private
readonly
GroupBuyConfigModule
groupBuyConfigModule
=
new
GroupBuyConfigModule
();
/// <summary>
/// 添加修改拼团配置
/// </summary>
/// <returns></returns>
public
ApiResult
SetGroupBuyConfig
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_GroupBuyConfig_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
var
flag
=
groupBuyConfigModule
.
SetGroupBuyConfigModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 添加修改拼团消息配置
/// </summary>
/// <returns></returns>
public
ApiResult
SetGroupBuyConfigMessage
()
{
var
extModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_GroupBuyConfig_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
var
flag
=
groupBuyConfigModule
.
SetGroupBuyConfigMessageModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取拼团配置实体
/// </summary>
/// <returns></returns>
public
ApiResult
GetGroupBuyConfigModule
()
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_GroupBuyConfig_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
var
extModel
=
groupBuyConfigModule
.
GetGroupBuyConfigModule
(
query
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
}
}
\ No newline at end of file
Mall.WebApi/Mall.WebApi.csproj
View file @
b64b5359
...
...
@@ -13,6 +13,7 @@
<PackageReference Include="DotNetCore.CAP.MongoDB" Version="2.6.0" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="2.6.0" />
<PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup>
...
...
Mall.WebApi/Startup.cs
View file @
b64b5359
...
...
@@ -62,7 +62,7 @@ namespace Mall.WebApi
services
.
AddCap
(
x
=>
{
x
.
UseMongoDB
(
Common
.
Config
.
ReadConfigKey
(
"Mongo"
)
);
x
.
UseMongoDB
(
Common
.
Config
.
Mongo
);
x
.
UseRabbitMQ
(
cfg
=>
{
cfg
.
HostName
=
Common
.
Config
.
ReadConfigKey
(
"RabbitMqConfig"
,
"HostName"
);
...
...
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