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
8339a359
Commit
8339a359
authored
Aug 12, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
4fc29488
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
9 deletions
+162
-9
AppletUserInfo.cs
Mall.Common/API/AppletUserInfo.cs
+4
-0
UserModule.cs
Mall.Module.User/UserModule.cs
+31
-1
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+14
-0
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+13
-6
AppletUserController.cs
Mall.WebApi/Controllers/User/AppletUserController.cs
+100
-2
No files found.
Mall.Common/API/AppletUserInfo.cs
View file @
8339a359
...
...
@@ -35,6 +35,10 @@ namespace Mall.Common
/// </summary>
public
int
UserId
{
get
;
set
;
}
/// 用户店铺id
/// </summary>
public
int
SmallShopId
{
get
;
set
;
}
/// <summary>
/// 唯一码
/// </summary>
...
...
Mall.Module.User/UserModule.cs
View file @
8339a359
...
...
@@ -6069,6 +6069,9 @@ namespace Mall.Module.User
#
region
申请微店
public
bool
ApplySmallShopsInfo
(
RB_SmallShops_Info_Extend
model
)
{
if
(
model
.
Id
==
0
)
...
...
@@ -6088,7 +6091,34 @@ namespace Mall.Module.User
return
smallShopsInfoRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 小程序用户更新微信名称、logo、公告
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
UpdateShopsInfo
(
RB_SmallShops_Info_Extend
model
)
{
if
(
model
.
Id
>
0
)
{
#
endregion
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_SmallShops_Info
.
Name
),
model
.
Name
},
{
nameof
(
RB_SmallShops_Info
.
Logo
),
model
.
Logo
},
{
nameof
(
RB_SmallShops_Info
.
Notice
),
model
.
Notice
},
{
nameof
(
RB_SmallShops_Info
.
UpdateDate
),
model
.
UpdateDate
},
};
IList
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_SmallShops_Info
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
smallShopsInfoRepository
.
Update
(
fileds
,
whereHelpers
);
}
return
false
;
}
#
endregion
}
}
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
8339a359
...
...
@@ -797,5 +797,19 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
}
#
endregion
#
region
微店
/// <summary>
/// 获取微店所有的id (包括自己)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
string
GetSmallShopChildIdStr
(
int
id
)
{
string
sql
=
$@" select GetSmallShopChildrenList_AllUser(
{
id
}
)"
;
return
ExecuteScalar
(
sql
).
ToString
();
}
#
endregion
}
}
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
8339a359
...
...
@@ -33,6 +33,7 @@ namespace Mall.WebApi.Controllers.User
private
readonly
UserModule
userModule
=
new
UserModule
();
private
readonly
CouponModule
couponModule
=
new
CouponModule
();
//private readonly Module.BaseSetUp.MallBaseModule MallBaseModule = new Module.BaseSetUp.MallBaseModule();
/// <summary>
/// 商户小程序处理类
/// </summary>
...
...
@@ -174,22 +175,24 @@ namespace Mall.WebApi.Controllers.User
Source
=
demodel
.
Source
,
SecretKey
=
demodel
.
SecretKey
,
SuperiorId
=
demodel
.
SuperiorId
??
0
,
Token
=
token
Token
=
token
,
SmallShopId
=
0
};
UserReidsCache
.
AppletUserInfoSet
(
UserModuleCacheKeyConfig
.
Applet_Login_Info
+
UserId
,
appletUserInfo
,
Config
.
JwtExpirTime
);
if
(
couponResult
!=
null
&&
couponResult
.
ID
>
0
)
{
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Success
,
""
,
couponResult
.
Name
,
appletUserInfo
);
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Success
,
""
,
couponResult
.
Name
,
appletUserInfo
);
}
else
{
else
{
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Fail
,
""
,
""
,
appletUserInfo
);
}
}
return
ApiResult
.
CouponFailed
(
ResultCode
.
Fail
,
""
,
""
);
// return ApiResult.Failed("注册失败,请联系管理员");
// return ApiResult.Failed("注册失败,请联系管理员");
}
else
{
...
...
@@ -220,6 +223,9 @@ namespace Mall.WebApi.Controllers.User
string
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
var
mmodel
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
umodel
.
MallBaseId
});
//2020-08-12 Add By:W
var
smallShopsInfoModle
=
userModule
.
GetSmallShopsInfoList
(
new
RB_SmallShops_Info_Extend
{
TenantId
=
umodel
.
TenantId
,
MallBaseId
=
umodel
.
MallBaseId
,
UserId
=
umodel
.
Id
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
AppletUserInfo
appletUserInfo
=
new
AppletUserInfo
()
{
MallBaseId
=
umodel
.
MallBaseId
,
...
...
@@ -233,7 +239,8 @@ namespace Mall.WebApi.Controllers.User
Source
=
demodel
.
Source
,
SecretKey
=
umodel
.
SecretKey
,
SuperiorId
=
umodel
.
SuperiorId
??
0
,
Token
=
token
Token
=
token
,
SmallShopId
=
(
smallShopsInfoModle
!=
null
&&
smallShopsInfoModle
.
AuditStatus
==
DistributorAuditStatusEnum
.
Audited
)
?
smallShopsInfoModle
.
Id
:
0
};
UserReidsCache
.
AppletUserInfoSet
(
UserModuleCacheKeyConfig
.
Applet_Login_Info
+
umodel
.
Id
,
appletUserInfo
,
Config
.
JwtExpirTime
);
return
ApiResult
.
CouponSuccess
(
ResultCode
.
Fail
,
""
,
""
,
appletUserInfo
);
...
...
Mall.WebApi/Controllers/User/AppletUserController.cs
View file @
8339a359
...
...
@@ -1698,10 +1698,28 @@ namespace Mall.WebApi.Controllers.User
}
#
endregion
#
region
开店申请
#
region
微店
/// <summary>
/// 新增修改地址
/// 获取微信基础设置信息
/// </summary>
/// <returns></returns>
public
ApiResult
GetMicroShopBasics
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
microShopBasics
=
MallBaseModule
.
GetMicroShopBasicsList
(
new
Model
.
Entity
.
BaseSetUp
.
RB_MicroShop_Basics
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
}).
FirstOrDefault
();
if
(
microShopBasics
==
null
)
{
microShopBasics
=
new
Model
.
Entity
.
BaseSetUp
.
RB_MicroShop_Basics
();
}
return
ApiResult
.
Success
(
""
,
microShopBasics
);
}
/// <summary>
/// 申请微店
/// </summary>
/// <returns></returns>
[
HttpPost
]
...
...
@@ -1775,6 +1793,7 @@ namespace Mall.WebApi.Controllers.User
demodel
.
Name
=
userInfo
.
Photo
;
}
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
GradeId
=
0
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
...
...
@@ -1792,6 +1811,85 @@ namespace Mall.WebApi.Controllers.User
}
}
/// <summary>
/// 更新微店信息
/// </summary>
/// <returns></returns>
public
ApiResult
UpdateShopsInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_SmallShops_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_SmallShops_Info_Extend
>(
req
.
msg
.
ToString
());
var
oldList
=
userModule
.
GetSmallShopsInfoList
(
new
RB_SmallShops_Info_Extend
{
TenantId
=
userInfo
.
TenantId
,
MallBaseId
=
userInfo
.
MallBaseId
,
UserId
=
userInfo
.
UserId
}).
OrderByDescending
(
x
=>
x
.
CreateDate
).
FirstOrDefault
();
if
(
oldList
!=
null
)
{
if
(
oldList
.
AuditStatus
==
DistributorAuditStatusEnum
.
Reject
)
{
return
ApiResult
.
Failed
(
"您之前的申请已被拒绝,不能修改"
);
}
else
if
(
oldList
.
AuditStatus
==
DistributorAuditStatusEnum
.
Auditing
)
{
return
ApiResult
.
Failed
(
"您的申请审核中,不能修改"
);
}
}
else
{
return
ApiResult
.
Failed
(
"您还未申请成为微店"
);
}
demodel
.
Id
=
oldList
.
Id
;
demodel
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
flag
=
userModule
.
UpdateShopsInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
(
""
,
"更新成功"
);
}
else
{
return
ApiResult
.
Failed
(
""
,
"更新失败"
);
}
}
/// <summary>
/// 获取我的团队里粉象返佣标题
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GerSmallShopsMyTeamTitelListForFX
()
{
var
userInfo
=
AppletUserInfo
;
var
obj
=
userModule
.
GerUserMyTeamTitelListForFX
(
userInfo
);
return
ApiResult
.
Success
(
""
,
obj
);
}
/// <summary>
/// 获取我的团队 粉象返佣列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetSmallShopsMyTeamPageListForFX
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
req
.
msg
.
ToString
());
RB_Distributor_Info_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_Info_Extend
>(
req
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
pageModel
.
pageData
=
userModule
.
GetUserMyTeamPageListForFX
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
count
,
demodel
);
pageModel
.
count
=
Convert
.
ToInt32
(
count
);
return
ApiResult
.
Success
(
""
,
pageModel
);
}
#
endregion
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment