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
c29729bc
Commit
c29729bc
authored
Sep 07, 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
310608fe
c5d21b23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
5 deletions
+106
-5
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+6
-3
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+5
-2
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+95
-0
No files found.
Mall.Module.Product/OrderModule.cs
View file @
c29729bc
...
...
@@ -3838,7 +3838,7 @@ namespace Mall.Module.Product
return
ApiResult
.
Failed
(
"商品服务类型不一致"
);
}
int
uday
=
Convert
.
ToInt32
((
gmodel
.
UseDay
??
0
).
Equals
(
0.5
)
?
1
:
(
gmodel
.
UseDay
??
0
));
if
(
demodel
.
TripSTime
.
Value
.
AddDays
(
uday
-
1
)
!=
demodel
.
TripETime
)
if
(
demodel
.
TripSTime
.
Value
.
AddDays
(
uday
-
1
)
.
ToString
(
"yyyy-MM-dd"
)
!=
demodel
.
TripETime
.
Value
.
ToString
(
"yyyy-MM-dd"
))
{
return
ApiResult
.
Failed
(
"预定日期与商品使用天数不一致"
);
}
...
...
@@ -3854,6 +3854,8 @@ namespace Mall.Module.Product
item
.
CarColorId
=
gmodel
.
CarColorId
;
item
.
CarNumber
=
gmodel
.
CarNumber
;
item
.
LineName
=
gmodel
.
LineName
;
item
.
Specification
=
"[]"
;
item
.
SpecificationSort
=
"0"
;
var
tdlist
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
item
.
GoodsId
??
0
,
StartTime
=
item
.
TripSTime
.
Value
.
ToString
(
"yyyy-MM-dd"
),
EndTime
=
item
.
TripETime
.
Value
.
ToString
(
"yyyy-MM-dd"
)
});
var
targetList
=
tdlist
.
Where
(
x
=>
x
.
IsReserve
==
1
&&
x
.
Date
==
Convert
.
ToDateTime
(
demodel
.
TripSTime
.
Value
.
ToString
(
"yyyy-MM-dd"
))).
ToList
();
...
...
@@ -5991,7 +5993,8 @@ namespace Mall.Module.Product
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_TargetDate
.
Id
),
FiledValue
=
qitem
FiledValue
=
qitem
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_TargetDateRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
...
...
@@ -6792,7 +6795,7 @@ namespace Mall.Module.Product
{
//剑鱼兄需求 2020=07-30 再查询一次商品表
string
GoodsIds
=
string
.
Join
(
","
,
dlist
.
Select
(
x
=>
x
.
GoodsId
).
Distinct
());
var
GList
=
goodsRepository
.
GetSingleListForGoodsSubName
(
new
RB_Goods_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
GoodsIds
=
GoodsIds
});
var
GList
=
goodsRepository
.
GetSingleListForGoodsSubName
(
new
RB_Goods_Extend
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
,
GoodsIds
=
GoodsIds
}
,
true
);
foreach
(
var
item
in
dlist
)
{
item
.
CoverImagePath
=
item
.
CoverImage
;
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
c29729bc
...
...
@@ -305,9 +305,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetSingleListForGoodsSubName
(
RB_Goods_Extend
dmodel
)
public
List
<
RB_Goods_Extend
>
GetSingleListForGoodsSubName
(
RB_Goods_Extend
dmodel
,
bool
IsSelectAll
=
false
)
{
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 and g.GoodsClassify=0"
;
string
where
=
$" 1=1 and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 "
;
if
(
IsSelectAll
==
false
)
{
where
+=
$@" and g.GoodsClassify=0 "
;
}
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
...
...
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
c29729bc
...
...
@@ -363,6 +363,95 @@ namespace Mall.WebApi.Controllers.MallBase
});
}
/// <summary>
/// 获取可预定日期列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsTargetDateList
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
DayType
=
parms
.
GetInt
(
"DayType"
,
1
);
//类型 1时间范围 2按周 3按月份
string
StartDate
=
parms
.
GetStringValue
(
"StartDate"
);
string
EndDate
=
parms
.
GetStringValue
(
"EndDate"
);
string
Year
=
parms
.
GetStringValue
(
"Year"
);
//年
string
Month
=
parms
.
GetStringValue
(
"Month"
);
//月
int
Week
=
parms
.
GetInt
(
"Week"
,
1
);
//周几
List
<
string
>
DateList
=
new
List
<
string
>();
if
(
DayType
==
1
)
{
if
(
string
.
IsNullOrWhiteSpace
(
StartDate
)
||
string
.
IsNullOrWhiteSpace
(
EndDate
))
{
return
ApiResult
.
Failed
(
"请选完善时间段"
);
}
else
{
DateTime
endDate
=
Convert
.
ToDateTime
(
EndDate
);
for
(
DateTime
dt
=
Convert
.
ToDateTime
(
StartDate
);
dt
<=
endDate
;)
{
if
(!
DateList
.
Contains
(
dt
.
ToString
(
"yyyy-MM-dd"
)))
{
DateList
.
Add
(
dt
.
ToString
(
"yyyy-MM-dd"
));
}
dt
=
dt
.
AddDays
(
1
);
}
}
}
else
if
(
DayType
==
2
)
{
if
(
string
.
IsNullOrWhiteSpace
(
Month
))
{
return
ApiResult
.
ParamIsNull
(
"请选择月份"
);
}
DateTime
StartTime
=
Convert
.
ToDateTime
(
Month
+
"-01"
);
DateTime
EndTime
=
StartTime
.
AddMonths
(
1
).
AddDays
(-
1
);
for
(
DateTime
dt
=
StartTime
;
dt
<=
EndTime
;)
{
if
(!
DateList
.
Contains
(
dt
.
ToString
(
"yyyy-MM-dd"
)))
{
DateList
.
Add
(
dt
.
ToString
(
"yyyy-MM-dd"
));
}
dt
=
dt
.
AddDays
(
1
);
}
}
else
if
(
DayType
==
3
)
{
DateTime
StartTime
=
DateTime
.
Now
;
DateTime
EndTime
=
DateTime
.
Now
;
if
(
string
.
IsNullOrWhiteSpace
(
Year
))
{
return
ApiResult
.
ParamIsNull
(
"请选择年份"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
Month
))
{
StartTime
=
Convert
.
ToDateTime
(
Year
+
"-"
+
Month
+
"-01"
);
EndTime
=
StartTime
.
AddMonths
(
1
).
AddDays
(-
1
);
}
else
{
StartTime
=
Convert
.
ToDateTime
(
Year
+
"-01"
+
"-01"
);
EndTime
=
StartTime
.
AddYears
(
1
).
AddDays
(-
1
);
}
for
(
DateTime
dt
=
StartTime
;
dt
<=
EndTime
;)
{
//将日期转换为周几
DayOfWeek
week
=
dt
.
DayOfWeek
;
if
(
week
==
(
DayOfWeek
)
Week
)
{
if
(!
DateList
.
Contains
(
dt
.
ToString
(
"yyyy-MM-dd"
)))
{
DateList
.
Add
(
dt
.
ToString
(
"yyyy-MM-dd"
));
}
}
dt
=
dt
.
AddDays
(
1
);
}
}
return
ApiResult
.
Success
(
""
,
DateList
);
}
/// <summary>
/// 获取服务类型枚举
/// </summary>
...
...
@@ -462,6 +551,12 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
IsSpell
??=
1
;
demodel
.
AdvanceDay
??=
0
;
if
(
demodel
.
TargetDateList
!=
null
&&
demodel
.
TargetDateList
.
Any
())
{
//去除重复
if
(
demodel
.
TargetDateList
.
Count
()
!=
demodel
.
TargetDateList
.
Select
(
x
=>
x
.
Date
).
Distinct
().
Count
())
{
return
ApiResult
.
ParamIsNull
(
"可预定日期有重复"
);
}
}
if
(
demodel
.
Id
>
0
)
{
string
vmsg
=
guideCarModule
.
ValidateGoodsTargetDate
(
demodel
.
Id
,
demodel
.
TargetDateList
);
...
...
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