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
829b68cc
Commit
829b68cc
authored
Jun 05, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
02ff4072
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
429 additions
and
1 deletion
+429
-1
RB_Template_Market.cs
Mall.Model/Entity/MarketingCenter/RB_Template_Market.cs
+115
-0
RB_Template_Market_Extend.cs
...Model/Extend/MarketingCenter/RB_Template_Market_Extend.cs
+18
-0
TemplateMarketModule.cs
Mall.Module.MarketingCenter/TemplateMarketModule.cs
+135
-0
RB_Miniprogram_TemplateRepository.cs
...tory/MarketingCenter/RB_Miniprogram_TemplateRepository.cs
+1
-1
RB_Template_MarketRepository.cs
...epository/MarketingCenter/RB_Template_MarketRepository.cs
+57
-0
TemplateController.cs
....WebApi/Controllers/MarketingCenter/TemplateController.cs
+103
-0
No files found.
Mall.Model/Entity/MarketingCenter/RB_Template_Market.cs
0 → 100644
View file @
829b68cc
using
Mall.Common.AOP
;
using
Mall.Common.Enum.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.MarketingCenter
{
/// <summary>
/// 模板市场实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Template_Market
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 图片
/// </summary>
public
string
Pics
{
get
;
set
;
}
/// <summary>
/// 价格
/// </summary>
public
decimal
?
Price
{
get
;
set
;
}
/// <summary>
/// 是否使用(0-禁用,1-使用)
/// </summary>
public
int
?
IsUse
{
get
;
set
;
}
/// <summary>
/// 是否显示(0-不显示,1-显示)
/// </summary>
public
int
?
IsShow
{
get
;
set
;
}
/// <summary>
/// 模板数据
/// </summary>
public
string
TemplateData
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
?
SortNum
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
}
}
Mall.Model/Extend/MarketingCenter/RB_Template_Market_Extend.cs
0 → 100644
View file @
829b68cc
using
Mall.Common.AOP
;
using
Mall.Common.Enum.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.MarketingCenter
{
/// <summary>
/// 模板市场扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Template_Market_Extend
:
Model
.
Entity
.
MarketingCenter
.
RB_Template_Market
{
}
}
\ No newline at end of file
Mall.Module.MarketingCenter/TemplateMarketModule.cs
0 → 100644
View file @
829b68cc
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Repository
;
using
Mall.Repository.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Module.MarketingCenter
{
/// <summary>
/// 模板市场处理类
/// </summary>
public
class
TemplateMarketModule
{
/// <summary>
/// 模板市场仓储层对象
/// </summary>
private
readonly
RB_Template_MarketRepository
template_MarketRepository
=
new
RB_Template_MarketRepository
();
/// <summary>
/// 模板市场分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Template_Market_Extend
>
GetTemplateMarketPageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Template_Market_Extend
query
)
{
return
template_MarketRepository
.
GetTemplateMarketPageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
}
/// <summary>
/// 模板市场列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Template_Market_Extend
>
GetTemplateMarketListModule
(
RB_Template_Market_Extend
query
)
{
return
template_MarketRepository
.
GetTemplateMarketListRepository
(
query
);
}
/// <summary>
/// 添加修改模板市场
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetTemplateMarketModule
(
RB_Template_Market_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Template_Market_Extend
.
Name
),
extModel
.
Name
.
Trim
()
},
{
nameof
(
RB_Template_Market_Extend
.
Pics
),
extModel
.
Pics
},
{
nameof
(
RB_Template_Market_Extend
.
Price
),
extModel
.
Price
},
{
nameof
(
RB_Template_Market_Extend
.
IsUse
),
extModel
.
IsUse
},
{
nameof
(
RB_Template_Market_Extend
.
IsShow
),
extModel
.
IsShow
},
{
nameof
(
RB_Template_Market_Extend
.
TemplateData
),
extModel
.
TemplateData
},
{
nameof
(
RB_Template_Market_Extend
.
SortNum
),
extModel
.
SortNum
},
};
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
extModel
.
Id
));
}
else
{
var
newId
=
template_MarketRepository
.
Insert
(
extModel
);
extModel
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号获取模板市场实体
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Template_Market_Extend
GetTemplateMarketModule
(
object
Id
)
{
return
template_MarketRepository
.
GetEntity
<
RB_Template_Market_Extend
>(
Id
);
}
/// <summary>
/// 删除模板市场
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveTemplateMarketModule
(
object
Id
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Template_Market_Extend
.
Status
),
1
},
};
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新模板市场是否显示
/// </summary>
/// <param name="Id">编号</param>
/// <param name="IsShow">是否显示(0-不显示,1-显示)</param>
/// <returns></returns>
public
bool
UpdateTemplateMarketIsShowModule
(
object
Id
,
int
IsShow
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Template_Market_Extend
.
IsShow
),
IsShow
},
};
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新模板市场是否使用
/// </summary>
/// <param name="Id">编号</param>
/// <param name="IsUse">是否使用(0-禁用,1-使用)</param>
/// <returns></returns>
public
bool
UpdateTemplateMarketIsUseModule
(
object
Id
,
int
IsUse
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Template_Market_Extend
.
IsUse
),
IsUse
},
};
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
Id
));
return
flag
;
}
}
}
Mall.Repository/MarketingCenter/RB_Miniprogram_TemplateRepository.cs
View file @
829b68cc
...
...
@@ -68,7 +68,7 @@ namespace Mall.Repository.MarketingCenter
}
if
(
query
.
QIds
!=
null
&&
!
string
.
IsNullOrEmpty
(
query
.
QIds
.
Trim
()))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Miniprogram_Template_Extend
.
Id
),
query
.
QIds
);
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Miniprogram_Template_Extend
.
Id
),
query
.
QIds
);
}
}
return
Get
<
RB_Miniprogram_Template_Extend
>(
builder
.
ToString
()).
ToList
();
...
...
Mall.Repository/MarketingCenter/RB_Template_MarketRepository.cs
0 → 100644
View file @
829b68cc
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Extend.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.MarketingCenter
{
/// <summary>
/// 模板市场仓储类
/// </summary>
public
class
RB_Template_MarketRepository
:
RepositoryBase
<
RB_Template_Market
>
{
/// <summary>
/// 模板市场分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Template_Market_Extend
>
GetTemplateMarketPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Template_Market_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Template_Market WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
Name
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
Name
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Template_Market_Extend
.
Name
)}
like '%
{
query
.
Name
.
Trim
()}
%'"
);
}
}
return
GetPage
<
RB_Template_Market_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 模板市场列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Template_Market_Extend
>
GetTemplateMarketListRepository
(
RB_Template_Market_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Template_Market WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
Name
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
Name
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Template_Market_Extend
.
Name
)}
like '%
{
query
.
Name
.
Trim
()}
%'"
);
}
}
return
Get
<
RB_Template_Market_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/MarketingCenter/TemplateController.cs
View file @
829b68cc
...
...
@@ -31,6 +31,11 @@ namespace Mall.WebApi.Controllers.MarketingCenter
/// </summary>
private
readonly
MiniprogramPageTemplModule
miniprogramPageTemplModule
=
new
MiniprogramPageTemplModule
();
/// <summary>
/// 模板市场处理类
/// </summary>
private
readonly
TemplateMarketModule
templateMarketModule
=
new
TemplateMarketModule
();
#
region
模板管理
/// <summary>
/// 新增修改小程序模板
...
...
@@ -230,5 +235,103 @@ namespace Mall.WebApi.Controllers.MarketingCenter
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
#
region
模板市场
/// <summary>
/// 模板市场分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTemplateMarketPageListModule
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Template_Market_Extend
>(
parms
.
msg
.
ToString
());
var
list
=
templateMarketModule
.
GetTemplateMarketPageListModule
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
query
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 模板市场列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTemplateMarketList
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Template_Market_Extend
>(
parms
.
msg
.
ToString
());
var
list
=
templateMarketModule
.
GetTemplateMarketListModule
(
query
);
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 根据编号获取模板市场实体
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTemplateMarket
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
extModel
=
templateMarketModule
.
GetTemplateMarketModule
(
Id
);
return
ApiResult
.
Success
(
""
,
extModel
);
}
/// <summary>
/// 添加修改模板市场
/// </summary>
/// <returns></returns>
public
ApiResult
SetTemplateMarket
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Template_Market_Extend
>(
RequestParm
.
msg
.
ToString
());
Int32
.
TryParse
(
RequestParm
.
uid
,
out
int
Uid
);
extModel
.
CreateBy
=
Uid
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
Status
=
0
;
var
flag
=
templateMarketModule
.
SetTemplateMarketModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
.
Id
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除模板市场
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveTemplateMarketModule
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
flag
=
templateMarketModule
.
RemoveTemplateMarketModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新模板市场是否显示
/// </summary>
/// <returns></returns>
public
ApiResult
UpdateTemplateMarketIsShow
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
IsShow
=
parms
.
GetInt
(
"IsShow"
,
0
);
var
flag
=
templateMarketModule
.
UpdateTemplateMarketIsShowModule
(
Id
,
IsShow
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新模板市场是否显示
/// </summary>
/// <returns></returns>
public
ApiResult
UpdateTemplateMarketIsUse
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
IsUse
=
parms
.
GetInt
(
"IsUse"
,
0
);
var
flag
=
templateMarketModule
.
UpdateTemplateMarketIsUseModule
(
Id
,
IsUse
);
return
flag
?
ApiResult
.
Success
()
:
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