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
c8dd7ba4
Commit
c8dd7ba4
authored
Mar 15, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
ba73be59
a7c92841
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
146 additions
and
25 deletions
+146
-25
RB_Course_Offer.cs
Edu.Model/Entity/Course/RB_Course_Offer.cs
+5
-0
RB_Course_OfferDetails_ViewModel.cs
...odel/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
+11
-1
CourseModule.cs
Edu.Module.Course/CourseModule.cs
+41
-1
CourseOfferModule.cs
Edu.Module.Course/CourseOfferModule.cs
+22
-11
RB_Course_JobDetailsRepository.cs
Edu.Repository/Course/RB_Course_JobDetailsRepository.cs
+12
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+4
-1
CourseOfferController.cs
Edu.WebApi/Controllers/Course/CourseOfferController.cs
+51
-11
No files found.
Edu.Model/Entity/Course/RB_Course_Offer.cs
View file @
c8dd7ba4
...
@@ -121,5 +121,10 @@ namespace Edu.Model.Entity.Course
...
@@ -121,5 +121,10 @@ namespace Edu.Model.Entity.Course
/// 客户人数
/// 客户人数
/// </summary>
/// </summary>
public
int
JoinNum
{
get
;
set
;
}
public
int
JoinNum
{
get
;
set
;
}
/// <summary>
/// 订单编号
/// </summary>
public
int
OrderId
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
View file @
c8dd7ba4
...
@@ -26,12 +26,22 @@ namespace Edu.Model.ViewModel.Course
...
@@ -26,12 +26,22 @@ namespace Edu.Model.ViewModel.Course
public
string
QOfferIds
{
get
;
set
;
}
public
string
QOfferIds
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 班级id
/// 班级id
【转订单使用】
/// </summary>
/// </summary>
public
int
ClassId
{
get
;
set
;
}
public
int
ClassId
{
get
;
set
;
}
/// 课程源数据
/// 课程源数据
/// </summary>
/// </summary>
public
object
SourceData
{
get
;
set
;
}
public
object
SourceData
{
get
;
set
;
}
/// <summary>
/// 班级名称【转订单使用】
/// </summary>
public
string
ClassName
{
get
;
set
;
}
/// <summary>
/// 可选班级列表【转订单使用】
/// </summary>
public
List
<
object
>
ClassList
{
get
;
set
;
}
}
}
}
}
Edu.Module.Course/CourseModule.cs
View file @
c8dd7ba4
...
@@ -204,7 +204,6 @@ namespace Edu.Module.Course
...
@@ -204,7 +204,6 @@ namespace Edu.Module.Course
model
.
RenewOgPrice
=
0
;
model
.
RenewOgPrice
=
0
;
model
.
RenewSlPrice
=
0
;
model
.
RenewSlPrice
=
0
;
}
}
if
(
model
.
CourseId
>
0
)
if
(
model
.
CourseId
>
0
)
{
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
@@ -861,6 +860,47 @@ namespace Edu.Module.Course
...
@@ -861,6 +860,47 @@ namespace Edu.Module.Course
model
.
JobId
=
newId
;
model
.
JobId
=
newId
;
flag
=
newId
>
0
;
flag
=
newId
>
0
;
}
}
var
oldJobDetailsList
=
course_JobDetailsRepository
.
GetCourseJobDetailsListRepository
(
new
RB_Course_JobDetails_ViewModel
()
{
JobId
=
model
.
JobId
});
if
(
oldJobDetailsList
==
null
||
(
oldJobDetailsList
!=
null
&&
oldJobDetailsList
.
Count
==
0
))
{
if
(
model
.
JobDetailsList
!=
null
&&
model
.
JobDetailsList
.
Count
>
0
)
{
foreach
(
var
item
in
model
.
JobDetailsList
)
{
item
.
JobId
=
model
.
JobId
;
flag
=
course_JobDetailsRepository
.
Insert
(
item
)
>
0
;
}
}
else
{
//现在没有详情列表【直接删除以前的详情列表】
if
(
model
.
JobDetailsList
==
null
||
(
model
.
JobDetailsList
!=
null
&&
model
.
JobDetailsList
.
Count
==
0
))
{
course_JobDetailsRepository
.
RemoveCourseJobDetailsRepository
(
model
.
JobId
);
}
//找出差异的数据
var
deleteList
=
oldJobDetailsList
.
Where
(
qitem
=>
!
model
.
JobDetailsList
.
Any
(
oldItem
=>
qitem
.
DetailsId
==
oldItem
.
DetailsId
)).
ToList
();
foreach
(
var
dItem
in
deleteList
)
{
if
(
dItem
.
DetailsId
>
0
)
{
course_JobDetailsRepository
.
Delete
(
dItem
.
DetailsId
);
}
}
foreach
(
var
dItem
in
model
.
JobDetailsList
)
{
dItem
.
JobId
=
model
.
JobId
;
if
(
dItem
.
DetailsId
==
0
)
{
course_JobDetailsRepository
.
Insert
(
dItem
);
}
else
{
course_JobDetailsRepository
.
Update
(
dItem
);
}
}
}
}
return
flag
;
return
flag
;
}
}
...
...
Edu.Module.Course/CourseOfferModule.cs
View file @
c8dd7ba4
...
@@ -253,27 +253,30 @@ namespace Edu.Module.Course
...
@@ -253,27 +253,30 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
/// <param name="offerId"></param>
/// <param name="offerId"></param>
/// <param name="detailList"></param>
/// <param name="detailList"></param>
/// <param name="createBy"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
SetOfferCreateOrder
(
int
offerId
,
List
<
RB_Course_OfferDetails_ViewModel
>
detailList
,
int
createBy
)
{
[
TransactionCallHandler
]
var
emModel
=
accountRepository
.
GetEmployeeInfo
(
createBy
);
public
virtual
bool
SetOfferCreateOrder
(
int
offerId
,
List
<
RB_Course_OfferDetails_ViewModel
>
detailList
)
foreach
(
var
item
in
detailList
)
{
{
var
offerModel
=
GetCourseOfferModule
(
offerId
);
var
emModel
=
accountRepository
.
GetEmployeeInfo
(
offerModel
.
CreateBy
);
foreach
(
var
item
in
detailList
)
{
try
try
{
{
decimal
uPrice
=
item
.
OriginalPrice
/
item
.
JoinNum
;
decimal
uPrice
=
item
.
OriginalPrice
/
item
.
JoinNum
;
int
OrderId
=
orderRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order
()
int
OrderId
=
orderRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order
()
{
{
ClassId
=
item
.
ClassId
,
ClassId
=
item
.
ClassId
,
Class_Price
=
uPrice
,
Class_Price
=
uPrice
,
CommissionMoney
=
-
1
,
CommissionMoney
=
-
1
,
CreateBy
=
c
reateBy
,
CreateBy
=
offerModel
.
C
reateBy
,
CreateTime
=
DateTime
.
Now
,
CreateTime
=
DateTime
.
Now
,
Dept_Id
=
emModel
?.
Dept_Id
??
0
,
Dept_Id
=
emModel
?.
Dept_Id
??
0
,
School_Id
=
emModel
?.
School_Id
??
0
,
School_Id
=
emModel
?.
School_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
DirectorRemark
=
""
,
DirectorRemark
=
""
,
DiscountMoney
=
item
.
DiscountPrice
,
DiscountMoney
=
item
.
DiscountPrice
,
EnterID
=
c
reateBy
,
EnterID
=
offerModel
.
C
reateBy
,
ExtraDeductMoney
=
0
,
ExtraDeductMoney
=
0
,
ExtraRewardMoney
=
0
,
ExtraRewardMoney
=
0
,
GuestNum
=
item
.
JoinNum
,
GuestNum
=
item
.
JoinNum
,
...
@@ -292,18 +295,19 @@ namespace Edu.Module.Course
...
@@ -292,18 +295,19 @@ namespace Edu.Module.Course
TeacherRemark
=
""
,
TeacherRemark
=
""
,
TradeWay
=
Common
.
Enum
.
Course
.
TradeWayEnum
.
OnLine
,
TradeWay
=
Common
.
Enum
.
Course
.
TradeWayEnum
.
OnLine
,
Unit_Price
=
uPrice
,
Unit_Price
=
uPrice
,
UpdateBy
=
c
reateBy
,
UpdateBy
=
offerModel
.
C
reateBy
,
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
OfferId
=
offerId
OfferId
=
offerId
});
});
if
(
OrderId
>
0
)
{
if
(
OrderId
>
0
)
{
order_RemarkRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order_Remark
()
order_RemarkRepository
.
Insert
(
new
Model
.
Entity
.
Course
.
RB_Order_Remark
()
{
{
Id
=
0
,
Id
=
0
,
OrderId
=
OrderId
,
OrderId
=
OrderId
,
Type
=
1
,
Type
=
1
,
Content
=
item
.
Remark
,
Content
=
item
.
Remark
,
CreateBy
=
c
reateBy
,
CreateBy
=
offerModel
.
C
reateBy
,
CreateTime
=
DateTime
.
Now
CreateTime
=
DateTime
.
Now
});
});
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
...
@@ -315,9 +319,16 @@ namespace Edu.Module.Course
...
@@ -315,9 +319,16 @@ namespace Edu.Module.Course
LogContent
=
"由报价单自动创建订单"
,
LogContent
=
"由报价单自动创建订单"
,
School_Id
=
emModel
?.
School_Id
??
0
,
School_Id
=
emModel
?.
School_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
Group_Id
=
emModel
?.
Group_Id
??
0
,
CreateBy
=
c
reateBy
,
CreateBy
=
offerModel
.
C
reateBy
,
CreateTime
=
DateTime
.
Now
CreateTime
=
DateTime
.
Now
});
});
//更新报价单订单编号
Dictionary
<
string
,
object
>
offerFileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Course_Offer_ViewModel
.
OrderId
),
OrderId
}
};
course_OfferRepository
.
Update
(
offerFileds
,
new
WhereHelper
(
nameof
(
RB_Course_Offer_ViewModel
.
Id
),
offerId
));
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
Edu.Repository/Course/RB_Course_JobDetailsRepository.cs
View file @
c8dd7ba4
...
@@ -39,5 +39,17 @@ WHERE 1=1
...
@@ -39,5 +39,17 @@ WHERE 1=1
}
}
return
Get
<
RB_Course_JobDetails_ViewModel
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Course_JobDetails_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
/// <summary>
/// 根据作业编号删除作业
/// </summary>
/// <param name="JobId"></param>
/// <returns></returns>
public
bool
RemoveCourseJobDetailsRepository
(
int
JobId
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@" DELETE FROM RB_Course_JobDetails WHERE JobId={0} "
,
JobId
);
return
base
.
Execute
(
builder
.
ToString
())
>
0
;
}
}
}
}
}
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
c8dd7ba4
...
@@ -86,7 +86,10 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -86,7 +86,10 @@ namespace Edu.WebApi.Controllers.Course
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetClassList
()
public
ApiResult
GetClassList
()
{
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Class_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Class_ViewModel
()
{
CouseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
)
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
var
list
=
classModule
.
GetClassListModule
(
query
);
var
list
=
classModule
.
GetClassListModule
(
query
);
...
...
Edu.WebApi/Controllers/Course/CourseOfferController.cs
View file @
c8dd7ba4
...
@@ -46,10 +46,10 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -46,10 +46,10 @@ namespace Edu.WebApi.Controllers.Course
CustomerSource
=
(
CustomerSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerSource"
),
CustomerSource
=
(
CustomerSourceEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerSource"
),
CustomerType
=
(
CustomerTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerType"
),
CustomerType
=
(
CustomerTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerType"
),
CustomerStatus
=
(
CustomerStatusEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerStatus"
),
CustomerStatus
=
(
CustomerStatusEnum
)
base
.
ParmJObj
.
GetInt
(
"CustomerStatus"
),
SerialNum
=
base
.
ParmJObj
.
GetStringValue
(
"SerialNum"
),
SerialNum
=
base
.
ParmJObj
.
GetStringValue
(
"SerialNum"
),
IsGetDetails
=
base
.
ParmJObj
.
GetInt
(
"IsGetDetails"
),
IsGetDetails
=
base
.
ParmJObj
.
GetInt
(
"IsGetDetails"
),
CustomerName
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerName"
),
CustomerName
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerName"
),
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
)
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
)
};
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
query
.
School_Id
=
base
.
UserInfo
.
School_Id
;
...
@@ -133,9 +133,9 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -133,9 +133,9 @@ namespace Edu.WebApi.Controllers.Course
TotalPrice
=
base
.
ParmJObj
.
GetDecimal
(
"TotalPrice"
),
TotalPrice
=
base
.
ParmJObj
.
GetDecimal
(
"TotalPrice"
),
TotalDiscountPrice
=
base
.
ParmJObj
.
GetDecimal
(
"TotalDiscountPrice"
),
TotalDiscountPrice
=
base
.
ParmJObj
.
GetDecimal
(
"TotalDiscountPrice"
),
CustomerInfo
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerInfo"
),
CustomerInfo
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerInfo"
),
CustomerName
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerName"
),
CustomerName
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerName"
),
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
),
CustomerTel
=
base
.
ParmJObj
.
GetStringValue
(
"CustomerTel"
),
JoinNum
=
base
.
ParmJObj
.
GetInt
(
"JoinNum"
)
JoinNum
=
base
.
ParmJObj
.
GetInt
(
"JoinNum"
)
};
};
try
try
{
{
...
@@ -154,7 +154,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -154,7 +154,7 @@ namespace Edu.WebApi.Controllers.Course
extModel
.
School_Id
=
this
.
UserInfo
.
School_Id
;
extModel
.
School_Id
=
this
.
UserInfo
.
School_Id
;
extModel
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
extModel
.
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
;
bool
flag
=
courseOfferModule
.
SetCourseOfferModule
(
extModel
);
bool
flag
=
courseOfferModule
.
SetCourseOfferModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
.
Id
)
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
(
data
:
extModel
.
Id
)
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// <summary>
...
@@ -173,8 +173,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -173,8 +173,8 @@ namespace Edu.WebApi.Controllers.Course
if
(
extModel
!=
null
&&
extModel
.
CreateBy
>
0
)
if
(
extModel
!=
null
&&
extModel
.
CreateBy
>
0
)
{
{
var
user
=
UserReidsCache
.
GetUserLoginInfo
(
extModel
.
CreateBy
);
var
user
=
UserReidsCache
.
GetUserLoginInfo
(
extModel
.
CreateBy
);
CreateByName
=
user
?.
AccountName
??
""
;
CreateByName
=
user
?.
AccountName
??
""
;
CreateTel
=
user
?.
UserMobile
??
""
;
CreateTel
=
user
?.
UserMobile
??
""
;
}
}
var
obj
=
new
var
obj
=
new
{
{
...
@@ -195,7 +195,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -195,7 +195,7 @@ namespace Edu.WebApi.Controllers.Course
extModel
?.
JoinNum
,
extModel
?.
JoinNum
,
extModel
?.
SerialNum
,
extModel
?.
SerialNum
,
OfferDetails
=
extModel
?.
OfferDetails
??
new
List
<
RB_Course_OfferDetails_ViewModel
>(),
OfferDetails
=
extModel
?.
OfferDetails
??
new
List
<
RB_Course_OfferDetails_ViewModel
>(),
CreateTime
=
Common
.
ConvertHelper
.
FormatDate2
(
extModel
.
CreateTime
),
CreateTime
=
Common
.
ConvertHelper
.
FormatDate2
(
extModel
.
CreateTime
),
CreateByName
,
CreateByName
,
CreateTel
,
CreateTel
,
CreateWeChatNo
CreateWeChatNo
...
@@ -247,5 +247,45 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -247,5 +247,45 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
data
);
return
ApiResult
.
Success
(
data
:
data
);
}
}
#
endregion
#
endregion
/// <summary>
/// 报价单转订单
/// </summary>
/// <returns></returns>
public
ApiResult
OfferTransOrder
()
{
var
offerId
=
base
.
ParmJObj
.
GetInt
(
"OfferId"
,
0
);
if
(
offerId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递报价单编号!"
);
}
List
<
RB_Course_OfferDetails_ViewModel
>
detailsList
=
new
List
<
RB_Course_OfferDetails_ViewModel
>();
try
{
detailsList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
RB_Course_OfferDetails_ViewModel
>>(
base
.
ParmJObj
.
GetStringValue
(
"OfferDetails"
));
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"OfferTransOrder"
);
}
if
(
detailsList
==
null
||
(
detailsList
!=
null
&&
detailsList
.
Count
==
0
))
{
return
ApiResult
.
ParamIsNull
(
"请传递报价单详情!"
);
}
string
message
=
""
;
foreach
(
var
item
in
detailsList
)
{
if
(
item
.
ClassId
<=
0
)
{
message
+=
string
.
Format
(
"、请选择【{0}】的班级"
,
item
.
CourseName
);
}
}
if
(!
string
.
IsNullOrEmpty
(
message
))
{
return
ApiResult
.
ParamIsNull
(
message
:
message
[
1.
.]);
}
var
flag
=
courseOfferModule
.
SetOfferCreateOrder
(
offerId
,
detailsList
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
}
}
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