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
c4273a40
Commit
c4273a40
authored
Sep 03, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sdzq-ld' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq
parents
f2e54dc5
6ea9bf02
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
19 deletions
+69
-19
RB_Goods_TargetDate.cs
Mall.Model/Entity/Product/RB_Goods_TargetDate.cs
+8
-0
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+42
-6
AppletGuideCarController.cs
Mall.WebApi/Controllers/Product/AppletGuideCarController.cs
+11
-13
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+8
-0
No files found.
Mall.Model/Entity/Product/RB_Goods_TargetDate.cs
View file @
c4273a40
...
...
@@ -35,5 +35,13 @@ namespace Mall.Model.Entity.Product
/// 可预定日期
/// </summary>
public
DateTime
?
Date
{
get
;
set
;
}
/// <summary>
/// 是否可以预定 1是 2否
/// </summary>
public
int
IsReserve
{
get
;
set
;
}
/// <summary>
/// 已预定的座位数量
/// </summary>
public
int
ReserveNum
{
get
;
set
;
}
}
}
Mall.Module.Product/GuideCarModule.cs
View file @
c4273a40
...
...
@@ -645,6 +645,29 @@ namespace Mall.Module.Product
return
model
;
}
/// <summary>
/// 验证可预定日期是否可以修改
/// </summary>
/// <param name="goodsIs"></param>
/// <param name="tdlist"></param>
/// <returns></returns>
public
string
ValidateGoodsTargetDate
(
int
goodsId
,
List
<
RB_Goods_TargetDate_Extend
>
tdlist
)
{
var
oldtdlist
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
goodsId
});
var
tddeleteList
=
oldtdlist
.
Where
(
x
=>
!
tdlist
.
Select
(
y
=>
y
.
Date
).
Contains
(
x
.
Date
)).
ToList
();
string
msg
=
""
;
foreach
(
var
item
in
tddeleteList
)
{
//看是否有不可预约的 / 有预定人数的
if
(
item
.
IsReserve
==
2
||
item
.
ReserveNum
>
0
)
{
msg
+=
item
.
Date
.
Value
.
ToString
(
"yyyy-MM-dd"
)
+
","
;
}
}
if
(
msg
!=
""
)
{
msg
=
msg
[..
1
];
msg
+=
" 已有订单预定,无法修改当前日期"
;
}
return
msg
;
}
/// <summary>
/// 新增修改商品信息
/// </summary>
...
...
@@ -754,7 +777,9 @@ namespace Mall.Module.Product
{
Id
=
0
,
GoodsId
=
demodel
.
Id
,
Date
=
item
.
Date
Date
=
item
.
Date
,
IsReserve
=
1
,
ReserveNum
=
0
});
}
foreach
(
var
item
in
tddeleteList
)
...
...
@@ -935,7 +960,9 @@ namespace Mall.Module.Product
{
Id
=
0
,
GoodsId
=
Id
,
Date
=
item
.
Date
Date
=
item
.
Date
,
IsReserve
=
1
,
ReserveNum
=
0
});
}
//插入分类
...
...
@@ -1576,6 +1603,12 @@ namespace Mall.Module.Product
{
model
.
LineDescriptionList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
LineDescription
);
}
var
targetList
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
goodsId
});
if
(
model
.
AdvanceDay
>
0
)
{
DateTime
Mindate
=
Convert
.
ToDateTime
(
DateTime
.
Now
.
AddDays
(
model
.
AdvanceDay
??
0
).
ToString
(
"yyyy-MM-dd"
));
targetList
=
targetList
.
Where
(
x
=>
x
.
Date
>=
Mindate
).
ToList
();
}
#
endregion
#
region
返回参数
...
...
@@ -1620,9 +1653,12 @@ namespace Mall.Module.Product
line_descriptionlist
=
model
.
LineDescriptionList
,
is_spell
=
model
.
IsSpell
,
ride_num
=
model
.
RideNum
,
// 哪天 再加个剩余座位数
target_list
=
targetList
.
Select
(
x
=>
new
{
x
.
Id
,
Date
=
x
.
Date
.
Value
.
ToString
(
"yyyy-MM-dd"
),
x
.
IsReserve
,
x
.
ReserveNum
}),
advance_day
=
model
.
AdvanceDay
,
give_integral
=
model
.
IntegralPresent
,
give_integral_type
=
model
.
IntegralPresentType
,
...
...
@@ -1652,7 +1688,7 @@ namespace Mall.Module.Product
video_url
=
model
.
VideoAddress
,
level_show
=
(
userModel
?.
MemberGrade
??
0
)
>
0
?
1
:
2
,
//是否显示会员价
is_sales
=
model
.
GoodsStatus
,
//是否可购买 ______根据日期判断 。。。。。。。。。。。。。。。。。。。。。。。。。。
attr
=
priceList
,
//
attr = priceList,
pic_url
=
model
.
CarouselImageList
.
Select
(
x
=>
new
{
id
=
x
.
Id
,
...
...
Mall.WebApi/Controllers/Product/AppletGuideCarController.cs
View file @
c4273a40
...
...
@@ -20,7 +20,7 @@ namespace Mall.WebApi.Controllers.Product
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
AppletGuideCarController
:
BaseController
public
class
AppletGuideCarController
:
ControllerBase
{
private
readonly
GuideCarModule
guideCarModule
=
new
GuideCarModule
();
...
...
@@ -60,13 +60,12 @@ namespace Mall.WebApi.Controllers.Product
/// 获取详情
/// </summary>
/// <returns></returns>
public
ApiResult
GetGuideCarGuideModel
()
public
ApiResult
GetGuideCarGuideModel
(
object
requestMsg
)
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Guide_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Guide_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
parms
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
oldLogisticsModel
=
guideCarModule
.
GetGuideCarGuideModel
(
query
);
if
(
oldLogisticsModel
==
null
)
{
...
...
@@ -82,13 +81,12 @@ namespace Mall.WebApi.Controllers.Product
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGuideCarModel
()
public
ApiResult
GetGuideCarModel
(
object
requestMsg
)
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
userInfo
.
TenantId
;
query
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
parms
.
msg
.
ToString
());
query
.
TenantId
=
parms
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
oldLogisticsModel
=
guideCarModule
.
GetGuideCarModel
(
query
);
if
(
oldLogisticsModel
==
null
)
{
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
c4273a40
...
...
@@ -462,6 +462,14 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
IsSpell
??=
1
;
demodel
.
AdvanceDay
??=
0
;
if
(
demodel
.
Id
>
0
)
{
string
vmsg
=
guideCarModule
.
ValidateGoodsTargetDate
(
demodel
.
Id
,
demodel
.
TargetDateList
);
if
(
vmsg
!=
""
)
{
return
ApiResult
.
Failed
(
vmsg
);
}
}
#
endregion
demodel
.
IsCustomSpecification
??=
2
;
...
...
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