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
8e25bb45
Commit
8e25bb45
authored
Apr 14, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1089ce94
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
474 additions
and
459 deletions
+474
-459
ContractTypeEnum.cs
Edu.Common/Enum/Course/ContractTypeEnum.cs
+2
-2
RB_Education_Contract.cs
Edu.Model/Entity/Course/RB_Education_Contract.cs
+321
-151
RB_Education_Contract_ViewModel.cs
...Model/ViewModel/Course/RB_Education_Contract_ViewModel.cs
+0
-30
EducationContractModule.cs
Edu.Module.Course/EducationContractModule.cs
+48
-124
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+67
-67
RB_Education_ContractRepository.cs
Edu.Repository/Course/RB_Education_ContractRepository.cs
+8
-8
EducationContractController.cs
Edu.WebApi/Controllers/Course/EducationContractController.cs
+28
-77
No files found.
Edu.Common/Enum/Course/ContractTypeEnum.cs
View file @
8e25bb45
...
@@ -17,9 +17,9 @@ namespace Edu.Common.Enum.Course
...
@@ -17,9 +17,9 @@ namespace Edu.Common.Enum.Course
Train
=
1
,
Train
=
1
,
/// <summary>
/// <summary>
/// 留学
/// 留学
就业
/// </summary>
/// </summary>
[
EnumField
(
"留学"
)]
[
EnumField
(
"留学
就业
"
)]
StudyAbroad
=
2
StudyAbroad
=
2
}
}
}
}
Edu.Model/Entity/Course/RB_Education_Contract.cs
View file @
8e25bb45
...
@@ -15,7 +15,7 @@ namespace Edu.Model.Entity.Course
...
@@ -15,7 +15,7 @@ namespace Edu.Model.Entity.Course
public
class
RB_Education_Contract
public
class
RB_Education_Contract
{
{
/// <summary>
/// <summary>
///
Id
///
合同主键编号
/// </summary>
/// </summary>
public
int
Id
{
get
;
set
;
}
public
int
Id
{
get
;
set
;
}
...
@@ -24,154 +24,324 @@ namespace Edu.Model.Entity.Course
...
@@ -24,154 +24,324 @@ namespace Edu.Model.Entity.Course
/// </summary>
/// </summary>
public
ContractTypeEnum
CType
{
get
;
set
;
}
public
ContractTypeEnum
CType
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 关联订单id
/// 关联订单id
/// </summary>
/// </summary>
public
int
OrderId
{
get
;
set
;
}
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 合同编号
/// 学生名单id
/// </summary>
/// </summary>
public
string
ContractNo
{
get
;
set
;
}
public
int
GuestId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学生姓名
/// 合同编号
/// </summary>
/// </summary>
public
string
StudentName
{
get
;
set
;
}
public
string
ContractNo
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学校名称
/// 学生姓名
/// </summary>
/// </summary>
public
string
SchoolName
{
get
;
set
;
}
public
string
StudentName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 课程名称
/// 学生生日
/// </summary>
/// </summary>
public
string
CourseName
{
get
;
set
;
}
public
DateTime
StuBirth
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 课程内容
/// 学生性别(0-男,1-女)
/// </summary>
/// </summary>
public
string
CourseContent
{
get
;
set
;
}
public
int
StuSex
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 大写金额
/// 学生地址
/// </summary>
/// </summary>
public
string
CNYCaps
{
get
;
set
;
}
public
string
StuAddress
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 金额
/// 学生电话
/// </summary>
/// </summary>
public
string
Money
{
get
;
set
;
}
public
string
StuTel
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 乙方当前选择考试
/// 学生邮箱
/// </summary>
/// </summary>
public
string
Exam
{
get
;
set
;
}
public
string
StuEmail
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 旅游代表签名
/// 家长姓名
/// </summary>
/// </summary>
public
string
Sign
{
get
;
set
;
}
public
string
ParentName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 集团编号
/// 家长与学员关系
/// </summary>
/// </summary>
public
int
Group_Id
{
get
;
set
;
}
public
string
ParentRelation
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学校id
/// 家长电话
/// </summary>
/// </summary>
public
int
School_Id
{
get
;
set
;
}
public
string
ParentTel
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 创建人
/// 家长邮箱
/// </summary>
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
public
string
ParentEmail
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 创建时间
/// 紧急联系人姓名
/// </summary>
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
public
string
UrgentName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 修改人
/// 紧急联系人与学生关系
/// </summary>
/// </summary>
public
int
UpdateBy
{
get
;
set
;
}
public
string
UrgentRelation
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 修改时间
/// 紧急联系人电话
/// </summary>
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
public
string
UrgentTel
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 状态(0-草稿,1-提交审核,2-审核通过,3-驳回,4-取消)
/// 紧急联系人邮箱
/// </summary>
/// </summary>
public
int
Status
{
get
;
set
;
}
public
string
UrgentEmail
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否盖章(0-未盖章,1-已盖章)
/// 监护人身份证后4位
/// </summary>
/// </summary>
public
int
IsCompanySeal
{
get
;
set
;
}
public
string
GuardianIDCard
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 审核时间
/// 培训课程内容
/// </summary>
/// </summary>
public
DateTime
?
AuditDate
{
get
;
set
;
}
public
string
CourseName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 签名时间
/// 校区名称
/// </summary>
/// </summary>
public
DateTime
?
SignDate
{
get
;
set
;
}
public
string
SchoolName
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 盖章时间
/// 校区负责人
/// </summary>
/// </summary>
public
DateTime
?
SealDate
{
get
;
set
;
}
public
string
SchoolPrincipal
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 审核人
/// 起始级别
/// </summary>
/// </summary>
public
int
AuditEmpId
{
get
;
set
;
}
public
string
StartLevel
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学生名单id
/// 课程顾问
/// </summary>
/// </summary>
public
int
GuestId
{
get
;
set
;
}
public
string
CourseConsultant
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 性别 1男 2女 0未设置
/// 收款人
/// </summary>
/// </summary>
public
int
Sex
{
get
;
set
;
}
public
string
Payee
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 身份证
/// 第一期-培训课时数
/// </summary>
/// </summary>
public
string
IDCard
{
get
;
set
;
}
public
int
FirstClassHours
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 身份证居住地
/// 第一期-培训课程费
/// </summary>
/// </summary>
public
string
Domicile
{
get
;
set
;
}
public
decimal
FirstCourseFee
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 联系地址
/// 第一期-培训教材费
/// </summary>
/// </summary>
public
string
ContactAddress
{
get
;
set
;
}
public
decimal
FirstBookFee
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 联系电话
/// 第一期-培训课件费
/// </summary>
/// </summary>
public
string
ContactMobile
{
get
;
set
;
}
public
decimal
FirstClassFee
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 紧急联系人
/// 第一期-折让价格
/// </summary>
/// </summary>
public
string
EmergencyContact
{
get
;
set
;
}
public
decimal
FirstDiscountMoney
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 紧急联系电话
/// 第一期-费用总计
/// </summary>
/// </summary>
public
string
EmergencyMobile
{
get
;
set
;
}
public
decimal
FirstMoney
{
get
;
set
;
}
}
/// <summary>
/// 第一期-支付日期
/// </summary>
public
DateTime
FirstPayDate
{
get
;
set
;
}
/// <summary>
/// 第二期-培训课时数
/// </summary>
public
int
SecondClassHours
{
get
;
set
;
}
/// <summary>
/// 第二期-培训课程费
/// </summary>
public
decimal
SecondCourseFee
{
get
;
set
;
}
/// <summary>
/// 第二期-培训教材费
/// </summary>
public
decimal
SecondBookFee
{
get
;
set
;
}
/// <summary>
/// 第二期-培训课件费
/// </summary>
public
decimal
SecondClassFee
{
get
;
set
;
}
/// <summary>
/// 第二期-折让价格
/// </summary>
public
decimal
SecondDiscountMoney
{
get
;
set
;
}
/// <summary>
/// 第二期-费用总计
/// </summary>
public
decimal
SecondMoney
{
get
;
set
;
}
/// <summary>
/// 第二期-支付日期
/// </summary>
public
DateTime
SecondPayDate
{
get
;
set
;
}
/// <summary>
/// 第三期-培训课时数
/// </summary>
public
int
ThirdClassHours
{
get
;
set
;
}
/// <summary>
/// 第三期-培训课程费
/// </summary>
public
decimal
ThirdCourseFee
{
get
;
set
;
}
/// <summary>
/// 第三期-培训教材费
/// </summary>
public
decimal
ThirdBookFee
{
get
;
set
;
}
/// <summary>
/// 第三期-培训课件费
/// </summary>
public
decimal
ThirdClassFee
{
get
;
set
;
}
/// <summary>
/// 第三期-折让价格
/// </summary>
public
decimal
ThirdDiscountMoney
{
get
;
set
;
}
/// <summary>
/// 第三期-费用总计
/// </summary>
public
decimal
ThirdMoney
{
get
;
set
;
}
/// <summary>
/// 第三期-支付日期
/// </summary>
public
DateTime
ThirdPayDate
{
get
;
set
;
}
/// <summary>
/// 人民币大写金额
/// </summary>
public
string
CNYCaps
{
get
;
set
;
}
/// <summary>
/// 金额
/// </summary>
public
decimal
Money
{
get
;
set
;
}
/// <summary>
/// 乙方当前选择考试
/// </summary>
public
string
Exam
{
get
;
set
;
}
/// <summary>
/// 是否有补充协议(1-有)
/// </summary>
public
int
IsSupplement
{
get
;
set
;
}
/// <summary>
/// 学生签名
/// </summary>
public
string
Sign
{
get
;
set
;
}
/// <summary>
/// 签名时间
/// </summary>
public
DateTime
SignDate
{
get
;
set
;
}
/// <summary>
/// 监护人签字
/// </summary>
public
string
GuardianSign
{
get
;
set
;
}
/// <summary>
/// 监护人签字时间
/// </summary>
public
DateTime
GuardianSignDate
{
get
;
set
;
}
/// <summary>
/// 审核时间
/// </summary>
public
DateTime
AuditDate
{
get
;
set
;
}
/// <summary>
/// 审核人id
/// </summary>
public
int
AuditEmpId
{
get
;
set
;
}
/// <summary>
/// 是否盖章(0-未盖章,1-已盖章)
/// </summary>
public
int
IsCompanySeal
{
get
;
set
;
}
/// <summary>
/// 盖章时间
/// </summary>
public
DateTime
SealDate
{
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
;
}
/// <summary>
/// 状态(0-草稿,1-提交审核,2-审核通过,3-驳回,4-取消)
/// </summary>
public
int
Status
{
get
;
set
;
}
}
}
}
Edu.Model/ViewModel/Course/RB_Education_Contract_ViewModel.cs
View file @
8e25bb45
...
@@ -18,36 +18,6 @@ namespace Edu.Model.ViewModel.Course
...
@@ -18,36 +18,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
/// </summary>
public
string
CreateByPhoto
{
get
;
set
;
}
public
string
CreateByPhoto
{
get
;
set
;
}
/// <summary>
/// 公司章
/// </summary>
public
string
CompanySealImage
{
get
;
set
;
}
/// <summary>
/// 合同公司名称
/// </summary>
public
string
ContractBranch
{
get
;
set
;
}
/// <summary>
/// 合同电话
/// </summary>
public
string
ContractTel
{
get
;
set
;
}
/// <summary>
/// 公司名称
/// </summary>
public
string
BranchName
{
get
;
set
;
}
/// <summary>
/// 法人代表
/// </summary>
public
string
LegalPerson
{
get
;
set
;
}
/// <summary>
/// 公司列表
/// </summary>
public
List
<
string
>
BranchNList
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学生名单ids
/// 学生名单ids
/// </summary>
/// </summary>
...
...
Edu.Module.Course/EducationContractModule.cs
View file @
8e25bb45
...
@@ -25,10 +25,12 @@ namespace Edu.Module.Course
...
@@ -25,10 +25,12 @@ namespace Edu.Module.Course
/// 教育合同
/// 教育合同
/// </summary>
/// </summary>
private
readonly
RB_Education_ContractRepository
education_ContractRepository
=
new
RB_Education_ContractRepository
();
private
readonly
RB_Education_ContractRepository
education_ContractRepository
=
new
RB_Education_ContractRepository
();
/// <summary>
/// <summary>
/// 账号
/// 账号
/// </summary>
/// </summary>
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
private
readonly
RB_AccountRepository
accountRepository
=
new
RB_AccountRepository
();
/// <summary>
/// <summary>
/// 集团仓储对象
/// 集团仓储对象
/// </summary>
/// </summary>
...
@@ -50,7 +52,8 @@ namespace Edu.Module.Course
...
@@ -50,7 +52,8 @@ namespace Edu.Module.Course
{
{
var
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
CreateBy
).
Distinct
());
var
userIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
CreateBy
).
Distinct
());
var
alist
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
QIds
=
userIds
});
var
alist
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
QIds
=
userIds
});
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
var
amodel
=
alist
.
Where
(
x
=>
x
.
Id
==
item
.
CreateBy
).
FirstOrDefault
();
var
amodel
=
alist
.
Where
(
x
=>
x
.
Id
==
item
.
CreateBy
).
FirstOrDefault
();
item
.
CreateByName
=
amodel
?.
AccountName
??
""
;
item
.
CreateByName
=
amodel
?.
AccountName
??
""
;
item
.
CreateByPhoto
=
amodel
?.
UserIcon
??
""
;
item
.
CreateByPhoto
=
amodel
?.
UserIcon
??
""
;
...
@@ -67,41 +70,42 @@ namespace Edu.Module.Course
...
@@ -67,41 +70,42 @@ namespace Edu.Module.Course
/// <returns></returns>
/// <returns></returns>
public
bool
SetEducationContractInfo
(
RB_Education_Contract_ViewModel
dmodel
,
UserInfo
userInfo
)
public
bool
SetEducationContractInfo
(
RB_Education_Contract_ViewModel
dmodel
,
UserInfo
userInfo
)
{
{
if
(
dmodel
.
Id
>
0
)
//if (dmodel.Id > 0)
{
//{
dmodel
.
CNYCaps
=
StringHelper
.
MoneyToUpper
(
dmodel
.
Money
.
ToString
());
// dmodel.CNYCaps = StringHelper.MoneyToUpper(dmodel.Money.ToString());
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{
nameof
(
RB_Education_Contract_ViewModel
.
StudentName
),
dmodel
.
StudentName
},
// { nameof(RB_Education_Contract_ViewModel.StudentName),dmodel.StudentName},
{
nameof
(
RB_Education_Contract_ViewModel
.
SchoolName
),
dmodel
.
SchoolName
},
// { nameof(RB_Education_Contract_ViewModel.SchoolName),dmodel.SchoolName},
{
nameof
(
RB_Education_Contract_ViewModel
.
CourseName
),
dmodel
.
CourseName
},
// { nameof(RB_Education_Contract_ViewModel.CourseName),dmodel.CourseName},
{
nameof
(
RB_Education_Contract_ViewModel
.
CourseContent
),
dmodel
.
CourseContent
},
// { nameof(RB_Education_Contract_ViewModel.CourseContent),dmodel.CourseContent},
{
nameof
(
RB_Education_Contract_ViewModel
.
CNYCaps
),
dmodel
.
CNYCaps
},
// { nameof(RB_Education_Contract_ViewModel.CNYCaps),dmodel.CNYCaps},
{
nameof
(
RB_Education_Contract_ViewModel
.
Money
),
dmodel
.
Money
},
// { nameof(RB_Education_Contract_ViewModel.Money),dmodel.Money},
{
nameof
(
RB_Education_Contract_ViewModel
.
Exam
),
dmodel
.
Exam
},
// { nameof(RB_Education_Contract_ViewModel.Exam),dmodel.Exam},
{
nameof
(
RB_Education_Contract_ViewModel
.
UpdateBy
),
userInfo
.
Id
},
// { nameof(RB_Education_Contract_ViewModel.UpdateBy),userInfo.Id},
{
nameof
(
RB_Education_Contract_ViewModel
.
UpdateTime
),
dmodel
.
UpdateTime
},
// { nameof(RB_Education_Contract_ViewModel.UpdateTime),dmodel.UpdateTime},
{
nameof
(
RB_Education_Contract_ViewModel
.
Sex
),
dmodel
.
Sex
},
// { nameof(RB_Education_Contract_ViewModel.Sex),dmodel.Sex},
{
nameof
(
RB_Education_Contract_ViewModel
.
IDCard
),
dmodel
.
IDCard
},
// { nameof(RB_Education_Contract_ViewModel.IDCard),dmodel.IDCard},
{
nameof
(
RB_Education_Contract_ViewModel
.
Domicile
),
dmodel
.
Domicile
},
// { nameof(RB_Education_Contract_ViewModel.Domicile),dmodel.Domicile},
{
nameof
(
RB_Education_Contract_ViewModel
.
ContactAddress
),
dmodel
.
ContactAddress
},
// { nameof(RB_Education_Contract_ViewModel.ContactAddress),dmodel.ContactAddress},
{
nameof
(
RB_Education_Contract_ViewModel
.
ContactMobile
),
dmodel
.
ContactMobile
},
// { nameof(RB_Education_Contract_ViewModel.ContactMobile),dmodel.ContactMobile},
{
nameof
(
RB_Education_Contract_ViewModel
.
EmergencyContact
),
dmodel
.
EmergencyContact
},
// { nameof(RB_Education_Contract_ViewModel.EmergencyContact),dmodel.EmergencyContact},
{
nameof
(
RB_Education_Contract_ViewModel
.
EmergencyMobile
),
dmodel
.
EmergencyMobile
},
// { nameof(RB_Education_Contract_ViewModel.EmergencyMobile),dmodel.EmergencyMobile},
};
// };
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
// List<WhereHelper> wheres = new List<WhereHelper>() {
new
WhereHelper
(){
// new WhereHelper(){
FiledName
=
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
// FiledName=nameof(RB_Education_Contract_ViewModel.Id),
FiledValue
=
dmodel
.
Id
,
// FiledValue=dmodel.Id,
OperatorEnum
=
OperatorEnum
.
Equal
// OperatorEnum=OperatorEnum.Equal
}
// }
};
// };
return
education_ContractRepository
.
Update
(
keyValues
,
wheres
);
// return education_ContractRepository.Update(keyValues, wheres);
}
//}
else
{
//else {
//生成合同编码
// //生成合同编码
dmodel
.
ContractNo
=
CreateContractNum
(
userInfo
.
Group_Id
);
// dmodel.ContractNo = CreateContractNum(userInfo.Group_Id);
return
education_ContractRepository
.
Insert
(
dmodel
)
>
0
;
// return education_ContractRepository.Insert(dmodel) > 0;
}
//}
return
false
;
}
}
/// <summary>
/// <summary>
...
@@ -114,20 +118,6 @@ namespace Edu.Module.Course
...
@@ -114,20 +118,6 @@ namespace Edu.Module.Course
var
model
=
education_ContractRepository
.
GetEntity
<
RB_Education_Contract_ViewModel
>(
contractId
);
var
model
=
education_ContractRepository
.
GetEntity
<
RB_Education_Contract_ViewModel
>(
contractId
);
if
(
model
==
null
)
return
model
;
if
(
model
==
null
)
return
model
;
var
gmodel
=
groupRepository
.
GetEntity
(
model
.
Group_Id
);
var
gmodel
=
groupRepository
.
GetEntity
(
model
.
Group_Id
);
if
(
model
.
IsCompanySeal
==
1
)
{
model
.
CompanySealImage
=
gmodel
?.
SealImage
??
""
;
}
model
.
ContractBranch
=
gmodel
?.
ContractBranch
??
""
;
model
.
ContractTel
=
gmodel
?.
Tel
??
""
;
model
.
LegalPerson
=
gmodel
?.
LegalPerson
??
""
;
model
.
BranchNList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
model
.
ContractBranch
))
{
string
[]
arr
=
model
.
ContractBranch
.
Split
(
','
);
model
.
BranchNList
=
arr
.
ToList
();
model
.
BranchName
=
arr
[
1
]
+
arr
[
2
];
model
.
ContractBranch
=
model
.
ContractBranch
.
Replace
(
","
,
""
);
}
return
model
;
return
model
;
}
}
...
@@ -165,26 +155,15 @@ namespace Edu.Module.Course
...
@@ -165,26 +155,15 @@ namespace Edu.Module.Course
/// <returns></returns>
/// <returns></returns>
public
bool
SetEducationContractAudit
(
int
contractId
,
int
state
,
UserInfo
userInfo
)
public
bool
SetEducationContractAudit
(
int
contractId
,
int
state
,
UserInfo
userInfo
)
{
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>();
if
(
state
==
5
)
if
(
state
==
5
)
{
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
IsCompanySeal
),
1
);
{
nameof
(
RB_Education_Contract_ViewModel
.
IsCompanySeal
),
1
},
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
SealDate
),
DateTime
.
Now
);
{
nameof
(
RB_Education_Contract_ViewModel
.
SealDate
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
FiledValue
=
contractId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
education_ContractRepository
.
Update
(
keyValues
,
wheres
);
}
}
else
else
{
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
Status
),
state
);
{
nameof
(
RB_Education_Contract_ViewModel
.
Status
),
state
}
};
if
(
state
==
1
||
state
==
4
)
if
(
state
==
1
||
state
==
4
)
{
{
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
UpdateBy
),
userInfo
.
Id
);
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
UpdateBy
),
userInfo
.
Id
);
...
@@ -195,15 +174,8 @@ namespace Edu.Module.Course
...
@@ -195,15 +174,8 @@ namespace Edu.Module.Course
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
AuditEmpId
),
userInfo
.
Id
);
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
AuditEmpId
),
userInfo
.
Id
);
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
AuditDate
),
DateTime
.
Now
);
keyValues
.
Add
(
nameof
(
RB_Education_Contract_ViewModel
.
AuditDate
),
DateTime
.
Now
);
}
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
FiledValue
=
contractId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
education_ContractRepository
.
Update
(
keyValues
,
wheres
);
}
}
return
education_ContractRepository
.
Update
(
keyValues
,
new
WhereHelper
(
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
contractId
));
}
}
/// <summary>
/// <summary>
...
@@ -215,60 +187,12 @@ namespace Edu.Module.Course
...
@@ -215,60 +187,12 @@ namespace Edu.Module.Course
/// <returns></returns>
/// <returns></returns>
public
bool
SetEducationContractSign
(
int
contractId
,
string
sign
)
public
bool
SetEducationContractSign
(
int
contractId
,
string
sign
)
{
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Education_Contract_ViewModel
.
Sign
),
sign
},
{
nameof
(
RB_Education_Contract_ViewModel
.
Sign
),
sign
},
{
nameof
(
RB_Education_Contract_ViewModel
.
SignDate
),
DateTime
.
Now
},
{
nameof
(
RB_Education_Contract_ViewModel
.
SignDate
),
DateTime
.
Now
},
};
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
return
education_ContractRepository
.
Update
(
keyValues
,
new
WhereHelper
(
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
contractId
));
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Education_Contract_ViewModel
.
Id
),
FiledValue
=
contractId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
education_ContractRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 复制合同
/// </summary>
/// <param name="contractId"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
public
bool
SetEducationContractCopy
(
int
contractId
,
UserInfo
userInfo
)
{
var
model
=
education_ContractRepository
.
GetEntity
(
contractId
);
return
education_ContractRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Education_Contract
()
{
Id
=
0
,
GuestId
=
0
,
ContractNo
=
CreateContractNum
(
userInfo
.
Group_Id
),
CreateBy
=
userInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
CType
=
model
.
CType
,
Exam
=
""
,
Group_Id
=
userInfo
.
Group_Id
,
IsCompanySeal
=
0
,
CNYCaps
=
model
.
CNYCaps
,
Money
=
model
.
Money
,
OrderId
=
0
,
CourseName
=
model
.
CourseName
,
CourseContent
=
model
.
CourseContent
,
SchoolName
=
model
.
SchoolName
,
School_Id
=
model
.
School_Id
,
Sign
=
""
,
Status
=
0
,
StudentName
=
model
.
StudentName
,
UpdateBy
=
userInfo
.
Id
,
UpdateTime
=
DateTime
.
Now
,
IDCard
=
model
.
IDCard
,
Sex
=
model
.
Sex
,
ContactAddress
=
model
.
ContactAddress
,
ContactMobile
=
model
.
ContactMobile
,
Domicile
=
model
.
Domicile
,
EmergencyContact
=
model
.
EmergencyContact
,
EmergencyMobile
=
model
.
EmergencyMobile
,
})
>
0
;
}
}
}
}
}
}
Edu.Module.Course/OrderModule.cs
View file @
8e25bb45
...
@@ -1656,73 +1656,73 @@ namespace Edu.Module.Course
...
@@ -1656,73 +1656,73 @@ namespace Edu.Module.Course
/// <returns></returns>
/// <returns></returns>
public
bool
SetOrderReceiveContract
(
int
orderId
,
int
guestId
,
UserInfo
userInfo
)
public
bool
SetOrderReceiveContract
(
int
orderId
,
int
guestId
,
UserInfo
userInfo
)
{
{
var
glist
=
order_GuestRepository
.
GetList
(
new
RB_Order_Guest_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Id
=
guestId
,
OrderId
=
orderId
,
GuestState
=
1
});
//
var glist = order_GuestRepository.GetList(new RB_Order_Guest_ViewModel() { Group_Id = userInfo.Group_Id, Id = guestId, OrderId = orderId, GuestState = 1 });
if
(
glist
.
Any
())
//
if (glist.Any())
{
//
{
//订单信息
//
//订单信息
var
omodel
=
orderRepository
.
GetEntity
(
orderId
);
//
var omodel = orderRepository.GetEntity(orderId);
decimal
Money
=
(
omodel
.
PreferPrice
-
omodel
.
DiscountMoney
)
/
glist
.
Count
();
//平均每人费用 (看是否根据订单单价)
//
decimal Money = (omodel.PreferPrice - omodel.DiscountMoney) / glist.Count();//平均每人费用 (看是否根据订单单价)
string
dxMoney
=
StringHelper
.
MoneyToUpper
(
Money
.
ToString
());
//
string dxMoney = StringHelper.MoneyToUpper(Money.ToString());
//班级信息
//
//班级信息
var
classmodel
=
classRepository
.
GetClassAndCourseListRepository
(
new
RB_Class_ViewModel
()
{
ClassId
=
omodel
.
ClassId
}).
FirstOrDefault
();
//
var classmodel = classRepository.GetClassAndCourseListRepository(new RB_Class_ViewModel() { ClassId = omodel.ClassId }).FirstOrDefault();
string
newContractNum
=
"JH-CD0018"
;
//
string newContractNum = "JH-CD0018";
var
totalCount
=
education_ContractRepository
.
GetContractCount
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
});
//
var totalCount = education_ContractRepository.GetContractCount(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id });
//查询已有合同的
//
//查询已有合同的
string
guestIds
=
string
.
Join
(
","
,
glist
.
Select
(
x
=>
x
.
Id
));
//
string guestIds = string.Join(",", glist.Select(x => x.Id));
var
clist
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
OrderId
=
orderId
,
GuestIds
=
guestIds
,
Status
=
-
1
}).
Where
(
x
=>
x
.
Status
!=
4
).
ToList
();
//
var clist = education_ContractRepository.GetList(new RB_Education_Contract_ViewModel() { Group_Id = userInfo.Group_Id, OrderId = orderId, GuestIds = guestIds, Status = -1 }).Where(x => x.Status != 4).ToList();
foreach
(
var
item
in
glist
)
{
//
foreach (var item in glist) {
var
cmodel
=
clist
.
Where
(
x
=>
x
.
GuestId
==
item
.
Id
).
FirstOrDefault
();
//
var cmodel = clist.Where(x => x.GuestId == item.Id).FirstOrDefault();
if
(
cmodel
==
null
)
{
//
if (cmodel == null) {
totalCount
+=
1
;
//
totalCount += 1;
string
num
=
totalCount
.
ToString
();
//
string num = totalCount.ToString();
switch
(
num
.
Length
)
//
switch (num.Length)
{
//
{
case
1
:
//
case 1:
num
=
"00000"
+
num
;
break
;
//
num = "00000" + num; break;
case
2
:
//
case 2:
num
=
"0000"
+
num
;
break
;
//
num = "0000" + num; break;
case
3
:
//
case 3:
num
=
"000"
+
num
;
break
;
//
num = "000" + num; break;
case
4
:
//
case 4:
num
=
"00"
+
num
;
break
;
//
num = "00" + num; break;
case
5
:
//
case 5:
num
=
"0"
+
num
;
break
;
//
num = "0" + num; break;
}
//
}
string
ContractNo
=
newContractNum
+
num
;
//
string ContractNo = newContractNum + num;
education_ContractRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Education_Contract
()
//
education_ContractRepository.Insert(new Model.Entity.Course.RB_Education_Contract()
{
//
{
Id
=
0
,
//
Id = 0,
GuestId
=
item
.
Id
,
//
GuestId = item.Id,
ContractNo
=
ContractNo
,
//
ContractNo = ContractNo,
CreateBy
=
userInfo
.
Id
,
//
CreateBy = userInfo.Id,
CreateTime
=
DateTime
.
Now
,
//
CreateTime = DateTime.Now,
CType
=
ContractTypeEnum
.
Train
,
//
CType = ContractTypeEnum.Train,
Exam
=
""
,
//
Exam = "",
Group_Id
=
userInfo
.
Group_Id
,
//
Group_Id = userInfo.Group_Id,
IsCompanySeal
=
0
,
//
IsCompanySeal = 0,
CNYCaps
=
dxMoney
,
//
CNYCaps = dxMoney,
Money
=
Money
.
ToString
(),
//
Money = Money.ToString(),
OrderId
=
orderId
,
//
OrderId = orderId,
CourseName
=
classmodel
.
CateName
,
//
CourseName = classmodel.CateName,
CourseContent
=
classmodel
.
CourseName
,
//
CourseContent = classmodel.CourseName,
SchoolName
=
classmodel
.
SchoolName
,
//
SchoolName = classmodel.SchoolName,
School_Id
=
classmodel
.
School_Id
,
//
School_Id = classmodel.School_Id,
Sign
=
""
,
//
Sign = "",
Status
=
0
,
//
Status = 0,
StudentName
=
item
.
GuestName
,
//
StudentName = item.GuestName,
UpdateBy
=
userInfo
.
Id
,
//
UpdateBy = userInfo.Id,
UpdateTime
=
DateTime
.
Now
,
//
UpdateTime = DateTime.Now,
ContactAddress
=
item
.
ContactAddress
,
//
ContactAddress = item.ContactAddress,
Domicile
=
item
.
Domicile
,
//
Domicile = item.Domicile,
IDCard
=
item
.
IDCard
,
//
IDCard = item.IDCard,
ContactMobile
=
item
.
Mobile
,
//
ContactMobile = item.Mobile,
EmergencyContact
=
item
.
Contact
,
//
EmergencyContact = item.Contact,
EmergencyMobile
=
item
.
ContactMobile
,
//
EmergencyMobile = item.ContactMobile,
Sex
=
item
.
Sex
//
Sex = item.Sex
});
//
});
}
//
}
}
//
}
}
//
}
return
true
;
return
true
;
}
}
#
endregion
#
endregion
...
...
Edu.Repository/Course/RB_Education_ContractRepository.cs
View file @
8e25bb45
...
@@ -39,10 +39,10 @@ namespace Edu.Repository.Course
...
@@ -39,10 +39,10 @@ namespace Edu.Repository.Course
{
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
OrderId
)}
=
{
demodel
.
OrderId
}
"
;
}
}
if
(
demodel
.
CType
>
0
)
//
if (demodel.CType > 0)
{
//
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
CType
)}
=
{(
int
)
demodel
.
CType
}
"
;
//
where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
//
}
if
(
demodel
.
Status
>=
0
)
if
(
demodel
.
Status
>=
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
...
@@ -89,10 +89,10 @@ namespace Edu.Repository.Course
...
@@ -89,10 +89,10 @@ namespace Edu.Repository.Course
{
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
GuestId
)}
in(
{
demodel
.
GuestIds
}
)"
;
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
GuestId
)}
in(
{
demodel
.
GuestIds
}
)"
;
}
}
if
(
demodel
.
CType
>
0
)
//
if (demodel.CType > 0)
{
//
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
CType
)}
=
{(
int
)
demodel
.
CType
}
"
;
//
where += $@" and {nameof(RB_Education_Contract_ViewModel.CType)} ={(int)demodel.CType}";
}
//
}
if
(
demodel
.
Status
>=
0
)
if
(
demodel
.
Status
>=
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
where
+=
$@" and
{
nameof
(
RB_Education_Contract_ViewModel
.
Status
)}
=
{
demodel
.
Status
}
"
;
...
...
Edu.WebApi/Controllers/Course/EducationContractController.cs
View file @
8e25bb45
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.API
;
using
Edu.Common.Enum.Course
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.Log
;
using
Edu.Module.Course
;
using
Edu.Module.Course
;
using
Edu.WebApi.Filter
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Authorization
;
...
@@ -28,7 +26,6 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -28,7 +26,6 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// </summary>
private
readonly
EducationContractModule
educationContractModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
EducationContractModule
>();
private
readonly
EducationContractModule
educationContractModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
EducationContractModule
>();
#
region
合同列表
#
region
合同列表
/// <summary>
/// <summary>
...
@@ -42,20 +39,17 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -42,20 +39,17 @@ namespace Edu.WebApi.Controllers.Course
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Education_Contract_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Education_Contract_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
var
list
=
educationContractModule
.
GetEducationContractPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
count
,
dmodel
);
var
list
=
educationContractModule
.
GetEducationContractPageList
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
count
,
dmodel
);
pageModel
.
Count
=
Convert
.
ToInt32
(
count
);
pageModel
.
Count
=
Convert
.
ToInt32
(
count
);
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
pageModel
.
PageData
=
list
.
Select
(
x
=>
new
{
{
x
.
Id
,
x
.
Id
,
x
.
CType
,
x
.
CType
,
CTypeName
=
x
.
CType
.
ToName
(),
x
.
OrderId
,
x
.
OrderId
,
x
.
ContractNo
,
x
.
ContractNo
,
x
.
StudentName
,
x
.
StudentName
,
x
.
SchoolName
,
x
.
SchoolName
,
x
.
CourseName
,
x
.
CourseName
,
x
.
CourseContent
,
x
.
CNYCaps
,
x
.
CNYCaps
,
x
.
Money
,
x
.
Money
,
x
.
Exam
,
x
.
Exam
,
...
@@ -66,13 +60,6 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -66,13 +60,6 @@ namespace Edu.WebApi.Controllers.Course
x
.
CreateBy
,
x
.
CreateBy
,
x
.
CreateByName
,
x
.
CreateByName
,
x
.
CreateByPhoto
,
x
.
CreateByPhoto
,
x
.
Sex
,
x
.
IDCard
,
x
.
Domicile
,
x
.
ContactAddress
,
x
.
ContactMobile
,
x
.
EmergencyContact
,
x
.
EmergencyMobile
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm"
)
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm"
)
});
});
return
ApiResult
.
Success
(
""
,
pageModel
);
return
ApiResult
.
Success
(
""
,
pageModel
);
...
@@ -84,23 +71,23 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -84,23 +71,23 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResult
GetEducationContractInfo
()
{
public
ApiResult
GetEducationContractInfo
()
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
{
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
int
ContractId
=
base
.
ParmJObj
.
GetInt
(
"ContractId"
,
0
);
//合同id
var
model
=
educationContractModule
.
GetEducationContractInfo
(
ContractId
);
var
model
=
educationContractModule
.
GetEducationContractInfo
(
ContractId
);
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"合同不存在"
);
}
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"合同不存在"
);
}
return
ApiResult
.
Success
(
""
,
new
return
ApiResult
.
Success
(
""
,
new
{
{
model
.
Id
,
model
.
Id
,
model
.
CType
,
model
.
CType
,
CTypeName
=
model
.
CType
.
ToName
(),
model
.
OrderId
,
model
.
OrderId
,
model
.
ContractNo
,
model
.
ContractNo
,
model
.
StudentName
,
model
.
StudentName
,
model
.
SchoolName
,
model
.
SchoolName
,
model
.
CourseName
,
model
.
CourseName
,
model
.
CourseContent
,
model
.
CNYCaps
,
model
.
CNYCaps
,
model
.
Money
,
model
.
Money
,
model
.
Exam
,
model
.
Exam
,
...
@@ -108,21 +95,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -108,21 +95,7 @@ namespace Edu.WebApi.Controllers.Course
model
.
Status
,
model
.
Status
,
model
.
StatusStr
,
model
.
StatusStr
,
model
.
IsCompanySeal
,
model
.
IsCompanySeal
,
model
.
CompanySealImage
,
model
.
ContractBranch
,
model
.
ContractTel
,
model
.
BranchNList
,
model
.
BranchName
,
model
.
Sex
,
model
.
IDCard
,
model
.
Domicile
,
model
.
ContactAddress
,
model
.
ContactMobile
,
model
.
EmergencyContact
,
model
.
EmergencyMobile
,
model
.
LegalPerson
,
SignDate
=
model
.
SignDate
.
HasValue
?
model
.
SignDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
,
SealDate
=
model
.
SealDate
.
HasValue
?
model
.
SealDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
});
});
}
}
...
@@ -133,26 +106,26 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -133,26 +106,26 @@ namespace Edu.WebApi.Controllers.Course
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetEducationContractInfo
()
public
ApiResult
SetEducationContractInfo
()
{
{
var
userInfo
=
base
.
UserInfo
;
var
userInfo
=
base
.
UserInfo
;
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Education_Contract_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
dmodel
=
JsonHelper
.
DeserializeObject
<
RB_Education_Contract_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
dmodel
.
StudentName
))
{
if
(
string
.
IsNullOrEmpty
(
dmodel
.
StudentName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入学生姓名"
);
return
ApiResult
.
ParamIsNull
(
"请输入学生姓名"
);
}
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
SchoolName
))
{
if
(
string
.
IsNullOrEmpty
(
dmodel
.
SchoolName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入学校名称"
);
return
ApiResult
.
ParamIsNull
(
"请输入学校名称"
);
}
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
CourseName
))
{
if
(
string
.
IsNullOrEmpty
(
dmodel
.
CourseName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入课程名称"
);
return
ApiResult
.
ParamIsNull
(
"请输入课程名称"
);
}
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
CourseContent
))
{
return
ApiResult
.
ParamIsNull
(
"请输入课程内容"
);
if
(
string
.
IsNullOrEmpty
(
dmodel
.
CNYCaps
))
}
{
if
(
string
.
IsNullOrEmpty
(
dmodel
.
CNYCaps
))
{
return
ApiResult
.
ParamIsNull
(
"请输入大写金额"
);
return
ApiResult
.
ParamIsNull
(
"请输入大写金额"
);
}
}
if
(
string
.
IsNullOrEmpty
(
dmodel
.
Money
))
{
return
ApiResult
.
ParamIsNull
(
"请输入金额"
);
}
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
dmodel
.
Group_Id
=
userInfo
.
Group_Id
;
dmodel
.
School_Id
=
userInfo
.
School_Id
;
dmodel
.
School_Id
=
userInfo
.
School_Id
;
...
@@ -167,7 +140,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -167,7 +140,8 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
();
return
ApiResult
.
Failed
();
}
}
}
}
...
@@ -183,36 +157,12 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -183,36 +157,12 @@ namespace Edu.WebApi.Controllers.Course
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
int
State
=
parms
.
GetInt
(
"State"
,
1
);
// 状态 1提交审核 2通过 3驳回 4取消 5盖章
int
State
=
parms
.
GetInt
(
"State"
,
1
);
// 状态 1提交审核 2通过 3驳回 4取消 5盖章
if
(
ContractId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递合同id"
);
}
bool
flag
=
educationContractModule
.
SetEducationContractAudit
(
ContractId
,
State
,
userInfo
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 合同复制
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetEducationContractCopy
()
{
var
userInfo
=
base
.
UserInfo
;
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
if
(
ContractId
<=
0
)
if
(
ContractId
<=
0
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递合同id"
);
return
ApiResult
.
ParamIsNull
(
"请传递合同id"
);
}
}
bool
flag
=
educationContractModule
.
SetEducationContract
Copy
(
ContractId
,
userInfo
);
bool
flag
=
educationContractModule
.
SetEducationContract
Audit
(
ContractId
,
State
,
userInfo
);
if
(
flag
)
if
(
flag
)
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
...
@@ -229,7 +179,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -229,7 +179,8 @@ namespace Edu.WebApi.Controllers.Course
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResult
SetEducationContractSign
()
{
public
ApiResult
SetEducationContractSign
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
int
ContractId
=
parms
.
GetInt
(
"ContractId"
,
0
);
//合同id
string
Sign
=
parms
.
GetStringValue
(
"Sign"
);
//签名
string
Sign
=
parms
.
GetStringValue
(
"Sign"
);
//签名
...
@@ -263,7 +214,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -263,7 +214,7 @@ namespace Edu.WebApi.Controllers.Course
var
ID
=
parms
.
GetInt
(
"ContractId"
);
var
ID
=
parms
.
GetInt
(
"ContractId"
);
var
CType
=
parms
.
GetInt
(
"CType"
);
var
CType
=
parms
.
GetInt
(
"CType"
);
string
curl
=
Common
.
Config
.
UploadSiteUrl
+
string
.
Format
(
@"/Home/EducationContractInfo?ID={0}&CType={1}"
,
ID
,
CType
);
string
curl
=
Common
.
Config
.
UploadSiteUrl
+
string
.
Format
(
@"/Home/EducationContractInfo?ID={0}&CType={1}"
,
ID
,
CType
);
//string curl = "http://localhost:50034"+ string.Format(@"/Home/EducationContractInfo?ID={0}&CType={1}", ID, CType);
var
flag
=
new
ToPdfHelper
().
HtmlWJtoPdf
(
tempPath
,
curl
);
var
flag
=
new
ToPdfHelper
().
HtmlWJtoPdf
(
tempPath
,
curl
);
return
ApiResult
.
Success
(
""
,
path
);
return
ApiResult
.
Success
(
""
,
path
);
}
}
...
...
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