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
8808b992
Commit
8808b992
authored
Dec 15, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
教师奖励
parent
bfed8a2f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
19 deletions
+139
-19
RB_Teacher_ViewModel.cs
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
+5
-0
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+15
-0
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+28
-17
RB_TeacherRepository.cs
Edu.Repository/User/RB_TeacherRepository.cs
+23
-0
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+47
-0
TeachingRewardsController.cs
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
+19
-0
appsettings.json
Edu.WebApi/appsettings.json
+2
-2
No files found.
Edu.Model/ViewModel/User/RB_Teacher_ViewModel.cs
View file @
8808b992
...
...
@@ -78,5 +78,10 @@ namespace Edu.Model.ViewModel.User
/// 教师编号
/// </summary>
public
string
QTIds
{
get
;
set
;
}
/// <summary>
/// 对应账号id
/// </summary>
public
int
AccountId
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Course/OrderModule.cs
View file @
8808b992
...
...
@@ -363,6 +363,21 @@ namespace Edu.Module.Course
return
orderRepository
.
GetEntity
<
RB_Order_ViewModel
>(
orderId
);
}
/// <summary>
/// 获取订单详情
/// </summary>
/// <param name="orderId"></param>
/// <returns></returns>
public
RB_Order_ViewModel
GetClassOrderInfo_V2
(
int
orderId
)
{
var
model
=
orderRepository
.
GetEntity
<
RB_Order_ViewModel
>(
orderId
);
if
(
model
!=
null
)
{
model
.
ClassName
=
classRepository
.
GetEntity
(
model
.
ClassId
)?.
ClassName
??
""
;
}
return
model
;
}
/// <summary>
/// 获取订单阶梯价格
/// </summary>
...
...
Edu.Module.Course/TeachingRewardsModule.cs
View file @
8808b992
...
...
@@ -455,7 +455,7 @@ namespace Edu.Module.Course
List
<
RB_Class_Time_ViewModel
>
timeList
=
new
List
<
RB_Class_Time_ViewModel
>();
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>();
List
<
RB_Teacher_ViewModel
>
teacherList
=
new
List
<
RB_Teacher_ViewModel
>();
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
});
...
...
@@ -466,12 +466,13 @@ namespace Edu.Module.Course
string
classIds
=
string
.
Join
(
","
,
plist
.
Select
(
x
=>
x
.
ClassId
).
Distinct
());
checkList
=
class_CheckRepository
.
GetClassCheckStatistics
(
new
RB_Class_Check_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Q_ClassIds
=
classIds
,
StartDate
=
StartTime
,
EndDate
=
EndTime
});
//查询教师列表
//
string teacherIds = string.Join(",", plist.Select(x => x.TeacherId).Distinct());
//
teacherList = teacherRepository.GetTeacherListRepository(new RB_Teacher_ViewModel() { QTIds = teacherIds });
string
teacherIds
=
string
.
Join
(
","
,
plist
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
());
teacherList
=
teacherRepository
.
GetTeacherListRepository
(
new
RB_Teacher_ViewModel
()
{
QTIds
=
teacherIds
});
}
var
trans
=
teaching_BonusDetailRepository
.
DbTransaction
;
try
{
decimal
TotalMoney
=
0
;
foreach
(
var
item
in
plist
)
{
//查询课时
...
...
@@ -481,13 +482,13 @@ namespace Edu.Module.Course
foreach
(
var
qitem
in
ctimelist
)
{
var
ts
=
Convert
.
ToDateTime
(
nowTime
+
" "
+
qitem
.
EndTime
)
-
Convert
.
ToDateTime
(
nowTime
+
" "
+
qitem
.
StartTime
);
minute
+=
ts
.
Minutes
;
minute
+=
(
int
)
ts
.
Total
Minutes
;
}
int
ksNum
=
minute
/
configModel
.
BasicMinutes
;
// 未达到一课时时间 算不算一课时
//查询课单价
var
typeModel
=
typeList
.
Where
(
x
=>
x
.
CTypeId
==
item
.
ClassType
).
FirstOrDefault
();
//
var teacherModel = teacherList.Where(x => x.TId == item.TeacherId).FirstOrDefault();
decimal
unitPrice
=
configModel
.
BasicHourFee
+
(
typeModel
?.
AddHourFee
??
0
);
var
teacherModel
=
teacherList
.
Where
(
x
=>
x
.
TId
==
item
.
TeacherId
).
FirstOrDefault
();
decimal
unitPrice
=
configModel
.
BasicHourFee
+
(
typeModel
?.
AddHourFee
??
0
)
+
(
teacherModel
?.
BaseHourFee
??
0
)
;
//签到人数
var
checkModel
=
checkList
.
Where
(
x
=>
x
.
ClassId
==
item
.
ClassId
&&
x
.
ClassDate
==
item
.
ClassDate
).
FirstOrDefault
();
...
...
@@ -511,11 +512,13 @@ namespace Edu.Module.Course
UpdateBy
=
dmodel
.
UpdateBy
,
UpdateTime
=
DateTime
.
Now
},
trans
);
TotalMoney
+=
ksNum
*
unitPrice
;
}
#
region
更新状态为待确认
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Wait
}
{
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Wait
},
{
nameof
(
RB_Teaching_Bonus_ViewModel
.
Money
),
TotalMoney
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -566,13 +569,15 @@ namespace Edu.Module.Course
string
msg
=
""
;
//查询出所有需要发提成的人
List
<
int
>
EmpList
=
list
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
().
ToList
();
//根据教师ids 查询 账号ids
var
teachList
=
teacherRepository
.
GetTeacherList
(
string
.
Join
(
","
,
EmpList
));
//查询所有的账户信息 不存在的需要提示
var
banklist
=
clientBankAccountRepository
.
GetList
(
new
RB_ClientBankAccount_Extend
()
{
RB_Group_Id
=
userInfo
.
Group_Id
,
Type
=
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ObjIdStr
=
string
.
Join
(
","
,
EmpList
)
});
foreach
(
var
item
in
Emp
List
)
var
banklist
=
clientBankAccountRepository
.
GetList
(
new
RB_ClientBankAccount_Extend
()
{
RB_Group_Id
=
userInfo
.
Group_Id
,
Type
=
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ObjIdStr
=
string
.
Join
(
","
,
teachList
.
Select
(
x
=>
x
.
AccountId
)
)
});
foreach
(
var
item
in
teach
List
)
{
if
(!
banklist
.
Where
(
x
=>
x
.
ObjID
==
item
).
Any
())
if
(!
banklist
.
Where
(
x
=>
x
.
ObjID
==
item
.
AccountId
).
Any
())
{
msg
+=
(
UserReidsCache
.
GetUserLoginInfo
(
item
)?.
AccountName
??
""
)
+
"未查询到员工银行账户信息;"
;
msg
+=
(
UserReidsCache
.
GetUserLoginInfo
(
item
.
AccountId
)?.
AccountName
??
""
)
+
"未查询到员工银行账户信息;"
;
}
}
if
(
msg
!=
""
)
...
...
@@ -584,10 +589,10 @@ namespace Edu.Module.Course
foreach
(
var
item
in
EmpList
)
{
var
tlist
=
list
.
Where
(
x
=>
x
.
TeacherId
==
item
).
ToList
();
var
teacherModel
=
teach
erRepository
.
GetEntity
(
item
);
var
teacherModel
=
teach
List
.
Where
(
x
=>
x
.
TId
==
item
).
FirstOrDefault
(
);
#
region
新增财务单据
//银行账户
var
clientModel
=
banklist
.
Where
(
x
=>
x
.
ObjID
==
item
).
FirstOrDefault
();
var
clientModel
=
banklist
.
Where
(
x
=>
x
.
ObjID
==
teacherModel
.
AccountId
).
FirstOrDefault
();
var
detailList
=
new
List
<
object
>
{
};
decimal
TotalMoney
=
0
;
foreach
(
var
qitem
in
tlist
)
...
...
@@ -606,21 +611,27 @@ namespace Edu.Module.Course
string
Remark
=
tmodel
.
Month
+
"月,"
+
teacherModel
.
TeacherName
+
"教师奖励"
;
var
financeObj
=
new
{
CreateBy
=
userInfo
.
Id
,
IsPublic
,
ClientType
=
(
int
)
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ClientID
=
clientModel
.
ID
,
CurrencyId
,
WBMoney
=
TotalMoney
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
RB_Branch_Id
=
teacherModel
.
School_Id
,
TemplateId
=
Config
.
ReadConfigKey
(
"TeachingBonusTemplete"
),
OrderSource
=
17
,
OtherType
=
26
,
ReFinanceId
=
bonusId
,
Remark
,
detailList
,
RB_Depart_Id
=
teacherModel
.
Dept_Id
CreateBy
=
userInfo
.
Id
,
RB_Branch_Id
=
teacherModel
.
School_Id
,
RB_Depart_Id
=
teacherModel
.
Dept_Id
,
RB_Group_Id
=
userInfo
.
Group_Id
,
RB_CreateByName
=
userInfo
.
AccountName
,
RB_DepartName
=
teacherModel
.
DeptName
,
RB_BranchName
=
teacherModel
.
SName
,
RB_GroupName
=
userInfo
.
GroupName
,
FinanceType
=
2
};
string
sign
=
EncryptionHelper
.
AesEncrypt
(
JsonHelper
.
Serialize
(
financeObj
),
Config
.
ReadConfigKey
(
"FinanceKey"
));
var
resultInfo
=
new
...
...
@@ -652,7 +663,7 @@ namespace Edu.Module.Course
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Teaching_Bonus_ViewModel
),
FiledName
=
nameof
(
RB_Teaching_Bonus_ViewModel
.
Id
),
FiledValue
=
bonusId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
...
...
Edu.Repository/User/RB_TeacherRepository.cs
View file @
8808b992
...
...
@@ -148,5 +148,28 @@ WHERE 1=1
}
return
GetPage
<
RB_Teacher_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取教师账户
/// </summary>
/// <param name="teacherIds"></param>
/// <returns></returns>
public
List
<
RB_Teacher_ViewModel
>
GetTeacherList
(
string
teacherIds
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT t.*,a.Id as AccountId,s.SName,d.DeptName
FROM rb_teacher AS t
LEFT JOIN rb_account as a ON (t.TId=a.AccountId AND a.AccountType=2)
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
left join rb_department as d on t.Dept_Id = d.DeptId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
builder
.
AppendFormat
(
" AND t.{0}={1} "
,
nameof
(
RB_Teacher_ViewModel
.
AuditStatus
),
(
int
)
AccountStatusEnum
.
Pass
);
builder
.
AppendFormat
(
" AND t.{0} IN({1}) "
,
nameof
(
RB_Teacher_ViewModel
.
TId
),
teacherIds
);
return
Get
<
RB_Teacher_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
8808b992
...
...
@@ -338,6 +338,53 @@ namespace Edu.WebApi.Controllers.Course
});
}
/// <summary>
/// 订单详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetClassOrderForDetail
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
model
=
orderModule
.
GetClassOrderInfo_V2
(
OrderId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"订单不存在"
);
}
return
ApiResult
.
Success
(
""
,
new
{
model
.
OrderId
,
model
.
ClassId
,
model
.
TradeWay
,
model
.
Class_Price
,
model
.
Unit_Price
,
model
.
GuestNum
,
model
.
PreferPrice
,
model
.
Income
,
model
.
Refund
,
model
.
DiscountMoney
,
model
.
PlatformTax
,
DueInMoney
=
model
.
PreferPrice
-
(
model
.
Income
-
model
.
Refund
+
model
.
PlatformTax
+
model
.
DiscountMoney
),
model
.
OrderState
,
OrderStateName
=
model
.
OrderState
.
ToName
(),
model
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
model
.
EnterID
)?.
AccountName
??
""
,
model
.
CommissionMoney
,
model
.
ExtraRewardMoney
,
model
.
ExtraDeductMoney
,
model
.
IsCommissionGive
,
CreateTime
=
model
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
CreateTime2
=
model
.
CreateTime
.
ToString
(
"yyyy年MM月dd日"
)
});
}
/// <summary>
/// 取消订单
/// </summary>
...
...
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
View file @
8808b992
...
...
@@ -434,6 +434,10 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
ParamIsNull
(
"请选择月份"
);
}
//if (Convert.ToDateTime(dmodel.Month) >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM")))
//{
// return ApiResult.ParamIsNull("只能选择之前月份");
//}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
TeacherIds
))
{
return
ApiResult
.
ParamIsNull
(
"请选择老师"
);
...
...
@@ -484,6 +488,21 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Failed
(
msg
);
}
}
/// <summary>
/// 获取枚举列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetBonusStateEnumList
()
{
var
list
=
EnumHelper
.
EnumToList
(
typeof
(
BonusStateEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
x
.
Name
,
x
.
Id
}));
}
#
endregion
}
}
Edu.WebApi/appsettings.json
View file @
8808b992
...
...
@@ -23,8 +23,8 @@
"Mongo"
:
"mongodb://47.96.25.130:27017"
,
"MongoDBName"
:
"Edu"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"PaymentFinanceApi"
:
"http://192.168.
2.16
:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"TeachingBonusTemplete"
:
1
34
,
"PaymentFinanceApi"
:
"http://192.168.
1.13
:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"TeachingBonusTemplete"
:
1
41
,
"BonusCostTypeId"
:
540
,
"RabbitMqConfig"
:
{
"HostName"
:
"47.96.25.130"
,
...
...
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