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
2ab772a8
Commit
2ab772a8
authored
May 14, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
ce606472
d6589bf3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
2153 additions
and
61 deletions
+2153
-61
Config.cs
Mall.Common/Config.cs
+10
-1
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+16
-14
WeiXinHelper.cs
Mall.Common/Plugin/WeiXinHelper.cs
+1
-1
RB_Live_House.cs
Mall.Model/Entity/AppletWeChat/RB_Live_House.cs
+70
-0
RB_Miniprogram_Page_Templ.cs
...Model/Entity/MarketingCenter/RB_Miniprogram_Page_Templ.cs
+107
-0
RB_Miniprogram_Page_Templ_Details.cs
...tity/MarketingCenter/RB_Miniprogram_Page_Templ_Details.cs
+52
-0
RB_Miniprogram_Template.cs
Mall.Model/Entity/MarketingCenter/RB_Miniprogram_Template.cs
+88
-0
RB_Member_Subscription.cs
Mall.Model/Entity/User/RB_Member_Subscription.cs
+64
-0
RB_MiniProgram.cs
Mall.Model/Entity/User/RB_MiniProgram.cs
+6
-0
RB_Live_House_Extend.cs
Mall.Model/Extend/AppletWeChat/RB_Live_House_Extend.cs
+26
-0
RB_Miniprogram_Page_Templ_Details_Extend.cs
...rketingCenter/RB_Miniprogram_Page_Templ_Details_Extend.cs
+21
-0
RB_Miniprogram_Page_Templ_Extend.cs
...xtend/MarketingCenter/RB_Miniprogram_Page_Templ_Extend.cs
+21
-0
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+39
-0
RB_Member_Subscription_Extend.cs
Mall.Model/Extend/User/RB_Member_Subscription_Extend.cs
+21
-0
Mall.Model.csproj
Mall.Model/Mall.Model.csproj
+0
-2
CouponModule.cs
Mall.Module.MarketingCenter/CouponModule.cs
+23
-11
MiniprogramPageTemplModule.cs
Mall.Module.MarketingCenter/MiniprogramPageTemplModule.cs
+170
-0
MiniprogramTemplateModule.cs
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
+111
-0
MiniProgramModule.cs
Mall.Module.User/MiniProgramModule.cs
+430
-11
RB_Live_HouseRepository.cs
Mall.Repository/AppletWeChat/RB_Live_HouseRepository.cs
+68
-0
Mall.Repository.csproj
Mall.Repository/Mall.Repository.csproj
+0
-4
RB_Miniprogram_Page_TemplRepository.cs
...ry/MarketingCenter/RB_Miniprogram_Page_TemplRepository.cs
+109
-0
RB_Miniprogram_Page_Templ_DetailsRepository.cs
...tingCenter/RB_Miniprogram_Page_Templ_DetailsRepository.cs
+34
-0
RB_Miniprogram_TemplateRepository.cs
...tory/MarketingCenter/RB_Miniprogram_TemplateRepository.cs
+73
-0
RB_Member_CouponRepository.cs
Mall.Repository/User/RB_Member_CouponRepository.cs
+4
-4
RB_Member_SubscriptionRepository.cs
Mall.Repository/User/RB_Member_SubscriptionRepository.cs
+62
-0
PublishController.cs
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
+316
-6
TemplateController.cs
....WebApi/Controllers/MarketingCenter/TemplateController.cs
+197
-0
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+0
-5
Mall.WebApi.csproj
Mall.WebApi/Mall.WebApi.csproj
+4
-0
mall.oytour.com.pubxml.user
...pi/Properties/PublishProfiles/mall.oytour.com.pubxml.user
+5
-0
appsettings.json
Mall.WebApi/appsettings.json
+2
-1
web.config
Mall.WebApi/web.config
+3
-1
No files found.
Mall.Common/Config.cs
View file @
2ab772a8
...
...
@@ -308,6 +308,15 @@ namespace Mall.Common
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"DeveloperKitsPort"
).
Value
;
}
}
/// <summary>
/// 小程序生成二维码跳转地址
/// </summary>
public
static
string
FirstPage
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"FirstPage"
).
Value
;
}
}
}
}
\ No newline at end of file
Mall.Common/Plugin/StringHelper.cs
View file @
2ab772a8
...
...
@@ -194,6 +194,7 @@ namespace Mall.Common.Plugin
}
}
/// <summary>
/// 获取年份月份中的最后一天
/// </summary>
...
...
@@ -510,7 +511,8 @@ namespace Mall.Common.Plugin
{
TotalDay
=
Saturday
+
Sunday
+
2
;
}
else
{
else
{
TotalDay
=
Saturday
+
Sunday
+
1
;
}
}
...
...
@@ -567,22 +569,22 @@ namespace Mall.Common.Plugin
}
}
#
endregion
#
endregion
#
region
字符转换
#
region
字符转换
/// <summary>
/// 为字符串左边填充字符
/// <example>
/// 111 LPAD(,'0',8) --> 00000111
/// </example>
/// </summary>
/// <param name="str">字符串</param>
/// <param name="swap">替换的字符</param>
/// <param name="length">长度</param>
/// <returns></returns>
public
static
string
LPAD
(
object
str
,
string
swap
,
int
length
)
/// <summary>
/// 为字符串左边填充字符
/// <example>
/// 111 LPAD(,'0',8) --> 00000111
/// </example>
/// </summary>
/// <param name="str">字符串</param>
/// <param name="swap">替换的字符</param>
/// <param name="length">长度</param>
/// <returns></returns>
public
static
string
LPAD
(
object
str
,
string
swap
,
int
length
)
{
string
s
=
str
.
ToString
();
...
...
Mall.Common/Plugin/WeiXinHelper.cs
View file @
2ab772a8
...
...
@@ -6,7 +6,7 @@ namespace Mall.Common.Plugin
{
public
class
WeiXinHelper
{
}
/// <summary>
...
...
Mall.Model/Entity/AppletWeChat/RB_Live_House.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.AppletWeChat
{
/// <summary>
/// 直播房间信息
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Live_House
{
/// <summary>
/// 房间号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 商户id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
public
DateTime
CreateDate
{
get
;
set
;
}
/// <summary>
/// 房间名
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 房间id
/// </summary>
public
string
roomid
{
get
;
set
;
}
/// <summary>
/// 直播间背景墙
/// </summary>
public
string
cover_img
{
get
;
set
;
}
/// <summary>
/// 直播状态
/// </summary>
public
string
live_status
{
get
;
set
;
}
/// <summary>
/// 直播计划开始时间
/// </summary>
public
string
start_time
{
get
;
set
;
}
/// <summary>
/// 直播计划结束时间
/// </summary>
public
string
end_time
{
get
;
set
;
}
/// <summary>
/// 主播名
/// </summary>
public
string
anchor_name
{
get
;
set
;
}
/// <summary>
/// 主播图片
/// </summary>
public
string
anchor_img
{
get
;
set
;
}
}
}
Mall.Model/Entity/MarketingCenter/RB_Miniprogram_Page_Templ.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_Templ
{
/// <summary>
/// 主键
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 页面名称
/// </summary>
public
string
PageName
{
get
;
set
;
}
/// <summary>
/// 启用1,禁用0
/// </summary>
public
int
?
IsUse
{
get
;
set
;
}
/// <summary>
/// 是否显示导航条(0-不显示,1-显示)
/// </summary>
public
int
?
IsShowNav
{
get
;
set
;
}
/// <summary>
/// 是否为首页(0-否,1-是)
/// </summary>
public
int
?
IsHome
{
get
;
set
;
}
/// <summary>
/// 商户号Id
/// </summary>
public
int
?
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序Id
/// </summary>
public
int
?
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 创建日期
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
}
}
Mall.Model/Entity/MarketingCenter/RB_Miniprogram_Page_Templ_Details.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_Templ_Details
{
/// <summary>
/// 主键编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 主表编号
/// </summary>
public
int
?
PageTemplID
{
get
;
set
;
}
/// <summary>
/// 导航名称
/// </summary>
public
string
NavName
{
get
;
set
;
}
/// <summary>
/// 模板编号
/// </summary>
public
int
?
TemplateId
{
get
;
set
;
}
}
}
Mall.Model/Entity/MarketingCenter/RB_Miniprogram_Template.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Template
{
/// <summary>
/// 主键
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 商户号Id
/// </summary>
public
int
?
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序Id
/// </summary>
public
int
?
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 模板名称
/// </summary>
public
string
TemplateName
{
get
;
set
;
}
/// <summary>
/// 模板数据[JSON]格式
/// </summary>
public
string
TemplateData
{
get
;
set
;
}
/// <summary>
/// 创建日期
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
?
CreateBy
{
get
;
set
;
}
/// <summary>
/// 状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Member_Subscription.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 会员订阅消息实体表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Member_Subscription
{
/// <summary>
/// 编号
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 会员id
/// </summary>
public
int
?
UserId
{
get
;
set
;
}
/// <summary>
/// 订阅模板id
/// </summary>
public
string
TempleteId
{
get
;
set
;
}
/// <summary>
/// OpenId
/// </summary>
public
string
OpenId
{
get
;
set
;
}
/// <summary>
/// 类型 1赞羊
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// 删除
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 次数
/// </summary>
public
int
?
Count
{
get
;
set
;
}
/// <summary>
/// 商户号id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_MiniProgram.cs
View file @
2ab772a8
...
...
@@ -365,5 +365,11 @@ namespace Mall.Model.Entity.User
/// </summary>
public
string
JumpAppId
{
get
;
set
;
}
#
endregion
/// <summary>
///小程序直播组件 0-否,1-是
/// </summary>
public
int
LivePlayerPlugin
{
get
;
set
;
}
}
}
Mall.Model/Extend/AppletWeChat/RB_Live_House_Extend.cs
0 → 100644
View file @
2ab772a8
using
Mall.Model.Entity.AppletWeChat
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.AppletWeChat
{
public
class
RB_Live_House_Extend
{
/// <summary>
/// errcode = 0 代表成功;errcode = 1 代表未创建直播房间
/// </summary>
public
string
errcode
{
get
;
set
;
}
public
string
errmsg
{
get
;
set
;
}
public
List
<
RB_Live_House
>
room_info
{
get
;
set
;
}
/// <summary>
/// 房间总数
/// </summary>
public
string
total
{
get
;
set
;
}
}
}
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Page_Templ_Details_Extend.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_Templ_Details_Extend
:
RB_Miniprogram_Page_Templ_Details
{
/// <summary>
/// 页面模板编号【逗号分割】
/// </summary>
public
string
QPageTemplIDs
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Page_Templ_Extend.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_Templ_Extend
:
Model
.
Entity
.
MarketingCenter
.
RB_Miniprogram_Page_Templ
{
/// <summary>
/// 页面导航列表
/// </summary>
public
List
<
RB_Miniprogram_Page_Templ_Details_Extend
>
DetailsList
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.AOP
;
using
Mall.Model.Entity.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.MarketingCenter
{
/// <summary>
/// 小程序模板扩展实体表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Miniprogram_Template_Extend
:
Model
.
Entity
.
MarketingCenter
.
RB_Miniprogram_Template
{
/// <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
List
<
object
>
ComponentDataList
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Member_Subscription_Extend.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.AOP
;
using
Mall.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 订阅消息扩展表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Member_Subscription_Extend
:
RB_Member_Subscription
{
/// <summary>
/// 模板ids
/// </summary>
public
List
<
string
>
TempleteIdList
{
get
;
set
;
}
}
}
Mall.Model/Mall.Model.csproj
View file @
2ab772a8
...
...
@@ -10,8 +10,6 @@
<ItemGroup>
<Folder Include="CacheEntity\" />
<Folder Include="Entity\AppletWeChat\" />
<Folder Include="Extend\AppletWeChat\" />
</ItemGroup>
<ItemGroup>
...
...
Mall.Module.MarketingCenter/CouponModule.cs
View file @
2ab772a8
...
...
@@ -191,23 +191,35 @@ namespace Mall.Module.MarketingCenter
{
id
=
model
.
ID
;
flag
=
discountCouponRepository
.
Update
(
model
,
trans
);
var
listProduct
=
productRepository
.
GetCouponProductList
(
new
RB_DiscountCoupon_Product
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
DiscountCouponId
=
id
});
if
(
listProduct
!=
null
&&
listProduct
.
Any
())
{
foreach
(
var
item
in
model
.
ProductList
)
{
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_DiscountCoupon_Product
.
Status
),
1
},
{
nameof
(
RB_DiscountCoupon_Product
.
UpdateDate
),
model
.
UpdateDate
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_DiscountCoupon_Product
.
ID
),
FiledValue
=
item
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
new
WhereHelper
(){
FiledName
=
nameof
(
RB_DiscountCoupon_Product
.
DiscountCouponId
),
FiledValue
=
id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
flag
=
productRepository
.
Update
(
fileds
,
whereHelpers
,
trans
);
}
}
productRepository
.
Update
(
fileds
,
whereHelpers
,
trans
);
////var listProduct = productRepository.GetCouponProductList(new RB_DiscountCoupon_Product { TenantId = model.TenantId, MallBaseId = model.MallBaseId, DiscountCouponId = id });
////if (listProduct != null && listProduct.Any())
////{
//// foreach (var item in listProduct)
//// {
//// IDictionary<string, object> fileds = new Dictionary<string, object>()
//// {
//// { nameof(RB_DiscountCoupon_Product.Status),1},
//// { nameof(RB_DiscountCoupon_Product.UpdateDate),model.UpdateDate},
//// };
//// IList<WhereHelper> whereHelpers = new List<WhereHelper>()
//// {
//// new WhereHelper (){ FiledName=nameof(RB_DiscountCoupon_Product.ID),FiledValue=item.ID,OperatorEnum=OperatorEnum.Equal}
//// };
//// flag = productRepository.Update(fileds, whereHelpers, trans);
//// }
////}
if
(
model
.
ProductList
!=
null
&&
model
.
ProductList
.
Any
())
{
...
...
Mall.Module.MarketingCenter/MiniprogramPageTemplModule.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Query
;
using
Mall.Repository
;
using
Mall.Repository.MarketingCenter
;
using
MySqlX.XDevAPI.Relational
;
using
Org.BouncyCastle.Crypto.Tls
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Module.MarketingCenter
{
/// <summary>
/// 小程序自定义页面处理类
/// </summary>
public
class
MiniprogramPageTemplModule
{
/// <summary>
/// 小程序自定义页面导航仓储层对象
/// </summary>
private
readonly
RB_Miniprogram_Page_Templ_DetailsRepository
detailsRepository
=
new
RB_Miniprogram_Page_Templ_DetailsRepository
();
/// <summary>
/// 小程序自定义页面仓储层对象
/// </summary>
private
readonly
RB_Miniprogram_Page_TemplRepository
pageRepository
=
new
RB_Miniprogram_Page_TemplRepository
();
/// <summary>
/// 小程序自定义页面分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Extend
>
GetMiniprogramPageTemplPageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miniprogram_Page_Templ_Extend
query
)
{
var
list
=
pageRepository
.
GetMiniprogramPageTemplPageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
string
pageIds
=
string
.
Join
(
","
,
list
.
Select
(
qitem
=>
qitem
.
Id
));
List
<
RB_Miniprogram_Page_Templ_Details_Extend
>
details_Extends
=
GetMiniprogramPageTemplDetailsListModule
(
new
RB_Miniprogram_Page_Templ_Details_Extend
()
{
QPageTemplIDs
=
pageIds
});
foreach
(
var
item
in
list
)
{
item
.
DetailsList
=
details_Extends
?.
Where
(
qitem
=>
qitem
.
PageTemplID
==
item
.
Id
)?.
ToList
();
}
}
return
list
;
}
/// <summary>
/// 小程序自定义页面列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Extend
>
GetMiniprogramPageTemplListModule
(
RB_Miniprogram_Page_Templ_Extend
query
)
{
var
list
=
pageRepository
.
GetMiniprogramPageTemplListRepository
(
query
);
return
list
;
}
/// <summary>
/// 小程序自定义页面导航列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Details_Extend
>
GetMiniprogramPageTemplDetailsListModule
(
RB_Miniprogram_Page_Templ_Details_Extend
query
)
{
return
detailsRepository
.
GetMiniprogramPageTemplDetailsListRepository
(
query
);
}
/// <summary>
/// 小程序自定义页面实体
/// </summary>
/// <param name="query">查询条件</param>
/// <param name="isGetHome">是否查询首页页面</param>
/// <returns></returns>
public
RB_Miniprogram_Page_Templ_Extend
GetMiniprogramPageTemplModule
(
RB_Miniprogram_Page_Templ_Extend
query
,
bool
isGetHome
=
false
)
{
var
extModel
=
pageRepository
.
GetMiniprogramPageTemplRepository
(
query
,
isGetHome
:
isGetHome
);
if
(
extModel
==
null
)
{
extModel
=
new
RB_Miniprogram_Page_Templ_Extend
();
}
if
(
extModel
.
Id
>
0
)
{
extModel
.
DetailsList
=
GetMiniprogramPageTemplDetailsListModule
(
new
RB_Miniprogram_Page_Templ_Details_Extend
()
{
QPageTemplIDs
=
extModel
.
Id
.
ToString
()
});
}
return
extModel
;
}
/// <summary>
/// 新增修改自定义页面
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetMiniprogramPageTemplModule
(
RB_Miniprogram_Page_Templ_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
PageName
),
extModel
.
PageName
}
};
fileds
.
Add
(
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
IsUse
),
extModel
.
IsUse
);
fileds
.
Add
(
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
IsShowNav
),
extModel
.
IsShowNav
);
fileds
.
Add
(
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
IsHome
),
extModel
.
IsHome
);
flag
=
pageRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
Id
),
extModel
.
Id
));
}
else
{
var
newId
=
pageRepository
.
Insert
(
extModel
);
extModel
.
Id
=
newId
;
flag
=
newId
>
0
;
}
if
(
flag
&&
extModel
.
DetailsList
!=
null
&&
extModel
.
DetailsList
.
Count
>
0
)
{
foreach
(
var
subItem
in
extModel
.
DetailsList
)
{
subItem
.
PageTemplID
=
extModel
.
Id
;
if
(
subItem
.
Id
>
0
)
{
flag
=
detailsRepository
.
Update
(
subItem
);
}
else
{
flag
=
detailsRepository
.
Insert
(
subItem
)
>
0
;
}
}
}
return
flag
;
}
/// <summary>
/// 更新自定义页面状态
/// </summary>
/// <param name="Id">编号</param>
/// <param name="Status">状态</param>
/// <returns></returns>
public
bool
RemoveMiniprogramPageTemplModule
(
object
Id
,
int
Status
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
Status
),
Status
}
};
flag
=
pageRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 根据Id删除小程序自定义页面导航
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
bool
RemoveMiniprogramPageTemplDetailsModule
(
object
Id
)
{
bool
flag
=
false
;
flag
=
detailsRepository
.
Delete
(
Id
)>
0
;
return
flag
;
}
}
}
Mall.Module.MarketingCenter/MiniprogramTemplateModule.cs
0 → 100644
View file @
2ab772a8
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.MarketingCenter
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Query
;
using
Mall.Repository
;
using
Mall.Repository.MarketingCenter
;
using
MySqlX.XDevAPI.Relational
;
using
Org.BouncyCastle.Crypto.Tls
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Module.MarketingCenter
{
/// <summary>
/// 小程序模板处理类
/// </summary>
public
class
MiniprogramTemplateModule
{
/// <summary>
/// 小程序模板仓储层对象
/// </summary>
private
readonly
RB_Miniprogram_TemplateRepository
miniprogram_TemplateRepository
=
new
RB_Miniprogram_TemplateRepository
();
/// <summary>
/// 小程序模板分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Template_Extend
>
GetMiniprogramTemplatePageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miniprogram_Template_Extend
query
)
{
return
miniprogram_TemplateRepository
.
GetMiniprogramTemplatePageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
}
/// <summary>
/// 小程序模板列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Template_Extend
>
GetMiniprogramTemplateListModule
(
RB_Miniprogram_Template_Extend
query
)
{
return
miniprogram_TemplateRepository
.
GetMiniprogramTemplateListRepository
(
query
);
}
/// <summary>
/// 新增修改小程序模板
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetMiniprogramTemplateModule
(
RB_Miniprogram_Template_Extend
extModel
)
{
bool
flag
=
false
;
if
(
extModel
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Template_Extend
.
Id
),
extModel
.
Id
}
};
fileds
.
Add
(
nameof
(
RB_Miniprogram_Template_Extend
.
TemplateName
),
extModel
.
TemplateName
);
fileds
.
Add
(
nameof
(
RB_Miniprogram_Template_Extend
.
TemplateData
),
extModel
.
TemplateData
);
flag
=
miniprogram_TemplateRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Template_Extend
.
Id
),
extModel
.
Id
));
}
else
{
var
newId
=
miniprogram_TemplateRepository
.
Insert
(
extModel
);
extModel
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 获取小程序模板实体
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public
RB_Miniprogram_Template_Extend
GetMiniprogramTemplateModule
(
object
Id
)
{
RB_Miniprogram_Template_Extend
extModel
=
miniprogram_TemplateRepository
.
GetEntity
<
RB_Miniprogram_Template_Extend
>(
Id
);
if
(
extModel
==
null
)
{
extModel
=
new
RB_Miniprogram_Template_Extend
();
}
return
extModel
;
}
/// <summary>
/// 删除小程序模板
/// </summary>
/// <param name="Id"></param>
/// <param name="Status"></param>
/// <returns></returns>
public
bool
RemoveMiniprogramTemplateModule
(
object
Id
,
int
Status
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Miniprogram_Template_Extend
.
Status
),
Status
}
};
flag
=
miniprogram_TemplateRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Miniprogram_Template_Extend
.
Id
),
Id
));
return
flag
;
}
}
}
Mall.Module.User/MiniProgramModule.cs
View file @
2ab772a8
This diff is collapsed.
Click to expand it.
Mall.Repository/AppletWeChat/RB_Live_HouseRepository.cs
0 → 100644
View file @
2ab772a8
using
Mall.Model.Entity.AppletWeChat
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.AppletWeChat
{
/// <summary>
/// 直播房间仓储层
/// </summary>
public
class
RB_Live_HouseRepository
:
RepositoryBase
<
RB_Live_House
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Live_House
);
}
}
/// <summary>
/// 获取直播房间
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Live_House
>
GetLiveHouseListRepository
(
RB_Live_House
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1"
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Live_House
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Live_House
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
}
return
Get
<
RB_Live_House
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取直播房间
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Live_House
>
GetLiveHousePageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Live_House
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1"
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Live_House
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Live_House
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
}
return
GetPage
<
RB_Live_House
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/Mall.Repository.csproj
View file @
2ab772a8
...
...
@@ -21,8 +21,4 @@
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="AppletWeChat\" />
</ItemGroup>
</Project>
Mall.Repository/MarketingCenter/RB_Miniprogram_Page_TemplRepository.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_TemplRepository
:
RepositoryBase
<
RB_Miniprogram_Page_Templ
>
{
/// <summary>
/// 小程序自定义页面分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Extend
>
GetMiniprogramPageTemplPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miniprogram_Page_Templ_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Page_Templ WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
PageName
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
PageName
.
Trim
()))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
PageName
)}
like '%
{
query
.
PageName
.
Trim
()}
%'"
);
}
}
return
GetPage
<
RB_Miniprogram_Page_Templ_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 小程序自定义页面列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Extend
>
GetMiniprogramPageTemplListRepository
(
RB_Miniprogram_Page_Templ_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Page_Templ WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
PageName
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
PageName
.
Trim
()))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
PageName
)}
like '%
{
query
.
PageName
.
Trim
()}
%'"
);
}
}
return
Get
<
RB_Miniprogram_Page_Templ_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 小程序自定义页面实体
/// </summary>
/// <param name="query">查询条件</param>
/// <param name="isGetHome">是否查询首页页面</param>
/// <returns></returns>
public
RB_Miniprogram_Page_Templ_Extend
GetMiniprogramPageTemplRepository
(
RB_Miniprogram_Page_Templ_Extend
query
,
bool
isGetHome
=
false
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Page_Templ WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
PageName
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
PageName
.
Trim
()))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
PageName
)}
like '%
{
query
.
PageName
.
Trim
()}
%'"
);
}
if
(
query
.
Id
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
isGetHome
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Extend
.
IsHome
)}
=1 "
);
}
}
return
Get
<
RB_Miniprogram_Page_Templ_Extend
>(
builder
.
ToString
()).
FirstOrDefault
();
}
}
}
Mall.Repository/MarketingCenter/RB_Miniprogram_Page_Templ_DetailsRepository.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_Page_Templ_DetailsRepository
:
RepositoryBase
<
RB_Miniprogram_Page_Templ_Details
>
{
/// <summary>
/// 小程序自定义页面导航列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Page_Templ_Details_Extend
>
GetMiniprogramPageTemplDetailsListRepository
(
RB_Miniprogram_Page_Templ_Details_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Page_Templ_Details WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
QPageTemplIDs
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
QPageTemplIDs
.
Trim
()))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Page_Templ_Details_Extend
.
PageTemplID
)}
IN (
{
query
.
QPageTemplIDs
.
Trim
()}
) "
);
}
}
return
Get
<
RB_Miniprogram_Page_Templ_Details_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/MarketingCenter/RB_Miniprogram_TemplateRepository.cs
0 → 100644
View file @
2ab772a8
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_Miniprogram_TemplateRepository
:
RepositoryBase
<
RB_Miniprogram_Template
>
{
/// <summary>
/// 小程序模板分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Template_Extend
>
GetMiniprogramTemplatePageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miniprogram_Template_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Template WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
TemplateName
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
TemplateName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
TemplateName
)}
like '%
{
query
.
TemplateName
.
Trim
()}
%'"
);
}
}
return
GetPage
<
RB_Miniprogram_Template_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 小程序模板列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Miniprogram_Template_Extend
>
GetMiniprogramTemplateListRepository
(
RB_Miniprogram_Template_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM RB_Miniprogram_Template WHERE Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
TemplateName
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
query
.
TemplateName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Miniprogram_Template_Extend
.
TemplateName
)}
like '%
{
query
.
TemplateName
.
Trim
()}
%'"
);
}
}
return
Get
<
RB_Miniprogram_Template_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/User/RB_Member_CouponRepository.cs
View file @
2ab772a8
...
...
@@ -97,7 +97,7 @@ namespace Mall.Repository.User
}
if
(
query
.
PlatformType
>
0
)
{
builder
.
Append
(
$" AND
b.
{
nameof
(
RB_Member_User
.
Sourc
e
)}
=
{
query
.
PlatformType
}
"
);
builder
.
Append
(
$" AND
a.
{
nameof
(
RB_Member_DiscountCoupon_Extend
.
PlatformTyp
e
)}
=
{
query
.
PlatformType
}
"
);
}
if
(
query
.
UserId
>
0
)
{
...
...
@@ -112,7 +112,7 @@ namespace Mall.Repository.User
builder
.
Append
(
$" AND DATE_FORMAT(c.
{
nameof
(
RB_DiscountCoupon
.
CreateDate
)}
,'%Y-%m-%d' )<= DATE_FORMAT('
{
query
.
EndDate
}
','%Y-%m-%d' )"
);
}
}
string
sql
=
@
$" select *
from
FROM
string
sql
=
@
$" select * FROM
{
TableName
}
AS
a
LEFT
JOIN
{
MemberTableName
}
AS
b
ON
a
.
UserId
=
b
.
Id
LEFT
JOIN
{
DiscountCouponTableName
}
as
c
on
c
.
ID
=
a
.
CouponId
where
1
=
1
{
builder
.
ToString
()}
";
...
...
@@ -143,7 +143,7 @@ LEFT JOIN {DiscountCouponTableName} as c on c.ID=a.CouponId where 1=1 {builder
}
if
(
query
.
PlatformType
>
0
)
{
builder
.
Append
(
$" AND
b.
{
nameof
(
RB_Member_User
.
Sourc
e
)}
=
{
query
.
PlatformType
}
"
);
builder
.
Append
(
$" AND
a.
{
nameof
(
RB_Member_DiscountCoupon_Extend
.
PlatformTyp
e
)}
=
{
query
.
PlatformType
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StartDate
))
{
...
...
@@ -209,7 +209,7 @@ LEFT JOIN {DiscountCouponTableName} as c on c.ID=a.CouponId where a.EndDate<NO
}
if
(
query
.
PlatformType
>
0
)
{
builder
.
Append
(
$" AND
b.
{
nameof
(
RB_Member_User
.
Sourc
e
)}
=
{
query
.
PlatformType
}
"
);
builder
.
Append
(
$" AND
a.
{
nameof
(
RB_Member_DiscountCoupon_Extend
.
PlatformTyp
e
)}
=
{
query
.
PlatformType
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StartDate
))
{
...
...
Mall.Repository/User/RB_Member_SubscriptionRepository.cs
0 → 100644
View file @
2ab772a8
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.User
{
/// <summary>
/// 会员订阅微信消息仓储层
/// </summary>
public
class
RB_Member_SubscriptionRepository
:
RepositoryBase
<
RB_Member_Subscription
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Member_Subscription
);
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="where"></param>
/// <returns></returns>
public
List
<
RB_Member_Subscription_Extend
>
GetList
(
RB_Member_Subscription_Extend
where
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
$@"SELECT * from
{
TableName
}
where Status=0"
);
if
(
where
!=
null
)
{
if
(
where
.
MallBaseId
>
0
)
{
sb
.
AppendFormat
(
" and MallBaseId={0}"
,
where
.
MallBaseId
);
}
if
(
where
.
TenantId
>
0
)
{
sb
.
AppendFormat
(
" and TenantId={0}"
,
where
.
TenantId
);
}
if
(
where
.
UserId
>
0
)
{
sb
.
AppendFormat
(
" and UserId={0}"
,
where
.
UserId
);
}
if
(
where
.
Type
>
0
)
{
sb
.
AppendFormat
(
" and Type={0}"
,
where
.
Type
);
}
if
(!
string
.
IsNullOrEmpty
(
where
.
TempleteId
))
{
sb
.
AppendFormat
(
" and TempleteId ='{0}'"
,
where
.
TempleteId
);
}
if
(!
string
.
IsNullOrEmpty
(
where
.
OpenId
))
{
sb
.
AppendFormat
(
" and OpenId ='{0}'"
,
where
.
OpenId
);
}
}
return
Get
<
RB_Member_Subscription_Extend
>(
sb
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
View file @
2ab772a8
This diff is collapsed.
Click to expand it.
Mall.WebApi/Controllers/MarketingCenter/TemplateController.cs
0 → 100644
View file @
2ab772a8
using
System.Linq
;
using
Mall.Common.API
;
using
Microsoft.AspNetCore.Mvc
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Mall.Module.MarketingCenter
;
using
Newtonsoft.Json
;
using
Mall.Model.Query
;
using
System
;
using
Mall.Common.Plugin
;
using
System.Collections.Generic
;
using
Mall.Model.Extend.MarketingCenter
;
using
Newtonsoft.Json.Linq
;
using
Mall.Model.Entity.MarketingCenter
;
namespace
Mall.WebApi.Controllers.MarketingCenter
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
TemplateController
:
BaseController
{
/// <summary>
/// 模板处理类
/// </summary>
private
readonly
Module
.
MarketingCenter
.
MiniprogramTemplateModule
templateModule
=
new
MiniprogramTemplateModule
();
/// <summary>
/// 自定义页面处理类
/// </summary>
private
readonly
MiniprogramPageTemplModule
miniprogramPageTemplModule
=
new
MiniprogramPageTemplModule
();
#
region
模板管理
/// <summary>
/// 新增修改小程序模板
/// </summary>
/// <returns></returns>
public
ApiResult
SetMiniTemplate
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Template_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
if
(
extModel
.
ComponentDataList
!=
null
&&
extModel
.
ComponentDataList
.
Count
>
0
)
{
extModel
.
TemplateData
=
JsonConvert
.
SerializeObject
(
extModel
.
ComponentDataList
);
}
Int32
.
TryParse
(
RequestParm
.
uid
,
out
int
Uid
);
extModel
.
CreateBy
=
Uid
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
Status
=
0
;
var
flag
=
templateModule
.
SetMiniprogramTemplateModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
.
Id
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取小程序模板实体
/// </summary>
/// <returns></returns>
public
ApiResult
GetMiniTemplate
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
);
var
result
=
templateModule
.
GetMiniprogramTemplateModule
(
Id
);
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
/// 删除小程序模板
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveMiniTemplate
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
Status
=
parms
.
GetInt
(
"Status"
,
1
);
var
flag
=
templateModule
.
RemoveMiniprogramTemplateModule
(
Id
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 小程序模板分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMiniTemplatePageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Template_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
templateModule
.
GetMiniprogramTemplatePageListModule
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
query
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
#
region
自定义页面管理
/// <summary>
/// 小程序自定义页面分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMiniprogramPageTemplPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Page_Templ_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
miniprogramPageTemplModule
.
GetMiniprogramPageTemplPageListModule
(
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
GetMiniprogramPageTemplList
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Page_Templ_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
miniprogramPageTemplModule
.
GetMiniprogramPageTemplListModule
(
query
);
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 小程序自定义页面实体
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMiniprogramPageTempl
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Page_Templ_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
Convert
.
ToInt32
(
RequestParm
.
uid
);
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
bool
isGetHome
=
parms
.
GetBoolValue
(
"isGetHome"
);
var
extModel
=
miniprogramPageTemplModule
.
GetMiniprogramPageTemplModule
(
query
,
isGetHome
:
isGetHome
);
return
ApiResult
.
Success
(
""
,
extModel
);
}
/// <summary>
/// 新增修改自定义页面
/// </summary>
/// <returns></returns>
public
ApiResult
SetMiniprogramPageTempl
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Miniprogram_Page_Templ_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
Int32
.
TryParse
(
RequestParm
.
uid
,
out
int
Uid
);
extModel
.
CreateBy
=
Uid
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
Status
=
0
;
var
flag
=
miniprogramPageTemplModule
.
SetMiniprogramPageTemplModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
.
Id
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新自定义页面状态
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveMiniprogramPageTempl
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
Status
=
parms
.
GetInt
(
"Status"
,
1
);
var
flag
=
miniprogramPageTemplModule
.
RemoveMiniprogramPageTemplModule
(
Id
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新自定义页面状态
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveMiniprogramPageTemplDetails
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
Id
=
parms
.
GetInt
(
"Id"
,
0
);
var
flag
=
miniprogramPageTemplModule
.
RemoveMiniprogramPageTemplDetailsModule
(
Id
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/TenantController.cs
View file @
2ab772a8
...
...
@@ -908,10 +908,5 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
data
:
resultList
);
}
}
}
\ No newline at end of file
Mall.WebApi/Mall.WebApi.csproj
View file @
2ab772a8
...
...
@@ -4,6 +4,10 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Remove="web.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
...
...
Mall.WebApi/Properties/PublishProfiles/mall.oytour.com.pubxml.user
View file @
2ab772a8
...
...
@@ -8,4 +8,9 @@
<TimeStampOfAssociatedLegacyPublishXmlFile
/>
<_PublishTargetUrl>
E:\LDWork\LiuDongWork\MallFB
</_PublishTargetUrl>
</PropertyGroup>
<ItemGroup>
<File
Include=
"run.cmd"
>
<publishTime>
04/22/2020 10:26:33
</publishTime>
</File>
</ItemGroup>
</Project>
\ No newline at end of file
Mall.WebApi/appsettings.json
View file @
2ab772a8
...
...
@@ -22,7 +22,8 @@
"Mongo"
:
"mongodb://192.168.2.214:27017"
,
"MongoDBName"
:
"Mall"
,
"ProjectUrl"
:
"D:/project/GitProject/tripfriend"
,
"DeveloperKitsPort"
:
"54333"
,
"DeveloperKitsPort"
:
"63994"
,
"FirstPage"
:
"pages/index/index.html"
,
"RedisSetting"
:
{
"RedisServer"
:
"192.168.2.214"
,
"RedisPort"
:
"6379"
,
...
...
Mall.WebApi/web.config
View file @
2ab772a8
...
...
@@ -5,9 +5,11 @@
<
handlers
>
<
add
name
=
"aspNetCore"
path
=
"*"
verb
=
"*"
modules
=
"AspNetCoreModuleV2"
resourceType
=
"Unspecified"
/>
</
handlers
>
<
aspNetCore
processPath
=
"
.\Mall.WebApi.exe"
arguments
=
".\Mall.WebApi.dll"
stdoutLogEnabled
=
"false"
stdoutLogFile
=
".\logs\stdout"
hostingModel
=
"OutOf
Process"
>
<
aspNetCore
processPath
=
"
%LAUNCHER_PATH%"
arguments
=
"%LAUNCHER_ARGS%"
stdoutLogEnabled
=
"false"
stdoutLogFile
=
".\logs\stdout"
hostingModel
=
"In
Process"
>
<
environmentVariables
>
<
environmentVariable
name
=
"ASPNETCORE_ENVIRONMENT"
value
=
"Development"
/>
<
environmentVariable
name
=
"ASPNETCORE_HTTPS_PORT"
value
=
"44370"
/>
<
environmentVariable
name
=
"COMPLUS_ForceENC"
value
=
"1"
/>
</
environmentVariables
>
</
aspNetCore
>
</
system
.
webServer
>
...
...
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