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
a5d544fb
Commit
a5d544fb
authored
Jun 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
a666282d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
232 additions
and
0 deletions
+232
-0
RB_Recharge_Custom.cs
Mall.Model/Entity/MarketingCenter/RB_Recharge_Custom.cs
+72
-0
RechargeModule.cs
Mall.Module.MarketingCenter/RechargeModule.cs
+48
-0
RB_Recharge_CustomRepository.cs
...epository/MarketingCenter/RB_Recharge_CustomRepository.cs
+48
-0
RechargeController.cs
....WebApi/Controllers/MarketingCenter/RechargeController.cs
+64
-0
No files found.
Mall.Model/Entity/MarketingCenter/RB_Recharge_Custom.cs
0 → 100644
View file @
a5d544fb
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.MarketingCenter
{
/// <summary>
/// 充值自定义设置
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Recharge_Custom
{
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 商户id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
DateTime
CreateDate
{
get
;
set
;
}
public
DateTime
UpdateDate
{
get
;
set
;
}
/// <summary>
/// 余额名称
/// </summary>
public
string
BalanceName
{
get
;
set
;
}
/// <summary>
/// 充值金额
/// </summary>
public
string
RechareName
{
get
;
set
;
}
/// <summary>
/// 充值说明
/// </summary>
public
string
RechareExplain
{
get
;
set
;
}
/// <summary>
/// 按钮圆角
/// </summary>
public
int
BtnFillet
{
get
;
set
;
}
/// <summary>
/// 按钮文本
/// </summary>
public
string
BtnName
{
get
;
set
;
}
/// <summary>
/// 背景颜色
/// </summary>
public
string
BackgroundColor
{
get
;
set
;
}
/// <summary>
/// 文本颜色
/// </summary>
public
string
TextColor
{
get
;
set
;
}
}
}
Mall.Module.MarketingCenter/RechargeModule.cs
View file @
a5d544fb
...
...
@@ -18,6 +18,8 @@ namespace Mall.Module.MarketingCenter
private
RB_Member_BalanceRepository
balanceRepository
=
new
RB_Member_BalanceRepository
();
private
RB_Recharge_SettingsRepository
settingsRepository
=
new
RB_Recharge_SettingsRepository
();
private
RB_Recharge_CustomRepository
customRepository
=
new
RB_Recharge_CustomRepository
();
#
region
充值规则信息
/// <summary>
/// 充值信息列表
...
...
@@ -156,5 +158,51 @@ namespace Mall.Module.MarketingCenter
}
#
endregion
#
region
自定义充值
/// <summary>
/// 自定义充值信息列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Recharge_Custom
>
GetRechargeCustomList
(
RB_Recharge_Custom
query
)
{
return
customRepository
.
GetRechargeCustomList
(
query
);
}
/// <summary>
/// 新增/修改自定义充值
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdateRechargeCustom
(
RB_Recharge_Custom
model
)
{
if
(
model
.
ID
==
0
)
{
return
customRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Recharge_Custom
.
BalanceName
),
model
.
BalanceName
},
{
nameof
(
RB_Recharge_Custom
.
RechareName
),
model
.
RechareName
},
{
nameof
(
RB_Recharge_Custom
.
RechareExplain
),
model
.
RechareExplain
},
{
nameof
(
RB_Recharge_Custom
.
BtnFillet
),
model
.
BtnFillet
},
{
nameof
(
RB_Recharge_Custom
.
BtnName
),
model
.
BtnName
},
{
nameof
(
RB_Recharge_Custom
.
BackgroundColor
),
model
.
BackgroundColor
},
{
nameof
(
RB_Recharge_Custom
.
TextColor
),
model
.
TextColor
},
{
nameof
(
RB_Recharge_Custom
.
UpdateDate
),
model
.
UpdateDate
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Recharge_Custom
.
ID
),
FiledValue
=
model
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
customRepository
.
Update
(
fileds
,
whereHelpers
);
}
}
#
endregion
}
}
Mall.Repository/MarketingCenter/RB_Recharge_CustomRepository.cs
0 → 100644
View file @
a5d544fb
using
Mall.Model.Entity.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.MarketingCenter
{
/// <summary>
/// 自定义充值仓储层
/// </summary>
public
class
RB_Recharge_CustomRepository
:
RepositoryBase
<
RB_Recharge_Custom
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Recharge_Custom
);
}
}
/// <summary>
/// 自定义充值信息列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Recharge_Custom
>
GetRechargeCustomList
(
RB_Recharge_Custom
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Recharge_Custom
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Recharge_Custom
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Recharge_Custom
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Recharge_Custom
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
}
return
Get
<
RB_Recharge_Custom
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/MarketingCenter/RechargeController.cs
View file @
a5d544fb
...
...
@@ -333,5 +333,69 @@ namespace Mall.WebApi.Controllers.MarketingCenter
}
#
endregion
#
region
余额自定义设置
/// <summary>
/// 获取详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetRechargeCustomList
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Recharge_Custom
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
oldLogisticsModel
=
rechargeModule
.
GetRechargeCustomList
(
query
).
FirstOrDefault
();
if
(
oldLogisticsModel
==
null
)
{
oldLogisticsModel
=
new
RB_Recharge_Custom
();
oldLogisticsModel
.
BalanceName
=
"余额"
;
oldLogisticsModel
.
RechareName
=
"充值金额"
;
oldLogisticsModel
.
RechareExplain
=
"充值说明"
;
oldLogisticsModel
.
BtnFillet
=
40
;
oldLogisticsModel
.
BtnName
=
"立即充值"
;
oldLogisticsModel
.
BackgroundColor
=
"#FF4544"
;
oldLogisticsModel
.
TextColor
=
"#FFFFFF"
;
}
return
ApiResult
.
Success
(
""
,
oldLogisticsModel
);
}
/// <summary>
/// 保存充值方案
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
AddOrUpdateRechargeCustom
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Recharge_Custom
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入自定义设置"
);
}
else
{
if
(
query
.
ID
==
0
)
{
query
.
CreateDate
=
System
.
DateTime
.
Now
;
}
query
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
result
=
rechargeModule
.
AddOrUpdateRechargeCustom
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"自定义设置保存成功"
);
}
else
{
return
ApiResult
.
Failed
(
"自定义设置保存失败"
);
}
}
}
#
endregion
}
}
\ 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