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
64c1bf01
Commit
64c1bf01
authored
Sep 02, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
60445506
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
533 additions
and
26 deletions
+533
-26
CarClassEnum.cs
Mall.Common/Enum/GuideCar/CarClassEnum.cs
+61
-0
RB_GuideCar_Car.cs
Mall.Model/Entity/GuideCar/RB_GuideCar_Car.cs
+3
-2
RB_GuideCar_CarColor_Extend.cs
Mall.Model/Extend/GuideCar/RB_GuideCar_CarColor_Extend.cs
+2
-0
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+190
-7
RB_GuideCar_CarColorRepository.cs
Mall.Repository/GuideCar/RB_GuideCar_CarColorRepository.cs
+91
-0
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+186
-17
No files found.
Mall.Common/Enum/GuideCar/CarClassEnum.cs
0 → 100644
View file @
64c1bf01
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Common.Enum.GuideCar
{
public
enum
CarClassEnum
{
/// <summary>
/// 新能源
/// </summary>
[
EnumField
(
"新能源"
)]
NewEnergy
=
1
,
/// <summary>
/// 微型
/// </summary>
[
EnumField
(
"微型"
)]
Miniature
=
2
,
/// <summary>
/// 小型
/// </summary>
[
EnumField
(
"小型"
)]
SmallScale
=
3
,
/// <summary>
/// 紧凑型
/// </summary>
[
EnumField
(
"紧凑型"
)]
Compact
=
4
,
/// <summary>
/// 中型
/// </summary>
[
EnumField
(
"中型"
)]
MediumSized
=
5
,
/// <summary>
/// 中大型
/// </summary>
[
EnumField
(
"中大型"
)]
MediumLargeScale
=
6
,
/// <summary>
/// 大型
/// </summary>
[
EnumField
(
"大型"
)]
Large
=
7
,
/// <summary>
/// SUV
/// </summary>
[
EnumField
(
"SUV"
)]
SUV
=
8
,
/// <summary>
/// MPV
/// </summary>
[
EnumField
(
"MPV"
)]
MPV
=
9
,
/// <summary>
/// 跑车
/// </summary>
[
EnumField
(
"跑车"
)]
SportsCar
=
10
}
}
Mall.Model/Entity/GuideCar/RB_GuideCar_Car.cs
View file @
64c1bf01
using
System
;
using
Mall.Common.Enum.GuideCar
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -52,7 +53,7 @@ namespace Mall.Model.Entity.GuideCar
/// <summary>
/// 车辆分类
/// </summary>
public
int
CarClass
{
get
;
set
;
}
public
CarClassEnum
CarClass
{
get
;
set
;
}
/// <summary>
/// 车辆品牌
/// </summary>
...
...
Mall.Model/Extend/GuideCar/RB_GuideCar_CarColor_Extend.cs
View file @
64c1bf01
...
...
@@ -8,5 +8,7 @@ namespace Mall.Model.Extend.GuideCar
public
class
RB_GuideCar_CarColor_Extend
:
RB_GuideCar_CarColor
{
public
List
<
string
>
PicList
{
get
;
set
;
}
public
string
CardIds
{
get
;
set
;
}
}
}
Mall.Module.Product/GuideCarModule.cs
View file @
64c1bf01
...
...
@@ -149,6 +149,14 @@ namespace Mall.Module.Product
/// 司导基础配置
/// </summary>
private
RB_GuideCar_GuideRepository
GuideRepository
=
new
RB_GuideCar_GuideRepository
();
/// <summary>
/// 车辆
/// </summary>
private
RB_GuideCar_CarRepository
GuideCarRepository
=
new
RB_GuideCar_CarRepository
();
/// <summary>
/// 车辆颜色
/// </summary>
private
RB_GuideCar_CarColorRepository
CarColorRepository
=
new
RB_GuideCar_CarColorRepository
();
#
region
基础配置
/// <summary>
...
...
@@ -186,7 +194,8 @@ namespace Mall.Module.Product
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}).
ToList
();
}
else
{
else
{
model
.
OrderStateList
=
JsonConvert
.
DeserializeObject
<
List
<
GrudeCarStateModel
>>(
model
.
OrderStateJson
);
}
return
model
;
...
...
@@ -204,7 +213,8 @@ namespace Mall.Module.Product
{
return
guideCar_BaseRepository
.
Insert
(
demodel
)
>
0
;
}
else
{
else
{
model
.
UpdateBy
=
demodel
.
UpdateBy
;
model
.
AdvanceDay
=
demodel
.
AdvanceDay
;
model
.
CancelHour
=
demodel
.
CancelHour
;
...
...
@@ -553,7 +563,8 @@ namespace Mall.Module.Product
#
region
可预定日期
model
.
TargetDateList
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
goodsId
});
#
endregion
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
model
.
LineDescriptionList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
LineDescription
);
}
return
model
;
...
...
@@ -662,7 +673,8 @@ namespace Mall.Module.Product
var
tdlist
=
goods_TargetDateRepository
.
GetList
(
new
RB_Goods_TargetDate_Extend
()
{
GoodsId
=
demodel
.
Id
});
var
tdinsertList
=
demodel
.
TargetDateList
.
Where
(
x
=>
!
tdlist
.
Select
(
y
=>
y
.
Date
).
Contains
(
x
.
Date
)).
ToList
();
var
tddeleteList
=
tdlist
.
Where
(
x
=>
!
demodel
.
TargetDateList
.
Select
(
y
=>
y
.
Date
).
Contains
(
x
.
Date
)).
ToList
();
foreach
(
var
item
in
tdinsertList
)
{
foreach
(
var
item
in
tdinsertList
)
{
goods_TargetDateRepository
.
Insert
(
new
RB_Goods_TargetDate
()
{
Id
=
0
,
...
...
@@ -670,7 +682,8 @@ namespace Mall.Module.Product
Date
=
item
.
Date
});
}
foreach
(
var
item
in
tddeleteList
)
{
foreach
(
var
item
in
tddeleteList
)
{
goods_TargetDateRepository
.
Delete
(
item
);
}
#
endregion
...
...
@@ -723,7 +736,7 @@ namespace Mall.Module.Product
#
endregion
#
region
修改分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
...
...
@@ -841,7 +854,8 @@ namespace Mall.Module.Product
if
(
flag
)
{
//插入可预定日期
foreach
(
var
item
in
demodel
.
TargetDateList
)
{
foreach
(
var
item
in
demodel
.
TargetDateList
)
{
goods_TargetDateRepository
.
Insert
(
new
RB_Goods_TargetDate
()
{
Id
=
0
,
...
...
@@ -1365,5 +1379,174 @@ namespace Mall.Module.Product
return
flag
;
}
#
endregion
#
region
车辆信息
/// <summary>
/// 车辆列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_GuideCar_Car_Extend
>
GetGuideCarPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_GuideCar_Car_Extend
query
)
{
List
<
RB_GuideCar_Car_Extend
>
list
=
GuideCarRepository
.
GetPageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
if
(
list
!=
null
&&
list
.
Any
())
{
List
<
RB_GuideCar_CarColor_Extend
>
listCarColor
=
CarColorRepository
.
GetCarColorList
(
new
RB_GuideCar_CarColor_Extend
{
TenantId
=
query
.
TenantId
,
MallBaseId
=
query
.
MallBaseId
,
CardIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
ID
))
});
if
(
listCarColor
!=
null
&&
listCarColor
.
Any
())
{
listCarColor
.
Where
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
CarPic
)).
ToList
().
ForEach
(
x
=>
x
.
PicList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
CarPic
));
}
foreach
(
var
item
in
list
)
{
item
.
ColorList
=
new
List
<
RB_GuideCar_CarColor_Extend
>();
item
.
ColorList
=
listCarColor
.
Where
(
x
=>
x
.
CarId
==
item
.
ID
).
ToList
();
}
}
return
list
;
}
/// <summary>
/// 车辆
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
RB_GuideCar_Car_Extend
GetGuideCarModel
(
RB_GuideCar_Car_Extend
query
)
{
RB_GuideCar_Car_Extend
model
=
GuideCarRepository
.
GetGuideCarCarList
(
query
).
FirstOrDefault
();
if
(
model
!=
null
)
{
List
<
RB_GuideCar_CarColor_Extend
>
listCarColor
=
CarColorRepository
.
GetCarColorList
(
new
RB_GuideCar_CarColor_Extend
{
TenantId
=
query
.
TenantId
,
MallBaseId
=
query
.
MallBaseId
,
CarId
=
model
.
ID
});
if
(
listCarColor
!=
null
&&
listCarColor
.
Any
())
{
listCarColor
.
Where
(
x
=>
!
string
.
IsNullOrWhiteSpace
(
x
.
CarPic
)).
ToList
().
ForEach
(
x
=>
x
.
PicList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
x
.
CarPic
));
}
model
.
ColorList
=
new
List
<
RB_GuideCar_CarColor_Extend
>();
model
.
ColorList
=
listCarColor
;
}
return
model
;
}
/// <summary>
/// 车辆
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_GuideCar_Car_Extend
>
GetGuideCarList
(
RB_GuideCar_Car_Extend
query
)
{
return
GuideCarRepository
.
GetGuideCarCarList
(
query
);
}
/// <summary>
/// 新增/修改车辆
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdateGuideCar
(
RB_GuideCar_Car_Extend
model
)
{
bool
flag
=
false
;
var
trans
=
GuideCarRepository
.
DbTransaction
;
try
{
int
rulesId
=
0
;
if
(
model
.
ID
==
0
)
{
rulesId
=
GuideCarRepository
.
Insert
(
model
,
trans
);
flag
=
rulesId
>
0
;
}
else
{
rulesId
=
model
.
ID
;
flag
=
GuideCarRepository
.
Update
(
model
,
trans
);
List
<
RB_GuideCar_CarColor_Extend
>
listLogisticsRulesRegion
=
CarColorRepository
.
GetCarColorList
(
new
RB_GuideCar_CarColor_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
CarId
=
model
.
ID
});
//List<string> ColorListdExcept = new List<string>();
//if (model.ColorList != null && model.ColorList.Any())
//{
// if (listLogisticsRulesRegion != null && listLogisticsRulesRegion.Any())
// {
// //颜色差集
// ColorListdExcept = model.ColorList.Select(x => x.ID.ToString()).Except(listLogisticsRulesRegion.Select(x => x.ID.ToString())).ToList();
// }
// foreach (var item in listLogisticsRulesRegion.Where(x => ColorListdExcept.Contains(x.ID.ToString())))
// {
// IDictionary<string, object> filedsRegion = new Dictionary<string, object>()//删除价格下面对应的地区
// {
// { nameof(RB_GuideCar_CarColor_Extend.Status),1},
// { nameof(RB_GuideCar_CarColor_Extend.UpdateDate),System.DateTime.Now},
// };
// IList<WhereHelper> whereHelpersRegion = new List<WhereHelper>()
// {
// new WhereHelper (){ FiledName=nameof(RB_GuideCar_CarColor_Extend.ID),FiledValue=item.ID,OperatorEnum=OperatorEnum.Equal}
// };
// CarColorRepository.Update(filedsRegion, whereHelpersRegion, trans);
// }
//}
//else
//{ //全部删除
foreach
(
var
itemRegion
in
listLogisticsRulesRegion
.
Where
(
x
=>
x
.
CarId
==
model
.
ID
))
{
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//删除价格下面对应的地区
{
{
nameof
(
RB_GuideCar_CarColor_Extend
.
Status
),
1
},
{
nameof
(
RB_GuideCar_CarColor_Extend
.
UpdateDate
),
System
.
DateTime
.
Now
},
};
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_GuideCar_CarColor_Extend
.
ID
),
FiledValue
=
itemRegion
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
CarColorRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
}
//}
}
if
(
model
.
ColorList
!=
null
&&
model
.
ColorList
.
Any
())
{
foreach
(
var
item
in
model
.
ColorList
)
{
if
(
item
.
ID
==
0
)
{
item
.
TenantId
=
model
.
TenantId
;
item
.
CreateDate
=
System
.
DateTime
.
Now
;
item
.
ID
=
0
;
item
.
CarId
=
rulesId
;
item
.
MallBaseId
=
model
.
MallBaseId
;
CarColorRepository
.
Insert
(
item
,
trans
);
}
else
{
IDictionary
<
string
,
object
>
filedsRegion
=
new
Dictionary
<
string
,
object
>()
//更新之前的信息
{
{
nameof
(
RB_GuideCar_CarColor_Extend
.
ColorName
),
item
.
ColorName
},
{
nameof
(
RB_GuideCar_CarColor_Extend
.
Status
),
0
},
{
nameof
(
RB_GuideCar_CarColor_Extend
.
CarPic
),
item
.
CarPic
},
{
nameof
(
RB_GuideCar_CarColor_Extend
.
UpdateDate
),
System
.
DateTime
.
Now
},
};
IList
<
WhereHelper
>
whereHelpersRegion
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_GuideCar_CarColor_Extend
.
ID
),
FiledValue
=
item
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
CarColorRepository
.
Update
(
filedsRegion
,
whereHelpersRegion
,
trans
);
}
}
}
GuideCarRepository
.
DBSession
.
Commit
();
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"AddOrUpdateGuideCar"
);
GuideCarRepository
.
DBSession
.
Rollback
(
"AddOrUpdateGuideCar"
);
return
false
;
}
return
flag
;
}
#
endregion
}
}
Mall.Repository/GuideCar/RB_GuideCar_CarColorRepository.cs
0 → 100644
View file @
64c1bf01
using
Mall.Model.Entity.GuideCar
;
using
Mall.Model.Extend.GuideCar
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.GuideCar
{
/// <summary>
/// 车辆颜色仓储层
/// </summary>
public
class
RB_GuideCar_CarColorRepository
:
BaseRepository
<
RB_GuideCar_CarColor
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_GuideCar_CarColor
);
}
}
/// <summary>
/// 车辆颜色列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_GuideCar_CarColor_Extend
>
GetCarColorPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_GuideCar_CarColor_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_GuideCar_CarColor_Extend
.
Status
)}
=0"
);
if
(
query
!=
null
)
{
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CarId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
CarId
)}
=
{
query
.
CarId
}
"
);
}
}
return
GetPage
<
RB_GuideCar_CarColor_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 车辆颜色列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_GuideCar_CarColor_Extend
>
GetCarColorList
(
RB_GuideCar_CarColor_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_GuideCar_CarColor_Extend
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CarId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
CarId
)}
=
{
query
.
CarId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CardIds
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarColor_Extend
.
CarId
)}
in (
{
query
.
CardIds
}
)"
);
}
}
return
Get
<
RB_GuideCar_CarColor_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
64c1bf01
...
...
@@ -17,6 +17,7 @@ using Mall.Common;
using
Mall.Module.Product
;
using
Mall.AOP
;
using
Mall.Model.Extend.GuideCar
;
using
DotNetCore.CAP.Infrastructure
;
namespace
Mall.WebApi.Controllers.MallBase
{
...
...
@@ -47,16 +48,19 @@ namespace Mall.WebApi.Controllers.MallBase
/// 保存司导专区配置
/// </summary>
/// <returns></returns>
public
ApiResult
SetGuideCarInfo
()
{
public
ApiResult
SetGuideCarInfo
()
{
var
req
=
RequestParm
;
RB_GuideCar_Base_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Base_Extend
>(
req
.
msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
demodel
.
PagePath
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
PagePath
))
{
return
ApiResult
.
ParamIsNull
(
"请输入详情页面链接地址"
);
}
demodel
.
OrderStateJson
=
""
;
if
(
demodel
.
OrderStateList
!=
null
&&
demodel
.
OrderStateList
.
Any
())
{
if
(
demodel
.
OrderStateList
!=
null
&&
demodel
.
OrderStateList
.
Any
())
{
demodel
.
OrderStateJson
=
JsonConvert
.
SerializeObject
(
demodel
.
OrderStateList
);
}
demodel
.
TenantId
=
req
.
TenantId
;
...
...
@@ -69,7 +73,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Success
();
}
else
{
else
{
return
ApiResult
.
Failed
();
}
}
...
...
@@ -267,42 +272,55 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请输入原价"
);
}
#
region
司导项验证
if
((
demodel
.
SiteId
??
0
)
<=
0
)
{
if
((
demodel
.
SiteId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择站点"
);
}
if
((
demodel
.
GuideId
??
0
)
<=
0
)
{
if
((
demodel
.
GuideId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择导游"
);
}
if
((
demodel
.
CarId
??
0
)
<=
0
)
{
if
((
demodel
.
CarId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择车辆信息"
);
}
if
((
demodel
.
CarColorId
??
0
)
<=
0
)
{
if
((
demodel
.
CarColorId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择车辆颜色"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
CarNumber
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
CarNumber
))
{
return
ApiResult
.
ParamIsNull
(
"请输入车牌号"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
CarBuyYear
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
CarBuyYear
))
{
return
ApiResult
.
ParamIsNull
(
"请输入车辆购买年限"
);
}
if
((
demodel
.
CarType
??
0
)
<=
0
)
{
if
((
demodel
.
CarType
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择服务类型"
);
}
if
(
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
SQ
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
ZB
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
Line
)
{
if
((
demodel
.
UserDay
??
0
)
<=
0
)
{
if
(
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
SQ
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
ZB
||
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
Line
)
{
if
((
demodel
.
UserDay
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入使用时间"
);
}
if
(
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
Line
)
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
LineName
))
{
if
(
demodel
.
CarType
==
Common
.
Enum
.
Goods
.
GuideCarGoodsTypeEnum
.
Line
)
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
LineName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入线路名称"
);
}
demodel
.
LineDescription
=
""
;
if
(
demodel
.
LineDescriptionList
!=
null
&&
demodel
.
LineDescriptionList
.
Any
())
{
if
(
demodel
.
LineDescriptionList
!=
null
&&
demodel
.
LineDescriptionList
.
Any
())
{
demodel
.
LineDescription
=
JsonConvert
.
SerializeObject
(
demodel
.
LineDescriptionList
);
}
}
}
if
((
demodel
.
RideNum
??
0
)
<=
0
)
{
if
((
demodel
.
RideNum
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入可乘坐人数"
);
}
...
...
@@ -839,5 +857,156 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
#
endregion
#
region
司导
-
车辆
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGuideCarPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_GuideCar_Car_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
UserInfo
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
guideCarModule
.
GetGuideCarPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
Name
,
x
.
CarLogo
,
x
.
CarBrand
,
x
.
CarType
,
CarClassStr
=
EnumHelper
.
GetEnumName
(
x
.
CarClass
),
x
.
ColorList
,
x
.
GoodsNum
,
x
.
OrderNum
,
x
.
GuestNum
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGuideCarModel
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
oldLogisticsModel
=
guideCarModule
.
GetGuideCarModel
(
query
);
if
(
oldLogisticsModel
==
null
)
{
oldLogisticsModel
=
new
RB_GuideCar_Car_Extend
();
}
return
ApiResult
.
Success
(
""
,
oldLogisticsModel
);
}
/// <summary>
/// 获取全部车辆
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGuideCarList
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
guideCarModule
.
GetGuideCarList
(
query
);
var
result
=
list
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
Name
,
x
.
CarBrand
,
x
.
CarClass
,
x
.
CarLogo
,
x
.
ColorList
,
x
.
CarType
});
return
ApiResult
.
Success
(
""
,
result
);
}
/// <summary>
/// 保存车辆信息
/// </summary>
/// <returns></returns>
public
ApiResult
AddOrUpdateGuideCar
()
{
var
parms
=
RequestParm
;
var
query
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_Car_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入车辆信息"
);
}
else
{
if
(
string
.
IsNullOrWhiteSpace
(
query
.
Name
))
{
return
ApiResult
.
Failed
(
"请输入车辆名称"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
CarBrand
))
{
return
ApiResult
.
Failed
(
"请输入车辆品牌"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
CarLogo
))
{
return
ApiResult
.
Failed
(
"请上传车辆LOGO"
);
}
if
(
string
.
IsNullOrWhiteSpace
(
query
.
CarType
))
{
return
ApiResult
.
Failed
(
"请输入车辆型号"
);
}
if
((
int
)
query
.
CarClass
==
0
)
{
return
ApiResult
.
Failed
(
"请选择车辆分类"
);
}
if
(
query
.
ColorList
==
null
||
!
query
.
ColorList
.
Any
())
{
return
ApiResult
.
Failed
(
"请输入车辆颜色信息"
);
}
else
{
query
.
ColorList
.
Where
(
x
=>
x
.
PicList
!=
null
&&
x
.
PicList
.
Any
()).
ToList
().
ForEach
(
x
=>
x
.
CarPic
=
JsonConvert
.
SerializeObject
(
x
.
PicList
));
}
if
(
query
.
ID
==
0
)
{
query
.
CreateDate
=
System
.
DateTime
.
Now
;
}
query
.
UpdateDate
=
System
.
DateTime
.
Now
;
bool
result
=
guideCarModule
.
AddOrUpdateGuideCar
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"车辆信息保存成功"
);
}
else
{
return
ApiResult
.
Failed
(
"车辆信息保存失败"
);
}
}
}
/// <summary>
/// 获取车辆分类下拉
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetCarClassList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
Common
.
Enum
.
GuideCar
.
CarClassEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
#
endregion
}
}
\ No newline at end of file
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