Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
ed25580e
Commit
ed25580e
authored
Jun 23, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
5fb5ada1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
193 additions
and
12 deletions
+193
-12
Config.cs
Edu.Common/Config.cs
+46
-0
ApiRequestFromEnum.cs
Edu.Common/Enum/ApiRequestFromEnum.cs
+7
-0
FinanceConfigTypeEnum.cs
Edu.Common/Enum/Course/FinanceConfigTypeEnum.cs
+13
-1
UserInfo.cs
Edu.Model/CacheModel/UserInfo.cs
+16
-0
RB_Question_RoomUseLog_ViewModel.cs
...el/ViewModel/Question/RB_Question_RoomUseLog_ViewModel.cs
+15
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+25
-3
ClassRoomController.cs
Edu.WebApi/Controllers/Course/ClassRoomController.cs
+9
-4
LoginController.cs
Edu.WebApi/Controllers/User/LoginController.cs
+58
-0
WeChatPayController.cs
Edu.WebApi/Controllers/WeChatPay/WeChatPayController.cs
+4
-4
No files found.
Edu.Common/Config.cs
View file @
ed25580e
...
...
@@ -541,5 +541,51 @@ namespace Edu.Common
}
}
/// <summary>
/// 甲鹤教育接口请求地址
/// </summary>
public
static
string
DmcMallApi
{
get
{
return
ReadConfigKey
(
"DmcMallApi"
);
}
}
/// <summary>
/// 甲鹤教育商户id
/// </summary>
public
static
string
JHTenantId
{
get
{
return
ReadConfigKey
(
"JHTenantId"
);
}
}
/// <summary>
/// 甲鹤教育小程序id
/// </summary>
public
static
string
JHMallBaseId
{
get
{
return
ReadConfigKey
(
"JHMallBaseId"
);
}
}
/// <summary>
/// 电商加密
/// </summary>
public
static
string
MallJwtSecretKey
{
get
{
return
ReadConfigKey
(
"MallJwtSecretKey"
);
}
}
}
}
\ No newline at end of file
Edu.Common/Enum/ApiRequestFromEnum.cs
View file @
ed25580e
...
...
@@ -38,6 +38,13 @@ namespace Edu.Common.Enum
[
EnumField
(
"ERP"
)]
ERP
=
6
,
/// <summary>
/// Mall【生成Token使用】
/// </summary>
[
EnumField
(
"Mall"
)]
Mall
=
7
,
/// <summary>
/// App学生端
/// </summary>
...
...
Edu.Common/Enum/Course/FinanceConfigTypeEnum.cs
View file @
ed25580e
...
...
@@ -52,6 +52,18 @@ namespace Edu.Common.Enum.Course
/// 学费收入
/// </summary>
[
EnumField
(
"学费收入"
)]
Tuition
=
8
Tuition
=
8
,
/// <summary>
/// 活动收入(电商)
/// </summary>
[
EnumField
(
"活动收入"
)]
ActivityIncome
=
9
,
/// <summary>
/// 活动退款(电商)
/// </summary>
[
EnumField
(
"活动退款"
)]
ActivityExpenditure
=
10
,
}
}
Edu.Model/CacheModel/UserInfo.cs
View file @
ed25580e
...
...
@@ -67,6 +67,22 @@ namespace Edu.Model.CacheModel
/// </summary>
public
string
ErpToken
{
get
;
set
;
}
/// <summary>
/// 电商-token
/// </summary>
public
string
MallToken
{
get
;
set
;
}
/// <summary>
/// 电商-JHTenantId
/// </summary>
public
string
JHTenantId
{
get
;
set
;
}
/// <summary>
/// 电商-JHMallBaseId
/// </summary>
public
string
JHMallBaseId
{
get
;
set
;
}
/// <summary>
/// 菜单列表
/// </summary>
...
...
Edu.Model/ViewModel/Question/RB_Question_RoomUseLog_ViewModel.cs
View file @
ed25580e
...
...
@@ -45,5 +45,20 @@ namespace Edu.Model.ViewModel.Question
/// 间隔多少个15分钟
/// </summary>
public
int
IntervalNum
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// 课程进度
/// </summary>
public
decimal
CompleteProgress
{
get
;
set
;
}
/// <summary>
/// 学生
/// </summary>
public
string
StudentName
{
get
;
set
;
}
}
}
Edu.Module.Course/ClassModule.cs
View file @
ed25580e
...
...
@@ -1372,7 +1372,7 @@ namespace Edu.Module.Course
public
object
GetClassPlanLogPageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Class_Plan_ViewModel
query
)
{
List
<
object
>
result
=
new
List
<
object
>();
var
list
=
class_PlanRepository
.
GetClassPlanLogPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
var
list
=
class_PlanRepository
.
GetClassPlanLogPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
List
<
RB_Class_Check_ViewModel
>
checkLogList
=
new
List
<
RB_Class_Check_ViewModel
>();
...
...
@@ -1421,7 +1421,7 @@ namespace Edu.Module.Course
MonthStr
=
item
.
ClassDate
.
ToString
(
"MM"
),
DayStr
=
item
.
ClassDate
.
ToString
(
"dd"
),
YearStr
=
item
.
ClassDate
.
ToString
(
"yyyy"
),
TimeList
=
time
TimeList
=
time
};
result
.
Add
(
planCheckObj
);
}
...
...
@@ -1490,7 +1490,29 @@ namespace Edu.Module.Course
/// <returns></returns>
public
List
<
RB_Class_Plan_ViewModel
>
GetClassPlanList_V2
(
RB_Class_Plan_ViewModel
query
)
{
return
class_PlanRepository
.
GetClassPlanList_V2
(
query
);
var
list
=
class_PlanRepository
.
GetClassPlanList_V2
(
query
);
if
(
list
!=
null
&&
list
.
Any
())
{
string
ClassIds
=
string
.
Join
(
","
,
list
.
Distinct
().
Select
(
x
=>
x
.
ClassId
));
var
orderStudentList
=
order_GuestRepository
.
GetList
(
new
RB_Order_Guest_ViewModel
()
{
ClassIds
=
ClassIds
,
Group_Id
=
query
.
Group_Id
,
School_Id
=
-
1
}).
Where
(
x
=>
x
.
GuestState
==
1
).
ToList
();
if
(
orderStudentList
!=
null
&&
orderStudentList
.
Any
())
{
foreach
(
var
item
in
list
)
{
item
.
GuestList
=
new
List
<
RB_Order_Guest_ViewModel
>();
item
.
GuestList
=
orderStudentList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
).
ToList
();
}
}
}
return
list
;
}
/// <summary>
...
...
Edu.WebApi/Controllers/Course/ClassRoomController.cs
View file @
ed25580e
...
...
@@ -277,7 +277,7 @@ namespace Edu.WebApi.Controllers.Course
InfoTime
=
item
.
CreateTime
,
Type
=
item
.
ErrorType
==
0
?
1
:
2
,
ClassStatus
=
-
1
,
IntervalNum
=
IntervalNum
IntervalNum
=
IntervalNum
,
});
}
foreach
(
var
item
in
timeList
)
...
...
@@ -291,17 +291,22 @@ namespace Edu.WebApi.Controllers.Course
var
planModel
=
roomList
.
Where
(
x
=>
x
.
ClassPlanId
==
item
.
ClassPlanId
).
FirstOrDefault
();
if
(
planModel
!=
null
&&
planModel
.
ClassPlanId
>
0
)
{
var
roomModel
=
roomList
.
Where
(
x
=>
x
.
ClassPlanId
==
item
.
ClassPlanId
).
FirstOrDefault
();
resultList
.
Add
(
new
Model
.
ViewModel
.
Question
.
RB_Question_RoomUseLog_ViewModel
{
Id
=
item
.
ClassTimeId
,
Title
=
room
List
.
Where
(
x
=>
x
.
ClassPlanId
==
item
.
ClassPlanId
).
FirstOrDefault
()
?.
ClassName
,
Content
=
room
List
.
Where
(
x
=>
x
.
ClassPlanId
==
item
.
ClassPlanId
).
FirstOrDefault
()
?.
TeacherName
,
Title
=
room
Model
?.
ClassName
,
Content
=
room
Model
?.
TeacherName
,
StartTime
=
item
.
StartTime
,
EndTime
=
item
.
EndTime
,
InfoTime
=
Convert
.
ToDateTime
(
planModel
.
ClassDate
.
ToString
(
"yyyy-MM-dd "
)
+
item
.
StartTime
),
Type
=
0
,
ClassStatus
=
item
.
ClassStatus
,
IntervalNum
=
IntervalNum
IntervalNum
=
IntervalNum
,
CourseName
=
roomModel
?.
CourseName
,
CompleteProgress
=
roomModel
?.
CompleteProgress
??
0
,
StudentName
=
(
roomModel
!=
null
&&
roomModel
.
GuestList
!=
null
&&
roomModel
.
GuestList
.
Any
())
?
string
.
Join
(
","
,
roomModel
.
GuestList
.
Select
(
x
=>
x
.
GuestName
))
:
""
});
}
}
...
...
Edu.WebApi/Controllers/User/LoginController.cs
View file @
ed25580e
...
...
@@ -2,7 +2,9 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
Edu.Cache.User
;
using
Edu.Common
;
using
Edu.Common.API
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
...
...
@@ -108,6 +110,59 @@ namespace Edu.WebApi.Controllers.User
string
token
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_User_Key
,
eduUserInfo
);
string
erpToken
=
WebApiTokenHelper
.
CreateToken
(
Common
.
GlobalKey
.
JWT_ERP_User_Key
,
erpUserInfo
);
#
region
获取甲鹤教育
Token
string
JHTenantId
=
Config
.
JHTenantId
;
string
JHMallBaseId
=
Config
.
JHMallBaseId
;
IUserInfoToken
mallJHUserInfo
=
new
ErpTokenUserInfo
()
{
requestFrom
=
Common
.
Enum
.
ApiRequestFromEnum
.
Mall
,
uid
=
JHTenantId
,
groupId
=
model
.
Group_Id
};
#
region
JWT
// string mallToken = WebApiTokenHelper.CreateToken(Common.GlobalKey.JWT_Mall_User_Key, mallJHUserInfo);
#
endregion
#
endregion
#
region
获取甲鹤教育
Token
#
region
JWT
JWT
.
IDateTimeProvider
provider2
=
new
JWT
.
UtcDateTimeProvider
();
var
now2
=
provider2
.
GetNow
().
AddMinutes
(-
1
);
var
unixEpoch2
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
// or use JwtValidator.UnixEpoch
var
secondsSinceEpoch2
=
Math
.
Round
((
now2
-
unixEpoch2
).
TotalSeconds
);
var
payload2
=
new
Dictionary
<
string
,
object
>
{
{
"iat"
,
secondsSinceEpoch2
},
{
"exp"
,
secondsSinceEpoch2
+
Config
.
JwtExpirTime
},
{
"mall_userInfoJH"
,
mallJHUserInfo
}
};
JWT
.
Algorithms
.
IJwtAlgorithm
algorithm2
=
new
JWT
.
Algorithms
.
HMACSHA256Algorithm
();
JWT
.
IJsonSerializer
serializer2
=
new
JWT
.
Serializers
.
JsonNetSerializer
();
JWT
.
IBase64UrlEncoder
urlEncoder2
=
new
JWT
.
JwtBase64UrlEncoder
();
JWT
.
IJwtEncoder
encoder2
=
new
JWT
.
JwtEncoder
(
algorithm2
,
serializer2
,
urlEncoder2
);
string
secret2
=
Config
.
MallJwtSecretKey
;
string
malltokenJH
=
encoder2
.
Encode
(
payload2
,
secret2
);
#
endregion
#
endregion
var
treeList
=
menuModule
.
GetPostMenuTreeModule
(
new
Model
.
ViewModel
.
System
.
RB_Menu_ViewModel
()
{
MenuType
=
accountType
...
...
@@ -130,6 +185,9 @@ namespace Edu.WebApi.Controllers.User
SchoolName
=
model
.
SchoolName
,
Token
=
token
,
ErpToken
=
erpToken
,
MallToken
=
malltokenJH
,
JHMallBaseId
=
JHMallBaseId
,
JHTenantId
=
JHTenantId
,
MenuList
=
treeList
,
UserCenterList
=
userCenterList
,
GroupLogo
=
model
.
GroupLogo
,
...
...
Edu.WebApi/Controllers/WeChatPay/WeChatPayController.cs
View file @
ed25580e
...
...
@@ -149,7 +149,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
Cache
.
User
.
UserReidsCache
.
Set
(
Cache
.
CacheKey
.
WeChatPay_Callback_Key
+
payModel
.
out_trade_no
,
payModel
.
out_trade_no
,
1800
);
isAdd
=
true
;
Cache
.
User
.
UserReidsCache
.
Set
(
Cache
.
CacheKey
.
WeChatPay_Callback_Key
+
payModel
.
out_trade_no
,
payModel
.
out_trade_no
,
1800
);
var
oldOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
}).
FirstOrDefault
();
var
oldOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
,
Type
=
1
}).
FirstOrDefault
();
if
(
oldOrderRecordModel
==
null
||
oldOrderRecordModel
.
ID
==
0
)
{
isAdd
=
true
;
...
...
@@ -338,7 +338,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
contractId
=
Convert
.
ToInt32
(
outTradeNo
[
17.
.]);
}
var
orderModle
=
educationContractModule
.
GetEducationContractModule
(
contractId
);
var
orderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
outTradeNo
}).
FirstOrDefault
();
var
orderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
outTradeNo
,
Type
=
2
}).
FirstOrDefault
();
if
(
orderRecordModel
==
null
)
{
return
ApiResult
.
Failed
(
"未查询到当前商户订单号对应的支付记录"
);
...
...
@@ -433,7 +433,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
Cache
.
User
.
UserReidsCache
.
Set
(
Cache
.
CacheKey
.
WeChatPay_Callback_Key
+
payModel
.
out_trade_no
,
payModel
.
out_trade_no
,
1800
);
isAdd
=
true
;
Cache
.
User
.
UserReidsCache
.
Set
(
Cache
.
CacheKey
.
WeChatPay_Callback_Key
+
payModel
.
out_trade_no
,
payModel
.
out_trade_no
,
1800
);
var
oldOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
}).
FirstOrDefault
();
var
oldOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
,
Type
=
2
}).
FirstOrDefault
();
if
(
oldOrderRecordModel
==
null
||
oldOrderRecordModel
.
ID
==
0
)
{
isAdd
=
true
;
...
...
@@ -442,7 +442,7 @@ namespace Edu.WebApi.Controllers.WeChatPay
{
var
orderModle
=
educationContractModule
.
GetEducationContractModule
(
contractId
);
var
orderModel
=
orderModule
.
GetClassOrderInfoModule
(
orderModle
.
OrderId
);
var
payOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
}).
FirstOrDefault
();
var
payOrderRecordModel
=
educationContractModule
.
GetOrderRecordList
(
new
RB_Finance_OrderRecord
{
ContractId
=
contractId
,
OutTradeNo
=
payModel
.
out_trade_no
,
Type
=
1
}).
FirstOrDefault
();
var
userInfo
=
employeeModule
.
GetEmployeeListModule
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
{
Id
=
orderModel
.
EnterID
,
Group_Id
=
orderModel
.
Group_Id
}).
ToList
().
FirstOrDefault
();
var
OriginalFee
=
Math
.
Round
(
Convert
.
ToDecimal
((
Convert
.
ToDecimal
(
Config
.
SettlementRate
)
/
100
)
*
(
Convert
.
ToDecimal
(
payModel
.
amount
.
payer_total
)
/
100
)),
2
,
MidpointRounding
.
AwayFromZero
);
//手续费
RB_Online_Trade_Detail
model
=
new
RB_Online_Trade_Detail
();
...
...
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