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
0faccf69
Commit
0faccf69
authored
Apr 27, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分销+商品分类
parent
54981cbb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
2444 additions
and
30 deletions
+2444
-30
DistributorAuditStatusEnum.cs
Mall.Common/Enum/User/DistributorAuditStatusEnum.cs
+31
-0
DistributorExportEnum.cs
Mall.Common/Enum/User/DistributorExportEnum.cs
+81
-0
DistributorRemitAuditStatusEnum.cs
Mall.Common/Enum/User/DistributorRemitAuditStatusEnum.cs
+36
-0
DistributorRemitExportEnum.cs
Mall.Common/Enum/User/DistributorRemitExportEnum.cs
+71
-0
RB_Product_Category.cs
Mall.Model/Entity/Product/RB_Product_Category.cs
+154
-0
RB_Product_CategoryStyle.cs
Mall.Model/Entity/Product/RB_Product_CategoryStyle.cs
+90
-0
RB_Distributor_Basics.cs
Mall.Model/Entity/User/RB_Distributor_Basics.cs
+2
-2
RB_Distributor_Info.cs
Mall.Model/Entity/User/RB_Distributor_Info.cs
+1
-1
RB_Distributor_Remit.cs
Mall.Model/Entity/User/RB_Distributor_Remit.cs
+19
-3
RB_Product_CategoryStyle_Extend.cs
Mall.Model/Extend/Product/RB_Product_CategoryStyle_Extend.cs
+18
-0
RB_Product_Category_Extend.cs
Mall.Model/Extend/Product/RB_Product_Category_Extend.cs
+84
-0
RB_Distributor_Basics_Extend.cs
Mall.Model/Extend/User/RB_Distributor_Basics_Extend.cs
+4
-0
RB_Distributor_Info_Extend.cs
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
+10
-0
RB_Distributor_Remit_Extend.cs
Mall.Model/Extend/User/RB_Distributor_Remit_Extend.cs
+34
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+392
-0
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+34
-2
UserModule.cs
Mall.Module.User/UserModule.cs
+381
-10
RB_Material_InfoRepository.cs
Mall.Repository/Product/RB_Material_InfoRepository.cs
+10
-5
RB_Product_CategoryRepository.cs
Mall.Repository/Product/RB_Product_CategoryRepository.cs
+111
-0
RB_Product_CategoryStyleRepository.cs
....Repository/Product/RB_Product_CategoryStyleRepository.cs
+66
-0
RB_Distributor_InfoRepository.cs
Mall.Repository/User/RB_Distributor_InfoRepository.cs
+62
-0
RB_Distributor_RemitRepository.cs
Mall.Repository/User/RB_Distributor_RemitRepository.cs
+106
-0
BaseController.cs
Mall.WebApi/Controllers/BaseController.cs
+1
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+239
-0
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+407
-7
No files found.
Mall.Common/Enum/User/DistributorAuditStatusEnum.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.User
{
/// <summary>
/// 分销商审核状态枚举
/// </summary>
public
enum
DistributorAuditStatusEnum
{
/// <summary>
/// 审核中
/// </summary>
[
EnumField
(
"未审核"
)]
Auditing
=
1
,
/// <summary>
/// 审核通过
/// </summary>
[
EnumField
(
"已通过"
)]
Audited
=
2
,
/// <summary>
/// 审核拒绝
/// </summary>
[
EnumField
(
"已拒绝"
)]
Reject
=
3
}
}
Mall.Common/Enum/User/DistributorExportEnum.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.User
{
/// <summary>
/// 分销商导出选项枚举
/// </summary>
public
enum
DistributorExportEnum
{
/// <summary>
/// 所属平台
/// </summary>
[
EnumField
(
"所属平台"
)]
SSPT
=
1
,
/// <summary>
/// 用户ID
/// </summary>
[
EnumField
(
"用户ID"
)]
YHID
=
2
,
/// <summary>
/// 昵称
/// </summary>
[
EnumField
(
"昵称"
)]
NC
=
3
,
/// <summary>
/// 姓名
/// </summary>
[
EnumField
(
"姓名"
)]
Name
=
4
,
/// <summary>
/// 绑定手机号
/// </summary>
[
EnumField
(
"手机号"
)]
BDSJH
=
5
,
/// <summary>
/// 申请时间
/// </summary>
[
EnumField
(
"申请时间"
)]
Time
=
6
,
/// <summary>
/// 审核状态
/// </summary>
[
EnumField
(
"审核状态"
)]
AuditStatus
=
7
,
/// <summary>
/// 累计佣金
/// </summary>
[
EnumField
(
"累计佣金"
)]
LJYJ
=
8
,
/// <summary>
/// 可提现佣金
/// </summary>
[
EnumField
(
"可提现佣金"
)]
KTXYJ
=
9
,
/// <summary>
/// 订单数
/// </summary>
[
EnumField
(
"订单数"
)]
DDS
=
10
,
/// <summary>
/// 下级用户
/// </summary>
[
EnumField
(
"下级用户"
)]
XJYH
=
11
,
/// <summary>
/// 推荐人
/// </summary>
[
EnumField
(
"推荐人"
)]
TJR
=
12
,
/// <summary>
/// 备注信息
/// </summary>
[
EnumField
(
"备注信息"
)]
BZ
=
13
}
}
Mall.Common/Enum/User/DistributorRemitAuditStatusEnum.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.User
{
/// <summary>
/// 分销商提现审核状态枚举
/// </summary>
public
enum
DistributorRemitAuditStatusEnum
{
/// <summary>
/// 未审核
/// </summary>
[
EnumField
(
"未审核"
)]
Auditing
=
1
,
/// <summary>
/// 待打款
/// </summary>
[
EnumField
(
"待打款"
)]
ToPlayWith
=
2
,
/// <summary>
/// 已打款
/// </summary>
[
EnumField
(
"已打款"
)]
HaveMoney
=
3
,
/// <summary>
/// 驳回
/// </summary>
[
EnumField
(
"驳回"
)]
Reject
=
4
}
}
Mall.Common/Enum/User/DistributorRemitExportEnum.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.User
{
/// <summary>
/// 分销提现导出选项枚举
/// </summary>
public
enum
DistributorRemitExportEnum
{
/// <summary>
/// 所属平台
/// </summary>
[
EnumField
(
"所属平台"
)]
SSPT
=
1
,
/// <summary>
/// 订单号
/// </summary>
[
EnumField
(
"订单号"
)]
OrderNum
=
2
,
/// <summary>
/// 昵称
/// </summary>
[
EnumField
(
"昵称"
)]
NC
=
3
,
/// <summary>
/// 提现金额
/// </summary>
[
EnumField
(
"提现金额"
)]
TXJE
=
4
,
/// <summary>
/// 申请日期
/// </summary>
[
EnumField
(
"申请日期"
)]
SQRQ
=
5
,
/// <summary>
/// 银行名称
/// </summary>
[
EnumField
(
"银行名称"
)]
Bank
=
6
,
/// <summary>
/// 打款账户
/// </summary>
[
EnumField
(
"打款账户"
)]
DKZH
=
7
,
/// <summary>
/// 真实姓名
/// </summary>
[
EnumField
(
"真实姓名"
)]
ZSXM
=
8
,
/// <summary>
/// 状态
/// </summary>
[
EnumField
(
"状态"
)]
Status
=
9
,
/// <summary>
/// 打款方式
/// </summary>
[
EnumField
(
"打款方式"
)]
DKFS
=
10
,
/// <summary>
/// 打款时间
/// </summary>
[
EnumField
(
"打款时间"
)]
DKSJ
=
11
}
}
Mall.Model/Entity/Product/RB_Product_Category.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 商品分类表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Product_Category
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 分类名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 层级
/// </summary>
public
int
?
Tier
{
get
;
set
;
}
/// <summary>
/// 父级id
/// </summary>
public
int
?
ParentId
{
get
;
set
;
}
/// <summary>
/// 根节点id
/// </summary>
public
int
?
RootId
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
?
Sort
{
get
;
set
;
}
/// <summary>
/// 分类图标
/// </summary>
public
int
?
Icon
{
get
;
set
;
}
/// <summary>
/// 分类大图
/// </summary>
public
int
?
BigIcon
{
get
;
set
;
}
/// <summary>
/// 分类广告图
/// </summary>
public
int
?
AdvertisingImage
{
get
;
set
;
}
/// <summary>
/// 分类广告链接
/// </summary>
public
string
AdvertisingAddress
{
get
;
set
;
}
/// <summary>
/// 启用 1是 2否
/// </summary>
public
int
?
Enabled
{
get
;
set
;
}
/// <summary>
/// 是否显示 1是 2否
/// </summary>
public
int
?
IsShow
{
get
;
set
;
}
/// <summary>
/// 删除
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Product_CategoryStyle.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 商品分类样式表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Product_CategoryStyle
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 分类 1一级样式 2二级样式 3三级样式
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// 样式id
/// </summary>
public
int
?
Style
{
get
;
set
;
}
/// <summary>
/// 每个分类商品显示总数
/// </summary>
public
int
?
CategoryNum
{
get
;
set
;
}
/// <summary>
/// 商品每行显示的数量
/// </summary>
public
int
?
RowNum
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
?
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_Basics.cs
View file @
0faccf69
...
...
@@ -107,9 +107,9 @@ namespace Mall.Model.Entity.User
/// </summary>
public
string
GradeEntranceImage
{
get
;
set
;
}
/// <summary>
/// 提现方式 枚举
/// 提现方式 枚举
json格式
/// </summary>
public
DistrbutorWithdrawWayEnum
?
WithdrawWay
public
string
WithdrawWay
{
get
;
set
;
...
...
Mall.Model/Entity/User/RB_Distributor_Info.cs
View file @
0faccf69
...
...
@@ -65,7 +65,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 审核状态 1审核中 2通过 3拒绝
/// </summary>
public
int
?
AuditStatus
public
DistributorAuditStatusEnum
?
AuditStatus
{
get
;
set
;
...
...
Mall.Model/Entity/User/RB_Distributor_Remit.cs
View file @
0faccf69
...
...
@@ -33,7 +33,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 提现方式 枚举
/// </summary>
public
int
?
WithdrawalWay
public
DistrbutorWithdrawWayEnum
?
WithdrawalWay
{
get
;
set
;
...
...
@@ -65,7 +65,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 审核状态 1申请中 2同意申请,待打款 3已打款 4拒绝
/// </summary>
public
int
?
AuditStatus
public
DistributorRemitAuditStatusEnum
?
AuditStatus
{
get
;
set
;
...
...
@@ -87,6 +87,10 @@ namespace Mall.Model.Entity.User
set
;
}
/// <summary>
/// 拒绝时间
/// </summary>
public
DateTime
?
RejectDate
{
get
;
set
;
}
/// <summary>
/// 审核备注
/// </summary>
public
string
AuditRemark
...
...
@@ -103,6 +107,10 @@ namespace Mall.Model.Entity.User
set
;
}
/// <summary>
/// 拒绝备注
/// </summary>
public
string
RejectRemark
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
...
...
@@ -127,7 +135,7 @@ namespace Mall.Model.Entity.User
set
;
}
/// <summary>
///
账户
名称
///
真实
名称
/// </summary>
public
string
AccountName
{
...
...
@@ -142,5 +150,13 @@ namespace Mall.Model.Entity.User
get
;
set
;
}
/// <summary>
/// 银行名称
/// </summary>
public
string
BankName
{
get
;
set
;
}
/// <summary>
/// 提现订单号
/// </summary>
public
string
OrderNum
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Product_CategoryStyle_Extend.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 商品分类样式表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Product_CategoryStyle_Extend
:
RB_Product_CategoryStyle
{
}
}
Mall.Model/Extend/Product/RB_Product_Category_Extend.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 商品分类表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Product_Category_Extend
:
RB_Product_Category
{
/// <summary>
/// 分类ids
/// </summary>
public
string
CategoryIds
{
get
;
set
;
}
/// <summary>
/// 分类图标
/// </summary>
public
string
IconPath
{
get
;
set
;
}
/// <summary>
/// 分类大图
/// </summary>
public
string
BigIconPath
{
get
;
set
;
}
/// <summary>
/// 分类广告图
/// </summary>
public
string
AdvertisingImagePath
{
get
;
set
;
}
}
/// <summary>
/// 树形结构
/// </summary>
public
class
RB_Product_CategoryTree
{
/// <summary>
/// id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 分类名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 分类图标
/// </summary>
public
int
Icon
{
get
;
set
;
}
/// <summary>
/// 地址
/// </summary>
public
string
IconPath
{
get
;
set
;
}
/// <summary>
/// 子集列表
/// </summary>
public
List
<
RB_Product_CategoryTree
>
ChildList
{
get
;
set
;
}
}
/// <summary>
/// 分类排序
/// </summary>
public
class
RB_Product_CategorySort
{
/// <summary>
/// id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
Sort
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_Basics_Extend.cs
View file @
0faccf69
...
...
@@ -21,5 +21,9 @@ namespace Mall.Model.Extend.User
/// 路径
/// </summary>
public
string
BackgroundImagePath
{
get
;
set
;
}
/// <summary>
/// 提现方式枚举
/// </summary>
public
List
<
int
>
WithdrawWayList
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_Info_Extend.cs
View file @
0faccf69
...
...
@@ -63,5 +63,15 @@ namespace Mall.Model.Extend.User
/// 用户ids
/// </summary>
public
string
UserIds
{
get
;
set
;
}
/// <summary>
/// 订单数量
/// </summary>
public
int
?
OrderNum
{
get
;
set
;
}
/// <summary>
/// 下载枚举ids
/// </summary>
public
List
<
int
>
ExcelEnumIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_Remit_Extend.cs
0 → 100644
View file @
0faccf69
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Common.Enum.User
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 商户分销提现表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_Remit_Extend
:
RB_Distributor_Remit
{
/// <summary>
/// 用户名称
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 头像
/// </summary>
public
string
Photo
{
get
;
set
;
}
/// <summary>
/// 来源
/// </summary>
public
UserSourceEnum
?
Source
{
get
;
set
;
}
/// <summary>
/// 下载枚举
/// </summary>
public
List
<
int
>
ExcelEnumIds
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
0faccf69
This diff is collapsed.
Click to expand it.
Mall.Module.User/UserCommonModule.cs
View file @
0faccf69
...
...
@@ -28,6 +28,10 @@ namespace Mall.Module.User
/// 分销自定义设置
/// </summary>
private
readonly
RB_Distributor_CustomRepository
distributor_CustomRepository
=
new
RB_Distributor_CustomRepository
();
/// <summary>
/// 分类样式
/// </summary>
private
readonly
RB_Product_CategoryStyleRepository
product_CategoryStyleRepository
=
new
RB_Product_CategoryStyleRepository
();
/// <summary>
/// 初始化分销基础配置
...
...
@@ -66,7 +70,7 @@ namespace Mall.Module.User
UpdateDate
=
DateTime
.
Now
,
UserNotes
=
""
,
WithdrawFee
=
0
,
WithdrawWay
=
Common
.
Enum
.
User
.
DistrbutorWithdrawWayEnum
.
ZDDK
,
WithdrawWay
=
"["
+
(
int
)
Common
.
Enum
.
User
.
DistrbutorWithdrawWayEnum
.
ZDDK
+
"]"
,
IsCommissionResidue
=
2
})
>
0
;
}
...
...
@@ -83,7 +87,7 @@ namespace Mall.Module.User
public
bool
InitializeDistributorCustomInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
OModel
=
distributor_CustomRepository
.
GetList
(
new
RB_Distributor_Custom_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
OModel
!
=
null
)
if
(
OModel
=
=
null
)
{
return
distributor_CustomRepository
.
Insert
(
new
RB_Distributor_Custom
()
{
...
...
@@ -130,5 +134,33 @@ namespace Mall.Module.User
return
true
;
}
}
/// <summary>
/// 初始化分类样式
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <returns></returns>
public
bool
InitializeCategoryStyleInfo
(
int
TenantId
,
int
MallBaseId
)
{
var
OModel
=
product_CategoryStyleRepository
.
GetList
(
new
RB_Product_CategoryStyle_Extend
()
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
}).
FirstOrDefault
();
if
(
OModel
==
null
)
{
return
product_CategoryStyleRepository
.
Insert
(
new
Model
.
Entity
.
Product
.
RB_Product_CategoryStyle
()
{
CategoryNum
=
1
,
CreateDate
=
DateTime
.
Now
,
Id
=
0
,
MallBaseId
=
MallBaseId
,
RowNum
=
1
,
Style
=
1
,
TenantId
=
TenantId
,
Type
=
1
,
UpdateDate
=
DateTime
.
Now
})
>
0
;
}
else
{
return
true
;
}
}
}
}
Mall.Module.User/UserModule.cs
View file @
0faccf69
This diff is collapsed.
Click to expand it.
Mall.Repository/Product/RB_Material_InfoRepository.cs
View file @
0faccf69
...
...
@@ -24,12 +24,17 @@ namespace Mall.Repository.Product
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
if
(
dmodel
.
Id
>=
100
)
{
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
...
...
Mall.Repository/Product/RB_Product_CategoryRepository.cs
0 → 100644
View file @
0faccf69
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品分类仓储层
/// </summary>
public
class
RB_Product_CategoryRepository
:
RepositoryBase
<
RB_Product_Category
>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Product_Category_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Product_Category_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Product_Category_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
Tier
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Tier
)}
=
{
dmodel
.
Tier
}
"
;
}
if
(
dmodel
.
ParentId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
ParentId
)}
=
{
dmodel
.
ParentId
}
"
;
}
if
(
dmodel
.
RootId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
RootId
)}
=
{
dmodel
.
RootId
}
"
;
}
if
(
dmodel
.
Enabled
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Enabled
)}
=
{
dmodel
.
Enabled
}
"
;
}
if
(
dmodel
.
IsShow
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
IsShow
)}
=
{
dmodel
.
IsShow
}
"
;
}
string
sql
=
$@"select * from RB_Product_Category where
{
where
}
order by Id asc"
;
return
GetPage
<
RB_Product_Category_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Product_Category_Extend
>
GetList
(
RB_Product_Category_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Product_Category_Extend
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Id
)}
in(
{
dmodel
.
CategoryIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
Tier
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Tier
)}
=
{
dmodel
.
Tier
}
"
;
}
if
(
dmodel
.
ParentId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
ParentId
)}
=
{
dmodel
.
ParentId
}
"
;
}
if
(
dmodel
.
RootId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
RootId
)}
=
{
dmodel
.
RootId
}
"
;
}
if
(
dmodel
.
Enabled
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
Enabled
)}
=
{
dmodel
.
Enabled
}
"
;
}
if
(
dmodel
.
IsShow
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_Category_Extend
.
IsShow
)}
=
{
dmodel
.
IsShow
}
"
;
}
string
sql
=
$@"select * from RB_Product_Category where
{
where
}
order by Id asc"
;
return
Get
<
RB_Product_Category_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Product_CategoryStyleRepository.cs
0 → 100644
View file @
0faccf69
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品分类样式仓储层
/// </summary>
public
class
RB_Product_CategoryStyleRepository
:
RepositoryBase
<
RB_Product_CategoryStyle
>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Product_CategoryStyle_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Product_CategoryStyle_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
string
sql
=
$@"select * from RB_Product_CategoryStyle where
{
where
}
order by Id asc"
;
return
GetPage
<
RB_Product_CategoryStyle_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Product_CategoryStyle_Extend
>
GetList
(
RB_Product_CategoryStyle_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Product_CategoryStyle_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
string
sql
=
$@"select * from RB_Product_CategoryStyle where
{
where
}
order by Id asc"
;
return
Get
<
RB_Product_CategoryStyle_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Distributor_InfoRepository.cs
View file @
0faccf69
...
...
@@ -33,6 +33,10 @@ namespace Mall.Repository.User
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
if
(
dmodel
.
GradeId
>=
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
GradeId
)}
=
{
dmodel
.
GradeId
}
"
;
}
...
...
@@ -77,6 +81,10 @@ where {where} order by di.CreateDate desc";
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
UserIds
))
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
UserId
)}
in(
{
dmodel
.
UserIds
}
)"
;
}
...
...
@@ -92,5 +100,59 @@ where {where} order by di.CreateDate desc";
string
sql
=
$@"select di.* from RB_Distributor_Info di where
{
where
}
order by di.CreateDate desc"
;
return
Get
<
RB_Distributor_Info_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取下载列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_Info_Extend
>
GetToExcelList
(
RB_Distributor_Info_Extend
dmodel
)
{
string
where
=
$@" 1=1 and di.
{
nameof
(
RB_Distributor_Info
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
if
(
dmodel
.
GradeId
>=
0
)
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
GradeId
)}
=
{
dmodel
.
GradeId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
Source
>
0
)
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Source
)}
=
{
dmodel
.
Source
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
NickName
))
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
dmodel
.
NickName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
))
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Moblie
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
}
string
sql
=
$@"select di.*,u.Name as NickName,u.Photo,u.Source,u.Moblie as Mobile,u.OrderNum from RB_Distributor_Info di
inner join rb_member_user u on di.UserId=u.Id
where
{
where
}
order by di.CreateDate desc"
;
return
Get
<
RB_Distributor_Info_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/User/RB_Distributor_RemitRepository.cs
0 → 100644
View file @
0faccf69
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System.Linq
;
namespace
Mall.Repository.User
{
/// <summary>
/// 分销商提现仓储层
/// </summary>
public
class
RB_Distributor_RemitRepository
:
RepositoryBase
<
RB_Distributor_Remit
>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_Remit_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_Remit_Extend
dmodel
)
{
string
where
=
$@" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
string
sql
=
$@"select r.*,u.Name as UserName,u.Photo,u.Source from RB_Distributor_Remit r
left join rb_member_user u on r.UserId = u.Id
where
{
where
}
order by r.Id desc"
;
return
GetPage
<
RB_Distributor_Remit_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_Remit_Extend
>
GetList
(
RB_Distributor_Remit_Extend
dmodel
)
{
string
where
=
$@" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_Remit
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_Remit
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_Remit
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
)}
=
{
dmodel
.
AuditStatus
}
"
;
}
string
sql
=
$@"select * from RB_Distributor_Remit where
{
where
}
order by Id desc"
;
return
Get
<
RB_Distributor_Remit_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取导出列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_Remit_Extend
>
GetDistributorRemitList
(
RB_Distributor_Remit_Extend
dmodel
)
{
string
where
=
$@" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
AuditStatus
>
0
)
{
where
+=
$@" and r.
{
nameof
(
RB_Distributor_Remit
.
AuditStatus
)}
=
{(
int
)
dmodel
.
AuditStatus
}
"
;
}
string
sql
=
$@"select r.*,u.Name as UserName,u.Photo,u.Source from RB_Distributor_Remit r
left join rb_member_user u on r.UserId = u.Id
where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Distributor_Remit_Extend
>(
sql
).
ToList
();
}
}
}
Mall.WebApi/Controllers/BaseController.cs
View file @
0faccf69
...
...
@@ -38,6 +38,7 @@ namespace Mall.WebApi.Controllers
{
JObject
parms
=
JObject
.
Parse
(
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
].
ToString
());
requestParm
.
uid
=
parms
.
GetStringValue
(
"uid"
);
requestParm
.
TenantId
=
Convert
.
ToInt32
(
requestParm
.
uid
);
}
#
endregion
//根据token 获取uid
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
0faccf69
...
...
@@ -40,6 +40,7 @@ namespace Mall.WebApi.Controllers.MallBase
RB_Material_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Material_Info_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetMaterialInfoPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
...
...
@@ -113,6 +114,7 @@ namespace Mall.WebApi.Controllers.MallBase
RB_Material_Group_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Material_Group_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetMaterialGroupList
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
...
...
@@ -345,5 +347,242 @@ namespace Mall.WebApi.Controllers.MallBase
}
#
endregion
#
region
商品分类
/// <summary>
/// 获取商品分类树形列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductCategoryPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Product_Category_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Product_Category_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetProductCategoryPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
Tier
,
x
.
ParentId
,
x
.
Sort
,
x
.
Icon
,
x
.
IconPath
,
x
.
BigIcon
,
x
.
BigIconPath
,
x
.
AdvertisingImage
,
x
.
AdvertisingImagePath
,
x
.
AdvertisingAddress
,
x
.
Enabled
,
x
.
IsShow
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取分类树形结构
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductCategoryTreeList
()
{
var
parms
=
RequestParm
;
RB_Product_Category_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Product_Category_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetProductCategoryTreeList
(
demodel
);
return
ApiResult
.
Success
(
""
,
list
);
}
/// <summary>
/// 保存分类
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetProductCategoryInfo
()
{
var
req
=
RequestParm
;
RB_Product_Category_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Product_Category_Extend
>(
req
.
msg
.
ToString
());
if
((
demodel
.
Tier
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择层级"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
return
ApiResult
.
ParamIsNull
(
"请输入分类名称"
);
}
if
(!
demodel
.
Sort
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请输入排序"
);
}
if
(
demodel
.
Tier
==
1
)
{
demodel
.
ParentId
=
0
;
}
else
if
(
demodel
.
Tier
>
1
)
{
if
((
demodel
.
ParentId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择上级"
);
}
}
demodel
.
TenantId
=
Convert
.
ToInt32
(
req
.
uid
);
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
Icon
??=
0
;
demodel
.
BigIcon
??=
0
;
demodel
.
AdvertisingImage
??=
0
;
demodel
.
AdvertisingAddress
??=
""
;
demodel
.
Enabled
??=
1
;
demodel
.
IsShow
??=
1
;
demodel
.
Status
??=
0
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
productModule
.
SetProductCategoryInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 删除分类
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DelProductCategoryInfo
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
CategoryId
=
parms
.
GetInt
(
"CategoryId"
,
0
);
if
(
CategoryId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择需删除分类id"
);
}
bool
flag
=
productModule
.
DelProductCategoryInfo
(
CategoryId
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 保存分类转移
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetProductCategoryTransfer
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
CategoryId
=
parms
.
GetInt
(
"CategoryId"
,
0
);
int
ParentId
=
parms
.
GetInt
(
"ParentId"
,
0
);
if
(
CategoryId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择需转移分类id"
);
}
if
(
ParentId
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择转入分类id"
);
}
if
(
CategoryId
==
ParentId
)
{
return
ApiResult
.
ParamIsNull
(
"不能转入同一分类下"
);
}
var
list
=
productModule
.
GetProductCategoryForALLChlid
(
CategoryId
,
Convert
.
ToInt32
(
req
.
uid
),
req
.
MallBaseId
);
if
(
list
.
Where
(
x
=>
x
.
Id
==
ParentId
).
Any
())
{
return
ApiResult
.
ParamIsNull
(
"不能转入当前分类的子集分类"
);
}
var
model
=
list
.
Where
(
x
=>
x
.
Id
==
CategoryId
).
FirstOrDefault
();
if
(
model
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"分类不存在,请核实后再试"
);
}
if
(
model
.
ParentId
==
ParentId
)
{
return
ApiResult
.
ParamIsNull
(
"已在当前分类下,未转移"
);
}
bool
flag
=
productModule
.
SetProductCategoryTransfer
(
model
,
ParentId
,
list
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 保存分类排序
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetProductCategorySort
()
{
var
req
=
RequestParm
;
List
<
RB_Product_CategorySort
>
delist
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Product_CategorySort
>>(
req
.
msg
.
ToString
());
if
(
delist
==
null
||
!
delist
.
Any
())
{
return
ApiResult
.
ParamIsNull
();
}
bool
flag
=
productModule
.
SetProductCategorySort
(
delist
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取分类样式
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductCategoryStyleInfo
()
{
var
parms
=
RequestParm
;
var
model
=
productModule
.
GetProductCategoryStyleInfo
(
parms
.
TenantId
,
parms
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
Type
,
model
.
Style
,
model
.
CategoryNum
,
model
.
RowNum
,
UpdateDate
=
model
.
UpdateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
}
/// <summary>
/// 保存分类样式
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetProductCategoryStyleInfo
()
{
var
req
=
RequestParm
;
RB_Product_CategoryStyle_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Product_CategoryStyle_Extend
>(
req
.
msg
.
ToString
());
demodel
.
CategoryNum
??=
1
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
RowNum
??=
1
;
demodel
.
Style
??=
1
;
demodel
.
TenantId
=
req
.
TenantId
;
demodel
.
Type
??=
1
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
productModule
.
SetProductCategoryStyleInfo
(
demodel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/UserController.cs
View file @
0faccf69
This diff is collapsed.
Click to expand it.
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