Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
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
黄奎
mall.oytour.com
Commits
a1219fd1
Commit
a1219fd1
authored
Sep 07, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
司导订单
parent
b81fb3f3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
156 additions
and
3 deletions
+156
-3
MobileCodeTypeEnum.cs
Mall.Common/Enum/MobileCodeTypeEnum.cs
+8
-1
Mall.Module.Product.csproj
Mall.Module.Product/Mall.Module.Product.csproj
+1
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+80
-1
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+10
-1
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+57
-0
No files found.
Mall.Common/Enum/MobileCodeTypeEnum.cs
View file @
a1219fd1
...
...
@@ -80,6 +80,13 @@ namespace Mall.Common.Enum
/// CRM营销发送发送直客生日祝福
/// </summary>
[
EnumField
(
"SMS_187570365"
)]
CRMGuestBirth
=
14
CRMGuestBirth
=
14
,
/// <summary>
/// 导游通知
/// </summary>
[
EnumField
(
"SMS_201716853"
)]
GuideMsg
=
15
}
}
Mall.Module.Product/Mall.Module.Product.csproj
View file @
a1219fd1
...
...
@@ -11,6 +11,7 @@
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Module.User\Mall.Module.User.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
</Project>
Mall.Module.Product/OrderModule.cs
View file @
a1219fd1
...
...
@@ -5,6 +5,7 @@ using System.Text;
using
System.Threading.Tasks
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Enum
;
using
Mall.Common.Enum.Goods
;
using
Mall.Common.Enum.User
;
using
Mall.Common.Plugin
;
...
...
@@ -17,9 +18,11 @@ using Mall.Module.User;
using
Mall.Repository
;
using
Mall.Repository.BaseSetUp
;
using
Mall.Repository.Finance
;
using
Mall.Repository.GuideCar
;
using
Mall.Repository.MarketingCenter
;
using
Mall.Repository.Product
;
using
Mall.Repository.User
;
using
Mall.ThirdCore.Message
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Configuration.Json
;
using
Newtonsoft.Json
;
...
...
@@ -280,6 +283,14 @@ namespace Mall.Module.Product
/// 商品可预定日期
/// </summary>
private
readonly
RB_Goods_TargetDateRepository
goods_TargetDateRepository
=
new
RB_Goods_TargetDateRepository
();
/// <summary>
/// 司导-导游
/// </summary>
private
readonly
RB_GuideCar_GuideRepository
guideCar_GuideRepository
=
new
RB_GuideCar_GuideRepository
();
/// <summary>
/// 司导-车辆
/// </summary>
private
readonly
RB_GuideCar_CarRepository
guideCar_CarRepository
=
new
RB_GuideCar_CarRepository
();
#
region
购物车
...
...
@@ -3842,6 +3853,7 @@ namespace Mall.Module.Product
{
return
ApiResult
.
Failed
(
"预定日期与商品使用天数不一致"
);
}
item
.
OrderType
=
OrderTypeEnum
.
SDGoods
;
item
.
CarType
=
gmodel
.
CarType
;
item
.
UseDay
=
gmodel
.
UseDay
;
item
.
TripSTime
=
demodel
.
TripSTime
;
...
...
@@ -4297,7 +4309,6 @@ namespace Mall.Module.Product
demodel
.
PaymentWay
=
OrderPaymentTypeEnum
.
OnlinePayment
;
//先默认在线支付
demodel
.
Remark
??=
""
;
demodel
.
ApplyForCancelStatus
??=
0
;
demodel
.
OrderType
=
(
int
)
OrderTypeEnum
.
SDGoods
;
int
OrderId
=
goods_OrderRepository
.
Insert
(
demodel
,
trans
);
if
(
OrderId
>
0
)
{
...
...
@@ -10595,6 +10606,74 @@ namespace Mall.Module.Product
#
endregion
#
region
司导订单
/// <summary>
/// 司导订单确认
/// </summary>
/// <param name="orderId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public
bool
SetSDOrderConfirm
(
int
orderId
,
int
Type
,
int
empId
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
};
if
(
Type
==
1
)
{
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
OrderStatus
),
OrderStatusEnum
.
WaitReceiving
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
DeliveryTime
),
DateTime
.
Now
);
}
else
if
(
Type
==
2
)
{
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
OrderStatus
),
OrderStatusEnum
.
Received
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
ReceivingTime
),
DateTime
.
Now
);
}
else
if
(
Type
==
3
)
{
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
OrderStatus
),
OrderStatusEnum
.
Completed
);
keyValues
.
Add
(
nameof
(
RB_Goods_Order
.
FinishTime
),
DateTime
.
Now
);
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_Order
.
OrderId
),
FiledValue
=
orderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
goods_OrderRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
&&
Type
==
1
)
{
//发送短信通知导游接单
var
omodel
=
goods_OrderRepository
.
GetEntity
(
orderId
);
var
list
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
OrderId
=
orderId
});
int
IsNormalServer
=
Convert
.
ToInt32
(
Config
.
IsNormalServer
);
//为正式才发送短信
if
(
IsNormalServer
==
1
)
{
foreach
(
var
item
in
list
)
{
if
(
item
.
GuideId
>
0
)
{
//查询导游信息
var
guideModel
=
guideCar_GuideRepository
.
GetEntity
(
item
.
GuideId
??
0
);
var
carModel
=
guideCar_CarRepository
.
GetEntity
(
item
.
CarId
??
0
);
if
(
guideModel
!=
null
&&
carModel
!=
null
&&
!
string
.
IsNullOrEmpty
(
guideModel
.
Telephone
))
{
string
Telephone
=
guideModel
.
Telephone
;
MobileCodeTypeEnum
mobileCodeType
=
MobileCodeTypeEnum
.
GuideMsg
;
//导游通知
if
(
ValidateHepler
.
IsMobileNumber
(
Telephone
))
{
object
PhoneMessage
=
new
{
omodel
.
OrderNo
,
StartDate
=
item
.
TripSTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm"
),
guideModel
.
Name
,
CarName
=
carModel
.
Name
+
"("
+
item
.
CarNumber
+
")"
};
SMSService
.
SendMsg
(
Telephone
,
PhoneMessage
,
EnumHelper
.
GetEnumName
(
mobileCodeType
));
}
}
}
}
}
}
return
flag
;
}
#
endregion
#
region
订单评论
/// <summary>
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
a1219fd1
...
...
@@ -387,6 +387,9 @@ namespace Mall.WebApi.Controllers.MallBase
}
else
{
if
(
Convert
.
ToDateTime
(
StartDate
)
<
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)))
{
return
ApiResult
.
Failed
(
"开始时间不能小于当前时间"
);
}
DateTime
endDate
=
Convert
.
ToDateTime
(
EndDate
);
for
(
DateTime
dt
=
Convert
.
ToDateTime
(
StartDate
);
dt
<=
endDate
;)
{
...
...
@@ -405,6 +408,9 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请选择月份"
);
}
DateTime
StartTime
=
Convert
.
ToDateTime
(
Month
+
"-01"
);
if
(
StartTime
<
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM"
)
+
"-01"
))
{
return
ApiResult
.
Failed
(
"月份不能小于当前月份"
);
}
DateTime
EndTime
=
StartTime
.
AddMonths
(
1
).
AddDays
(-
1
);
for
(
DateTime
dt
=
StartTime
;
dt
<=
EndTime
;)
{
...
...
@@ -433,7 +439,10 @@ namespace Mall.WebApi.Controllers.MallBase
StartTime
=
Convert
.
ToDateTime
(
Year
+
"-01"
+
"-01"
);
EndTime
=
StartTime
.
AddYears
(
1
).
AddDays
(-
1
);
}
if
(
StartTime
<
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM"
)
+
"-01"
))
{
return
ApiResult
.
Failed
(
"月份不能小于当前月份"
);
}
for
(
DateTime
dt
=
StartTime
;
dt
<=
EndTime
;)
{
//将日期转换为周几
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
a1219fd1
...
...
@@ -992,7 +992,64 @@ namespace Mall.WebApi.Controllers.MallBase
}));
}
#
region
司导订单管理
/// <summary>
/// 司导订单确认
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetSDOrderConfirm
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
OrderId
=
parms
.
GetInt
(
"OrderId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//类型 1确认 2出行 3完成
if
(
OrderId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递订单id"
);
}
var
omodel
=
orderModule
.
GetOrderInfo
(
OrderId
);
if
(
omodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"订单信息不存在"
);
}
if
(
omodel
.
OrderClassify
!=
1
)
{
return
ApiResult
.
ParamIsNull
(
"该订单不是司导订单"
);
}
if
(
Type
==
1
)
{
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
WaitSendGoods
)
{
return
ApiResult
.
ParamIsNull
(
"订单状态不正确,请核实后再试"
);
}
}
else
if
(
Type
==
2
)
{
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
WaitReceiving
)
{
return
ApiResult
.
ParamIsNull
(
"订单状态不正确,请核实后再试"
);
}
}
else
if
(
Type
==
3
)
{
if
(
omodel
.
OrderStatus
!=
OrderStatusEnum
.
Received
)
{
return
ApiResult
.
ParamIsNull
(
"订单状态不正确,请核实后再试"
);
}
}
else
{
return
ApiResult
.
Failed
();
}
bool
flag
=
orderModule
.
SetSDOrderConfirm
(
OrderId
,
Type
,
req
.
EmpId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
#
region
修改运费成本以及商品成本、供应商
/// <summary>
...
...
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