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
e0d649fc
Commit
e0d649fc
authored
Mar 10, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
活动调整
parent
87cc172c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
235 additions
and
12 deletions
+235
-12
RB_Miai_Activity_Extend.cs
Mall.Model/Extend/Miai/RB_Miai_Activity_Extend.cs
+10
-0
RB_Commerce_Consult_Extend.cs
....Model/Extend/TradePavilion/RB_Commerce_Consult_Extend.cs
+23
-0
CommerceConsultModule.cs
Mall.Module.TradePavilion/CommerceConsultModule.cs
+22
-8
RB_Miai_ActivityRepository.cs
Mall.Repository/Miai/RB_Miai_ActivityRepository.cs
+59
-0
RB_Commerce_ConsultRepository.cs
...Repository/TradePavilion/RB_Commerce_ConsultRepository.cs
+75
-1
AppletTradeController.cs
...WebApi/Controllers/TradePavilion/AppletTradeController.cs
+42
-2
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+4
-1
No files found.
Mall.Model/Extend/Miai/RB_Miai_Activity_Extend.cs
View file @
e0d649fc
...
...
@@ -43,6 +43,16 @@ namespace Mall.Model.Extend.Miai
/// </summary>
public
int
EnrollNum
{
get
;
set
;
}
/// <summary>
/// 只看可报名 1是
/// </summary>
public
int
IsSelectEnroll
{
get
;
set
;
}
/// <summary>
/// 排序 0默认最新 1报名人数倒序 2回复数量倒序
/// </summary>
public
int
OrderBy
{
get
;
set
;
}
/// <summary>
/// 活动ids
/// </summary>
...
...
Mall.Model/Extend/TradePavilion/RB_Commerce_Consult_Extend.cs
View file @
e0d649fc
...
...
@@ -24,5 +24,28 @@ namespace Mall.Model.Extend.TradePavilion
/// 报名状态 1正常 2取消 3查询所有
/// </summary>
public
int
EnrollState
{
get
;
set
;
}
/// <summary>
/// 活动名称
/// </summary>
public
string
ActivityName
{
get
;
set
;
}
/// <summary>
/// 活动封面图
/// </summary>
public
string
CoverImg
{
get
;
set
;
}
/// <summary>
/// 活动开始时间
/// </summary>
public
DateTime
?
StartTime
{
get
;
set
;
}
/// <summary>
/// 活动结束时间
/// </summary>
public
DateTime
?
EndTime
{
get
;
set
;
}
/// <summary>
/// 类型名称
/// </summary>
public
string
TypeName
{
get
;
set
;
}
}
}
Mall.Module.TradePavilion/CommerceConsultModule.cs
View file @
e0d649fc
...
...
@@ -194,10 +194,11 @@ namespace Mall.Module.TradePavilion
/// <param name="Id"></param>
/// <param name="Status"></param>
/// <returns></returns>
public
bool
CancelCommerceConsultModule
(
int
activityId
,
string
cancelRemark
,
int
userId
)
public
bool
CancelCommerceConsultModule
(
int
activityId
,
string
cancelRemark
,
out
int
IsCancelConfirm
,
int
userId
)
{
bool
flag
;
var
amodel
=
commerce_ActivityRepository
.
GetEntity
(
activityId
);
IsCancelConfirm
=
amodel
.
IsCancelConfirm
;
var
cmodel
=
consultRepository
.
GetCommerceConsultListRepository
(
new
RB_Commerce_Consult_Extend
()
{
ActivityId
=
activityId
,
UserId
=
userId
}).
FirstOrDefault
();
if
(
cmodel
==
null
||
cmodel
.
Status
==
Common
.
Enum
.
DateStateEnum
.
Delete
)
{
return
true
;
}
if
(
amodel
.
IsCancelConfirm
==
1
)
...
...
@@ -216,14 +217,14 @@ namespace Mall.Module.TradePavilion
else
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Commerce_Consult_Extend
.
Status
),
1
},
};
{
{
nameof
(
RB_Commerce_Consult_Extend
.
Status
),
1
},
};
List
<
WhereHelper
>
list
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Commerce_Consult_Extend
.
ActivityId
),
activityId
),
new
WhereHelper
(
nameof
(
RB_Commerce_Consult_Extend
.
UserId
),
userId
),
};
{
new
WhereHelper
(
nameof
(
RB_Commerce_Consult_Extend
.
ActivityId
),
activityId
),
new
WhereHelper
(
nameof
(
RB_Commerce_Consult_Extend
.
UserId
),
userId
),
};
flag
=
consultRepository
.
Update
(
fileds
,
list
);
if
(
flag
&&
cmodel
.
Money
>
0
)
{
//取消退回使用点数
...
...
@@ -317,5 +318,18 @@ namespace Mall.Module.TradePavilion
}
return
flag
;
}
/// <summary>
/// 获取我的报名列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Commerce_Consult_Extend
>
GetUserJoinActivityPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Commerce_Consult_Extend
dmodel
)
{
return
consultRepository
.
GetUserJoinActivityPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
dmodel
);
}
}
}
Mall.Repository/Miai/RB_Miai_ActivityRepository.cs
View file @
e0d649fc
...
...
@@ -41,6 +41,11 @@ namespace Mall.Repository.Miai
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
IsSelectEnroll
==
1
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
Deadline
)}
>='
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
'"
;
}
string
sql
=
$@"select a.*,u.Name as UserName,u.Photo,b.Sex from RB_Miai_Activity a
left join rb_member_user u on a.UserId =u.Id
left join rb_miai_baseinfo b on a.UserId =b.UserId
...
...
@@ -48,6 +53,60 @@ where {where} order by a.Id desc";
return
GetPage
<
RB_Miai_Activity_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
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_Miai_Activity_Extend
>
GetPageList_V2
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Miai_Activity_Extend
dmodel
)
{
string
where
=
$" 1=1 and a.
{
nameof
(
RB_Miai_Activity_Extend
.
Status
)}
=0 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ActivityTitle
))
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
ActivityTitle
)}
like '%
{
dmodel
.
ActivityTitle
}
%'"
;
}
if
(
dmodel
.
ForumId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
ForumId
)}
=
{
dmodel
.
ForumId
}
"
;
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
UserId
)}
=
{
dmodel
.
UserId
}
"
;
}
if
(
dmodel
.
IsSelectEnroll
==
1
)
{
where
+=
$@" and a.
{
nameof
(
RB_Miai_Activity_Extend
.
Deadline
)}
>='
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
'"
;
}
string
orderBy
=
" a.Id DESC"
;
if
(
dmodel
.
OrderBy
==
1
)
{
orderBy
=
" e.Number DESC,a.Id DESC"
;
}
else
if
(
dmodel
.
OrderBy
==
2
)
{
orderBy
=
" r.ReplyNum DESC,a.Id DESC"
;
}
string
sql
=
$@"select a.*,u.Name as UserName,u.Photo,b.Sex,IFNULL(r.ReplyNum,0) as ReplyNum,IFNULL(e.Number,0) as EnrollNum
from RB_Miai_Activity a
left join rb_member_user u on a.UserId =u.Id
left join rb_miai_baseinfo b on a.UserId =b.UserId
left join (select ActivityId,count(0) as ReplyNum from RB_Miai_ActivityDiscuss where Status =0 group by ActivityId) r on r.ActivityId = a.Id
left join (select ActivityId,count(0) as Number from RB_Miai_ActivityEnroll where Status =0 group by ActivityId) e on e.ActivityId = a.Id
where
{
where
}
order by
{
orderBy
}
"
;
return
GetPage
<
RB_Miai_Activity_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取列表
/// </summary>
...
...
Mall.Repository/TradePavilion/RB_Commerce_ConsultRepository.cs
View file @
e0d649fc
...
...
@@ -80,6 +80,80 @@ WHERE 1=1
}
return
Get
<
RB_Commerce_Consult_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取用户的报名列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Commerce_Consult_Extend
>
GetUserJoinActivityPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Commerce_Consult_Extend
query
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT c.*,a.ActivityName,a.CoverImg,a.StartTime,a.EndTime,t.TypeName
FROM RB_Commerce_Consult c
left join rb_commerce_activity a on c.ActivityId = a.Id
left join rb_commerce_activitytype t on t.Id = a.ActivityType
WHERE 1=1
"
);
if
(
query
==
null
)
{
rowsCount
=
0
;
return
new
List
<
RB_Commerce_Consult_Extend
>();
}
else
{
if
(
query
.
EnrollState
>
0
)
{
if
(
query
.
EnrollState
==
1
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
}
else
if
(
query
.
EnrollState
==
2
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
Status
),
(
int
)
DateStateEnum
.
Delete
);
}
}
else
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
TenantId
),
query
.
TenantId
);
}
if
(
query
.
MallBaseId
>
0
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
LinkMan
))
{
builder
.
AppendFormat
(
" AND c.{0} LIKE @Name "
,
nameof
(
RB_Commerce_Consult_Extend
.
LinkMan
));
parameters
.
Add
(
"Name"
,
"%"
+
query
.
LinkMan
.
Trim
()
+
"%"
);
}
if
(
query
.
ActivityId
>
0
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
ActivityId
),
query
.
ActivityId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QActivityIds
))
{
builder
.
AppendFormat
(
" AND c.{0} IN({1}) "
,
nameof
(
RB_Commerce_Consult_Extend
.
ActivityId
),
query
.
QActivityIds
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QUserIds
))
{
builder
.
AppendFormat
(
" AND c.{0} IN({1}) "
,
nameof
(
RB_Commerce_Consult_Extend
.
UserId
),
query
.
QUserIds
);
}
if
(
query
.
UserId
>
0
)
{
builder
.
AppendFormat
(
" AND c.{0}={1} "
,
nameof
(
RB_Commerce_Consult_Extend
.
UserId
),
query
.
UserId
);
}
}
builder
.
AppendFormat
(
" order by c.Id desc"
);
return
GetPage
<
RB_Commerce_Consult_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Mall.WebApi/Controllers/TradePavilion/AppletTradeController.cs
View file @
e0d649fc
...
...
@@ -404,6 +404,46 @@ namespace Mall.WebApi.Controllers.TradePavilion
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 获取活动报名列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetUserJoinActivityPageList
()
{
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_Commerce_Consult_Extend
dmodel
=
JsonConvert
.
DeserializeObject
<
RB_Commerce_Consult_Extend
>(
RequestParm
.
msg
.
ToString
());
var
userInfo
=
AppletUserInfo
;
dmodel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
dmodel
.
TenantId
=
userInfo
?.
TenantId
??
0
;
dmodel
.
UserId
=
userInfo
.
UserId
;
var
list
=
consultModule
.
GetUserJoinActivityPageList
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
dmodel
);
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
pageModel
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
ActivityId
,
x
.
UserId
,
x
.
LinkMan
,
x
.
LinkTel
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
x
.
Status
,
x
.
PeopleNum
,
x
.
Money
,
x
.
Remark
,
x
.
IsApplyForCancel
,
x
.
CancelRemark
,
x
.
ApplyForCancelStatus
,
x
.
RejectRemark
,
x
.
ActivityName
,
x
.
CoverImg
,
StartTime
=
x
.
StartTime
.
HasValue
?
x
.
StartTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
EndTime
=
x
.
EndTime
.
HasValue
?
x
.
EndTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
TypeName
});
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 新增修改商会活动报名
/// </summary>
...
...
@@ -443,8 +483,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
var
ActivityId
=
jObj
.
GetInt
(
"ActivityId"
);
string
CancelRemark
=
jObj
.
GetStringValue
(
"CancelRemark"
);
var
userInfo
=
AppletUserInfo
;
var
flag
=
consultModule
.
CancelCommerceConsultModule
(
ActivityId
,
CancelRemark
,
userInfo
.
UserId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
var
flag
=
consultModule
.
CancelCommerceConsultModule
(
ActivityId
,
CancelRemark
,
out
int
IsCancelConfirm
,
userInfo
.
UserId
);
return
flag
?
ApiResult
.
Success
(
""
,
IsCancelConfirm
)
:
ApiResult
.
Failed
();
}
/// <summary>
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
e0d649fc
...
...
@@ -339,7 +339,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
ActivityInfo
=
jObj
.
GetStringValue
(
"ActivityInfo"
),
SignStartTime
=
jObj
.
GetDateTime
(
"SignStartTime"
),
SignEndTime
=
jObj
.
GetDateTime
(
"SignEndTime"
),
IsFree
=
jObj
.
GetInt
(
"IsFree"
,
2
),
IsFree
=
jObj
.
GetInt
(
"IsFree"
,
1
),
Price
=
jObj
.
GetInt
(
"Price"
,
0
),
IsCancelConfirm
=
jObj
.
GetInt
(
"IsCancelConfirm"
,
2
)
};
...
...
@@ -359,6 +359,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
UpdateBy
=
Uid
;
extModel
.
UpdateDate
=
DateTime
.
Now
;
if
(
extModel
.
IsFree
==
1
)
{
extModel
.
Price
=
0
;
}
var
flag
=
activityModule
.
SetCommerceActivityModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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