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
6ea9bf02
Commit
6ea9bf02
authored
Sep 03, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改商品可预定日期
parent
f534ab9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+35
-3
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+8
-0
No files found.
Mall.Module.Product/GuideCarModule.cs
View file @
6ea9bf02
...
@@ -631,6 +631,29 @@ namespace Mall.Module.Product
...
@@ -631,6 +631,29 @@ namespace Mall.Module.Product
return
model
;
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>
/// 新增修改商品信息
/// 新增修改商品信息
/// </summary>
/// </summary>
...
@@ -1565,6 +1588,12 @@ namespace Mall.Module.Product
...
@@ -1565,6 +1588,12 @@ namespace Mall.Module.Product
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
model
.
LineDescriptionList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
LineDescription
);
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
#
endregion
#
region
返回参数
#
region
返回参数
...
@@ -1609,9 +1638,12 @@ namespace Mall.Module.Product
...
@@ -1609,9 +1638,12 @@ namespace Mall.Module.Product
line_descriptionlist
=
model
.
LineDescriptionList
,
line_descriptionlist
=
model
.
LineDescriptionList
,
is_spell
=
model
.
IsSpell
,
is_spell
=
model
.
IsSpell
,
ride_num
=
model
.
RideNum
,
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
,
advance_day
=
model
.
AdvanceDay
,
give_integral
=
model
.
IntegralPresent
,
give_integral
=
model
.
IntegralPresent
,
give_integral_type
=
model
.
IntegralPresentType
,
give_integral_type
=
model
.
IntegralPresentType
,
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
6ea9bf02
...
@@ -461,6 +461,14 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -461,6 +461,14 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
IsSpell
??=
1
;
demodel
.
IsSpell
??=
1
;
demodel
.
AdvanceDay
??=
0
;
demodel
.
AdvanceDay
??=
0
;
if
(
demodel
.
Id
>
0
)
{
string
vmsg
=
guideCarModule
.
ValidateGoodsTargetDate
(
demodel
.
Id
,
demodel
.
TargetDateList
);
if
(
vmsg
!=
""
)
{
return
ApiResult
.
Failed
(
vmsg
);
}
}
#
endregion
#
endregion
demodel
.
IsCustomSpecification
??=
2
;
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