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
e5295f14
Commit
e5295f14
authored
Sep 07, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1调整首店
parent
92d415dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+14
-14
RB_FirstShop_ListRepository.cs
Mall.Repository/TradePavilion/RB_FirstShop_ListRepository.cs
+2
-2
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+1
-0
No files found.
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
e5295f14
...
...
@@ -321,14 +321,14 @@ namespace Mall.Module.TradePavilion
//查询该榜单
var
listModel
=
firstShop_ListRepository
.
GetEntity
(
listId
);
if
(
listModel
==
null
)
{
return
null
;
}
var
enrollList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
userInfo
.
MallBaseId
,
ListId
=
listId
,
UserId
=
userInfo
.
UserId
});
if
(
enrollId
>
0
)
{
enrollList
=
enrollList
.
Where
(
x
=>
x
.
Id
!=
enrollId
).
ToList
();
}
//排除当前修改的
//
var enrollList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = userInfo.MallBaseId, ListId = listId, UserId = userInfo.UserId });
//
if (enrollId > 0) { enrollList = enrollList.Where(x => x.Id != enrollId).ToList(); }//排除当前修改的
//查询用户下所有的品牌
if
(
listModel
.
ObjectTypeIds
.
Contains
(
"1"
))
{
//品牌
var
blist
=
brandRepository
.
GetBrandList
(
new
RB_Brand_Extend
()
{
MallBaseId
=
userInfo
.
MallBaseId
,
UserId
=
userInfo
.
UserId
});
blist
=
blist
.
Where
(
x
=>
!
enrollList
.
Where
(
x
=>
x
.
ObjectType
==
Common
.
Enum
.
TradePavilion
.
ListObjectTypeEnum
.
Brand
).
Select
(
y
=>
y
.
ObjectId
).
Contains
(
x
.
ID
)).
ToList
();
//
blist = blist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Brand).Select(y => y.ObjectId).Contains(x.ID)).ToList();
if
(
blist
.
Any
())
{
foreach
(
var
item
in
blist
)
...
...
@@ -346,7 +346,7 @@ namespace Mall.Module.TradePavilion
if
(
listModel
.
ObjectTypeIds
.
Contains
(
"2"
))
{
var
clist
=
carrierRepository
.
GetCarrierList
(
new
RB_Carrier_Extend
()
{
MallBaseId
=
userInfo
.
MallBaseId
,
UserId
=
userInfo
.
UserId
});
clist
=
clist
.
Where
(
x
=>
!
enrollList
.
Where
(
x
=>
x
.
ObjectType
==
Common
.
Enum
.
TradePavilion
.
ListObjectTypeEnum
.
Carrier
).
Select
(
y
=>
y
.
ObjectId
).
Contains
(
x
.
ID
)).
ToList
();
//
clist = clist.Where(x => !enrollList.Where(x => x.ObjectType == Common.Enum.TradePavilion.ListObjectTypeEnum.Carrier).Select(y => y.ObjectId).Contains(x.ID)).ToList();
if
(
clist
.
Any
())
{
foreach
(
var
item
in
clist
)
...
...
@@ -386,11 +386,11 @@ namespace Mall.Module.TradePavilion
if
(
demodel
.
Id
>
0
)
{
#
region
验证
var
valistList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
demodel
.
MallBaseId
,
ListId
=
demodel
.
ListId
,
UserId
=
demodel
.
UserId
,
ObjectType
=
demodel
.
ObjectType
});
if
(
valistList
.
Where
(
x
=>
x
.
Id
!=
demodel
.
Id
).
Any
())
{
return
"该品牌/载体已报名,无法重复报名"
;
}
//
var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
//
if (valistList.Where(x => x.Id != demodel.Id).Any())
//
{
//
return "该品牌/载体已报名,无法重复报名";
//
}
#
endregion
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_FirstShop_ListEnroll_Extend
.
ObjectType
),
demodel
.
ObjectType
},
...
...
@@ -410,11 +410,11 @@ namespace Mall.Module.TradePavilion
else
{
#
region
验证
var
valistList
=
firstShop_ListEnrollRepository
.
GetList
(
new
RB_FirstShop_ListEnroll_Extend
()
{
MallBaseId
=
demodel
.
MallBaseId
,
ListId
=
demodel
.
ListId
,
UserId
=
demodel
.
UserId
,
ObjectType
=
demodel
.
ObjectType
});
if
(
valistList
.
Any
())
{
return
"该品牌/载体已报名,无法重复报名"
;
}
//
var valistList = firstShop_ListEnrollRepository.GetList(new RB_FirstShop_ListEnroll_Extend() { MallBaseId = demodel.MallBaseId, ListId = demodel.ListId, UserId = demodel.UserId, ObjectType = demodel.ObjectType });
//
if (valistList.Any())
//
{
//
return "该品牌/载体已报名,无法重复报名";
//
}
#
endregion
bool
flag
=
firstShop_ListEnrollRepository
.
Insert
(
demodel
)
>
0
;
return
flag
?
""
:
"报名失败,请联系管理人员"
;
...
...
Mall.Repository/TradePavilion/RB_FirstShop_ListRepository.cs
View file @
e5295f14
...
...
@@ -192,9 +192,9 @@ where {where} order by w.Id desc
where
+=
$@" and e.
{
nameof
(
RB_FirstShop_ListEnroll_Extend
.
UserId
)}
=
{
dmodel
.
CreateBy
}
"
;
}
string
sql
=
$@"select w.*,e.ObjectType,e.ObjectId,e.Rank,e.MedalImage,e.RankListState from RB_FirstShop_List w
string
sql
=
$@"select w.*,e.
Id as EnrollId,e.
ObjectType,e.ObjectId,e.Rank,e.MedalImage,e.RankListState from RB_FirstShop_List w
left join rb_firstshop_listenroll e on w.Id = e.ListId
where
{
where
}
group by w.Id,e.ObjectType,e.ObjectId order by w.EndDate desc
where
{
where
}
group by w.Id,e.
Id,e.
ObjectType,e.ObjectId order by w.EndDate desc
"
;
return
GetPage
<
RB_FirstShop_List_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
}
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
e5295f14
...
...
@@ -2081,6 +2081,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
RB_FirstShop_List_Extend
demodel
=
JsonHelper
.
DeserializeObject
<
RB_FirstShop_List_Extend
>(
req
.
msg
.
ToString
());
demodel
.
TenantId
=
req
.
TenantId
;
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
OrderBy
=
1
;
var
list
=
firstShopListModule
.
GetFirstShopListPageList
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
count
,
demodel
);
pageModel
.
count
=
Convert
.
ToInt32
(
count
);
...
...
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