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
91cc79ad
Commit
91cc79ad
authored
Dec 22, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
939ee838
01a3d36d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
75 deletions
+144
-75
RB_Order_Remark_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Order_Remark_ViewModel.cs
+4
-1
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+105
-49
RB_Order_RemarkRepository.cs
Edu.Repository/Course/RB_Order_RemarkRepository.cs
+6
-4
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+8
-8
FinanceController.cs
Edu.WebApi/Controllers/Finance/FinanceController.cs
+21
-13
No files found.
Edu.Model/ViewModel/Course/RB_Order_Remark_ViewModel.cs
View file @
91cc79ad
...
...
@@ -9,6 +9,9 @@ namespace Edu.Model.ViewModel.Course
[
Serializable
]
public
class
RB_Order_Remark_ViewModel
:
Model
.
Entity
.
Course
.
RB_Order_Remark
{
/// <summary>
/// 姓名
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/TeachingRewardsModule.cs
View file @
91cc79ad
...
...
@@ -103,19 +103,22 @@ namespace Edu.Module.Course
/// <param name="demodel"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
GetTeachimgRewardsList
(
RB_Teaching_Rewards_Rate_ViewModel
demodel
,
UserInfo
userInfo
,
out
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
fclist
)
public
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
GetTeachimgRewardsList
(
RB_Teaching_Rewards_Rate_ViewModel
demodel
,
UserInfo
userInfo
,
out
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
fclist
)
{
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
var
relist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
2
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
fclist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
1
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
var
vlist
=
new
List
<
RB_Teaching_Rewards_ViewModel
>();
if
(
relist
.
Any
())
{
if
(
relist
.
Any
())
{
string
TackClassRateIds
=
string
.
Join
(
","
,
relist
.
Select
(
x
=>
x
.
Id
));
vlist
=
teaching_RewardsRepository
.
GetList
(
new
RB_Teaching_Rewards_ViewModel
()
{
TackClassRateIds
=
TackClassRateIds
});
}
foreach
(
var
item
in
relist
)
{
foreach
(
var
item
in
relist
)
{
var
clist
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
foreach
(
var
qitem
in
fclist
)
{
foreach
(
var
qitem
in
fclist
)
{
var
vmodel
=
vlist
.
Where
(
x
=>
x
.
FullClassRateId
==
qitem
.
Id
&&
x
.
TackClassRateId
==
item
.
Id
).
FirstOrDefault
();
clist
.
Add
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
...
...
@@ -138,7 +141,7 @@ namespace Edu.Module.Course
/// <param name="deList"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetTeachingRewardsInfo
(
int
type
,
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
deList
,
UserInfo
userInfo
)
public
bool
SetTeachingRewardsInfo
(
int
type
,
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
deList
,
UserInfo
userInfo
)
{
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
type
});
var
trans
=
teaching_Rewards_RateRepository
.
DbTransaction
;
...
...
@@ -242,7 +245,8 @@ namespace Edu.Module.Course
}
};
var
flag
=
teaching_Rewards_BaseRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
...
...
@@ -258,14 +262,16 @@ namespace Edu.Module.Course
}
return
flag
;
}
else
{
else
{
var
list
=
teaching_Rewards_BaseRepository
.
GetList
(
new
RB_Teaching_Rewards_Base_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
if
(
list
.
Any
())
{
return
false
;
}
int
Id
=
teaching_Rewards_BaseRepository
.
Insert
(
demodel
);
if
(
Id
>
0
)
{
if
(
Id
>
0
)
{
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
...
...
@@ -316,7 +322,8 @@ namespace Edu.Module.Course
public
List
<
RB_Teaching_Bonus_ViewModel
>
GetTeachingBonusPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Bonus_ViewModel
dmodel
)
{
var
list
=
teaching_BonusRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
bonusIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
//获取所有的明细
var
dlist
=
teaching_BonusDetailRepository
.
GetList
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
BonusIds
=
bonusIds
});
...
...
@@ -328,7 +335,8 @@ namespace Edu.Module.Course
{
item
.
TeacherList
=
new
List
<
RB_Teaching_BonusDetail_ViewModel
>();
string
[]
teacherIdArr
=
item
.
TeacherIds
.
Split
(
","
);
foreach
(
var
qitem
in
teacherIdArr
)
{
foreach
(
var
qitem
in
teacherIdArr
)
{
int
teacherId
=
Convert
.
ToInt32
(
qitem
);
string
teacherName
=
tlist
.
Where
(
x
=>
x
.
TId
==
teacherId
).
FirstOrDefault
()?.
TeacherName
??
""
;
//教师累计奖励金额
...
...
@@ -386,7 +394,8 @@ namespace Edu.Module.Course
if
(
type
==
1
)
{
LogContent
=
"教务奖励确认"
;
if
(
model
.
State
!=
BonusStateEnum
.
Wait
)
{
if
(
model
.
State
!=
BonusStateEnum
.
Wait
)
{
return
false
;
}
keyValues
.
Add
(
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Confirmed
);
...
...
@@ -409,7 +418,8 @@ namespace Edu.Module.Course
}
};
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
...
...
@@ -436,10 +446,13 @@ namespace Edu.Module.Course
{
//验证当月教师是否已存在奖励
var
tlist
=
teaching_BonusRepository
.
GetList
(
new
RB_Teaching_Bonus_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Month
=
Convert
.
ToDateTime
(
dmodel
.
Month
).
ToString
(
"yyyy-MM"
)
}).
Where
(
x
=>
x
.
State
!=
BonusStateEnum
.
Cancel
).
ToList
();
if
(
tlist
.
Any
())
{
if
(
tlist
.
Any
())
{
string
[]
teacherArr
=
dmodel
.
TeacherIds
.
Split
(
','
);
foreach
(
var
item
in
tlist
)
{
foreach
(
var
qitem
in
teacherArr
)
{
foreach
(
var
item
in
tlist
)
{
foreach
(
var
qitem
in
teacherArr
)
{
if
((
","
+
item
.
TeacherIds
+
","
).
Contains
(
","
+
qitem
+
","
))
{
return
"教师 "
+
(
teacherRepository
.
GetEntity
(
qitem
)?.
TeacherName
??
""
)
+
"【"
+
qitem
+
"】"
+
"已存在当月奖励"
;
...
...
@@ -464,7 +477,8 @@ namespace Edu.Module.Course
List
<
RB_Class_Type_ViewModel
>
typeList
=
new
List
<
RB_Class_Type_ViewModel
>();
List
<
RB_Class_Check_ViewModel
>
checkList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
teacherList
=
new
List
<
RB_Teacher_ViewModel
>();
if
(
plist
.
Any
())
{
if
(
plist
.
Any
())
{
string
pids
=
string
.
Join
(
","
,
plist
.
Select
(
x
=>
x
.
ClassPlanId
));
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
QClassPlanIds
=
pids
});
...
...
@@ -537,7 +551,8 @@ namespace Edu.Module.Course
};
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
,
trans
);
#
endregion
if
(
flag
)
{
if
(
flag
)
{
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
...
...
@@ -709,6 +724,20 @@ namespace Edu.Module.Course
return
msg
;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Teaching_BonusDetail_ViewModel
>
GetBonusDetailList
(
RB_Teaching_BonusDetail_ViewModel
demodel
)
{
return
teaching_BonusDetailRepository
.
GetList
(
demodel
);
}
#
endregion
#
region
教师绩效
...
...
@@ -724,11 +753,13 @@ namespace Edu.Module.Course
public
List
<
RB_Teaching_Perf_ViewModel
>
GetTeachingPerfPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Perf_ViewModel
dmodel
)
{
var
list
=
teaching_PerfRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
:
dmodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
perfIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
rlist
=
teaching_PerfRemarkRepository
.
GetList
(
new
RB_Teaching_PerfRemark_ViewModel
()
{
PerfIds
=
perfIds
});
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
RemarkList
=
rlist
.
Where
(
x
=>
x
.
PerfId
==
item
.
Id
).
ToList
();
item
.
JJList
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
...
...
@@ -769,7 +800,8 @@ namespace Edu.Module.Course
})
>
0
;
return
flag
;
}
else
{
else
{
return
true
;
}
}
...
...
@@ -784,10 +816,11 @@ namespace Edu.Module.Course
public
string
SetTeachingPerfState
(
int
perfId
,
int
type
,
UserInfo
userInfo
)
{
var
perfModel
=
teaching_PerfRepository
.
GetEntity
(
perfId
);
if
(
perfModel
==
null
||
perfModel
.
Status
!=
0
)
{
return
"绩效不存在"
;
}
if
(
perfModel
==
null
||
perfModel
.
Status
!=
0
)
{
return
"绩效不存在"
;
}
if
(
type
==
1
)
{
if
(
perfModel
.
PerfState
!=
PerfStateEnum
.
Wait
)
{
if
(
perfModel
.
PerfState
!=
PerfStateEnum
.
Wait
)
{
return
"状态不正确"
;
}
var
teacherModel
=
teacherRepository
.
GetEntity
(
perfModel
.
TeacherId
);
...
...
@@ -806,7 +839,8 @@ namespace Edu.Module.Course
}
};
bool
flag
=
teaching_PerfRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//更新教师课时费 更新带班人数
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teacher_ViewModel
.
BaseHourFee
),
teacherModel
.
BaseHourFee
+
perfModel
.
AddHourFee
},
...
...
@@ -816,7 +850,7 @@ namespace Edu.Module.Course
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Teacher_ViewModel
.
TId
),
FiledValue
=
teacherModel
.
TId
,
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
}
};
teacherRepository
.
Update
(
keyValues1
,
wheres1
);
...
...
@@ -977,13 +1011,14 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="classId"></param>
/// <returns></returns>
public
string
SetTeachingPerfCreate
(
int
classId
,
RB_Class_ViewModel
classModel
=
null
)
public
string
SetTeachingPerfCreate
(
int
classId
,
RB_Class_ViewModel
classModel
=
null
)
{
if
(
classModel
==
null
)
{
classModel
=
classRepository
.
GetEntity
<
RB_Class_ViewModel
>(
classId
);
}
else
{
else
{
classId
=
classModel
.
ClassId
;
}
if
(
classModel
.
Status
==
DateStateEnum
.
Delete
)
{
return
"班级不存在"
;
}
...
...
@@ -1068,14 +1103,16 @@ namespace Edu.Module.Course
//查询奖金金额
decimal
UnitPrice
=
0
;
var
jjModel
=
JJrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
if
(
jjModel
!=
null
)
{
if
(
jjModel
!=
null
)
{
UnitPrice
=
jjModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
()?.
ClassMoney
??
0
;
}
//查询 增加课时费 带班人数
decimal
ClassMoney
=
0
;
int
StuNum
=
0
;
var
ksModel
=
KSrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
if
(
ksModel
!=
null
)
{
var
ksModel
=
KSrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
if
(
ksModel
!=
null
)
{
var
ks2Model
=
ksModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
ClassMoney
=
ks2Model
?.
ClassMoney
??
0
;
StuNum
=
ks2Model
?.
PeopelNum
??
0
;
...
...
@@ -1107,30 +1144,34 @@ namespace Edu.Module.Course
UnitPrice
=
UnitPrice
,
UpdateBy
=
0
,
UpdateTime
=
DateTime
.
Now
,
BonusJson
=
JsonHelper
.
Serialize
(
JJrelist
.
Select
(
x
=>
new
{
BonusJson
=
JsonHelper
.
Serialize
(
JJrelist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
StartValue
,
x
.
EndValue
,
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
StartValue
,
z
.
EndValue
,
z
.
ClassMoney
,
z
.
PeopelNum
})
})),
ClassFeeJson
=
JsonHelper
.
Serialize
(
KSrelist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
StartValue
,
x
.
EndValue
,
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
StartValue
,
z
.
EndValue
,
z
.
ClassMoney
,
z
.
PeopelNum
})
}))
})),
ClassFeeJson
=
JsonHelper
.
Serialize
(
KSrelist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
StartValue
,
x
.
EndValue
,
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
StartValue
,
z
.
EndValue
,
z
.
ClassMoney
,
z
.
PeopelNum
})
}))
});
return
""
;
}
...
...
@@ -1139,7 +1180,8 @@ namespace Edu.Module.Course
/// 获取集团列表
/// </summary>
/// <returns></returns>
public
List
<
RB_Group_ViewModel
>
GetGroupList
()
{
public
List
<
RB_Group_ViewModel
>
GetGroupList
()
{
return
groupRepository
.
GetGroupListRepository
(
new
RB_Group_ViewModel
()
{
});
}
...
...
@@ -1148,9 +1190,10 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="GroupId"></param>
/// <returns></returns>
public
List
<
RB_Class_ViewModel
>
GetTeachingPerfClassList
(
int
GroupId
)
{
public
List
<
RB_Class_ViewModel
>
GetTeachingPerfClassList
(
int
GroupId
)
{
return
classRepository
.
GetTeachingPerfClassList
(
GroupId
);
}
}
/// <summary>
/// 绩效制单
...
...
@@ -1175,7 +1218,8 @@ namespace Edu.Module.Course
#
region
新增财务单据
//银行账户
var
clientModel
=
clientBankAccountRepository
.
GetList
(
new
RB_ClientBankAccount_Extend
()
{
RB_Group_Id
=
userInfo
.
Group_Id
,
Type
=
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ObjIdStr
=
teacherModel
.
AccountId
.
ToString
()
}).
FirstOrDefault
();
if
(
clientModel
==
null
)
{
if
(
clientModel
==
null
)
{
return
"教师未添加账户信息"
;
}
var
detailList
=
new
List
<
object
>
...
...
@@ -1300,6 +1344,18 @@ namespace Edu.Module.Course
return
""
;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Teaching_Perf_ViewModel
>
GetTeachingPerfList
(
RB_Teaching_Perf_ViewModel
demodel
)
{
return
teaching_PerfRepository
.
GetList
(
demodel
);
}
#
endregion
}
}
Edu.Repository/Course/RB_Order_RemarkRepository.cs
View file @
91cc79ad
...
...
@@ -25,18 +25,20 @@ namespace Edu.Repository.Course
if
(
demodel
.
OrderId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Remark
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
where
+=
$@" and
r.
{
nameof
(
RB_Order_Remark
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
orderIds
))
{
where
+=
$@" and
{
nameof
(
RB_Order_Remark
.
OrderId
)}
in(
{
orderIds
}
)"
;
where
+=
$@" and
r.
{
nameof
(
RB_Order_Remark
.
OrderId
)}
in(
{
orderIds
}
)"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Order_Remark
.
Type
)}
=
{
demodel
.
Type
}
"
;
where
+=
$@" and
r.
{
nameof
(
RB_Order_Remark
.
Type
)}
=
{
demodel
.
Type
}
"
;
}
string
sql
=
$@" select * from RB_Order_Remark where
{
where
}
order by Id desc"
;
string
sql
=
$@" select r.*,e.EmName as CreateByName from RB_Order_Remark r
left join rb_employee e on r.CreateBy = e.EmployeeId
where
{
where
}
order by r.Id desc"
;
return
Get
<
RB_Order_Remark_ViewModel
>(
sql
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
91cc79ad
...
...
@@ -161,28 +161,28 @@ namespace Edu.WebApi.Controllers.Course
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
TeacherRemarkList
=
x
.
TeacherRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
RectorRemarkList
=
x
.
RectorRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
DirectorRemarkList
=
x
.
DirectorRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
GuestList
=
x
.
GuestList
.
Select
(
z
=>
new
...
...
@@ -863,28 +863,28 @@ namespace Edu.WebApi.Controllers.Course
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
TeacherRemarkList
=
x
.
TeacherRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
RectorRemarkList
=
x
.
RectorRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
DirectorRemarkList
=
x
.
DirectorRemarkList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Content
,
CreateBy
=
UserReidsCache
.
GetUserLoginInfo
(
z
.
CreateBy
)?.
AccountName
??
""
,
CreateBy
=
z
.
CreateByName
,
CreateTime
=
z
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
}),
GuestList
=
x
.
GuestList
.
Select
(
z
=>
new
...
...
Edu.WebApi/Controllers/Finance/FinanceController.cs
View file @
91cc79ad
...
...
@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
private
readonly
FinanceModule
financeModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
FinanceModule
>();
private
readonly
OrderModule
orderModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
OrderModule
>();
private
readonly
ClassModule
classModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
ClassModule
>();
private
readonly
TeachingRewardsModule
teachingRewardsModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
TeachingRewardsModule
>();
/// <summary>
/// 获取班级收支明细
...
...
@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
//收入
decimal
IncomeReceive
=
0
;
//应收
decimal
IncomeActual
=
0
;
//实收
var
orderList
=
orderModule
.
GetClassOrderList_V2
(
classId
,
base
.
UserInfo
.
Group_Id
);
var
orderList
=
orderModule
.
GetClassOrderList_V2
(
classId
,
base
.
UserInfo
.
Group_Id
)
.
Where
(
x
=>
(
int
)
x
.
OrderState
<
3
)
;
IncomeReceive
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
PreferPrice
)
:
0
;
IncomeActual
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
Income
)
:
0
;
...
...
@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
0
;
//实付
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
decimal
SaleCommission
=
0
;
//销售提成
decimal
TeacherProfitNow
=
0
;
//老师提成
decimal
MeritsProfit
=
0
;
//绩效提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
var
teacherProfitList
=
teachingRewardsModule
.
GetBonusDetailList
(
new
RB_Teaching_BonusDetail_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
});
decimal
TeacherProfitNow
=
(
teacherProfitList
!=
null
&&
teacherProfitList
.
Any
())
?
teacherProfitList
.
Sum
(
x
=>
x
.
Money
)
:
0
;
//老师提成
var
meritsProfitList
=
teachingRewardsModule
.
GetTeachingPerfList
(
new
RB_Teaching_Perf_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
});
decimal
MeritsProfit
=
(
meritsProfitList
!=
null
&&
meritsProfitList
.
Any
())
?
(
meritsProfitList
.
OrderByDescending
(
x
=>
x
.
CreateTime
).
FirstOrDefault
()?.
Money
??
0
)
:
0
;
//绩效提成
var
classInfo
=
classModule
.
GetClassAndCourseListRepository
(
new
Model
.
ViewModel
.
Course
.
RB_Class_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
}).
FirstOrDefault
();
var
recultFiniceList
=
financeList
.
Select
(
x
=>
new
...
...
@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
0
;
//实付
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
decimal
SaleCommission
=
0
;
//销售提成
decimal
TeacherProfitNow
=
0
;
//老师提成
decimal
MeritsProfit
=
0
;
//绩效提成
//提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
var
teacherProfitList
=
teachingRewardsModule
.
GetBonusDetailList
(
new
RB_Teaching_BonusDetail_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
});
decimal
TeacherProfitNow
=
(
teacherProfitList
!=
null
&&
teacherProfitList
.
Any
())
?
teacherProfitList
.
Sum
(
x
=>
x
.
Money
)
:
0
;
//老师提成
var
meritsProfitList
=
teachingRewardsModule
.
GetTeachingPerfList
(
new
RB_Teaching_Perf_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
});
decimal
MeritsProfit
=
(
meritsProfitList
!=
null
&&
meritsProfitList
.
Any
())
?
(
meritsProfitList
.
OrderByDescending
(
x
=>
x
.
CreateTime
).
FirstOrDefault
()?.
Money
??
0
)
:
0
;
//绩效提成
List
<
RB_Finance_Extend
>
financeReciveList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
IN
).
ToList
();
List
<
RB_Finance_Extend
>
financePayList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
OUT
).
ToList
();
//var recultFiniceList = financeList.Select(x => new
...
...
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