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
d8d9112c
Commit
d8d9112c
authored
Nov 03, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
885b5147
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
133 additions
and
0 deletions
+133
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+133
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
d8d9112c
...
...
@@ -12,6 +12,7 @@ using Mall.Common.Enum.User;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Finance
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Model.Extend.Education
;
using
Mall.Model.Extend.Finance
;
...
...
@@ -324,6 +325,11 @@ namespace Mall.Module.Product
/// </summary>
private
readonly
RB_Reserve_ServicePersonalRepository
reserve_ServicePersonalRepository
=
new
RB_Reserve_ServicePersonalRepository
();
/// <summary>
/// 门店仓储层对象
/// </summary>
private
readonly
RB_StoresRepository
storesRepository
=
new
RB_StoresRepository
();
#
region
购物车
/// <summary>
...
...
@@ -928,6 +934,133 @@ namespace Mall.Module.Product
});
}
/// <summary>
/// 获取线下服务我的订单详情
/// </summary>
/// <param name="orderId"></param>
/// <param name="userId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
GetOfflineMyOrderModule
(
int
orderId
,
int
userId
,
int
tenantId
,
int
mallBaseId
)
{
var
model
=
goods_OrderRepository
.
GetEntity
(
orderId
).
RefMapperTo
<
RB_Goods_Order_Extend
>();
if
(
model
==
null
||
model
.
UserId
!=
userId
)
{
return
ApiResult
.
Failed
(
"订单信息不存在,请核实后再试"
);
}
//门店实体信息
var
storeModel
=
new
RB_Stores
();
if
(
model
.
StoresId
>
0
)
{
storeModel
=
storesRepository
.
GetEntity
(
model
.
StoresId
);
}
//查询订单明细
var
dlist
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
OrderId
=
orderId
});
if
(
dlist
.
Any
())
{
string
orderDetailIds
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
Id
));
var
oasList
=
goods_OrderAfterSaleRepository
.
GetList
(
new
RB_Goods_OrderAfterSale_Extend
()
{
OrderDetailIds
=
orderDetailIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
},
false
);
string
servicePersions
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
ServicepersonalId
));
var
serviceList
=
reserve_ServicePersonalRepository
.
GetServicePersonalList
(
new
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
()
{
QIds
=
servicePersions
});
foreach
(
var
item
in
dlist
)
{
item
.
CoverImagePath
=
item
.
CoverImage
;
item
.
IsApplyForAfterSale
=
2
;
if
(
oasList
.
Where
(
x
=>
x
.
OrderDetialId
==
item
.
Id
).
Any
())
{
item
.
IsApplyForAfterSale
=
1
;
}
if
(
item
.
PresentFXGrade
>
0
)
{
model
.
PresentFXGrade
=
1
;
}
item
.
ServicepersonalName
=
serviceList
?.
Where
(
qitem
=>
qitem
.
ID
==
item
.
ServicepersonalId
)?.
FirstOrDefault
()?.
Name
??
""
;
}
}
model
.
DetailList
=
dlist
;
//是否可以申请售后
var
mallModel
=
mallBaseRepository
.
GetEntity
(
mallBaseId
);
model
.
IsCanApplyForAfterSale
=
2
;
if
(
model
.
OrderStatus
==
OrderStatusEnum
.
WaitReceiving
)
{
model
.
IsCanApplyForAfterSale
=
1
;
}
else
if
(
model
.
OrderStatus
==
OrderStatusEnum
.
Received
||
model
.
OrderStatus
==
OrderStatusEnum
.
Completed
)
{
if
(
mallModel
!=
null
&&
mallModel
.
AfterTime
>
0
&&
model
.
ReceivingTime
.
HasValue
)
{
if
(
model
.
ReceivingTime
.
Value
.
AddDays
(
mallModel
.
AfterTime
)
>
DateTime
.
Now
)
{
model
.
IsCanApplyForAfterSale
=
1
;
}
}
}
//获取订阅消息
var
miniModel
=
miniProgramRepository
.
GetListRepository
(
new
RB_MiniProgram_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
}).
FirstOrDefault
();
List
<
string
>
template_message_list
=
new
List
<
string
>();
if
(
miniModel
!=
null
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
miniModel
.
RefundTpl
))
{
template_message_list
.
Add
(
miniModel
.
RefundTpl
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
miniModel
.
OrderCancelTpl
))
{
template_message_list
.
Add
(
miniModel
.
OrderCancelTpl
);
}
}
return
ApiResult
.
Success
(
""
,
new
{
template_message_list
,
model
.
OrderId
,
model
.
OrderNo
,
model
.
OrderStatus
,
OrderStatusName
=
model
.
OrderStatus
.
GetEnumName
(),
CreateDate
=
model
.
CreateDate
.
HasValue
?
model
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
CancelTime
=
model
.
CancelTime
.
HasValue
?
model
.
CancelTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
model
.
PaymentWay
,
PaymentWayName
=
model
.
PaymentWay
.
GetEnumName
(),
model
.
PreferPrice
,
model
.
Income
,
model
.
CouponMoney
,
model
.
Consignee
,
model
.
Mobile
,
model
.
ShoppingAddress
,
DetailList
=
model
.
DetailList
.
Select
(
x
=>
new
{
DetailId
=
x
.
Id
,
x
.
GoodsId
,
x
.
GoodsName
,
x
.
CoverImagePath
,
x
.
Number
,
x
.
Final_Price
,
x
.
IsComment
,
x
.
IsApplyForAfterSale
,
x
.
FreeShippingRemarks
,
x
.
ServiceDate
,
x
.
ServiceTime
,
x
.
GoodServiceTime
,
x
.
ServicepersonalName
,
}),
model
.
IsApplyForCancel
,
model
.
RejectRemark
,
model
.
IsCanApplyForAfterSale
,
model
.
PresentFXGrade
,
model
.
BuyerMessage
,
model
.
Remark
,
model
.
CancelRemark
,
storeName
=
storeModel
?.
Name
,
storeAddress
=
storeModel
?.
Address
});
}
/// <summary>
/// 获取我的订单快递信息
/// </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