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
72f39c74
Commit
72f39c74
authored
Nov 02, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
2a080cf4
be0e00a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
586 additions
and
65 deletions
+586
-65
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+8
-0
RB_Stores_Extend.cs
Mall.Model/Extend/User/RB_Stores_Extend.cs
+26
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+104
-29
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+90
-7
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+4
-2
RB_Goods_OrderRepository.cs
Mall.Repository/Product/RB_Goods_OrderRepository.cs
+123
-0
RB_Reserve_ServicePersonalRepository.cs
...epository/Reserve/RB_Reserve_ServicePersonalRepository.cs
+27
-0
RB_StoresRepository.cs
Mall.Repository/User/RB_StoresRepository.cs
+17
-15
BaseController.cs
Mall.WebApi/Controllers/BaseController.cs
+6
-1
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+2
-1
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+133
-0
AppletStoresController.cs
Mall.WebApi/Controllers/Reserve/AppletStoresController.cs
+46
-10
No files found.
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
View file @
72f39c74
...
@@ -359,5 +359,13 @@ namespace Mall.Model.Entity.Product
...
@@ -359,5 +359,13 @@ namespace Mall.Model.Entity.Product
/// 购买抵扣佣金金额
/// 购买抵扣佣金金额
/// </summary>
/// </summary>
public
decimal
?
DeductionCommission
{
get
;
set
;
}
public
decimal
?
DeductionCommission
{
get
;
set
;
}
/// 服务日期
/// </summary>
public
string
ServiceDate
{
get
;
set
;
}
/// <summary>
/// 服务时间
/// </summary>
public
string
ServiceTime
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/User/RB_Stores_Extend.cs
View file @
72f39c74
...
@@ -39,4 +39,30 @@ namespace Mall.Model.Entity.User
...
@@ -39,4 +39,30 @@ namespace Mall.Model.Entity.User
/// </summary>
/// </summary>
public
string
QIds
{
get
;
set
;
}
public
string
QIds
{
get
;
set
;
}
}
}
/// <summary>
/// 门店预约实体
/// </summary>
public
class
StoreReserveDate
{
/// <summary>
/// 天数
/// </summary>
public
DateTime
DayDate
{
get
;
set
;
}
/// <summary>
/// 日期字符串
/// </summary>
public
string
DayDateStr
{
get
;
set
;
}
/// <summary>
/// 星期
/// </summary>
public
string
WeekDayStr
{
get
;
set
;
}
/// <summary>
/// 具体时间点
/// </summary>
public
List
<
string
>
TimeList
{
get
;
set
;
}
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
72f39c74
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
72f39c74
...
@@ -3530,16 +3530,96 @@ namespace Mall.Module.Product
...
@@ -3530,16 +3530,96 @@ namespace Mall.Module.Product
}
}
};
};
}
}
var
servicePersionList
=
reserve_ServicePersonalRepository
.
GetServicePersonalList
(
new
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
()
#
region
门店相关
string
categoryIds
=
"0"
;
if
(
model
.
CategoryList
!=
null
&&
model
.
CategoryList
.
Count
>
0
)
{
{
StoreId
=
storeId
,
categoryIds
=
string
.
Join
(
","
,
model
.
CategoryList
.
Select
(
qitem
=>
qitem
.
CategoryId
));
})?.
ToList
()
??
new
List
<
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
>();
}
var
servicePersionList
=
reserve_ServicePersonalRepository
.
GetServicePersonalListExtRepository
(
storeId
,
model
.
Id
,
categoryIds
)?.
ToList
()
??
new
List
<
Model
.
Extend
.
Reserve
.
RB_Reserve_ServicePersonal_Extend
>();
var
storeModel
=
storesRepository
.
GetEntity
(
storeId
);
var
storeModel
=
storesRepository
.
GetEntity
(
storeId
);
List
<
StoreReserveDate
>
storeDateList
=
new
List
<
StoreReserveDate
>();
DateTime
currentDay
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
));
for
(
int
i
=
0
;
i
<=
7
;
i
++)
{
var
storeDateModel
=
new
StoreReserveDate
()
{
DayDate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"yyyy-MM-dd"
)),
DayDateStr
=
DateTime
.
Now
.
AddDays
(
i
).
ToString
(
"MM-dd"
),
WeekDayStr
=
(
i
==
0
?
"今天"
:
"周"
+
Common
.
Plugin
.
CommonHelper
.
GetWeekDay
(
DateTime
.
Now
.
AddDays
(
i
))),
TimeList
=
new
List
<
string
>()
};
for
(
var
j
=
0
;
j
<
48
;
j
++)
{
string
tempTimeStr
=
""
;
if
(
j
%
2
==
0
)
{
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
}
else
{
tempTimeStr
=
currentDay
.
AddHours
((
Convert
.
ToDouble
(
j
)
/
2.0
)).
ToString
(
"HH:mm"
);
}
storeDateModel
.
TimeList
.
Add
(
tempTimeStr
);
}
storeDateList
.
Add
(
storeDateModel
);
}
if
(
storeModel
!=
null
&&
storeModel
.
Id
>
0
)
if
(
storeModel
!=
null
&&
storeModel
.
Id
>
0
)
{
{
//全天营业
if
(
storeModel
.
IsAllDay
==
1
)
{
List
<
string
>
tempTimeList
=
new
List
<
string
>();
var
firstModel
=
storeDateList
[
0
];
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
if
(
DateTime
.
Now
<
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
))
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
//有具体时间
else
{
for
(
var
i
=
0
;
i
<
storeDateList
.
Count
;
i
++)
{
List
<
string
>
tempTimeList
=
new
List
<
string
>();
var
firstModel
=
storeDateList
[
i
];
DateTime
startTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
storeModel
.
StartTime
);
DateTime
endTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
storeModel
.
EndTime
);
if
(
i
==
0
)
{
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
DateTime
currentTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
);
if
(
DateTime
.
Now
<
currentTime
&&
currentTime
>
startTime
&&
currentTime
<
endTime
)
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
else
{
foreach
(
var
timeItem
in
firstModel
.
TimeList
)
{
DateTime
currentTime
=
Convert
.
ToDateTime
(
firstModel
.
DayDate
.
ToString
(
"yyyy-MM-dd"
)
+
" "
+
timeItem
);
if
(
currentTime
>
startTime
&&
currentTime
<
endTime
)
{
tempTimeList
.
Add
(
timeItem
);
}
}
firstModel
.
TimeList
=
tempTimeList
;
}
}
}
}
}
#
endregion
return
new
return
new
{
{
goods
=
new
goods
=
new
...
@@ -3673,8 +3753,11 @@ namespace Mall.Module.Product
...
@@ -3673,8 +3753,11 @@ namespace Mall.Module.Product
qitem
.
Score
,
qitem
.
Score
,
qitem
.
Name
,
qitem
.
Name
,
qitem
.
Major
,
qitem
.
Major
,
Gender
=
qitem
.
Gender
.
ToInt
()
Gender
=
qitem
.
Gender
.
ToInt
(),
})
ReserveCount
=
qitem
.
OrderNum
,
ServiceId
=
qitem
.
ID
}),
storeDateList
=
storeDateList
.
Select
(
qitem
=>
new
{
qitem
.
DayDateStr
,
qitem
.
WeekDayStr
,
qitem
.
TimeList
})
},
},
delivery
=
""
delivery
=
""
};
};
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
72f39c74
...
@@ -24,6 +24,7 @@ namespace Mall.Repository.Product
...
@@ -24,6 +24,7 @@ namespace Mall.Repository.Product
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Goods_Extend
dmodel
,
bool
IsAllClassify
=
false
)
public
List
<
RB_Goods_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Goods_Extend
dmodel
,
bool
IsAllClassify
=
false
)
{
{
DynamicParameters
parameters
=
new
DynamicParameters
();
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 "
;
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 "
;
if
(
dmodel
.
GoodsClassify
==
3
)
if
(
dmodel
.
GoodsClassify
==
3
)
{
//查询非司导商品
{
//查询非司导商品
...
@@ -63,7 +64,8 @@ namespace Mall.Repository.Product
...
@@ -63,7 +64,8 @@ namespace Mall.Repository.Product
}
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
like @Name "
;
parameters
.
Add
(
"Name"
,
"%"
+
dmodel
.
Name
.
Trim
()
+
"%"
);
}
}
if
(
dmodel
.
GoodsStatus
>
0
)
if
(
dmodel
.
GoodsStatus
>
0
)
{
{
...
@@ -153,7 +155,7 @@ namespace Mall.Repository.Product
...
@@ -153,7 +155,7 @@ namespace Mall.Repository.Product
string
sql
=
$@"select g.* from RB_Goods g
string
sql
=
$@"select g.* from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
inner join rb_goods_category c on g.Id=c.GoodsId
where
{
where
}
group by g.Id order by
{
orderBy
}
"
;
where
{
where
}
group by g.Id order by
{
orderBy
}
"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
,
parameters
).
ToList
();
}
}
/// <summary>
/// <summary>
...
...
Mall.Repository/Product/RB_Goods_OrderRepository.cs
View file @
72f39c74
...
@@ -2094,5 +2094,128 @@ where {where} group by o.OrderId order by o.CreateDate desc";
...
@@ -2094,5 +2094,128 @@ where {where} group by o.OrderId order by o.CreateDate desc";
return
GetPage
<
RB_Goods_Order_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
return
GetPage
<
RB_Goods_Order_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
}
}
#
endregion
#
endregion
#
region
线下服务订单
/// <summary>
/// 线下服务订单分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Order_Extend
>
GetOfflineServiceOrderPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Order_Extend
dmodel
)
{
var
parameters
=
new
DynamicParameters
();
string
where
=
$" 1=1 and o.
{
nameof
(
RB_Goods_Order
.
Status
)}
=0 and o.
{
nameof
(
RB_Goods_Order
.
OrderClassify
)}
=3"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
OrderId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderId
)}
=
{
dmodel
.
OrderId
}
"
;
}
if
(
dmodel
.
OrderSource
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderSource
)}
=
{(
int
)
dmodel
.
OrderSource
}
"
;
}
if
(
dmodel
.
OrderType
>
0
)
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
OrderType
)}
=
{
dmodel
.
OrderType
}
"
;
}
if
(
dmodel
.
DeliveryMethod
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
DeliveryMethod
)}
=
{(
int
)
dmodel
.
DeliveryMethod
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
CreateDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
CreateDate
)}
<='
{
dmodel
.
EndTime
}
23:59:59'"
;
}
if
(
dmodel
.
OrderStatus
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderStatus
)}
=
{(
int
)
dmodel
.
OrderStatus
}
"
;
}
if
(
dmodel
.
IsNotSelectCancel
==
1
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderStatus
)}
<>
{(
int
)
OrderStatusEnum
.
Cancel
}
"
;
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
Recycled
)}
=2"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderStatusIds
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderStatus
)}
in(
{
dmodel
.
OrderStatusIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderNo
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
like @OrderNo "
;
parameters
.
Add
(
"OrderNo"
,
"%"
+
dmodel
.
OrderNo
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
MerchantsNo
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
MerchantsNo
)}
like @MerchantsNo "
;
parameters
.
Add
(
"MerchantsNo"
,
"%"
+
dmodel
.
MerchantsNo
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
UserName
))
{
where
+=
$@" and u.
{
nameof
(
RB_Member_User
.
Name
)}
like @UserName "
;
parameters
.
Add
(
"UserName"
,
"%"
+
dmodel
.
UserName
.
Trim
()
+
"%"
);
}
if
(
dmodel
.
UserId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
UserId
)}
=
{(
int
)
dmodel
.
UserId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsName
))
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
GoodsName
)}
like '%
{
dmodel
.
GoodsName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Consignee
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
Consignee
)}
like '%
{
dmodel
.
Consignee
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Mobile
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
Mobile
)}
like '%
{
dmodel
.
Mobile
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ProductCode
))
{
where
+=
$@" and od.
{
nameof
(
RB_Goods_OrderDetail
.
ProductCode
)}
like '%
{
dmodel
.
ProductCode
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
AnchorName
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
AnchorName
)}
like '%
{
dmodel
.
AnchorName
}
%'"
;
}
if
(
dmodel
.
Recycled
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
Recycled
)}
=
{(
int
)
dmodel
.
Recycled
}
"
;
}
if
(
dmodel
.
SmallShopsId
.
HasValue
&&
dmodel
.
SmallShopsId
>
0
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
SmallShopsId
)}
=
{
dmodel
.
SmallShopsId
}
"
;
}
if
(
dmodel
.
IsSelectPayMoney
==
1
)
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
PaymentTime
)}
IS NOT NULL"
;
}
string
sql
=
$@"
SELECT o.*,u.Name as UserName,sshop.`Name` as SmallShopsName FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
LEFT JOIN rb_smallshops_info as sshop on o.SmallShopsId=sshop.Id
where
{
where
}
group by o.OrderId order by o.CreateDate desc "
;
return
GetPage
<
RB_Goods_Order_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
,
parameters
).
ToList
();
}
#
endregion
}
}
}
}
Mall.Repository/Reserve/RB_Reserve_ServicePersonalRepository.cs
View file @
72f39c74
...
@@ -148,5 +148,32 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
...
@@ -148,5 +148,32 @@ LEFT JOIN (SELECT ServicePersonalId,COUNT(*) as CommentNum from rb_goods_commen
}
}
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
/// <summary>
/// 根据门店、商品编号和商品分类编号获取服务人员列表
/// </summary>
/// <param name="storeId"></param>
/// <param name="productId"></param>
/// <param name="categoryIds"></param>
/// <returns></returns>
public
List
<
RB_Reserve_ServicePersonal_Extend
>
GetServicePersonalListExtRepository
(
int
storeId
,
int
productId
,
string
categoryIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT DISTINCT A.*
FROM RB_Reserve_ServicePersonal AS A
INNER JOIN
(
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=3 AND `Status`=0
UNION
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=2 AND `Status`=0 AND ProductId={0}
UNION
SELECT * FROM rb_reserve_servicepersonalproduct WHERE ServiceType=1 AND `Status`=0 AND ProductId IN({1})
) AS B ON A.ID=B.ServiceId
WHERE A.Status=0 AND A.StoreId={2}
"
,
productId
,
categoryIds
,
storeId
);
return
Get
<
RB_Reserve_ServicePersonal_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
}
}
Mall.Repository/User/RB_StoresRepository.cs
View file @
72f39c74
...
@@ -35,64 +35,66 @@ namespace Mall.Repository.User
...
@@ -35,64 +35,66 @@ namespace Mall.Repository.User
float
.
TryParse
(
tempArray
[
1
],
out
lat
);
float
.
TryParse
(
tempArray
[
1
],
out
lat
);
}
}
}
}
builder
.
AppendFormat
(
@" SELECT * "
);
builder
.
AppendFormat
(
@" SELECT
A.
* "
);
if
(
lng
>
0
&&
lat
>
0
)
if
(
lng
>
0
&&
lat
>
0
)
{
{
builder
.
AppendFormat
(
@",lat_lng_distance(
Lng,Lat,{0},{1}) AS KM "
,
lng
,
lat
);
builder
.
AppendFormat
(
@",lat_lng_distance(
A.Lng,A.Lat,{0},{1}) AS KM "
,
lng
,
lat
);
}
}
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
FROM RB_Stores
FROM RB_Stores AS A
WHERE 1 = 1 AND Status = 0 "
);
LEFT JOIN
(SELECT StoresId,COUNT(1) AS SCount FROM rb_goods_order where StoresId>0 AND OrderStatus<>7 GROUP BY StoresId) AS B ON A.Id=B.StoresId
WHERE 1 = 1 AND A.Status = 0 "
);
if
(
query
.
TenantId
>
0
)
if
(
query
.
TenantId
>
0
)
{
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
builder
.
AppendFormat
(
" AND
A.
{0}={1} "
,
nameof
(
RB_Stores_Extend
.
TenantId
),
query
.
TenantId
);
}
}
if
(
query
.
MallBaseId
>
0
)
if
(
query
.
MallBaseId
>
0
)
{
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
MallBaseId
),
query
.
MallBaseId
);
builder
.
AppendFormat
(
" AND
A.
{0}={1} "
,
nameof
(
RB_Stores_Extend
.
MallBaseId
),
query
.
MallBaseId
);
}
}
if
(
query
.
Id
>
0
)
if
(
query
.
Id
>
0
)
{
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Stores_Extend
.
Id
),
query
.
Id
);
builder
.
AppendFormat
(
" AND
A.
{0}={1} "
,
nameof
(
RB_Stores_Extend
.
Id
),
query
.
Id
);
}
}
if
(
query
.
Name
!=
null
&&
!
string
.
IsNullOrEmpty
(
query
.
Name
.
Trim
()))
if
(
query
.
Name
!=
null
&&
!
string
.
IsNullOrEmpty
(
query
.
Name
.
Trim
()))
{
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
builder
.
AppendFormat
(
" AND
A.
{0} LIKE '%{1}%' "
,
nameof
(
RB_Stores_Extend
.
Name
),
query
.
Name
.
Trim
());
}
}
if
(
query
.
OrderByType
==
1
)
if
(
query
.
OrderByType
==
1
)
{
{
builder
.
Append
(
" ORDER BY Name ASC "
);
builder
.
Append
(
" ORDER BY
A.
Name ASC "
);
}
}
else
if
(
query
.
OrderByType
==
2
)
else
if
(
query
.
OrderByType
==
2
)
{
{
builder
.
Append
(
" ORDER BY Name DESC "
);
builder
.
Append
(
" ORDER BY
A.
Name DESC "
);
}
}
else
if
(
query
.
OrderByType
==
3
)
else
if
(
query
.
OrderByType
==
3
)
{
{
if
(
lng
>
0
&&
lat
>
0
)
if
(
lng
>
0
&&
lat
>
0
)
{
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(
Lng,
Lat,{0},{1}) ASC "
,
lng
,
lat
);
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(
A.Lng,A.
Lat,{0},{1}) ASC "
,
lng
,
lat
);
}
}
}
}
else
if
(
query
.
OrderByType
==
4
)
else
if
(
query
.
OrderByType
==
4
)
{
{
if
(
lng
>
0
&&
lat
>
0
)
if
(
lng
>
0
&&
lat
>
0
)
{
{
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(
Lng,
Lat,{0},{1}) DESC "
,
lng
,
lat
);
builder
.
AppendFormat
(
" ORDER BY lat_lng_distance(
A.Lng,A.
Lat,{0},{1}) DESC "
,
lng
,
lat
);
}
}
}
}
else
if
(
query
.
OrderByType
==
5
)
else
if
(
query
.
OrderByType
==
5
)
{
{
builder
.
Append
(
" ORDER BY
Score
ASC "
);
builder
.
Append
(
" ORDER BY
IFNULL(B.SCount,0)
ASC "
);
}
}
else
if
(
query
.
OrderByType
==
6
)
else
if
(
query
.
OrderByType
==
6
)
{
{
builder
.
Append
(
" ORDER BY
Score
DESC "
);
builder
.
Append
(
" ORDER BY
IFNULL(B.SCount,0)
DESC "
);
}
}
else
else
{
{
builder
.
Append
(
" ORDER BY Id DESC "
);
builder
.
Append
(
" ORDER BY
A.
Id DESC "
);
}
}
return
GetPage
<
RB_Stores_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Stores_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.WebApi/Controllers/BaseController.cs
View file @
72f39c74
...
@@ -33,7 +33,12 @@ namespace Mall.WebApi.Controllers
...
@@ -33,7 +33,12 @@ namespace Mall.WebApi.Controllers
{
{
#
region
读取
post
参数
#
region
读取
post
参数
var
requestMsg
=
Request
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
];
var
requestMsg
=
Request
.
HttpContext
.
Items
[
GlobalKey
.
UserPostInfo
];
var
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
requestParm
=
new
RequestParm
();
if
(
requestMsg
!=
null
)
{
requestParm
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
}
if
(
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
]
!=
null
)
if
(
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
]
!=
null
)
{
{
JObject
parms
=
JObject
.
Parse
(
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
].
ToString
());
JObject
parms
=
JObject
.
Parse
(
Request
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
].
ToString
());
...
...
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
72f39c74
...
@@ -724,6 +724,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -724,6 +724,7 @@ namespace Mall.WebApi.Controllers.MallBase
#
region
赋默认值
#
region
赋默认值
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
Country
??=
2
;
demodel
.
Country
??=
2
;
demodel
.
OrderStatus
=
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
NonPayment
;
demodel
.
OrderStatus
=
Common
.
Enum
.
Goods
.
OrderStatusEnum
.
NonPayment
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
CreateDate
=
DateTime
.
Now
;
...
@@ -744,7 +745,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -744,7 +745,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
DestinationAddress
??=
""
;
demodel
.
DestinationAddress
??=
""
;
#
endregion
#
endregion
bool
flag
=
orderModule
.
SetAppletOfflineGoodsOrderModule
(
demodel
,
out
string
message
);
bool
flag
=
orderModule
.
SetAppletOfflineGoodsOrderModule
(
demodel
,
out
string
message
);
return
flag
?
ApiResult
.
Success
(
message
:
message
)
:
ApiResult
.
Failed
(
message
:
message
);
return
flag
?
ApiResult
.
Success
(
message
:
message
,
data
:
new
{
demodel
.
OrderId
}
)
:
ApiResult
.
Failed
(
message
:
message
);
}
}
/// <summary>
/// <summary>
...
...
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
72f39c74
...
@@ -1824,7 +1824,140 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1824,7 +1824,140 @@ namespace Mall.WebApi.Controllers.MallBase
#
endregion
#
endregion
#
region
线下服务订单
/// <summary>
/// 商品订单后台分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetOfflineServiceOrderPage
()
{
var
parms
=
RequestParm
;
JObject
newParms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Order_Extend
demodel
=
new
RB_Goods_Order_Extend
()
{
UserName
=
newParms
.
GetStringValue
(
"UserName"
),
OrderSource
=
(
UserSourceEnum
)
newParms
.
GetInt
(
"OrderSource"
),
OrderType
=
newParms
.
GetInt
(
"OrderType"
),
OrderId
=
newParms
.
GetInt
(
"OrderId"
),
StartTime
=
newParms
.
GetStringValue
(
"StartTime"
),
EndTime
=
newParms
.
GetStringValue
(
"EndTime"
),
OrderStatus
=
(
OrderStatusEnum
)
newParms
.
GetInt
(
"OrderStatus"
),
OrderNo
=
newParms
.
GetStringValue
(
"OrderNo"
),
MerchantsNo
=
newParms
.
GetStringValue
(
"MerchantsNo"
),
UserId
=
newParms
.
GetInt
(
"UserId"
),
GoodsName
=
newParms
.
GetStringValue
(
"GoodsName"
),
Consignee
=
newParms
.
GetStringValue
(
"Consignee"
),
Recycled
=
newParms
.
GetInt
(
"Recycled"
),
AnchorName
=
newParms
.
GetStringValue
(
"AnchorName"
),
IsSelectPayMoney
=
newParms
.
GetInt
(
"IsSelectPayMoney"
,
0
)
};
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
OrderClassify
=
3
;
var
list
=
orderModule
.
GetOfflineServiceOrderPageListModule
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
OrderId
,
x
.
OrderNo
,
x
.
MerchantsNo
,
x
.
OrderSource
,
OrderSourceName
=
x
.
OrderSource
.
GetEnumName
(),
x
.
UserId
,
x
.
UserName
,
x
.
DeliveryMethod
,
DeliveryMethodName
=
x
.
DeliveryMethod
.
GetEnumName
(),
x
.
Income
,
x
.
FreightMoney
,
x
.
PaymentWay
,
PaymentWayName
=
x
.
PaymentWay
.
GetEnumName
(),
CouponMoney
=
x
.
CouponMoney
??
0
,
EducationMoney
=
x
.
EducationMoney
??
0
,
IntegralMoney
=
(
x
.
DetailList
!=
null
&&
x
.
DetailList
.
Any
())
?
(
x
.
DetailList
.
Sum
(
x
=>
x
.
IntegralMoney
??
0
))
:
0
,
IntegralNumber
=
(
x
.
DetailList
!=
null
&&
x
.
DetailList
.
Any
())
?
(
x
.
DetailList
.
Sum
(
x
=>
x
.
IntegralNumber
??
0
))
:
0
,
MemberDiscountCouponList
=
x
.
MemberDiscountCouponList
.
Select
(
y
=>
new
{
y
.
Name
,
y
.
MinConsumePrice
,
y
.
MaxDiscountsPrice
,
y
.
UseType
,
y
.
CouponType
,
y
.
DiscountsPrice
}),
DetailList
=
x
.
DetailList
.
Select
(
y
=>
new
{
y
.
SupplierId
,
y
.
SupplierName
,
y
.
FreightCostMoney
,
y
.
FreightMoney
,
y
.
CostMoney
,
y
.
Id
,
y
.
CoverImage
,
y
.
CoverImagePath
,
y
.
OrderType
,
OrderTypeName
=
y
.
OrderType
.
GetEnumName
(),
y
.
GoodsName
,
SpecificationList
=
y
.
TeacherList
.
Select
(
x
=>
x
.
Name
),
y
.
ProductCode
,
y
.
Final_Price
,
y
.
Number
,
y
.
IsBindExpress
,
y
.
FreeShippingRemarks
,
y
.
SmallShopsCostPrice
,
y
.
YSMoney
,
y
.
RealMoney
,
y
.
YFMoney
,
y
.
PayMoney
,
CouponMoney
=
y
.
CouponMoney
??
0
,
InsuranceMoney
=
y
.
InsuranceMoney
??
0
,
InsuranceCostMoney
=
y
.
InsuranceCostMoney
??
0
,
IntegralMoney
=
y
.
IntegralMoney
??
0
,
IntegralNumber
=
y
.
IntegralNumber
??
0
,
MemberEducationCouponList
=
y
.
MemberEducationCouponList
.
Select
(
z
=>
new
{
z
.
Name
,
}),
SFinanceList
=
y
.
FinanceList
.
Where
(
z
=>
z
.
Type
==
1
).
Select
(
z
=>
new
{
z
.
FrID
,
z
.
Status
,
z
.
Is_Cashier
}),
ZFinanceList
=
y
.
FinanceList
.
Where
(
z
=>
z
.
Type
==
2
).
Select
(
z
=>
new
{
z
.
FrID
,
z
.
Status
,
z
.
Is_Cashier
})
}),
x
.
Consignee
,
x
.
Mobile
,
x
.
DistrictAddress
,
x
.
ShoppingAddress
,
x
.
BuyerMessage
,
x
.
Remark
,
x
.
OrderStatus
,
OrderStatusName
=
x
.
OrderStatus
.
GetEnumName
(),
PaymentTime
=
x
.
PaymentTime
.
HasValue
?
x
.
PaymentTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
DeliveryTime
=
x
.
DeliveryTime
.
HasValue
?
x
.
DeliveryTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
ReceivingTime
=
x
.
ReceivingTime
.
HasValue
?
x
.
ReceivingTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
FinishTime
=
x
.
FinishTime
.
HasValue
?
x
.
FinishTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
Country
,
x
.
Province
,
x
.
City
,
x
.
District
,
x
.
TenantId
,
x
.
MallBaseId
,
x
.
SmallShopsId
,
x
.
SmallShopsName
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
#
region
修改运费成本以及商品成本、供应商
#
region
修改运费成本以及商品成本、供应商
...
...
Mall.WebApi/Controllers/Reserve/AppletStoresController.cs
View file @
72f39c74
...
@@ -43,6 +43,8 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -43,6 +43,8 @@ namespace Mall.WebApi.Controllers.Reserve
private
readonly
Module
.
User
.
UserModule
UserModule
=
new
Module
.
User
.
UserModule
();
private
readonly
Module
.
User
.
UserModule
UserModule
=
new
Module
.
User
.
UserModule
();
private
readonly
OrderModule
orderModule
=
new
OrderModule
();
/// <summary>
/// <summary>
/// 线下服务首页获取当前距离最近门店
/// 线下服务首页获取当前距离最近门店
/// </summary>
/// </summary>
...
@@ -53,6 +55,7 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -53,6 +55,7 @@ namespace Mall.WebApi.Controllers.Reserve
[
AllowAnonymous
]
[
AllowAnonymous
]
public
virtual
ApiResult
GetCurrentStore
(
object
requestMsg
)
public
virtual
ApiResult
GetCurrentStore
(
object
requestMsg
)
{
{
var
userInfo
=
AppletUserInfo
;
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
if
(
parms
.
MallBaseId
<=
0
)
{
{
...
@@ -61,12 +64,34 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -61,12 +64,34 @@ namespace Mall.WebApi.Controllers.Reserve
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
JObject
parm
=
JObject
.
Parse
(
parms
.
msg
.
ToString
());
var
position
=
parm
.
GetStringValue
(
"position"
);
var
position
=
parm
.
GetStringValue
(
"position"
);
int
storeId
=
parm
.
GetInt
(
"storeId"
);
int
storeId
=
parm
.
GetInt
(
"storeId"
);
if
(
userInfo
==
null
)
{
userInfo
=
new
Common
.
AppletUserInfo
()
{
UserId
=
106259
};
}
var
storeModel
=
contentModule
.
GetStoresListModule
(
new
RB_Stores_Extend
()
var
storeModel
=
contentModule
.
GetStoresListModule
(
new
RB_Stores_Extend
()
{
{
CurrentPosition
=
position
,
CurrentPosition
=
position
,
Id
=
storeId
,
Id
=
storeId
,
MallBaseId
=
parms
.
MallBaseId
MallBaseId
=
parms
.
MallBaseId
},
isFirst
:
true
)?.
FirstOrDefault
();
},
isFirst
:
true
)?.
FirstOrDefault
();
var
consumptionObj
=
new
object
();
if
(
userInfo
!=
null
&&
userInfo
.
UserId
>
0
)
{
var
orderModel
=
orderModule
.
GetOfflineServiceOrderPageListModule
(
1
,
1
,
out
long
rowsCount
,
new
RB_Goods_Order_Extend
()
{
UserId
=
userInfo
.
UserId
,
IsNotSelectCancel
=
1
,
})?.
FirstOrDefault
();
if
(
orderModel
!=
null
&&
orderModel
.
StoresId
>
0
)
{
var
useStoreModel
=
contentModule
.
GetStoresModule
(
orderModel
.
StoresId
);
consumptionObj
=
new
{
consumptionStoreId
=
useStoreModel
?.
Id
,
consumptionStoreName
=
useStoreModel
?.
Name
};
}
}
object
result
=
new
object
result
=
new
{
{
storeInfo
=
new
storeInfo
=
new
...
@@ -78,11 +103,7 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -78,11 +103,7 @@ namespace Mall.WebApi.Controllers.Reserve
distance
=
storeModel
?.
KM
,
distance
=
storeModel
?.
KM
,
storeCoverImg
=
storeModel
?.
CoverImg
,
storeCoverImg
=
storeModel
?.
CoverImg
,
storeNavImg
=
storeModel
?.
NavImg
,
storeNavImg
=
storeModel
?.
NavImg
,
consumptionObj
=
new
consumptionObj
{
consumptionStoreId
=
0
,
consumptionStoreName
=
"HK门店"
}
},
},
};
};
return
ApiResult
.
Success
(
data
:
result
);
return
ApiResult
.
Success
(
data
:
result
);
...
@@ -124,6 +145,7 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -124,6 +145,7 @@ namespace Mall.WebApi.Controllers.Reserve
[
AllowAnonymous
]
[
AllowAnonymous
]
public
virtual
ApiResult
GetStoreInfo
(
object
requestMsg
)
public
virtual
ApiResult
GetStoreInfo
(
object
requestMsg
)
{
{
var
userInfo
=
AppletUserInfo
;
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
parms
.
MallBaseId
<=
0
)
if
(
parms
.
MallBaseId
<=
0
)
{
{
...
@@ -150,6 +172,24 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -150,6 +172,24 @@ namespace Mall.WebApi.Controllers.Reserve
serviceTime
=
storeModel
.
StartTime
+
"-"
+
storeModel
.
EndTime
;
serviceTime
=
storeModel
.
StartTime
+
"-"
+
storeModel
.
EndTime
;
}
}
}
}
var
consumptionObj
=
new
object
();
if
(
userInfo
!=
null
&&
userInfo
.
UserId
>
0
)
{
var
orderModel
=
orderModule
.
GetOfflineServiceOrderPageListModule
(
1
,
1
,
out
long
rowsCount
,
new
RB_Goods_Order_Extend
()
{
UserId
=
userInfo
.
UserId
,
IsNotSelectCancel
=
1
,
})?.
FirstOrDefault
();
if
(
orderModel
!=
null
&&
orderModel
.
StoresId
>
0
)
{
var
useStoreModel
=
contentModule
.
GetStoresModule
(
orderModel
.
StoresId
);
consumptionObj
=
new
{
consumptionStoreId
=
useStoreModel
?.
Id
,
consumptionStoreName
=
useStoreModel
?.
Name
};
}
}
object
result
=
new
object
result
=
new
{
{
storeInfo
=
new
storeInfo
=
new
...
@@ -165,11 +205,7 @@ namespace Mall.WebApi.Controllers.Reserve
...
@@ -165,11 +205,7 @@ namespace Mall.WebApi.Controllers.Reserve
storeIntro
=
storeModel
?.
Intro
,
storeIntro
=
storeModel
?.
Intro
,
storeProject
=
storeModel
?.
ServiceProject
,
storeProject
=
storeModel
?.
ServiceProject
,
storeServiceTime
=
serviceTime
,
storeServiceTime
=
serviceTime
,
consumptionObj
=
new
consumptionObj
{
consumptionStoreId
=
0
,
consumptionStoreName
=
"HK门店"
}
},
},
};
};
return
ApiResult
.
Success
(
data
:
result
);
return
ApiResult
.
Success
(
data
:
result
);
...
...
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