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
a7c92841
Commit
a7c92841
authored
4 years ago
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
68314148
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
30 deletions
+65
-30
RB_Course_OfferDetails_ViewModel.cs
...odel/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
+1
-6
CourseOfferModule.cs
Edu.Module.Course/CourseOfferModule.cs
+22
-11
CourseOfferController.cs
Edu.WebApi/Controllers/Course/CourseOfferController.cs
+42
-13
No files found.
Edu.Model/ViewModel/Course/RB_Course_OfferDetails_ViewModel.cs
View file @
a7c92841
...
@@ -26,7 +26,7 @@ namespace Edu.Model.ViewModel.Course
...
@@ -26,7 +26,7 @@ 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
;
}
...
@@ -34,11 +34,6 @@ namespace Edu.Model.ViewModel.Course
...
@@ -34,11 +34,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
/// </summary>
public
object
SourceData
{
get
;
set
;
}
public
object
SourceData
{
get
;
set
;
}
/// <summary>
/// 班级编号【转订单使用】
/// </summary>
public
int
ClassId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 班级名称【转订单使用】
/// 班级名称【转订单使用】
/// </summary>
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
Edu.Module.Course/CourseOfferModule.cs
View file @
a7c92841
...
@@ -253,11 +253,14 @@ namespace Edu.Module.Course
...
@@ -253,11 +253,14 @@ 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
;
...
@@ -266,14 +269,14 @@ namespace Edu.Module.Course
...
@@ -266,14 +269,14 @@ namespace Edu.Module.Course
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
)
...
...
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Course/CourseOfferController.cs
View file @
a7c92841
...
@@ -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
...
@@ -255,8 +255,37 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -255,8 +255,37 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
OfferTransOrder
()
public
ApiResult
OfferTransOrder
()
{
{
var
offerId
=
base
.
ParmJObj
.
GetInt
(
"OfferId"
,
0
);
var
offerId
=
base
.
ParmJObj
.
GetInt
(
"OfferId"
,
0
);
if
(
offerId
<=
0
)
return
ApiResult
.
Failed
();
{
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
();
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
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