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
e0a25d9b
Commit
e0a25d9b
authored
Sep 03, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
56329030
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
279 additions
and
7 deletions
+279
-7
Mall.Common.csproj
Mall.Common/Mall.Common.csproj
+1
-0
StringHelper.cs
Mall.Common/Plugin/StringHelper.cs
+25
-1
RB_Destination_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
+3
-0
GuideCarModule.cs
Mall.Module.Product/GuideCarModule.cs
+89
-4
RB_GuideCar_CarSearchRepository.cs
Mall.Repository/GuideCar/RB_GuideCar_CarSearchRepository.cs
+48
-0
DestinationController.cs
Mall.WebApi/Controllers/MallBase/DestinationController.cs
+11
-2
GuideCarController.cs
Mall.WebApi/Controllers/Product/GuideCarController.cs
+102
-0
No files found.
Mall.Common/Mall.Common.csproj
View file @
e0a25d9b
...
...
@@ -24,6 +24,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NPOI" Version="2.4.1" />
<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
<PackageReference Include="QRCoder" Version="1.3.9" />
<PackageReference Include="StackExchange.Redis" Version="2.0.601" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
...
...
Mall.Common/Plugin/StringHelper.cs
View file @
e0a25d9b
using
System
;
using
Microsoft.International.Converters.PinYinConverter
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Specialized
;
using
System.IO
;
...
...
@@ -573,6 +574,29 @@ namespace Mall.Common.Plugin
#
region
字符转换
/// <summary>
/// 汉字转化为拼音
/// </summary>
/// <param name="str">汉字</param>
/// <returns>全拼</returns>
public
static
string
GetPinyin
(
string
str
)
{
string
r
=
string
.
Empty
;
foreach
(
char
obj
in
str
)
{
try
{
ChineseChar
chineseChar
=
new
ChineseChar
(
obj
);
string
t
=
chineseChar
.
Pinyins
[
0
].
ToString
();
r
+=
t
.
Substring
(
0
,
t
.
Length
-
1
);
}
catch
{
r
+=
obj
.
ToString
();
}
}
return
r
;
}
/// <summary>
/// 为字符串左边填充字符
...
...
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
View file @
e0a25d9b
...
...
@@ -56,6 +56,9 @@ namespace Mall.Model.Extend.BaseSetUp
}
}
public
string
PinYin
{
get
;
set
;
}
/// <summary>
/// 所属国家
/// </summary>
...
...
Mall.Module.Product/GuideCarModule.cs
View file @
e0a25d9b
...
...
@@ -158,6 +158,15 @@ namespace Mall.Module.Product
/// </summary>
private
RB_GuideCar_CarColorRepository
CarColorRepository
=
new
RB_GuideCar_CarColorRepository
();
/// <summary>
/// 车辆搜索模块
/// </summary>
private
RB_GuideCar_CarSearchSearchRepository
carSearchSearchRepository
=
new
RB_GuideCar_CarSearchSearchRepository
();
#
region
基础配置
/// <summary>
/// 获取基础配置
...
...
@@ -1558,7 +1567,8 @@ namespace Mall.Module.Product
string
CarName
=
GuideCarRepository
.
GetGuideCarCarList
(
new
RB_GuideCar_Car_Extend
()
{
ID
=
model
.
GuideId
??
0
}).
FirstOrDefault
()?.
Name
??
""
;
string
CarColorName
=
CarColorRepository
.
GetCarColorList
(
new
RB_GuideCar_CarColor_Extend
()
{
ID
=
model
.
CarColorId
??
0
}).
FirstOrDefault
()?.
ColorName
??
""
;
model
.
LineDescriptionList
=
new
List
<
string
>();
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
LineDescription
)
&&
model
.
LineDescription
!=
"[]"
)
{
model
.
LineDescriptionList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
model
.
LineDescription
);
}
#
endregion
...
...
@@ -1594,15 +1604,15 @@ namespace Mall.Module.Product
guide_id
=
model
.
GuideId
,
car_name
=
CarName
,
car_id
=
model
.
CarId
,
carcolor_name
=
CarColorName
,
carcolor_id
=
model
.
CarColorId
,
carcolor_name
=
CarColorName
,
carcolor_id
=
model
.
CarColorId
,
car_number
=
model
.
CarNumber
,
car_buyyear
=
model
.
CarBuyYear
,
car_type
=
model
.
CarType
,
car_type_name
=
model
.
CarType
.
GetEnumName
(),
use_day
=
model
.
UseDay
,
line_name
=
model
.
LineName
,
line_descriptionlist
=
model
.
LineDescriptionList
,
line_descriptionlist
=
model
.
LineDescriptionList
,
is_spell
=
model
.
IsSpell
,
ride_num
=
model
.
RideNum
,
...
...
@@ -2240,5 +2250,80 @@ namespace Mall.Module.Product
return
flag
;
}
#
endregion
#
region
车辆搜索模块
/// <summary>
/// 设置车辆搜索模块
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
bool
SetGuideCarSearchInfo
(
RB_GuideCar_CarSearch
demodel
)
{
var
OModel
=
carSearchSearchRepository
.
GetGuideCarSearchList
(
new
RB_GuideCar_CarSearch
()
{
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
}).
FirstOrDefault
();
if
(
OModel
!=
null
)
{
demodel
.
ID
=
OModel
.
ID
;
Dictionary
<
string
,
object
>
keyValuePairs
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_GuideCar_CarSearch
.
Background
),
demodel
.
Background
},
{
nameof
(
RB_GuideCar_CarSearch
.
SearchBackground
),
demodel
.
SearchBackground
},
{
nameof
(
RB_GuideCar_CarSearch
.
SearchTips
),
demodel
.
SearchTips
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowDate
),
demodel
.
IsShowDate
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowCity
),
demodel
.
IsShowCity
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowAddress
),
demodel
.
IsShowAddress
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowCarpooling
),
demodel
.
IsShowCarpooling
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowGuideCarGoodsType
),
demodel
.
IsShowGuideCarGoodsType
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowCarClass
),
demodel
.
IsShowCarClass
},
{
nameof
(
RB_GuideCar_CarSearch
.
IsShowTravelGuestNum
),
demodel
.
IsShowTravelGuestNum
},
{
nameof
(
RB_GuideCar_CarSearch
.
Tips
),
demodel
.
Tips
},
{
nameof
(
RB_GuideCar_CarSearch
.
TipsIco
),
demodel
.
TipsIco
},
{
nameof
(
RB_GuideCar_CarSearch
.
SearchIco
),
demodel
.
SearchIco
},
{
nameof
(
RB_GuideCar_CarSearch
.
SearchFilletPX
),
demodel
.
SearchFilletPX
},
{
nameof
(
RB_GuideCar_CarSearch
.
ButtonFilletPX
),
demodel
.
ButtonFilletPX
},
{
nameof
(
RB_GuideCar_CarSearch
.
ButtonText
),
demodel
.
ButtonText
},
{
nameof
(
RB_GuideCar_CarSearch
.
ButtonColor
),
demodel
.
ButtonColor
},
{
nameof
(
RB_GuideCar_CarSearch
.
ButtonTextColor
),
demodel
.
ButtonTextColor
},
{
nameof
(
RB_Distributor_Custom
.
UpdateDate
),
demodel
.
UpdateDate
},
};
List
<
WhereHelper
>
whereHelpers
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Custom
.
Id
),
FiledValue
=
demodel
.
ID
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Custom
.
TenantId
),
FiledValue
=
demodel
.
TenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Custom
.
MallBaseId
),
FiledValue
=
demodel
.
MallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
carSearchSearchRepository
.
Update
(
keyValuePairs
,
whereHelpers
);
}
else
{
return
carSearchSearchRepository
.
Insert
(
demodel
)
>
0
;
}
}
/// <summary>
/// 获取车辆搜索模块信息
/// </summary>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
RB_GuideCar_CarSearch
GetGuideCarSearchInfo
(
string
uid
,
int
mallBaseId
)
{
var
model
=
carSearchSearchRepository
.
GetGuideCarSearchList
(
new
RB_GuideCar_CarSearch
()
{
TenantId
=
Convert
.
ToInt32
(
uid
),
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
model
==
null
)
{
return
new
RB_GuideCar_CarSearch
();
}
return
model
;
}
#
endregion
}
}
Mall.Repository/GuideCar/RB_GuideCar_CarSearchRepository.cs
0 → 100644
View file @
e0a25d9b
using
Mall.Model.Entity.GuideCar
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.GuideCar
{
public
class
RB_GuideCar_CarSearchSearchRepository
:
BaseRepository
<
RB_GuideCar_CarSearch
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_GuideCar_CarSearch
);
}
}
/// <summary>
/// 司导-车辆搜索模块列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_GuideCar_CarSearch
>
GetGuideCarSearchList
(
RB_GuideCar_CarSearch
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE
{
nameof
(
RB_GuideCar_CarSearch
.
Status
)}
=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarSearch
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarSearch
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_GuideCar_CarSearch
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
}
return
Get
<
RB_GuideCar_CarSearch
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/MallBase/DestinationController.cs
View file @
e0a25d9b
...
...
@@ -61,9 +61,8 @@ namespace Mall.WebApi.Controllers.MallBase
var
result
=
GetData
(
list
);
return
ApiResult
.
Success
(
""
,
result
);
}
public
static
List
<
RB_Destination_Extend
>
GetData
(
List
<
RB_Destination_Extend
>
nodeList
)
{
...
...
@@ -86,5 +85,15 @@ namespace Mall.WebApi.Controllers.MallBase
}
[
HttpPost
]
public
ApiResult
GetAllPinYinList
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
list
=
destinationModule
.
GetAllList
();
list
.
ForEach
(
x
=>
x
.
PinYin
=
Mall
.
Common
.
Plugin
.
StringHelper
.
GetPinyin
(
x
.
Name
));
return
ApiResult
.
Success
(
""
,
list
);
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/GuideCarController.cs
View file @
e0a25d9b
...
...
@@ -19,6 +19,7 @@ using Mall.AOP;
using
Mall.Model.Extend.GuideCar
;
using
Mall.Common.Enum.Goods
;
using
DotNetCore.CAP.Infrastructure
;
using
Mall.Model.Entity.GuideCar
;
namespace
Mall.WebApi.Controllers.MallBase
{
...
...
@@ -1161,5 +1162,106 @@ namespace Mall.WebApi.Controllers.MallBase
}
#
endregion
#
region
司导
-
车辆搜索模块
/// <summary>
/// 新增车辆搜索模块
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGuideCarSearchInfo
()
{
var
requestParm
=
RequestParm
;
RB_GuideCar_CarSearch
demodel
=
JsonConvert
.
DeserializeObject
<
RB_GuideCar_CarSearch
>(
requestParm
.
msg
.
ToString
());
if
(
demodel
.
Background
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
Background
))
{
return
ApiResult
.
ParamIsNull
(
"请传递背景图片"
);
}
//if (demodel.SearchBackground == null || string.IsNullOrWhiteSpace(demodel.SearchBackground))
//{
// return ApiResult.ParamIsNull("请传递搜索背景图片");
//}
//if (string.IsNullOrEmpty(demodel.SearchTips))
//{
// return ApiResult.ParamIsNull("请传递搜索框提示文字");
//}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Tips
))
{
return
ApiResult
.
ParamIsNull
(
"请传递按钮上面的文字提示"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
TipsIco
))
{
return
ApiResult
.
ParamIsNull
(
"请传递按钮上面的文字图标提示"
);
}
//if (string.IsNullOrEmpty(demodel.SearchIco))
//{
// return ApiResult.ParamIsNull("请传递搜索框图标");
//}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ButtonTextColor
))
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下文本颜色"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ButtonText
))
{
return
ApiResult
.
ParamIsNull
(
"请传递按钮文本"
);
}
if
(
demodel
.
ButtonColor
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
ButtonColor
))
{
return
ApiResult
.
ParamIsNull
(
"请传递按钮颜色"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ButtonTextColor
))
{
return
ApiResult
.
ParamIsNull
(
"请传递按钮文字颜色"
);
}
demodel
.
TenantId
=
Convert
.
ToInt32
(
requestParm
.
uid
);
demodel
.
MallBaseId
=
requestParm
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
guideCarModule
.
SetGuideCarSearchInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取车辆搜索模块
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGuideCarSearchInfo
()
{
var
requestParm
=
RequestParm
;
var
model
=
guideCarModule
.
GetGuideCarSearchInfo
(
requestParm
.
uid
,
requestParm
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
ID
,
model
.
Background
,
model
.
SearchBackground
,
model
.
SearchTips
,
model
.
IsShowDate
,
model
.
IsShowCity
,
model
.
IsShowAddress
,
model
.
IsShowCarpooling
,
model
.
IsShowGuideCarGoodsType
,
model
.
IsShowCarClass
,
model
.
IsShowTravelGuestNum
,
model
.
Tips
,
model
.
TipsIco
,
model
.
SearchIco
,
model
.
SearchFilletPX
,
model
.
ButtonFilletPX
,
model
.
ButtonText
,
model
.
ButtonColor
,
model
.
ButtonTextColor
});
}
#
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