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
15c748cb
Commit
15c748cb
authored
Feb 05, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
9a905338
17720bf1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
415 additions
and
26 deletions
+415
-26
JsonHelper.cs
Mall.Common/Plugin/JsonHelper.cs
+12
-0
PointModule.cs
Mall.Module.Education/PointModule.cs
+14
-13
MiniProgramMsgModule.cs
Mall.Module.User/MiniProgramMsgModule.cs
+2
-2
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+14
-0
AppletPointController.cs
Mall.WebApi/Controllers/Education/AppletPointController.cs
+2
-1
PointController.cs
Mall.WebApi/Controllers/Education/PointController.cs
+130
-1
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+241
-9
No files found.
Mall.Common/Plugin/JsonHelper.cs
View file @
15c748cb
...
...
@@ -37,6 +37,18 @@ namespace Mall.Common.Plugin
return
result
;
}
/// <summary>
/// 获取日期时间
/// </summary>
/// <param name="jObject"></param>
/// <param name="key"></param>
/// <returns></returns>
public
static
DateTime
GetDateTime
(
this
JObject
jObject
,
string
key
)
{
DateTime
.
TryParse
(
jObject
[
key
]
==
null
?
""
:
jObject
[
key
].
ToString
(),
out
DateTime
result
);
return
result
;
}
/// <summary>
/// 获取Int
/// </summary>
...
...
Mall.Module.Education/PointModule.cs
View file @
15c748cb
...
...
@@ -193,17 +193,18 @@ namespace Mall.Module.Education
/// <returns></returns>
public
bool
UpdatePointOrder
(
RB_Point_Order_Extend
newModel
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
newModel
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
//判断订单状态是否是待支付 2020-06-16 Add By:W
var
model
=
pointOrderRepository
.
GetEntity
(
newModel
.
ID
);
if
(
model
==
null
)
{
return
false
;
}
var
umodel
=
member_UserRepository
.
GetEntity
(
model
.
UserId
);
if
(
umodel
==
null
)
{
return
false
;
}
if
(
model
.
State
!=
0
)
{
return
false
;
...
...
@@ -220,9 +221,8 @@ namespace Mall.Module.Education
IDictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>
{
{
nameof
(
RB_Point_Order_Extend
.
PaymentTime
),
newModel
.
PaymentTime
},
{
nameof
(
RB_Point_Order_Extend
.
OrderStatus
),
newModel
.
OrderStatus
},
{
nameof
(
RB_Point_Order_Extend
.
MerchantsNo
),
newModel
.
MerchantsNo
},
{
nameof
(
RB_Point_Order_Extend
.
OldPonitNum
),
newModel
.
OldPonitNum
}
{
nameof
(
RB_Point_Order_Extend
.
OrderStatus
),
2
},
{
nameof
(
RB_Point_Order_Extend
.
MerchantsNo
),
newModel
.
MerchantsNo
}
};
IList
<
WhereHelper
>
auditrecordWhereHelpers
=
new
List
<
WhereHelper
>
{
...
...
@@ -250,12 +250,12 @@ namespace Mall.Module.Education
{
UserId
=
model
.
UserId
,
Type
=
Common
.
Enum
.
MarketingCenter
.
RecordTypeEnum
.
Income
,
PonitNum
=
newModel
.
PonitNum
+
newM
odel
.
GivePoint
,
Description
=
"在线购买"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
)
:
""
),
PonitNum
=
model
.
PonitNum
+
m
odel
.
GivePoint
,
Description
=
"在线购买"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
),
CreateDate
=
newModel
.
PaymentTime
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
Remarks
=
"订单号:"
+
model
.
OrderNo
+
"在线购买支付"
+
model
.
Income
+
"元"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
)
:
""
),
Remarks
=
"订单号:"
+
model
.
OrderNo
+
"在线购买支付"
+
model
.
Income
+
"元"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
),
PlatformType
=
model
.
OrderSource
};
memberPointBalanceRepository
.
Insert
(
memberBalanceModel
,
trans
);
...
...
@@ -602,6 +602,7 @@ namespace Mall.Module.Education
{
nameof
(
RB_Point_TeacherCourse_Extend
.
MinDuration
),
model
.
MinDuration
},
{
nameof
(
RB_Point_TeacherCourse_Extend
.
StudyDuration
),
model
.
StudyDuration
},
{
nameof
(
RB_Point_TeacherCourse_Extend
.
RoomId
),
model
.
RoomId
},
{
nameof
(
RB_Point_TeacherCourse_Extend
.
DurationUnit
),
model
.
DurationUnit
},
};
IList
<
WhereHelper
>
auditrecordWhereHelpers
=
new
List
<
WhereHelper
>
{
...
...
@@ -879,7 +880,7 @@ namespace Mall.Module.Education
};
flag
=
pointTeacherCourseOrderRepository
.
Update
(
fileds
,
auditrecordWhereHelpers
,
trans
);
pointTeacherCourseOrderRepository
.
DBSession
.
Commit
();
if
(
flag
)
//推送房间信息
{
List
<
string
>
openidList
=
new
List
<
string
>();
...
...
@@ -887,7 +888,7 @@ namespace Mall.Module.Education
new
MiniProgramMsgModule
().
SendCourseOrderTplMsg
(
model
.
TenantId
,
model
.
MallBaseId
,
openidList
,
model
.
CourseName
,
model
.
RoomInfo
,
model
.
StudyDate
.
ToString
(
"MM月dd日"
));
}
}
pointTeacherCourseOrderRepository
.
DBSession
.
Commit
();
return
flag
;
}
...
...
Mall.Module.User/MiniProgramMsgModule.cs
View file @
15c748cb
...
...
@@ -949,11 +949,11 @@ namespace Mall.Module.User
{
thing1
=
new
{
value
=
Title
.
Substring
(
0
,
15
)
value
=
Title
.
Length
>
20
?
Title
.
Substring
(
0
,
15
)
:
Title
},
thing2
=
new
{
value
=
UserName
.
Substring
(
0
,
18
)
value
=
UserName
.
Length
>
20
?
UserName
.
Substring
(
0
,
18
):
UserName
},
time4
=
new
{
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
15c748cb
...
...
@@ -268,6 +268,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
OrderSource
=
userModel
.
Source
;
//新增充值记录
int
rechargeId
=
pointModule
.
SetPointOrder
(
demodel
);
if
(
rechargeId
==
0
)
...
...
@@ -587,6 +588,19 @@ namespace Mall.WebApi.Controllers.AppletWeChat
userCommonModule
.
InsertOrderPayInfo
(
demodel
.
UserId
??
0
,
demodel
.
OrderId
,
demodel
.
OrderNo
,
"s1111111111111"
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
.
WeChatPay
,
"test"
,
(
demodel
.
Income
??
0
),
System
.
DateTime
.
Now
,
0
);
return
ApiResult
.
Success
(
""
);
}
public
ApiResult
TestUpdatePointOrder
()
{
var
request
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Point_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Point_Order_Extend
>(
request
.
msg
.
ToString
());
//ID = OrderId, OrderNo = sOrderNo, Income = dPaid, MerchantsNo = TransactionId, PaymentTime = PayDate
pointModule
.
UpdatePointOrder
(
demodel
);
return
ApiResult
.
Success
(
""
);
}
#
endregion
...
...
Mall.WebApi/Controllers/Education/AppletPointController.cs
View file @
15c748cb
...
...
@@ -874,7 +874,8 @@ namespace Mall.WebApi.Controllers.Education
model
.
StudyStartDate
,
model
.
StudyEndDate
,
orderList
,
StudentNumTypeName
=
EnumHelper
.
GetEnumName
(
model
.
StudentNumType
)
StudentNumTypeName
=
EnumHelper
.
GetEnumName
(
model
.
StudentNumType
),
WeekStr
=
StringHelper
.
GetWeek
(
model
.
StudyDate
),
};
return
ApiResult
.
Success
(
""
,
result
);
}
...
...
Mall.WebApi/Controllers/Education/PointController.cs
View file @
15c748cb
...
...
@@ -389,6 +389,134 @@ namespace Mall.WebApi.Controllers.Education
}
/// <summary>
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetConfirmTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
var
userInfo
=
UserInfo
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
else
{
if
(
query
.
CourseId
==
0
)
{
return
ApiResult
.
Failed
(
"请选择课程信息"
);
}
if
(
query
.
TeacherId
==
0
)
{
return
ApiResult
.
Failed
(
"请传入老师id"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
RoomInfo
))
{
return
ApiResult
.
Failed
(
"请传入房间信息"
);
}
var
oldcourseOrderList
=
pointModule
.
GetPointOrderList
(
new
RB_Point_TeacherCourseOrder_Extend
{
CourseId
=
query
.
CourseId
,
TeacherId
=
query
.
TeacherId
});
var
updateList
=
new
List
<
RB_Point_TeacherCourseOrder_Extend
>();
if
(
query
.
StudentNumType
==
Common
.
Enum
.
Point
.
StudentNumTypeEnum
.
OneOnOne
)
{
if
(
query
.
ID
==
0
)
{
return
ApiResult
.
Failed
(
"请传入订单号id"
);
}
else
{
updateList
=
oldcourseOrderList
.
Where
(
x
=>
x
.
ID
==
query
.
ID
&&
x
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
).
ToList
();
}
}
else
{
updateList
=
oldcourseOrderList
.
Where
(
x
=>
x
.
OrderStaus
==
Common
.
Enum
.
Point
.
OrderStausEnum
.
Paid
).
ToList
();
}
if
(
updateList
==
null
||
!
updateList
.
Any
())
{
return
ApiResult
.
Failed
(
"订单已确认"
);
}
updateList
.
ForEach
(
x
=>
x
.
OrderStaus
=
Common
.
Enum
.
Point
.
OrderStausEnum
.
NoClass
);
updateList
.
ForEach
(
x
=>
x
.
UpdateDate
=
System
.
DateTime
.
Now
);
updateList
.
ForEach
(
x
=>
x
.
RoomInfo
=
query
.
RoomInfo
);
bool
result
=
pointModule
.
ConfirmTeacherCourseOrder
(
updateList
);
if
(
result
)
{
return
ApiResult
.
Success
(
"订单确认成功"
);
}
else
{
return
ApiResult
.
Failed
(
"订单确认失败"
);
}
}
}
/// <summary>
/// 保存课程分类信息
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetCompleteTeacherCourseOrder
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Point_TeacherCourseOrder_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
query
.
TeacherId
=
userInfo
.
UserTeacher
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
else
{
if
(
query
.
ID
==
0
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
var
oldModel
=
pointModule
.
GetPointOrderList
(
query
).
FirstOrDefault
();
if
(
oldModel
==
null
||
oldModel
.
ID
==
0
)
{
return
ApiResult
.
Failed
(
"请传入课程订单信息"
);
}
oldModel
.
ActualPointNum
=
query
.
ActualPointNum
;
oldModel
.
UpdateDate
=
System
.
DateTime
.
Now
;
oldModel
.
OrderStaus
=
Common
.
Enum
.
Point
.
OrderStausEnum
.
Complete
;
DateTime
nowOrderDate
=
query
.
StudyDate
;
if
(
query
.
DurationUnit
==
Common
.
Enum
.
Point
.
DurationUnitEnum
.
Hour
)
{
nowOrderDate
=
query
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
query
.
TotalStudyDuration
*
60
));
}
else
{
nowOrderDate
=
query
.
StudyDate
.
AddMinutes
(
Convert
.
ToDouble
(
query
.
TotalStudyDuration
));
}
bool
result
=
pointModule
.
CompleteTeacherCourseOrder
(
oldModel
);
if
(
result
)
{
return
ApiResult
.
Success
(
"订单完成操作成功"
);
}
else
{
return
ApiResult
.
Failed
(
"订单完成操作失败"
);
}
}
}
/// <summary>
/// 获取订单状态枚举
/// </summary>
...
...
@@ -435,7 +563,8 @@ namespace Mall.WebApi.Controllers.Education
StudentNumTypeStr
=
EnumHelper
.
GetEnumName
(
x
.
StudentNumType
),
DurationUnitStr
=
EnumHelper
.
GetEnumName
(
x
.
DurationUnit
),
x
.
PointNum
,
x
.
IsPublic
x
.
IsPublic
,
x
.
Title
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
15c748cb
This diff is collapsed.
Click to expand it.
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