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
4303516c
Commit
4303516c
authored
Apr 22, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
825be94e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1615 additions
and
7 deletions
+1615
-7
LogisticsTypeEnum.cs
Mall.Common/Enum/MallBase/LogisticsTypeEnum.cs
+21
-0
RB_Destination.cs
Mall.Model/Entity/BaseSetUp/RB_Destination.cs
+104
-0
RB_Logistics.cs
Mall.Model/Entity/BaseSetUp/RB_Logistics.cs
+40
-0
RB_LogisticsRules.cs
Mall.Model/Entity/BaseSetUp/RB_LogisticsRules.cs
+49
-0
RB_LogisticsRulesPrice.cs
Mall.Model/Entity/BaseSetUp/RB_LogisticsRulesPrice.cs
+63
-0
RB_LogisticsRulesRegion.cs
Mall.Model/Entity/BaseSetUp/RB_LogisticsRulesRegion.cs
+47
-0
RB_MallBase.cs
Mall.Model/Entity/BaseSetUp/RB_MallBase.cs
+6
-1
RB_Destination_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
+79
-0
RB_LogisticsRulesPrice_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_LogisticsRulesPrice_Extend.cs
+18
-0
RB_LogisticsRulesRegion_Extend.cs
....Model/Extend/BaseSetUp/RB_LogisticsRulesRegion_Extend.cs
+23
-0
RB_LogisticsRules_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_LogisticsRules_Extend.cs
+19
-0
DestinationModule.cs
Mall.Module.BaseSetUp/DestinationModule.cs
+332
-0
MallBaseModule.cs
Mall.Module.BaseSetUp/MallBaseModule.cs
+100
-1
RB_DestinationRepository.cs
Mall.Repository/BaseSetUp/RB_DestinationRepository.cs
+308
-0
RB_LogisticsRepository.cs
Mall.Repository/BaseSetUp/RB_LogisticsRepository.cs
+35
-0
RB_LogisticsRulesPriceRepository.cs
....Repository/BaseSetUp/RB_LogisticsRulesPriceRepository.cs
+44
-0
RB_LogisticsRulesRegionRepository.cs
...Repository/BaseSetUp/RB_LogisticsRulesRegionRepository.cs
+53
-0
RB_LogisticsRulesRepository.cs
Mall.Repository/BaseSetUp/RB_LogisticsRulesRepository.cs
+82
-0
RB_MallBaseRepository.cs
Mall.Repository/BaseSetUp/RB_MallBaseRepository.cs
+26
-1
DestinationController.cs
Mall.WebApi/Controllers/MallBase/DestinationController.cs
+52
-0
MallBaseController.cs
Mall.WebApi/Controllers/MallBase/MallBaseController.cs
+114
-4
No files found.
Mall.Common/Enum/MallBase/LogisticsTypeEnum.cs
0 → 100644
View file @
4303516c
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Common.Enum.MallBase
{
public
enum
LogisticsTypeEnum
{
/// <summary>
/// 快递鸟
/// </summary>
[
EnumField
(
"快递鸟"
)]
ExpressBird
=
1
,
/// <summary>
/// 阿里云接口
/// </summary>
[
EnumField
(
"阿里云接口"
)]
Aliyun
=
2
}
}
Mall.Model/Entity/BaseSetUp/RB_Destination.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Common.Enum
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 地区
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Destination
{
/// <summary>
/// 主键
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 父级节点编号
/// </summary>
public
int
?
ParentID
{
get
;
set
;
}
/// <summary>
/// 等级 1-国家,2-省,3-市,4-区县
/// </summary>
public
AreaRegionEnum
CodeLevel
{
get
;
set
;
}
/// <summary>
/// 三码
/// </summary>
public
string
ThreeCode
{
get
;
set
;
}
/// <summary>
/// 地区英文名
/// </summary>
public
string
EnName
{
get
;
set
;
}
/// <summary>
/// 四字码
/// </summary>
public
string
FourCode
{
get
;
set
;
}
/// <summary>
/// 自定义区域,如'1,2'
/// </summary>
public
string
Area
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
Common
.
Enum
.
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 经度
/// </summary>
public
string
Lng
{
get
;
set
;
}
/// <summary>
/// 纬度
/// </summary>
public
string
Lat
{
get
;
set
;
}
/// <summary>
/// 城市图片
/// </summary>
public
string
Images
{
get
;
set
;
}
}
}
Mall.Model/Entity/BaseSetUp/RB_Logistics.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Common.Enum.MallBase
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 物流设置
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Logistics
{
/// <summary>
/// 编号
/// </summary>
public
int
ID
{
get
;
set
;
}
/// <summary>
///查询类型选择 1-快递鸟,2-阿里云接口
/// </summary>
public
LogisticsTypeEnum
LogisticsType
{
get
;
set
;
}
/// <summary>
/// 阿里云APPCODE
/// </summary>
public
string
AliyunAppCode
{
get
;
set
;
}
/// <summary>
/// 快递鸟用户ID
/// </summary>
public
string
ExpressBirdID
{
get
;
set
;
}
/// <summary>
/// 快递鸟API KEY
/// </summary>
public
string
ExpressBirdAPIKey
{
get
;
set
;
}
public
int
TenantId
{
get
;
set
;
}
}
}
Mall.Model/Entity/BaseSetUp/RB_LogisticsRules.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 运费规则
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRules
{
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 商户id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 0-否1-是
/// </summary>
public
int
IsDefault
{
get
;
set
;
}
/// <summary>
/// 规则名称
/// </summary>
public
string
RulesName
{
get
;
set
;
}
/// <summary>
/// 计费方式
/// </summary>
public
int
ChargeMode
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
DateTime
CreateDate
{
get
;
set
;
}
public
DateTime
UpdateDate
{
get
;
set
;
}
public
DateTime
DeletedDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/BaseSetUp/RB_LogisticsRulesPrice.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 运费规则价格
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRulesPrice
{
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 商户id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 运费规则id
/// </summary>
public
int
RulesId
{
get
;
set
;
}
/// <summary>
/// 首重
/// </summary>
public
int
First
{
get
;
set
;
}
/// <summary>
/// 首重价格
/// </summary>
public
int
FirstPrice
{
get
;
set
;
}
/// <summary>
/// 首重
/// </summary>
public
int
Second
{
get
;
set
;
}
/// <summary>
/// 首重价格
/// </summary>
public
int
SecondPrice
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
DateTime
CreateDate
{
get
;
set
;
}
public
DateTime
UpdateDate
{
get
;
set
;
}
public
DateTime
DeletedDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/BaseSetUp/RB_LogisticsRulesRegion.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 运费规则地区
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRulesRegion
{
/// <summary>
/// 价格
/// </summary>
public
int
RulesPriceId
{
get
;
set
;
}
/// <summary>
/// 地区id
/// </summary>
public
int
RegionId
{
get
;
set
;
}
public
int
ID
{
get
;
set
;
}
/// <summary>
/// 商户id
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
public
DateTime
CreateDate
{
get
;
set
;
}
public
DateTime
UpdateDate
{
get
;
set
;
}
public
DateTime
DeletedDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/BaseSetUp/RB_MallBase.cs
View file @
4303516c
...
...
@@ -209,7 +209,7 @@ namespace Mall.Model.Entity.BaseSetUp
public
int
OtherTencent
{
get
;
set
;
}
/// <summary>
///
定位地址是否必填
///
会员等级标识
/// </summary>
public
int
OtherMemerLevel
{
get
;
set
;
}
...
...
@@ -265,5 +265,10 @@ namespace Mall.Model.Entity.BaseSetUp
/// 有效期
/// </summary>
public
DateTime
?
Indate
{
get
;
set
;
}
/// <summary>
/// 1-正常,2-禁用
/// </summary>
public
int
MallBaseState
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 地区
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Destination_Extend
:
RB_Destination
{
/// <summary>
/// 洲查询使用
/// </summary>
public
string
QArea
{
get
;
set
;
}
/// <summary>
/// 国家查询使用
/// </summary>
public
string
QCountry
{
get
;
set
;
}
/// <summary>
/// 省份查询使用
/// </summary>
public
string
QProvince
{
get
;
set
;
}
/// <summary>
/// 城市查询使用
/// </summary>
public
string
QCity
{
get
;
set
;
}
/// <summary>
/// 地区查询使用
/// </summary>
public
string
QDistrict
{
get
;
set
;
}
/// <summary>
/// 行政级别名称
/// </summary>
public
string
CodeLevelName
{
get
{
string
str
=
string
.
Empty
;
if
(
this
.
CodeLevel
>
0
)
{
str
=
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
CodeLevel
);
}
return
str
;
}
}
/// <summary>
/// 所属国家
/// </summary>
public
string
CountryName
{
get
;
set
;
}
/// <summary>
/// 所属省份
/// </summary>
public
string
ProvinceName
{
get
;
set
;
}
/// <summary>
/// 所属城市
/// </summary>
public
string
CityName
{
get
;
set
;
}
/// <summary>
/// ID查询字符串
/// </summary>
public
string
QIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_LogisticsRulesPrice_Extend.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 物流价格
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRulesPrice_Extend
:
RB_LogisticsRulesPrice
{
public
List
<
RB_LogisticsRulesRegion_Extend
>
List
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_LogisticsRulesRegion_Extend.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 物流地区
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRulesRegion_Extend
:
RB_LogisticsRulesRegion
{
/// <summary>
/// 地区名字
/// </summary>
public
string
RegionName
{
get
;
set
;
}
public
string
PriceIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_LogisticsRules_Extend.cs
0 → 100644
View file @
4303516c
using
Mall.Common.AOP
;
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 运费规则
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_LogisticsRules_Extend
:
RB_LogisticsRules
{
public
List
<
RB_LogisticsRulesPrice_Extend
>
Detail
{
get
;
set
;
}
}
}
Mall.Module.BaseSetUp/DestinationModule.cs
0 → 100644
View file @
4303516c
This diff is collapsed.
Click to expand it.
Mall.Module.BaseSetUp/MallBaseModule.cs
View file @
4303516c
...
...
@@ -3,6 +3,7 @@ using Mall.Model.Extend.BaseSetUp;
using
Mall.Repository.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Module.BaseSetUp
...
...
@@ -10,7 +11,12 @@ namespace Mall.Module.BaseSetUp
public
class
MallBaseModule
{
private
RB_MallBaseRepository
mallBaseRepository
=
new
RB_MallBaseRepository
();
private
RB_LogisticsRepository
logisticsRepository
=
new
RB_LogisticsRepository
();
private
RB_LogisticsRulesPriceRepository
logisticsRulesPriceRepository
=
new
RB_LogisticsRulesPriceRepository
();
private
RB_LogisticsRulesRegionRepository
logisticsRulesRegionRepository
=
new
RB_LogisticsRulesRegionRepository
();
private
RB_LogisticsRulesRepository
logisticsRulesRepository
=
new
RB_LogisticsRulesRepository
();
#
region
基础设置
/// <summary>
/// 获取小程序列表
/// </summary>
...
...
@@ -25,6 +31,17 @@ namespace Mall.Module.BaseSetUp
}
/// <summary>
/// 获取小程序列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_MallBase_Extend
>
GetListRepository
(
RB_MallBase_Extend
query
)
{
return
mallBaseRepository
.
GetListRepository
(
query
);
}
/// <summary>
/// 根据编号获取实体
/// </summary>
...
...
@@ -42,7 +59,7 @@ namespace Mall.Module.BaseSetUp
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdate
(
RB_MallBase
model
)
public
bool
AddOrUpdate
MallBase
(
RB_MallBase
model
)
{
if
(
model
.
ID
==
0
)
{
...
...
@@ -53,5 +70,87 @@ namespace Mall.Module.BaseSetUp
return
mallBaseRepository
.
Update
(
model
);
}
}
#
endregion
#
region
物流设置
/// <summary>
/// 根据商户id获取物流信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Logistics
>
GetLogisticsList
(
RB_Logistics
query
)
{
return
logisticsRepository
.
GetListRepository
(
query
);
}
/// <summary>
/// 新增/修改基础信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
AddOrUpdateLogistics
(
RB_Logistics
model
)
{
if
(
model
.
ID
==
0
)
{
return
logisticsRepository
.
Insert
(
model
)
>
0
;
}
else
{
return
logisticsRepository
.
Update
(
model
);
}
}
#
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_LogisticsRules_Extend
>
GetPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_LogisticsRules_Extend
query
)
{
return
logisticsRulesRepository
.
GetPageListRepository
(
pageIndex
,
pageSize
,
out
rowCount
,
query
);
}
/// <summary>
/// 物流规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_LogisticsRules_Extend
>
GetLogisticsRulesList
(
RB_LogisticsRules_Extend
query
)
{
return
logisticsRulesRepository
.
GetLogisticsRulesList
(
query
);
}
public
RB_LogisticsRules_Extend
GetLogisticsRulesModel
(
RB_LogisticsRules_Extend
query
)
{
RB_LogisticsRules_Extend
model
=
logisticsRulesRepository
.
GetLogisticsRulesList
(
query
).
FirstOrDefault
();
//获取价格规则
List
<
RB_LogisticsRulesPrice_Extend
>
ListPrice
=
logisticsRulesPriceRepository
.
GetListRepository
(
new
RB_LogisticsRulesPrice_Extend
{
TenantId
=
query
.
TenantId
,
MallBaseId
=
query
.
MallBaseId
,
RulesId
=
query
.
ID
});
List
<
RB_LogisticsRulesRegion_Extend
>
listLogisticsRulesRegion
=
logisticsRulesRegionRepository
.
GetListRepository
(
new
RB_LogisticsRulesRegion_Extend
{
TenantId
=
query
.
TenantId
,
MallBaseId
=
query
.
MallBaseId
,
PriceIds
=
string
.
Join
(
","
,
ListPrice
.
Select
(
x
=>
x
.
ID
))
});
model
.
Detail
=
new
List
<
RB_LogisticsRulesPrice_Extend
>();
model
.
Detail
=
ListPrice
;
foreach
(
var
item
in
model
.
Detail
)
{
item
.
List
=
new
List
<
RB_LogisticsRulesRegion_Extend
>();
}
return
model
;
}
#
endregion
}
}
Mall.Repository/BaseSetUp/RB_DestinationRepository.cs
0 → 100644
View file @
4303516c
This diff is collapsed.
Click to expand it.
Mall.Repository/BaseSetUp/RB_LogisticsRepository.cs
0 → 100644
View file @
4303516c
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.BaseSetUp
{
public
class
RB_LogisticsRepository
:
RepositoryBase
<
RB_Logistics
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_Logistics
);
}
}
/// <summary>
/// 根据商户id获取物流信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Logistics
>
GetListRepository
(
RB_Logistics
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND TenantId=
{
query
.
TenantId
}
"
);
}
}
return
Get
<
RB_Logistics
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/BaseSetUp/RB_LogisticsRulesPriceRepository.cs
0 → 100644
View file @
4303516c
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.BaseSetUp
{
public
class
RB_LogisticsRulesPriceRepository
:
RepositoryBase
<
RB_LogisticsRulesPrice
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_LogisticsRulesPrice
);
}
}
/// <summary>
/// 获取小程序列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_LogisticsRulesPrice_Extend
>
GetListRepository
(
RB_LogisticsRulesPrice_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRulesPrice_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRulesPrice_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
RulesId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRulesPrice_Extend
.
RulesId
)}
=
{
query
.
RulesId
}
"
);
}
}
return
Get
<
RB_LogisticsRulesPrice_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/BaseSetUp/RB_LogisticsRulesRegionRepository.cs
0 → 100644
View file @
4303516c
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.BaseSetUp
{
public
class
RB_LogisticsRulesRegionRepository
:
RepositoryBase
<
RB_LogisticsRulesRegion
>
{
// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_LogisticsRulesRegion
);
}
}
// <summary>
/// 表名称
/// </summary>
public
string
DestinationTableName
{
get
{
return
nameof
(
RB_Destination
);
}
}
/// <summary>
/// 获取小程序列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_LogisticsRulesRegion_Extend
>
GetListRepository
(
RB_LogisticsRulesRegion_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT a.*,b.`Name` as RegionName FROM
{
TableName
}
as a LEFT JOIN
{
DestinationTableName
}
as b on a.RegionId=b.ID WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_LogisticsRulesRegion_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_LogisticsRulesRegion_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
RulesPriceId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_LogisticsRulesRegion_Extend
.
RulesPriceId
)}
=
{
query
.
RulesPriceId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
PriceIds
))
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_LogisticsRulesRegion_Extend
.
RulesPriceId
)}
in (
{
query
.
PriceIds
}
)"
);
}
}
return
Get
<
RB_LogisticsRulesRegion_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/BaseSetUp/RB_LogisticsRulesRepository.cs
0 → 100644
View file @
4303516c
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.BaseSetUp
{
public
class
RB_LogisticsRulesRepository
:
RepositoryBase
<
RB_LogisticsRules
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_LogisticsRules
);
}
}
/// <summary>
/// 物料规则列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_LogisticsRules_Extend
>
GetPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_LogisticsRules_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
RulesName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
RulesName
)}
like '%
{
query
.
RulesName
}
%'"
);
}
}
return
GetPage
<
RB_LogisticsRules_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_LogisticsRules_Extend
>
GetLogisticsRulesList
(
RB_LogisticsRules_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
ID
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
ID
)}
=
{
query
.
ID
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
RulesName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_LogisticsRules_Extend
.
RulesName
)}
like '%
{
query
.
RulesName
}
%'"
);
}
}
return
Get
<
RB_LogisticsRules_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.Repository/BaseSetUp/RB_MallBaseRepository.cs
View file @
4303516c
...
...
@@ -9,6 +9,10 @@ namespace Mall.Repository.BaseSetUp
{
public
class
RB_MallBaseRepository
:
RepositoryBase
<
RB_MallBase
>
{
/// <summary>
/// 表名称
/// </summary>
public
string
TableName
{
get
{
return
nameof
(
RB_MallBase
);
}
}
/// <summary>
/// 获取小程序列表
/// </summary>
...
...
@@ -20,9 +24,10 @@ namespace Mall.Repository.BaseSetUp
public
List
<
RB_MallBase_Extend
>
GetPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_MallBase_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
" SELECT * FROM RB_MallBase
WHERE 1=1 "
);
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
// where += $@" and {nameof(RB_Customer_InfoCreate.CustomerId)}={dmodel.CustomerId}";
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND TenantId=
{
query
.
TenantId
}
"
);
...
...
@@ -30,5 +35,25 @@ namespace Mall.Repository.BaseSetUp
}
return
GetPage
<
RB_MallBase_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取小程序列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_MallBase_Extend
>
GetListRepository
(
RB_MallBase_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT * FROM
{
TableName
}
WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND TenantId=
{
query
.
TenantId
}
"
);
}
}
return
Get
<
RB_MallBase_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
Mall.WebApi/Controllers/MallBase/DestinationController.cs
0 → 100644
View file @
4303516c
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Module.BaseSetUp
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.MallBase
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
DestinationController
:
BaseController
{
/// <summary>
/// 地区模块处理类
/// </summary>
private
DestinationModule
destinationModule
=
new
DestinationModule
();
/// <summary>
/// 根据父节点编号获取子列表
/// </summary>
/// <param name="ParentID">父节点编号</param>
/// <returns></returns>
public
virtual
ApiResult
GetChildList
(
RequestParm
request
)
{
JObject
parm
=
JObject
.
Parse
(
request
.
msg
.
ToString
());
int
ID
=
parm
.
GetInt
(
"Id"
);
if
(
ID
>
0
)
{
var
CommonList
=
Mall
.
Common
.
Data
.
AreaDataHelper
.
GetAreaList
();
if
(
CommonList
!=
null
&&
CommonList
.
Count
>
0
)
{
return
ApiResult
.
Success
(
""
,
CommonList
.
Where
(
qitem
=>
qitem
.
P
==
ID
).
Select
(
qitem
=>
new
{
ID
=
qitem
.
I
,
Name
=
qitem
.
N
}));
}
var
list
=
destinationModule
.
GetChildList
(
ID
).
Select
(
item
=>
new
{
item
.
ID
,
item
.
Name
});
return
ApiResult
.
Success
(
""
,
list
);
}
else
{
return
ApiResult
.
Failed
(
"未找到相关数据!"
);
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/MallBase/MallBaseController.cs
View file @
4303516c
...
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Module.BaseSetUp
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
...
...
@@ -20,9 +21,12 @@ namespace Mall.WebApi.Controllers.MallBase
{
private
MallBaseModule
mallBaseModule
=
new
MallBaseModule
();
public
ApiResult
AddOrUpdate
()
private
Module
.
User
.
TenantModule
TenantModule
=
new
Module
.
User
.
TenantModule
();
#
region
基础设置
public
ApiResult
AddOrUpdateMallBase
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_MallBase
>(
RequestParm
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_MallBase
_Extend
>(
RequestParm
.
msg
.
ToString
());
if
(
query
==
null
)
{
...
...
@@ -30,12 +34,34 @@ namespace Mall.WebApi.Controllers.MallBase
}
else
{
query
.
TenantId
=
UserInfo
.
TenantId
;
if
(
query
.
ID
==
0
)
//新增
{
var
TenantModel
=
TenantModule
.
GetTenantModule
(
query
.
TenantId
);
if
(
TenantModel
==
null
)
{
return
ApiResult
.
Failed
(
"请确保商户信息正确"
);
}
if
(
TenantModel
.
AccountStatus
!=
2
)
{
return
ApiResult
.
Failed
(
"商户状态审核不通过"
);
}
if
(
TenantModel
.
IsEffective
==
0
&&
TenantModel
.
AccountValidate
.
HasValue
&&
TenantModel
.
AccountValidate
.
Value
<
System
.
DateTime
.
Now
)
{
return
ApiResult
.
Failed
(
"商户账号已过期"
);
}
//判断当前商户下面有多少小程序
if
(
TenantModel
.
CreateMiniPrograme
.
HasValue
)
{
var
oldList
=
mallBaseModule
.
GetListRepository
(
query
);
if
(
oldList
.
Count
()
>=
TenantModel
.
CreateMiniPrograme
.
Value
)
{
return
ApiResult
.
Failed
(
"商户可建小程序数:"
+
TenantModel
.
CreateMiniPrograme
.
Value
);
}
}
}
bool
result
=
mallBaseModule
.
AddOrUpdate
(
query
);
bool
result
=
mallBaseModule
.
AddOrUpdate
MallBase
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"基础信息保存成功"
);
...
...
@@ -47,5 +73,89 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetMallBasePage
()
{
// UserInfo userInfo = UserReidsCache.GetUserLoginInfo(requestParm.uid);
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
RB_MallBase_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_MallBase_Extend
>(
RequestParm
.
msg
.
ToString
());
demodel
.
TenantId
=
UserInfo
.
TenantId
;
var
list
=
mallBaseModule
.
GetPageListRepository
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
MallName
,
OrderNum
=
0
,
MemberNum
=
0
,
IndateStr
=
x
.
Indate
.
HasValue
?
x
.
Indate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
"永久"
,
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
#
region
物流设置
#
region
物流规格
-
物流设置
/// <summary>
/// 根据商户号获取物流信息
/// </summary>
/// <returns></returns>
public
ApiResult
GetLogistics
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Logistics
>(
RequestParm
.
msg
.
ToString
());
var
TenantModel
=
TenantModule
.
GetTenantModule
(
query
.
TenantId
);
query
.
TenantId
=
UserInfo
.
TenantId
;
var
oldLogisticsModel
=
mallBaseModule
.
GetLogisticsList
(
query
).
FirstOrDefault
();
if
(
oldLogisticsModel
==
null
)
{
oldLogisticsModel
=
new
RB_Logistics
();
oldLogisticsModel
.
LogisticsType
=
Common
.
Enum
.
MallBase
.
LogisticsTypeEnum
.
ExpressBird
;
}
return
ApiResult
.
Success
(
""
,
oldLogisticsModel
);
}
/// <summary>
/// 保存物流信息
/// </summary>
/// <returns></returns>
public
ApiResult
AddOrUpdateLogistics
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Logistics
>(
RequestParm
.
msg
.
ToString
());
if
(
query
==
null
)
{
return
ApiResult
.
Failed
(
"请传入物流基础信息"
);
}
else
{
query
.
TenantId
=
UserInfo
.
TenantId
;
bool
result
=
mallBaseModule
.
AddOrUpdateLogistics
(
query
);
if
(
result
)
{
return
ApiResult
.
Success
(
"物流设置信息保存成功"
);
}
else
{
return
ApiResult
.
Failed
(
"基物流设置信息保存失败"
);
}
}
}
#
endregion
#
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