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
cf7eb99c
Commit
cf7eb99c
authored
Dec 25, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增财务配置
parent
3d02f82b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
326 additions
and
13 deletions
+326
-13
FinanceConfigTypeEnum.cs
Edu.Common/Enum/Course/FinanceConfigTypeEnum.cs
+31
-0
RB_Finance_Config.cs
Edu.Model/Entity/Course/RB_Finance_Config.cs
+70
-0
RB_Finance_Config_ViewModel.cs
Edu.Model/ViewModel/Course/RB_Finance_Config_ViewModel.cs
+14
-0
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+11
-2
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+76
-4
RB_Finance_ConfigRepository.cs
Edu.Repository/Course/RB_Finance_ConfigRepository.cs
+38
-0
RB_Teaching_BonusDetailRepository.cs
Edu.Repository/Course/RB_Teaching_BonusDetailRepository.cs
+1
-1
TeachingRewardsController.cs
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
+85
-0
appsettings.json
Edu.WebApi/appsettings.json
+0
-6
No files found.
Edu.Common/Enum/Course/FinanceConfigTypeEnum.cs
0 → 100644
View file @
cf7eb99c
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.Course
{
/// <summary>
/// 财务流程费用配置枚举
/// </summary>
public
enum
FinanceConfigTypeEnum
{
/// <summary>
/// 教师课时费
/// </summary>
[
EnumField
(
"教师课时费"
)]
ClassFees
=
1
,
/// <summary>
/// 教师绩效
/// </summary>
[
EnumField
(
"教师绩效"
)]
Perf
=
2
,
/// <summary>
/// 学生退课
/// </summary>
[
EnumField
(
"学生退课"
)]
DropCourse
=
3
,
}
}
Edu.Model/Entity/Course/RB_Finance_Config.cs
0 → 100644
View file @
cf7eb99c
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Course
;
using
System
;
using
VT.FW.DB
;
namespace
Edu.Model.Entity.Course
{
/// <summary>
/// 财务流程费用配置实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Finance_Config
{
/// <summary>
/// 主键
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 类型 1教师课时费 2教师绩效 3学生退课 枚举
/// </summary>
public
FinanceConfigTypeEnum
Type
{
get
;
set
;
}
/// <summary>
/// 费用id
/// </summary>
public
int
CostTypeId
{
get
;
set
;
}
/// <summary>
/// 流程Id
/// </summary>
public
int
TempleteId
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
Status
{
get
;
set
;
}
/// <summary>
/// 集团编号
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
/// <summary>
/// 校区id
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 修改人
/// </summary>
public
int
UpdateBy
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Course/RB_Finance_Config_ViewModel.cs
0 → 100644
View file @
cf7eb99c
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 财务流程费用配置扩展类
/// </summary>
[
Serializable
]
public
class
RB_Finance_Config_ViewModel
:
Model
.
Entity
.
Course
.
RB_Finance_Config
{
}
}
\ No newline at end of file
Edu.Module.Course/StudentBillModule.cs
View file @
cf7eb99c
...
...
@@ -80,6 +80,13 @@ namespace Edu.Module.Course
/// </summary>
private
readonly
RB_Class_CheckRepository
class_CheckRepository
=
new
RB_Class_CheckRepository
();
/// <summary>
/// 财务配置
/// </summary>
private
readonly
RB_Finance_ConfigRepository
finance_ConfigRepository
=
new
RB_Finance_ConfigRepository
();
/// <summary>
/// 获取学员退课单据分页列表
/// </summary>
...
...
@@ -845,6 +852,8 @@ namespace Edu.Module.Course
if
(
backModel
.
FinanceId
>
0
)
{
return
"已制单,无法再次生成财务单据"
;
}
var
guestModel
=
order_GuestRepository
.
GetEntity
(
backModel
.
GuestId
);
if
(
guestModel
==
null
||
guestModel
.
GuestState
!=
2
)
{
return
"客人名单状态不正确"
;
}
var
fcmodel
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
FinanceConfigTypeEnum
.
DropCourse
}).
FirstOrDefault
();
if
(
fcmodel
==
null
)
{
return
"未配置制单流程"
;
}
string
msg
=
""
;
#
region
新增财务单据
...
...
@@ -852,7 +861,7 @@ namespace Edu.Module.Course
{
new
{
CostTypeId
=
Config
.
ReadConfigKey
(
"StuBackCostTypeId"
)
,
CostTypeId
=
fcmodel
.
CostTypeId
,
Number
=
1
,
OriginalMoney
=
backModel
.
RealityBackMoney
,
UnitPrice
=
backModel
.
RealityBackMoney
,
...
...
@@ -869,7 +878,7 @@ namespace Edu.Module.Course
CurrencyId
,
WBMoney
=
backModel
.
RealityBackMoney
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
Config
.
ReadConfigKey
(
"StuBackTemplete"
)
,
TemplateId
=
fcmodel
.
TempleteId
,
OrderSource
=
17
,
OrderID
=
backModel
.
OrderId
,
TCIDList
=
new
List
<
int
>()
{
backModel
.
ClassId
},
...
...
Edu.Module.Course/TeachingRewardsModule.cs
View file @
cf7eb99c
...
...
@@ -98,6 +98,10 @@ namespace Edu.Module.Course
/// 账户
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// 财务配置
/// </summary>
private
readonly
RB_Finance_ConfigRepository
finance_ConfigRepository
=
new
RB_Finance_ConfigRepository
();
#
region
教务配置
...
...
@@ -630,6 +634,9 @@ namespace Edu.Module.Course
if
(
tmodel
==
null
)
{
return
"教师奖励不存在"
;
}
if
(
tmodel
.
State
!=
BonusStateEnum
.
Confirmed
)
{
return
"奖金状态不正确"
;
}
if
(!
string
.
IsNullOrEmpty
(
tmodel
.
FinanceId
))
{
return
"已制单,无法再次生成单据"
;
}
var
fcmodel
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
FinanceConfigTypeEnum
.
ClassFees
}).
FirstOrDefault
();
if
(
fcmodel
==
null
)
{
return
"未配置制单流程"
;
}
var
list
=
teaching_BonusDetailRepository
.
GetTeachingBonusStatistics
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
BonusId
=
bonusId
});
string
msg
=
""
;
...
...
@@ -666,7 +673,7 @@ namespace Edu.Module.Course
{
detailList
.
Add
(
new
{
CostTypeId
=
Config
.
ReadConfigKey
(
"BonusCostTypeId"
)
,
CostTypeId
=
fcmodel
.
CostTypeId
,
Number
=
(
qitem
.
CourseHour
+
qitem
.
DCourseHour
),
OriginalMoney
=
qitem
.
Money
,
qitem
.
UnitPrice
,
...
...
@@ -684,7 +691,7 @@ namespace Edu.Module.Course
CurrencyId
,
WBMoney
=
TotalMoney
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
Config
.
ReadConfigKey
(
"TeachingBonusTemplete"
)
,
TemplateId
=
fcmodel
.
TempleteId
,
OrderSource
=
17
,
OtherType
=
26
,
ReFinanceId
=
bonusId
,
...
...
@@ -1262,6 +1269,8 @@ namespace Edu.Module.Course
if
(
tmodel
==
null
)
{
return
"教师绩效不存在"
;
}
if
(
tmodel
.
PerfState
!=
PerfStateEnum
.
Confirmed
)
{
return
"未确认无法制单"
;
}
if
(
tmodel
.
FinanceId
>
0
)
{
return
"财务单据已存在,无法再次制单"
;
}
var
fcmodel
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
FinanceConfigTypeEnum
.
Perf
}).
FirstOrDefault
();
if
(
fcmodel
==
null
)
{
return
"未配置制单流程"
;
}
string
msg
=
""
;
var
teacherModel
=
teacherRepository
.
GetTeacherList
(
tmodel
.
TeacherId
.
ToString
()).
FirstOrDefault
();
...
...
@@ -1280,7 +1289,7 @@ namespace Edu.Module.Course
{
new
{
CostTypeId
=
Config
.
ReadConfigKey
(
"PerfCostTypeId"
)
,
fcmodel
.
CostTypeId
,
Number
=
tmodel
.
ClassHours
,
OriginalMoney
=
tmodel
.
Money
,
tmodel
.
UnitPrice
,
...
...
@@ -1297,7 +1306,7 @@ namespace Edu.Module.Course
CurrencyId
,
WBMoney
=
tmodel
.
Money
,
PayDate
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
),
TemplateId
=
Config
.
ReadConfigKey
(
"TeachingPerfTemplete"
)
,
TemplateId
=
fcmodel
.
TempleteId
,
OrderSource
=
17
,
OtherType
=
27
,
ReFinanceId
=
perfId
,
...
...
@@ -1524,5 +1533,68 @@ namespace Edu.Module.Course
}
#
endregion
#
region
财务配置
/// <summary>
/// 获取财务配置列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_Config_ViewModel
>
GetFinanceConfigList
(
RB_Finance_Config_ViewModel
dmodel
)
{
return
finance_ConfigRepository
.
GetList
(
dmodel
);
}
/// <summary>
/// 获取财务配置
/// </summary>
/// <param name="type"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
RB_Finance_Config_ViewModel
GetFinanceConfigInfo
(
int
type
,
UserInfo
userInfo
)
{
var
model
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
(
FinanceConfigTypeEnum
)
type
}).
FirstOrDefault
();
if
(
model
==
null
)
{
model
=
new
RB_Finance_Config_ViewModel
()
{
Id
=
0
};
}
return
model
;
}
/// <summary>
/// 设置财务配置
/// </summary>
/// <param name="dmodel"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetFinanceConfigInfo
(
RB_Finance_Config_ViewModel
dmodel
,
UserInfo
userInfo
)
{
if
(
dmodel
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Finance_Config_ViewModel
.
CostTypeId
),
dmodel
.
CostTypeId
},
{
nameof
(
RB_Finance_Config_ViewModel
.
TempleteId
),
dmodel
.
TempleteId
},
{
nameof
(
RB_Finance_Config_ViewModel
.
UpdateBy
),
dmodel
.
UpdateBy
},
{
nameof
(
RB_Finance_Config_ViewModel
.
UpdateTime
),
dmodel
.
UpdateTime
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Finance_Config_ViewModel
.
Id
),
FiledValue
=
dmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
finance_ConfigRepository
.
Update
(
keyValues
,
wheres
);
}
else
{
var
model
=
finance_ConfigRepository
.
GetList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
dmodel
.
Type
}).
FirstOrDefault
();
if
(
model
!=
null
)
{
return
false
;
}
return
finance_ConfigRepository
.
Insert
(
dmodel
)
>
0
;
}
}
#
endregion
}
}
Edu.Repository/Course/RB_Finance_ConfigRepository.cs
0 → 100644
View file @
cf7eb99c
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Course
;
using
Edu.Model.ViewModel.Course
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Course
{
/// <summary>
/// 财务流程费用配置仓储层
/// </summary>
public
class
RB_Finance_ConfigRepository
:
BaseRepository
<
RB_Finance_Config
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Finance_Config_ViewModel
>
GetList
(
RB_Finance_Config_ViewModel
demodel
)
{
string
where
=
$@" 1=1 and Status =0"
;
if
(
demodel
.
Group_Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_Config_ViewModel
.
Group_Id
)}
=
{
demodel
.
Group_Id
}
"
;
}
if
(
demodel
.
Type
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Finance_Config_ViewModel
.
Type
)}
=
{(
int
)
demodel
.
Type
}
"
;
}
string
sql
=
$@" select * from RB_Finance_Config where
{
where
}
order by Id desc"
;
return
Get
<
RB_Finance_Config_ViewModel
>(
sql
).
ToList
();
}
}
}
Edu.Repository/Course/RB_Teaching_BonusDetailRepository.cs
View file @
cf7eb99c
...
...
@@ -108,7 +108,7 @@ namespace Edu.Repository.Course
string
sql
=
$@" select bd.*,c.ClassName from RB_Teaching_BonusDetail bd
inner join rb_teaching_bonus b on bd.BonusId = b.Id
left join rb_class c on bd.ClassId = c.ClassId
where
{
where
}
order by bd.
Id de
sc"
;
where
{
where
}
order by bd.
Date a
sc"
;
return
GetPage
<
RB_Teaching_BonusDetail_ViewModel
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
View file @
cf7eb99c
...
...
@@ -923,5 +923,90 @@ namespace Edu.WebApi.Controllers.Course
}
#
endregion
#
region
财务配置
/// <summary>
/// 获取列表 没用
/// </summary>
/// <returns></returns>
public
ApiResult
GetFinanceConfigList
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
var
list
=
teachingRewardsModule
.
GetFinanceConfigList
(
new
RB_Finance_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
(
FinanceConfigTypeEnum
)
Type
});
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Type
,
}));
}
/// <summary>
/// 获取枚举列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetFinanceConfigEnumList
()
{
var
list
=
EnumHelper
.
EnumToList
(
typeof
(
FinanceConfigTypeEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
x
.
Name
,
x
.
Id
}));
}
/// <summary>
/// 获取财务配置
/// </summary>
/// <returns></returns>
public
ApiResult
GetFinanceConfigInfo
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
if
(
Type
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
model
=
teachingRewardsModule
.
GetFinanceConfigInfo
(
Type
,
userInfo
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
Type
,
model
.
CostTypeId
,
model
.
TempleteId
});
}
/// <summary>
/// 新增财务配置
/// </summary>
/// <returns></returns>
public
ApiResult
SetFinanceConfigInfo
()
{
var
userInfo
=
base
.
UserInfo
;
RB_Finance_Config_ViewModel
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Finance_Config_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
if
(
dmodel
.
Type
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递类型"
);
}
if
(
dmodel
.
CostTypeId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择费用类型"
);
}
if
(
dmodel
.
TempleteId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择流程"
);
}
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
dmodel
.
School_Id
=
userInfo
.
School_Id
;
dmodel
.
Status
=
0
;
dmodel
.
CreateBy
=
userInfo
.
Id
;
dmodel
.
CreateTime
=
DateTime
.
Now
;
dmodel
.
UpdateBy
=
userInfo
.
Id
;
dmodel
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
teachingRewardsModule
.
SetFinanceConfigInfo
(
dmodel
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
}
}
Edu.WebApi/appsettings.json
View file @
cf7eb99c
...
...
@@ -24,12 +24,6 @@
"MongoDBName"
:
"Edu"
,
"FinanceKey"
:
"FinanceMallInsertToERPViitto2020"
,
"PaymentFinanceApi"
:
"http://192.168.1.13:8083/api/Mall/InsertFinanceBatchForMallOut"
,
"TeachingBonusTemplete"
:
141
,
"BonusCostTypeId"
:
540
,
"TeachingPerfTemplete"
:
141
,
"PerfCostTypeId"
:
540
,
"StuBackTemplete"
:
141
,
"StuBackCostTypeId"
:
540
,
"RabbitMqConfig"
:
{
"HostName"
:
"47.96.25.130"
,
"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