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
4637cf86
Commit
4637cf86
authored
Jun 05, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
455d0861
e6274c6f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
27 deletions
+175
-27
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+2
-2
RB_Template_Market_Extend.cs
...Model/Extend/MarketingCenter/RB_Template_Market_Extend.cs
+19
-0
TemplateMarketModule.cs
Mall.Module.MarketingCenter/TemplateMarketModule.cs
+30
-0
RB_Template_MarketRepository.cs
...epository/MarketingCenter/RB_Template_MarketRepository.cs
+8
-0
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+81
-24
TemplateController.cs
....WebApi/Controllers/MarketingCenter/TemplateController.cs
+35
-1
No files found.
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
View file @
4637cf86
...
@@ -596,7 +596,7 @@ namespace Mall.Model.Extend.MarketingCenter
...
@@ -596,7 +596,7 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary>
/// <summary>
/// 图片导航链接
/// 图片导航链接
/// </summary>
/// </summary>
public
rubikLinkItem
link
{
get
;
set
;
}
public
List
<
rubikLinkItem
>
link
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 宽度
/// 宽度
...
@@ -705,7 +705,7 @@ namespace Mall.Model.Extend.MarketingCenter
...
@@ -705,7 +705,7 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary>
/// <summary>
/// 热区链接
/// 热区链接
/// </summary>
/// </summary>
public
rubikLinkItem
link
{
get
;
set
;
}
public
List
<
rubikLinkItem
>
link
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 打开方式
/// 打开方式
...
...
Mall.Model/Extend/MarketingCenter/RB_Template_Market_Extend.cs
View file @
4637cf86
...
@@ -13,6 +13,25 @@ namespace Mall.Model.Entity.MarketingCenter
...
@@ -13,6 +13,25 @@ namespace Mall.Model.Entity.MarketingCenter
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Template_Market_Extend
:
Model
.
Entity
.
MarketingCenter
.
RB_Template_Market
public
class
RB_Template_Market_Extend
:
Model
.
Entity
.
MarketingCenter
.
RB_Template_Market
{
{
/// <summary>
/// 创建时间字符串
/// </summary>
public
string
CreateDateStr
{
get
{
string
str
=
""
;
if
(
this
.
CreateDate
!=
null
)
{
str
=
Convert
.
ToDateTime
(
this
.
CreateDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
}
return
str
;
}
}
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Mall.Module.MarketingCenter/TemplateMarketModule.cs
View file @
4637cf86
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Repository
;
using
Mall.Repository
;
using
Mall.Repository.MarketingCenter
;
using
Mall.Repository.MarketingCenter
;
using
System
;
using
System
;
...
@@ -17,6 +18,11 @@ namespace Mall.Module.MarketingCenter
...
@@ -17,6 +18,11 @@ namespace Mall.Module.MarketingCenter
/// </summary>
/// </summary>
private
readonly
RB_Template_MarketRepository
template_MarketRepository
=
new
RB_Template_MarketRepository
();
private
readonly
RB_Template_MarketRepository
template_MarketRepository
=
new
RB_Template_MarketRepository
();
/// <summary>
/// 小程序模板
/// </summary>
private
readonly
RB_Miniprogram_TemplateRepository
miniprogram_TemplateRepository
=
new
RB_Miniprogram_TemplateRepository
();
/// <summary>
/// <summary>
/// 模板市场分页列表
/// 模板市场分页列表
/// </summary>
/// </summary>
...
@@ -131,5 +137,29 @@ namespace Mall.Module.MarketingCenter
...
@@ -131,5 +137,29 @@ namespace Mall.Module.MarketingCenter
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
Id
));
flag
=
template_MarketRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Template_Market_Extend
.
Id
),
Id
));
return
flag
;
return
flag
;
}
}
/// <summary>
/// 加载模板
/// </summary>
/// <param name="Id">模板市场编号</param>
/// <param name="extModel">返回的模板实体</param>
/// <returns></returns>
public
bool
LoadTemplateMarketIsUseModule
(
object
Id
,
RB_Miniprogram_Template_Extend
extModel
)
{
var
marketModel
=
GetTemplateMarketModule
(
Id
);
if
(
marketModel
!=
null
&&
marketModel
.
Id
>
0
)
{
extModel
.
TemplateName
=
marketModel
.
Name
;
List
<
ComponentItem
>
items
=
new
List
<
ComponentItem
>();
if
(
marketModel
.
TemplateData
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
marketModel
.
TemplateData
))
{
items
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
ComponentItem
>>(
marketModel
.
TemplateData
.
Replace
(
"\r\n"
,
""
).
Trim
());
}
extModel
.
TemplateData
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
items
);
}
var
newId
=
miniprogram_TemplateRepository
.
Insert
(
extModel
);
extModel
.
Id
=
newId
;
return
newId
>
0
;
}
}
}
}
}
Mall.Repository/MarketingCenter/RB_Template_MarketRepository.cs
View file @
4637cf86
...
@@ -30,6 +30,14 @@ namespace Mall.Repository.MarketingCenter
...
@@ -30,6 +30,14 @@ namespace Mall.Repository.MarketingCenter
{
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Template_Market_Extend
.
Name
)}
like '%
{
query
.
Name
.
Trim
()}
%'"
);
builder
.
Append
(
$" AND
{
nameof
(
RB_Template_Market_Extend
.
Name
)}
like '%
{
query
.
Name
.
Trim
()}
%'"
);
}
}
if
(
query
.
IsShow
>=
0
)
{
builder
.
AppendFormat
(
" AND {0}={1}"
,
nameof
(
RB_Template_Market_Extend
.
IsShow
),
query
.
IsShow
);
}
if
(
query
.
IsUse
>=
0
)
{
builder
.
AppendFormat
(
" AND {0}={1}"
,
nameof
(
RB_Template_Market_Extend
.
IsUse
),
query
.
IsUse
);
}
}
}
return
GetPage
<
RB_Template_Market_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Template_Market_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
4637cf86
This diff is collapsed.
Click to expand it.
Mall.WebApi/Controllers/MarketingCenter/TemplateController.cs
View file @
4637cf86
...
@@ -12,6 +12,7 @@ using System.Collections.Generic;
...
@@ -12,6 +12,7 @@ using System.Collections.Generic;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Model.Extend.MarketingCenter
;
using
Newtonsoft.Json.Linq
;
using
Newtonsoft.Json.Linq
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.CacheManager.User
;
namespace
Mall.WebApi.Controllers.MarketingCenter
namespace
Mall.WebApi.Controllers.MarketingCenter
{
{
...
@@ -249,6 +250,16 @@ namespace Mall.WebApi.Controllers.MarketingCenter
...
@@ -249,6 +250,16 @@ namespace Mall.WebApi.Controllers.MarketingCenter
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Template_Market_Extend
>(
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
);
var
list
=
templateMarketModule
.
GetTemplateMarketPageListModule
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
{
item
.
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
Account
??
""
;
}
}
}
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
pagelist
.
pageData
=
list
;
return
ApiResult
.
Success
(
""
,
pagelist
);
return
ApiResult
.
Success
(
""
,
pagelist
);
...
@@ -299,7 +310,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
...
@@ -299,7 +310,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
/// 删除模板市场
/// 删除模板市场
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
ApiResult
RemoveTemplateMarket
Module
()
public
ApiResult
RemoveTemplateMarket
()
{
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
...
@@ -332,6 +343,29 @@ namespace Mall.WebApi.Controllers.MarketingCenter
...
@@ -332,6 +343,29 @@ namespace Mall.WebApi.Controllers.MarketingCenter
var
flag
=
templateMarketModule
.
UpdateTemplateMarketIsUseModule
(
Id
,
IsUse
);
var
flag
=
templateMarketModule
.
UpdateTemplateMarketIsUseModule
(
Id
,
IsUse
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 加载模板
/// </summary>
/// <returns></returns>
public
ApiResult
LoadTemplateMarket
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
Int32
.
TryParse
(
RequestParm
.
uid
,
out
int
Uid
);
var
extModel
=
new
RB_Miniprogram_Template_Extend
()
{
Id
=
0
,
ComponentDataList
=
new
List
<
ComponentItem
>(),
CreateBy
=
Uid
,
TenantId
=
RequestParm
.
TenantId
,
MallBaseId
=
RequestParm
.
MallBaseId
,
CreateDate
=
DateTime
.
Now
,
Status
=
0
};
var
flag
=
templateMarketModule
.
LoadTemplateMarketIsUseModule
(
Id
,
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
#
endregion
#
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