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
6bac38c9
Commit
6bac38c9
authored
Jul 15, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
48ab28ce
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
285 additions
and
77 deletions
+285
-77
UserInfo.cs
Mall.Common/API/UserInfo.cs
+14
-14
RB_Distributor_FXCommission.cs
Mall.Model/Entity/User/RB_Distributor_FXCommission.cs
+99
-0
RB_Distributor_FXCommission_Extend.cs
Mall.Model/Extend/User/RB_Distributor_FXCommission_Extend.cs
+25
-0
RB_Distributor_FXGrade_Extend.cs
Mall.Model/Extend/User/RB_Distributor_FXGrade_Extend.cs
+6
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+1
-1
RB_Distributor_FXCommissionRepository.cs
....Repository/User/RB_Distributor_FXCommissionRepository.cs
+78
-0
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+62
-62
No files found.
Mall.Common/API/UserInfo.cs
View file @
6bac38c9
...
...
@@ -127,20 +127,20 @@ namespace Mall.Common
/// </summary>
public
int
EmpId
{
get
;
set
;
}
//
public string erptoken { get; set; }
///
//
<summary>
///
//
erp用户id
///
//
</summary>
//
public int ERPEmpId { get; set; }
///
//
<summary>
///
//
erp公司id
///
//
</summary>
//
public int ERPBranchId { get; set; }
///
//
<summary>
///
//
erp集团id
///
//
</summary>
//
public int ERPGroupId { get; set; }
public
string
erptoken
{
get
;
set
;
}
/// <summary>
/// erp用户id
/// </summary>
public
int
ERPEmpId
{
get
;
set
;
}
/// <summary>
/// erp公司id
/// </summary>
public
int
ERPBranchId
{
get
;
set
;
}
/// <summary>
/// erp集团id
/// </summary>
public
int
ERPGroupId
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Distributor_FXCommission.cs
0 → 100644
View file @
6bac38c9
using
Mall.Common.AOP
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 粉象返佣等级表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Distributor_FXCommission
{
/// <summary>
/// Id
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 等级ID
/// </summary>
public
int
FXGradeId
{
get
;
set
;
}
/// <summary>
/// 返佣等级ID
/// </summary>
public
int
CommissionGradeId
{
get
;
set
;
}
/// <summary>
/// 等级类型,-直接,2-间接
/// </summary>
public
int
GradeType
{
get
;
set
;
}
/// <summary>
/// 返佣金额
/// </summary>
public
decimal
?
CommissionPrice
{
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/Extend/User/RB_Distributor_FXCommission_Extend.cs
0 → 100644
View file @
6bac38c9
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_Distributor_FXCommission_Extend
:
RB_Distributor_FXCommission
{
/// <summary>
/// GradeName
/// </summary>
public
string
GradeName
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Distributor_FXGrade_Extend.cs
View file @
6bac38c9
...
...
@@ -17,5 +17,11 @@ namespace Mall.Model.Extend.User
/// ids
/// </summary>
public
string
GradeIds
{
get
;
set
;
}
/// <summary>
/// 返佣佣金
/// </summary>
public
List
<
RB_Distributor_FXCommission_Extend
>
FXCommissionList
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
6bac38c9
...
...
@@ -2291,7 +2291,7 @@ namespace Mall.Module.Product
var
categoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
GoodsId
).
ToList
();
item
.
InventoryNum
=
gmodel
.
InventoryNum
??
0
;
item
.
CostMoney
=
gmodel
.
CostPrice
??
0
;
item
.
CostMoney
=
gmodel
.
CostPrice
??
0
;
//(gmodel.IsCustomSpecification==2)?(gmodel.CostPrice ?? 0):(speciPList.Where(x => x.GoodsId == item.GoodsId && x.SpecificationSort == item.SpecificationSort).FirstOrDefault().CostMoney);
item
.
ProductCode
=
gmodel
.
GoodsNumbers
;
item
.
CategoryIdList
=
categoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
ToList
();
int
GoodsWeight
=
gmodel
.
GoodsWeight
??
0
;
//商品重量
...
...
Mall.Repository/User/RB_Distributor_FXCommissionRepository.cs
0 → 100644
View file @
6bac38c9
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
{
public
class
RB_Distributor_FXCommissionRepository
:
RepositoryBase
<
RB_Distributor_FXCommission
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Distributor_FXCommission
);
}
}
/// <summary>
/// 卡券信息列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
GetCouponPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Distributor_FXCommission_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Distributor_FXCommission_Extend
.
Status
)}
=0"
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
FXGradeId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
FXGradeId
)}
=
{
query
.
FXGradeId
}
"
);
}
}
return
GetPage
<
RB_Distributor_FXCommission_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 卡券信息列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Distributor_FXCommission_Extend
>
GetCouponList
(
RB_Distributor_FXCommission_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_Distributor_FXCommission_Extend
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
FXGradeId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Distributor_FXCommission_Extend
.
FXGradeId
)}
=
{
query
.
FXGradeId
}
"
);
}
}
return
Get
<
RB_Distributor_FXCommission_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/User/TenantController.cs
View file @
6bac38c9
...
...
@@ -77,7 +77,7 @@ namespace Mall.WebApi.Controllers.User
private
ProductModule
productModule
=
new
ProductModule
();
//
private Module.Property.AuthorizeModule authorizeModule = new Module.Property.AuthorizeModule();
private
Module
.
Property
.
AuthorizeModule
authorizeModule
=
new
Module
.
Property
.
AuthorizeModule
();
#
region
商户信息
[
AllowAnonymous
]
...
...
@@ -115,63 +115,63 @@ namespace Mall.WebApi.Controllers.User
#
region
add
by
:
W
2020
-
07
-
06
erp
授权信息
//
var erpUserInfo = new Mall.Model.Entity.Property.RB_Employee();
//
string erptoken = "";
//
if (model.EmpId > 0)
//
{
//
//判断当前登录人是否有erp账号信息
//
var authorizeModel = authorizeModule.GetAuthorizeList(new Model.Extend.Property.RB_ERP_Authorize_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId, MallUserId = model.EmpId, Type = 1 }).FirstOrDefault();
//
if (authorizeModel != null && authorizeModel.Status == 2)
//
{
//
//先查询是否存在是否是登陆手机号登陆
//
erpUserInfo = authorizeModule.GetByLoginMobileAndPwd(authorizeModel.Account, authorizeModel.Password, authorizeModel.ERPGroupId);
//
if (erpUserInfo == null)
//
{
//
//再查询是否存在是否是账号登陆
//
erpUserInfo = authorizeModule.GetNewByAccountAndPwd(authorizeModel.Account, authorizeModel.Password, authorizeModel.ERPGroupId);
//
}
//
if (erpUserInfo != null && !string.IsNullOrWhiteSpace(erpUserInfo.EmLoginMobile) && erpUserInfo.IsLeave == 0)
//
{
//
TokenUserInfo erpUserInfoToken = new TokenUserInfo { uid = erpUserInfo.EmployeeId.ToString(), requestFrom = Common.Enum.ApiRequestFromEnum.ERP };
//
#region JWT
//
IDateTimeProvider erpprovider = new UtcDateTimeProvider();
//
var erpnow = erpprovider.GetNow().AddMinutes(-1);
//
var erpunixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); // or use JwtValidator.UnixEpoch
//
var erpsecondsSinceEpoch = Math.Round((erpnow - erpunixEpoch).TotalSeconds);
//
var erppayload = new Dictionary<string, object>
//
{
//
{"iat",erpsecondsSinceEpoch },
//
{"exp",erpsecondsSinceEpoch+Config.JwtExpirTime},
//
{"userInfo",erpUserInfoToken }
//
};
//
IJwtAlgorithm erpalgorithm = new HMACSHA256Algorithm();
//
IJsonSerializer erpserializer = new JsonNetSerializer();
//
IBase64UrlEncoder erpurlEncoder = new JwtBase64UrlEncoder();
//
IJwtEncoder erpencoder = new JwtEncoder(erpalgorithm, erpserializer, erpurlEncoder);
//
string erpsecret = Config.JwtSecretKey;
//
erptoken = erpencoder.Encode(erppayload, erpsecret);
//
#endregion
//
//ERPUserInfo erpObj = new ERPUserInfo
//
//{
//
// Domain = authorizeModel.DomainName,
//
// emName = erpUserInfo.EmName,
//
// EmployeeId = erpUserInfo.EmployeeId,
//
// RB_Group_id = erpUserInfo.RB_Group_id,
//
// RB_Branch_id = erpUserInfo.RB_Branch_id,
//
// RB_Post_Id = erpUserInfo.RB_Post_Id,
//
// RB_Department_Id = erpUserInfo.RB_Department_Id,
//
// token = erptoken,
//
// SecretKey = erpUserInfo.SecretKey,
//
// //ImAccount = imAccount?.AccID ?? model.EmLoginMobile, //model.EmLoginMobile,
//
// //ImToken = IMService.DefaultPassword(),
//
//};
//
//UserReidsCache.UserInfoSet(UserModuleCacheKeyConfig.ERP_Login_Info_+ erpUserInfo.EmployeeId, erpObj, Config.JwtExpirTime);
//
}
//
}
//
}
var
erpUserInfo
=
new
Mall
.
Model
.
Entity
.
Property
.
RB_Employee
();
string
erptoken
=
""
;
if
(
model
.
EmpId
>
0
)
{
//判断当前登录人是否有erp账号信息
var
authorizeModel
=
authorizeModule
.
GetAuthorizeList
(
new
Model
.
Extend
.
Property
.
RB_ERP_Authorize_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
MallUserId
=
model
.
EmpId
,
Type
=
1
}).
FirstOrDefault
();
if
(
authorizeModel
!=
null
&&
authorizeModel
.
Status
==
2
)
{
//先查询是否存在是否是登陆手机号登陆
erpUserInfo
=
authorizeModule
.
GetByLoginMobileAndPwd
(
authorizeModel
.
Account
,
authorizeModel
.
Password
,
authorizeModel
.
ERPGroupId
);
if
(
erpUserInfo
==
null
)
{
//再查询是否存在是否是账号登陆
erpUserInfo
=
authorizeModule
.
GetNewByAccountAndPwd
(
authorizeModel
.
Account
,
authorizeModel
.
Password
,
authorizeModel
.
ERPGroupId
);
}
if
(
erpUserInfo
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
erpUserInfo
.
EmLoginMobile
)
&&
erpUserInfo
.
IsLeave
==
0
)
{
TokenUserInfo
erpUserInfoToken
=
new
TokenUserInfo
{
uid
=
erpUserInfo
.
EmployeeId
.
ToString
(),
requestFrom
=
Common
.
Enum
.
ApiRequestFromEnum
.
ERP
};
#
region
JWT
IDateTimeProvider
erpprovider
=
new
UtcDateTimeProvider
();
var
erpnow
=
erpprovider
.
GetNow
().
AddMinutes
(-
1
);
var
erpunixEpoch
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
// or use JwtValidator.UnixEpoch
var
erpsecondsSinceEpoch
=
Math
.
Round
((
erpnow
-
erpunixEpoch
).
TotalSeconds
);
var
erppayload
=
new
Dictionary
<
string
,
object
>
{
{
"iat"
,
erpsecondsSinceEpoch
},
{
"exp"
,
erpsecondsSinceEpoch
+
Config
.
JwtExpirTime
},
{
"userInfo"
,
erpUserInfoToken
}
};
IJwtAlgorithm
erpalgorithm
=
new
HMACSHA256Algorithm
();
IJsonSerializer
erpserializer
=
new
JsonNetSerializer
();
IBase64UrlEncoder
erpurlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtEncoder
erpencoder
=
new
JwtEncoder
(
erpalgorithm
,
erpserializer
,
erpurlEncoder
);
string
erpsecret
=
Config
.
JwtSecretKey
;
erptoken
=
erpencoder
.
Encode
(
erppayload
,
erpsecret
);
#
endregion
//ERPUserInfo erpObj = new ERPUserInfo
//{
// Domain = authorizeModel.DomainName,
// emName = erpUserInfo.EmName,
// EmployeeId = erpUserInfo.EmployeeId,
// RB_Group_id = erpUserInfo.RB_Group_id,
// RB_Branch_id = erpUserInfo.RB_Branch_id,
// RB_Post_Id = erpUserInfo.RB_Post_Id,
// RB_Department_Id = erpUserInfo.RB_Department_Id,
// token = erptoken,
// SecretKey = erpUserInfo.SecretKey,
// //ImAccount = imAccount?.AccID ?? model.EmLoginMobile, //model.EmLoginMobile,
// //ImToken = IMService.DefaultPassword(),
//};
//UserReidsCache.UserInfoSet(UserModuleCacheKeyConfig.ERP_Login_Info_+ erpUserInfo.EmployeeId, erpObj, Config.JwtExpirTime);
}
}
}
#
endregion
...
...
@@ -210,10 +210,10 @@ namespace Mall.WebApi.Controllers.User
SecretKey
=
""
,
MallBaseId
=
0
,
EmpId
=
model
.
EmpId
,
//
erptoken = erptoken,
//
ERPEmpId = erpUserInfo.EmployeeId,
//
ERPBranchId = erpUserInfo.RB_Branch_id,
//
ERPGroupId = erpUserInfo.RB_Group_id
erptoken
=
erptoken
,
ERPEmpId
=
erpUserInfo
.
EmployeeId
,
ERPBranchId
=
erpUserInfo
.
RB_Branch_id
,
ERPGroupId
=
erpUserInfo
.
RB_Group_id
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
...
...
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