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
ec22e819
Commit
ec22e819
authored
Dec 23, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退课 一键制单
parent
2edee6e7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
171 additions
and
2 deletions
+171
-2
RB_Student_BackClass.cs
Edu.Model/Entity/Course/RB_Student_BackClass.cs
+6
-1
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+127
-0
StuController.cs
Edu.WebApi/Controllers/Course/StuController.cs
+35
-0
TeachingRewardsController.cs
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
+1
-1
appsettings.json
Edu.WebApi/appsettings.json
+2
-0
No files found.
Edu.Model/Entity/Course/RB_Student_BackClass.cs
View file @
ec22e819
...
@@ -97,5 +97,10 @@ namespace Edu.Model.Entity.Course
...
@@ -97,5 +97,10 @@ namespace Edu.Model.Entity.Course
/// 流程编号
/// 流程编号
/// </summary>
/// </summary>
public
int
FlowId
{
get
;
set
;
}
public
int
FlowId
{
get
;
set
;
}
}
/// <summary>
/// 财务单据id
/// </summary>
public
int
FinanceId
;
}
}
}
Edu.Module.Course/StudentBillModule.cs
View file @
ec22e819
using
Edu.Cache.User
;
using
Edu.Cache.User
;
using
Edu.Common
;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
...
@@ -8,7 +9,9 @@ using Edu.Model.Entity.Course;
...
@@ -8,7 +9,9 @@ using Edu.Model.Entity.Course;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Course
;
using
Edu.Repository.Flow
;
using
Edu.Repository.Flow
;
using
Edu.Repository.Log
;
using
Edu.Repository.User
;
using
Edu.Repository.User
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -47,6 +50,16 @@ namespace Edu.Module.Course
...
@@ -47,6 +50,16 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
private
readonly
RB_OrderRepository
orderRepository
=
new
RB_OrderRepository
();
private
readonly
RB_OrderRepository
orderRepository
=
new
RB_OrderRepository
();
/// <summary>
/// 班级
/// </summary>
private
readonly
RB_ClassRepository
classRepository
=
new
RB_ClassRepository
();
/// <summary>
/// 学校
/// </summary>
private
readonly
RB_SchoolRepository
schoolRepository
=
new
RB_SchoolRepository
();
/// <summary>
/// <summary>
/// 流程仓储层对象
/// 流程仓储层对象
/// </summary>
/// </summary>
...
@@ -57,6 +70,11 @@ namespace Edu.Module.Course
...
@@ -57,6 +70,11 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 日志
/// </summary>
private
readonly
RB_User_ChangeLogRepository
changeLogRepository
=
new
RB_User_ChangeLogRepository
();
/// <summary>
/// <summary>
/// 获取学员退课单据分页列表
/// 获取学员退课单据分页列表
/// </summary>
/// </summary>
...
@@ -704,5 +722,114 @@ namespace Edu.Module.Course
...
@@ -704,5 +722,114 @@ namespace Edu.Module.Course
}
}
return
obj
;
return
obj
;
}
}
/// <summary>
/// 退课一键制单
/// </summary>
/// <param name="backClassId"></param>
/// <param name="isPublic"></param>
/// <param name="currencyId"></param>
/// <param name="clientType"></param>
/// <param name="clientId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
string
SetStudentBackFinance
(
int
backClassId
,
int
IsPublic
,
int
CurrencyId
,
int
clientType
,
int
clientId
,
UserInfo
userInfo
)
{
var
backModel
=
student_BackClassRepository
.
GetEntity
(
backClassId
);
if
(
backModel
==
null
||
backModel
.
AuditStatus
!=
BackClassAuditStatusEnum
.
Pass
)
{
return
"退课流程未审核通过"
;
}
var
guestModel
=
order_GuestRepository
.
GetEntity
(
backModel
.
GuestId
);
if
(
guestModel
==
null
||
guestModel
.
GuestState
!=
2
)
{
return
"客人名单状态不正确"
;
}
string
msg
=
""
;
#
region
新增财务单据
var
detailList
=
new
List
<
object
>
{
new
{
CostTypeId
=
Config
.
ReadConfigKey
(
"StuBackCostTypeId"
),
Number
=
1
,
OriginalMoney
=
backModel
.
BackMoney
,
UnitPrice
=
backModel
.
BackMoney
,
Remark
=
"学员【"
+
guestModel
.
GuestName
+
"】退课"
}
};
var
classModel
=
classRepository
.
GetEntity
(
backModel
.
ClassId
);
string
Remark
=
"【"
+
(
classModel
?.
ClassName
??
""
)
+
"】下订单"
+
backModel
.
OrderId
+
" 客人退课"
;
var
financeObj
=
new
{
IsPublic
,
ClientType
=
clientType
,
ClientID
=
clientId
,
CurrencyId
,
WBMoney
=
backModel
.
BackMoney
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
Config
.
ReadConfigKey
(
"StuBackTemplete"
),
OrderSource
=
17
,
OrderID
=
backModel
.
OrderId
,
TCIDList
=
new
List
<
int
>()
{
backModel
.
ClassId
},
OtherType
=
28
,
ReFinanceId
=
backModel
.
BackId
,
Remark
,
detailList
,
CreateBy
=
userInfo
.
Id
,
RB_Branch_Id
=
classModel
.
School_Id
,
RB_Depart_Id
=
userInfo
.
DeptId
,
RB_Group_Id
=
userInfo
.
Group_Id
,
RB_CreateByName
=
userInfo
.
AccountName
,
RB_DepartName
=
userInfo
.
DeptName
,
RB_BranchName
=
schoolRepository
.
GetEntity
(
classModel
.
School_Id
)?.
SName
??
""
,
RB_GroupName
=
userInfo
.
GroupName
,
FinanceType
=
2
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
ReadConfigKey
(
"FinanceKey"
));
var
resultInfo
=
new
{
msg
=
sign
};
string
apiResult
=
HttpHelper
.
HttpPost
(
Config
.
ReadConfigKey
(
"PaymentFinanceApi"
),
JsonHelper
.
Serialize
(
resultInfo
),
""
);
JObject
parmsJob
=
JObject
.
Parse
(
apiResult
);
string
resultCode
=
parmsJob
.
GetStringValue
(
"resultCode"
);
int
frid
=
parmsJob
.
GetInt
(
"data"
,
0
);
if
(
resultCode
==
"1"
&&
frid
>
0
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_BackClass
.
FinanceId
),
frid
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Teaching_Perf_ViewModel
.
Id
),
FiledValue
=
backModel
.
BackId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
student_BackClassRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
Type
=
1
,
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
userInfo
.
Group_Id
,
LogContent
=
"生成学员退课财务单据【"
+
backModel
.
BackId
+
"】"
,
School_Id
=
userInfo
.
School_Id
,
SourceId
=
0
});
}
}
else
{
string
message
=
parmsJob
.
GetStringValue
(
"message"
);
LogHelper
.
Write
(
"SetStudentBackFinance:"
+
message
);
msg
+=
backModel
.
BackId
+
"创建财务单据失败;"
;
}
#
endregion
return
msg
;
}
}
}
}
}
Edu.WebApi/Controllers/Course/StuController.cs
View file @
ec22e819
...
@@ -12,6 +12,7 @@ using Edu.WebApi.Filter;
...
@@ -12,6 +12,7 @@ using Edu.WebApi.Filter;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Edu.WebApi.Controllers.Course
namespace
Edu.WebApi.Controllers.Course
{
{
...
@@ -122,5 +123,39 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -122,5 +123,39 @@ namespace Edu.WebApi.Controllers.Course
var
extModel
=
studentBillModule
.
GetStuBackInfoModule
(
BackId
);
var
extModel
=
studentBillModule
.
GetStuBackInfoModule
(
BackId
);
return
ApiResult
.
Success
(
data
:
extModel
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
}
/// <summary>
/// 退学 一键生成财务单据
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetStudentBackFinance
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
BackClassId
=
parms
.
GetInt
(
"BackClassId"
,
0
);
int
IsPublic
=
parms
.
GetInt
(
"IsPublic"
,
0
);
int
CurrencyId
=
parms
.
GetInt
(
"CurrencyId"
,
0
);
int
ClientType
=
parms
.
GetInt
(
"ClientType"
,
0
);
int
ClientId
=
parms
.
GetInt
(
"ClientId"
,
0
);
if
(
BackClassId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
if
(
ClientId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
string
msg
=
studentBillModule
.
SetStudentBackFinance
(
BackClassId
,
IsPublic
,
CurrencyId
,
ClientType
,
ClientId
,
userInfo
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
}
}
}
}
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
View file @
ec22e819
...
@@ -306,7 +306,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -306,7 +306,7 @@ namespace Edu.WebApi.Controllers.Course
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"日期"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"日期"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"老师"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"老师"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"班级"
)
{
CellWidth
=
1
5
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"班级"
)
{
CellWidth
=
2
5
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"类型"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"类型"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课时"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课时"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课单价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课单价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
...
...
Edu.WebApi/appsettings.json
View file @
ec22e819
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
"BonusCostTypeId"
:
540
,
"BonusCostTypeId"
:
540
,
"TeachingPerfTemplete"
:
141
,
"TeachingPerfTemplete"
:
141
,
"PerfCostTypeId"
:
540
,
"PerfCostTypeId"
:
540
,
"StuBackTemplete"
:
141
,
"StuBackCostTypeId"
:
540
,
"RabbitMqConfig"
:
{
"RabbitMqConfig"
:
{
"HostName"
:
"47.96.25.130"
,
"HostName"
:
"47.96.25.130"
,
"VirtualHost"
:
"/"
,
"VirtualHost"
:
"/"
,
...
...
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