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
c38f9893
Commit
c38f9893
authored
Jun 09, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
和平分销获取下线
parent
fbb1f486
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
5 deletions
+146
-5
UserModule.cs
Mall.Module.User/UserModule.cs
+87
-5
RB_Distributor_InfoRepository.cs
Mall.Repository/User/RB_Distributor_InfoRepository.cs
+3
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+2
-0
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+54
-0
No files found.
Mall.Module.User/UserModule.cs
View file @
c38f9893
...
@@ -1215,6 +1215,75 @@ namespace Mall.Module.User
...
@@ -1215,6 +1215,75 @@ namespace Mall.Module.User
return
list
;
return
list
;
}
}
/// <summary>
/// 获取待审核的所有下线列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_Info_Extend
>
GetHpUserReferralsAuditList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Distributor_Info_Extend
demodel
)
{
var
list
=
distributor_InfoRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
return
list
;
}
/// <summary>
/// 设置和平下线自行审核
/// </summary>
/// <param name="userId"></param>
/// <param name="type"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetHpUserReferralsAudit
(
int
userId
,
int
type
,
AppletUserInfo
userInfo
)
{
if
(
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
)
==
2
)
{
return
false
;
}
var
disModel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
userId
,
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
disModel
==
null
||
disModel
.
AuditStatus
==
DistributorAuditStatusEnum
.
Reject
)
{
return
false
;
}
if
(
type
==
1
)
{
//查询最小的代理等级
var
glist
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
});
int
MinId
=
glist
.
Where
(
x
=>
(
x
.
IsGuest
??
0
)
!=
1
).
Min
(
x
=>
x
.
Grade
??
0
);
int
MinGradeId
=
glist
.
Where
(
x
=>
x
.
Grade
==
MinId
).
FirstOrDefault
()?.
Id
??
0
;
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
AuditStatus
),
DistributorAuditStatusEnum
.
Audited
},
{
nameof
(
RB_Distributor_Info
.
HPGradeId
),
MinGradeId
},
{
nameof
(
RB_Distributor_Info
.
Remark
),
"上线自行审核通过"
},
{
nameof
(
RB_Distributor_Info
.
AuditDate
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Info
.
Id
),
FiledValue
=
disModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
AuditStatus
),
DistributorAuditStatusEnum
.
Reject
},
{
nameof
(
RB_Distributor_Info
.
Remark
),
"上线自行审核拒绝"
},
{
nameof
(
RB_Distributor_Info
.
AuditDate
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Info
.
Id
),
FiledValue
=
disModel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
distributor_InfoRepository
.
Update
(
keyValues
,
wheres
);
}
}
/// <summary>
/// <summary>
/// 新增分销商
/// 新增分销商
/// </summary>
/// </summary>
...
@@ -2429,13 +2498,25 @@ namespace Mall.Module.User
...
@@ -2429,13 +2498,25 @@ namespace Mall.Module.User
{
{
return
"分销商不存在"
;
return
"分销商不存在"
;
}
}
int
HpEnabled
=
GetHpDistributorIsEnabled
(
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
//分销商等级
//分销商等级
string
GradeName
=
"默认等级"
;
string
GradeName
=
"默认等级"
;
if
(
HpEnabled
==
1
)
{
if
(
model
.
HPGradeId
>
0
)
{
var
gmodel
=
distributor_HPGradeInfoRepository
.
GetEntity
(
model
.
HPGradeId
);
GradeName
=
gmodel
?.
GradeName
??
""
;
}
}
else
{
if
(
model
.
GradeId
>
0
)
if
(
model
.
GradeId
>
0
)
{
{
var
gmodel
=
distributor_GradeRepository
.
GetEntity
(
model
.
GradeId
);
var
gmodel
=
distributor_GradeRepository
.
GetEntity
(
model
.
GradeId
);
GradeName
=
gmodel
?.
Name
??
""
;
GradeName
=
gmodel
?.
Name
??
""
;
}
}
}
//已提现佣金 //未结算佣金
//已提现佣金 //未结算佣金
var
commModel
=
distributor_RemitRepository
.
GetDistributorCommissionStatiscs
(
userInfo
.
UserId
);
var
commModel
=
distributor_RemitRepository
.
GetDistributorCommissionStatiscs
(
userInfo
.
UserId
);
//提现总额
//提现总额
...
@@ -2494,7 +2575,8 @@ namespace Mall.Module.User
...
@@ -2494,7 +2575,8 @@ namespace Mall.Module.User
GradeName
,
GradeName
,
SuperiorId
,
SuperiorId
,
SuperiorName
,
SuperiorName
,
DistributorGradeEntrance
=
basicsModel
?.
GradeEntrance
??
2
,
DistributorGradeEntrance
=
HpEnabled
==
1
?
2
:
(
basicsModel
?.
GradeEntrance
??
2
),
HpReferralsGradeAudit
=
HpEnabled
==
1
?
(
basicsModel
?.
HpReferralsGradeAudit
??
2
)
:
2
,
CommissionWithdrawal
=
model
.
CommissionWithdrawal
??
0
,
CommissionWithdrawal
=
model
.
CommissionWithdrawal
??
0
,
TXCommission
=
commModel
?.
TXCommission
??
0
,
TXCommission
=
commModel
?.
TXCommission
??
0
,
WJSCommission
=
commModel
?.
WJSCommission
??
0
,
WJSCommission
=
commModel
?.
WJSCommission
??
0
,
...
@@ -2931,7 +3013,7 @@ namespace Mall.Module.User
...
@@ -2931,7 +3013,7 @@ namespace Mall.Module.User
if
(
SdisModel
!=
null
)
if
(
SdisModel
!=
null
)
{
{
var
glist
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
});
var
glist
=
distributor_HPGradeInfoRepository
.
GetList
(
new
RB_Distributor_HPGradeInfo_Extend
()
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
});
int
MinId
=
glist
.
Where
(
x
=>
(
x
.
IsGuest
??
0
)
!=
1
).
M
ax
(
x
=>
x
.
Grade
??
0
);
int
MinId
=
glist
.
Where
(
x
=>
(
x
.
IsGuest
??
0
)
!=
1
).
M
in
(
x
=>
x
.
Grade
??
0
);
var
sdisgM
=
glist
.
Where
(
x
=>
x
.
Id
==
SdisModel
.
HPGradeId
).
FirstOrDefault
();
var
sdisgM
=
glist
.
Where
(
x
=>
x
.
Id
==
SdisModel
.
HPGradeId
).
FirstOrDefault
();
if
(
MinId
==
(
sdisgM
?.
Grade
??
0
))
{
if
(
MinId
==
(
sdisgM
?.
Grade
??
0
))
{
IsShowDistributionCenter
=
2
;
//其上级为最后一级 和平下不能显示分销中心
IsShowDistributionCenter
=
2
;
//其上级为最后一级 和平下不能显示分销中心
...
...
Mall.Repository/User/RB_Distributor_InfoRepository.cs
View file @
c38f9893
...
@@ -54,6 +54,9 @@ namespace Mall.Repository.User
...
@@ -54,6 +54,9 @@ namespace Mall.Repository.User
{
{
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Mobile
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
where
+=
$@" and di.
{
nameof
(
RB_Distributor_Info
.
Mobile
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
}
}
if
(
dmodel
.
SuperiorId
>
0
)
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
SuperiorId
)}
=
{
dmodel
.
SuperiorId
}
"
;
}
string
sql
=
$@"select di.*,u.Name as NickName,u.SuperiorId,u.Photo,u.Source from RB_Distributor_Info di
string
sql
=
$@"select di.*,u.Name as NickName,u.SuperiorId,u.Photo,u.Source from RB_Distributor_Info di
inner join rb_member_user u on di.UserId=u.Id
inner join rb_member_user u on di.UserId=u.Id
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
c38f9893
...
@@ -195,10 +195,12 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -195,10 +195,12 @@ namespace Mall.WebApi.Controllers.MallBase
PaymentWayName
=
x
.
PaymentWay
.
GetEnumName
(),
PaymentWayName
=
x
.
PaymentWay
.
GetEnumName
(),
DetailList
=
x
.
DetailList
.
Select
(
y
=>
new
{
DetailList
=
x
.
DetailList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
Id
,
y
.
GoodsId
,
y
.
CoverImagePath
,
y
.
CoverImagePath
,
y
.
OrderType
,
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
y
.
GoodsName
,
y
.
SpecificationSort
,
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
),
SpecificationList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
y
.
Specification
),
y
.
ProductCode
,
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Final_Price
,
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
c38f9893
...
@@ -377,6 +377,60 @@ namespace Mall.WebApi.Controllers.User
...
@@ -377,6 +377,60 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
""
,
obj
);
return
ApiResult
.
Success
(
""
,
obj
);
}
}
/// <summary>
/// 获取和平下线
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetHpUserReferralsAuditList
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
req
.
msg
.
ToString
());
RB_Distributor_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_Info_Extend
>(
req
.
msg
.
ToString
());
demodel
.
SuperiorId
=
userInfo
.
UserId
;
demodel
.
AuditStatus
=
DistributorAuditStatusEnum
.
Auditing
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
list
=
userModule
.
GetHpUserReferralsAuditList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
UserId
,
UserName
=
x
.
NickName
,
x
.
Photo
,
x
.
Name
,
x
.
Mobile
,
x
.
Source
,
SourceName
=
x
.
Source
.
GetEnumName
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 和平下线自行审核
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetHpUserReferralsAudit
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
UserId
=
parms
.
GetInt
(
"UserId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 1 审核通过 2审核拒绝
bool
flag
=
userModule
.
SetHpUserReferralsAudit
(
UserId
,
Type
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// <summary>
/// 获取用户升级条件
/// 获取用户升级条件
/// </summary>
/// </summary>
...
...
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