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
aaafd0d6
Commit
aaafd0d6
authored
May 19, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单评价+批量发货
parent
3769945d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1498 additions
and
22 deletions
+1498
-22
UserReidsCache.cs
Mall.CacheManager/User/UserReidsCache.cs
+1
-0
AppletUserInfo.cs
Mall.Common/API/AppletUserInfo.cs
+11
-1
GoodsCommentTypeEnum.cs
Mall.Common/Enum/Goods/GoodsCommentTypeEnum.cs
+31
-0
SendGoodsBetchDataHelper.cs
Mall.DataHelper/Import/SendGoodsBetchDataHelper.cs
+52
-0
Mall.DataHelper.csproj
Mall.DataHelper/Mall.DataHelper.csproj
+0
-6
RB_Goods_Comment.cs
Mall.Model/Entity/Product/RB_Goods_Comment.cs
+163
-0
RB_Goods_CommentTemplate.cs
Mall.Model/Entity/Product/RB_Goods_CommentTemplate.cs
+91
-0
RB_Goods_CommentTemplate_Extend.cs
Mall.Model/Extend/Product/RB_Goods_CommentTemplate_Extend.cs
+18
-0
RB_Goods_Comment_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Comment_Extend.cs
+41
-0
RB_Goods_OrderExpress_Extend.cs
Mall.Model/Extend/Product/RB_Goods_OrderExpress_Extend.cs
+4
-0
RB_Goods_Order_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
+4
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+389
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+0
-1
RB_Goods_CommentRepository.cs
Mall.Repository/Product/RB_Goods_CommentRepository.cs
+144
-0
RB_Goods_CommentTemplateRepository.cs
....Repository/Product/RB_Goods_CommentTemplateRepository.cs
+53
-0
RB_Goods_OrderRepository.cs
Mall.Repository/Product/RB_Goods_OrderRepository.cs
+3
-0
FileController.cs
Mall.WebApi/Controllers/File/FileController.cs
+67
-0
AppletOrderController.cs
Mall.WebApi/Controllers/Product/AppletOrderController.cs
+103
-0
OrderController.cs
Mall.WebApi/Controllers/Product/OrderController.cs
+229
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+93
-14
AppletLoginController.cs
Mall.WebApi/Controllers/User/AppletLoginController.cs
+1
-0
No files found.
Mall.CacheManager/User/UserReidsCache.cs
View file @
aaafd0d6
...
...
@@ -187,6 +187,7 @@ namespace Mall.CacheManager.User
Name
=
umodel
.
Name
,
OpenId
=
umodel
.
OpenId
,
Photo
=
umodel
.
Photo
,
Source
=
umodel
.
Source
,
SecretKey
=
umodel
.
SecretKey
,
SuperiorId
=
umodel
.
SuperiorId
??
0
,
Token
=
token
...
...
Mall.Common/API/AppletUserInfo.cs
View file @
aaafd0d6
using
System
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -71,6 +72,15 @@ namespace Mall.Common
/// </summary>
public
string
Photo
{
get
;
set
;
}
/// <summary>
/// 来源 1微信 2支付宝
/// </summary>
public
UserSourceEnum
?
Source
{
get
;
set
;
}
/// <summary>
/// 商城名称
/// </summary>
...
...
Mall.Common/Enum/Goods/GoodsCommentTypeEnum.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Mall.Common.Enum.Goods
{
/// <summary>
/// 商品评论类型枚举
/// </summary>
public
enum
GoodsCommentTypeEnum
{
/// <summary>
/// 好评
/// </summary>
[
EnumField
(
"好评"
)]
Praise
=
1
,
/// <summary>
/// 中评
/// </summary>
[
EnumField
(
"中评"
)]
Medium
=
2
,
/// <summary>
/// 差评
/// </summary>
[
EnumField
(
"差评"
)]
Negative
=
3
}
}
Mall.DataHelper/Import/SendGoodsBetchDataHelper.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Model.Extend.Product
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
namespace
Mall.DataHelper
{
public
class
SendGoodsBetchDataHelper
{
/// <summary>
/// 导入模板
/// </summary>
/// <param name="fileName"></param>
/// <returns></returns>
public
static
List
<
RB_Goods_OrderExpress_Extend
>
ImportClaimData
(
string
fileName
)
{
List
<
RB_Goods_OrderExpress_Extend
>
list
=
new
List
<
RB_Goods_OrderExpress_Extend
>();
var
dt
=
Mall
.
Common
.
Plugin
.
NPOIHelper
.
ImportExceltoDt
(
fileName
,
0
,
0
,
true
);
if
(
dt
!=
null
&&
dt
.
Rows
.
Count
>
0
)
{
foreach
(
DataRow
dr
in
dt
.
Rows
)
{
list
.
Add
(
DataRowToModel
(
dr
));
}
}
return
list
;
}
/// <summary>
/// DataRow转实体
/// </summary>
/// <param name="dr"></param>
/// <returns></returns>
public
static
RB_Goods_OrderExpress_Extend
DataRowToModel
(
DataRow
dr
)
{
RB_Goods_OrderExpress_Extend
model
=
new
RB_Goods_OrderExpress_Extend
();
if
(
dr
!=
null
)
{
if
(
dr
.
Table
.
Columns
.
Contains
(
"订单号"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"订单号"
].
ToString
().
Trim
()))
{
model
.
OrderNo
=
dr
[
"订单号"
].
ToString
().
Trim
();
}
if
(
dr
.
Table
.
Columns
.
Contains
(
"快递单号"
)
&&
!
string
.
IsNullOrEmpty
(
dr
[
"快递单号"
].
ToString
().
Trim
()))
{
model
.
ExpressNumber
=
dr
[
"快递单号"
].
ToString
().
Trim
();
}
}
return
model
;
}
}
}
\ No newline at end of file
Mall.DataHelper/Mall.DataHelper.csproj
View file @
aaafd0d6
...
...
@@ -4,12 +4,6 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Import\**" />
<EmbeddedResource Remove="Import\**" />
<None Remove="Import\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
...
...
Mall.Model/Entity/Product/RB_Goods_Comment.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Goods
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 商品订评论表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Comment
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 用户id
/// </summary>
public
int
?
UserId
{
get
;
set
;
}
/// <summary>
/// 商品id
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 客人名称
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 用户头像
/// </summary>
public
int
?
UserPhoto
{
get
;
set
;
}
/// <summary>
/// 评论类型 1 好评 2中评 3差评
/// </summary>
public
GoodsCommentTypeEnum
?
CommentGrade
{
get
;
set
;
}
/// <summary>
/// 评论内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 评论图片
/// </summary>
public
string
CommentImage
{
get
;
set
;
}
/// <summary>
/// 回复
/// </summary>
public
string
Reply
{
get
;
set
;
}
/// <summary>
/// 来源
/// </summary>
public
UserSourceEnum
?
PlatformSource
{
get
;
set
;
}
/// <summary>
/// 是否置顶 1是 2否
/// </summary>
public
int
?
Is_Top
{
get
;
set
;
}
/// <summary>
/// 是否显示 1是 2否
/// </summary>
public
int
?
Is_Show
{
get
;
set
;
}
/// <summary>
/// 是否匿名 1是 2否
/// </summary>
public
int
?
Is_Anonymity
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Entity/Product/RB_Goods_CommentTemplate.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Common.AOP
;
using
Mall.Common.Enum.Goods
;
using
Mall.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.Product
{
/// <summary>
/// 商品订评论模板表实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_CommentTemplate
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 模板名称
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 模板内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 评论类型 1好评 2中评 3差评
/// </summary>
public
GoodsCommentTypeEnum
?
CommentGrade
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
/// <summary>
/// UpdateDate
/// </summary>
public
DateTime
?
UpdateDate
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_CommentTemplate_Extend.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 商品评论模板表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_CommentTemplate_Extend
:
RB_Goods_CommentTemplate
{
}
}
Mall.Model/Extend/Product/RB_Goods_Comment_Extend.cs
0 → 100644
View file @
aaafd0d6
using
Mall.Common.AOP
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
namespace
Mall.Model.Extend.Product
{
/// <summary>
/// 商品评论表扩展实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Goods_Comment_Extend
:
RB_Goods_Comment
{
/// <summary>
/// 商品图片
/// </summary>
public
string
CarouselImage
{
get
;
set
;
}
/// <summary>
/// 商品名称
/// </summary>
public
string
GoodsName
{
get
;
set
;
}
/// <summary>
/// 封面图
/// </summary>
public
string
CoverImage
{
get
;
set
;
}
/// <summary>
/// 评论图片列表
/// </summary>
public
List
<
string
>
CommentImgList
{
get
;
set
;
}
/// <summary>
/// 头像路径
/// </summary>
public
string
UserPhotoPath
{
get
;
set
;
}
/// <summary>
/// 评论数量
/// </summary>
public
int
CommentNum
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_OrderExpress_Extend.cs
View file @
aaafd0d6
...
...
@@ -22,6 +22,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
int
?
OrderId
{
get
;
set
;}
/// <summary>
/// 订单号
/// </summary>
public
string
OrderNo
{
get
;
set
;
}
/// <summary>
/// 订单快递ids
/// </summary>
public
string
OrderExpressIds
{
get
;
set
;
}
...
...
Mall.Model/Extend/Product/RB_Goods_Order_Extend.cs
View file @
aaafd0d6
...
...
@@ -18,6 +18,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
string
OrderIds
{
get
;
set
;
}
/// <summary>
/// 订单号s
/// </summary>
public
string
orderNos
{
get
;
set
;
}
/// <summary>
/// 是否来自购物车 1是 2否
/// </summary>
public
int
?
IsFormShoppingCart
{
get
;
set
;
}
...
...
Mall.Module.Product/OrderModule.cs
View file @
aaafd0d6
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
aaafd0d6
...
...
@@ -2034,7 +2034,6 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
SeparateDistribution
),
demodel
.
SeparateDistribution
},
{
nameof
(
RB_Goods
.
SeparateDistributionType
),
demodel
.
SeparateDistributionType
},
{
nameof
(
RB_Goods
.
SeparateDistributionMoneyType
),
demodel
.
SeparateDistributionMoneyType
},
{
nameof
(
RB_Goods
.
SeparateDistributionMoneyType
),
demodel
.
SeparateDistributionMoneyType
},
{
nameof
(
RB_Goods
.
SeparateSetMember
),
demodel
.
SeparateSetMember
},
{
nameof
(
RB_Goods
.
IsQuickBuy
),
demodel
.
IsQuickBuy
}
};
...
...
Mall.Repository/Product/RB_Goods_CommentRepository.cs
0 → 100644
View file @
aaafd0d6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
using
Mall.Model.Entity.User
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品评论仓储层
/// </summary>
public
class
RB_Goods_CommentRepository
:
RepositoryBase
<
RB_Goods_Comment
>
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Comment_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Comment_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CommentGrade
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
CommentGrade
)}
=
{(
int
)
dmodel
.
CommentGrade
}
"
;
}
if
(
dmodel
.
PlatformSource
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
PlatformSource
)}
=
{(
int
)
dmodel
.
PlatformSource
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
UserName
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
UserName
)}
like '%
{
dmodel
.
UserName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsName
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods
.
Name
)}
like '%
{
dmodel
.
GoodsName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Content
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
Content
)}
like '%
{
dmodel
.
Content
}
%'"
;
}
string
sql
=
$@"SELECT c.*,g.Name as GoodsName,g.CarouselImage FROM RB_Goods_Comment c
left join rb_goods g on c.GoodsId = g.Id
where
{
where
}
order by c.Id desc"
;
return
GetPage
<
RB_Goods_Comment_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Comment_Extend
>
GetAppletPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Comment_Extend
dmodel
)
{
string
where
=
$" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CommentGrade
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
CommentGrade
)}
=
{(
int
)
dmodel
.
CommentGrade
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(
dmodel
.
PlatformSource
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
PlatformSource
)}
=
{(
int
)
dmodel
.
PlatformSource
}
"
;
}
if
(
dmodel
.
Is_Show
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
Is_Show
)}
=
{
dmodel
.
Is_Show
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
UserName
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
UserName
)}
like '%
{
dmodel
.
UserName
}
%'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Content
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
Content
)}
like '%
{
dmodel
.
Content
}
%'"
;
}
string
sql
=
$@"SELECT c.* FROM RB_Goods_Comment c where
{
where
}
order by c.Is_Top asc,c.Id desc"
;
return
GetPage
<
RB_Goods_Comment_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
/// <summary>
/// 获取评论数量统计
/// </summary>
/// <param name="goodsId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
List
<
RB_Goods_Comment_Extend
>
GetAppletGoodsCommentStatistics
(
int
goodsId
,
int
tenantId
,
int
mallBaseId
)
{
string
where
=
$" 1=1 and c.
{
nameof
(
RB_Goods_Comment
.
Is_Show
)}
=1"
;
if
(
tenantId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
TenantId
)}
=
{
tenantId
}
"
;
}
if
(
mallBaseId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
MallBaseId
)}
=
{
mallBaseId
}
"
;
}
if
(
goodsId
>
0
)
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Comment
.
GoodsId
)}
=
{
goodsId
}
"
;
}
string
sql
=
$@"SELECT c.CommentGrade,COUNT(0) as CommentNum FROM RB_Goods_Comment c where
{
where
}
GROUP BY c.CommentGrade"
;
return
Get
<
RB_Goods_Comment_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Goods_CommentTemplateRepository.cs
0 → 100644
View file @
aaafd0d6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
using
Mall.Model.Entity.User
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品评论模板仓储层
/// </summary>
public
class
RB_Goods_CommentTemplateRepository
:
RepositoryBase
<
RB_Goods_CommentTemplate
>
{
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_CommentTemplate_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_CommentTemplate_Extend
dmodel
)
{
string
where
=
$" 1=1 and Status =0 "
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_CommentTemplate
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_CommentTemplate
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_CommentTemplate
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
CommentGrade
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_CommentTemplate
.
CommentGrade
)}
=
{(
int
)
dmodel
.
CommentGrade
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_CommentTemplate
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
string
sql
=
$@"SELECT * FROM RB_Goods_CommentTemplate where
{
where
}
order by Id desc"
;
return
GetPage
<
RB_Goods_CommentTemplate_Extend
>(
pageIndex
,
pageSize
,
out
count
,
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Goods_OrderRepository.cs
View file @
aaafd0d6
...
...
@@ -133,6 +133,9 @@ where {where} group by o.OrderId order by o.CreateDate desc";
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
OrderIds
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderId
)}
in(
{
dmodel
.
OrderIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
orderNos
))
{
where
+=
$@" and o.
{
nameof
(
RB_Goods_Order
.
OrderNo
)}
in(
{
dmodel
.
orderNos
}
)"
;
}
string
sql
=
$@"SELECT o.* FROM rb_goods_order o
where
{
where
}
group by o.OrderId asc"
;
...
...
Mall.WebApi/Controllers/File/FileController.cs
0 → 100644
View file @
aaafd0d6
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.IO
;
using
Microsoft.AspNetCore.Cors
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Mall.WebApi.Filter
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
namespace
Mall.WebApi.Controllers.File
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
FileController
:
ControllerBase
{
/// <summary>
/// 上传文件到本地临时文件
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
LocalFileUploadImport
()
{
try
{
var
files
=
Request
.
Form
.
Files
;
if
(
files
.
Count
==
0
)
{
return
new
ApiResult
{
resultCode
=
(
int
)
ResultCode
.
Fail
,
message
=
"未选择文件"
,
data
=
""
};
}
string
filename
=
files
[
0
].
FileName
;
string
fileExtention
=
System
.
IO
.
Path
.
GetExtension
(
files
[
0
].
FileName
);
//验证文件格式
List
<
string
>
ExtList
=
new
List
<
string
>()
{
".xls"
,
".xlsx"
};
if
(!
ExtList
.
Contains
(
fileExtention
))
{
return
new
ApiResult
{
resultCode
=
(
int
)
ResultCode
.
Fail
,
message
=
"文件格式有误"
,
data
=
""
};
}
string
path
=
Guid
.
NewGuid
().
ToString
()
+
fileExtention
;
string
basepath
=
AppContext
.
BaseDirectory
;
string
path_server
=
basepath
+
"\\upfile\\temporary\\"
+
path
;
if
(!
Directory
.
Exists
(
basepath
+
"\\upfile\\temporary"
))
{
Directory
.
CreateDirectory
(
basepath
+
"\\upfile\\temporary"
);
}
using
(
FileStream
fstream
=
new
FileStream
(
path_server
,
FileMode
.
OpenOrCreate
,
FileAccess
.
ReadWrite
))
{
files
[
0
].
CopyTo
(
fstream
);
}
return
ApiResult
.
Success
(
""
,
path_server
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"LocalFileUploadImport"
);
return
ApiResult
.
Failed
();
}
}
}
}
Mall.WebApi/Controllers/Product/AppletOrderController.cs
View file @
aaafd0d6
...
...
@@ -402,6 +402,10 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
#
region
订单售后
/// <summary>
/// 获取我的订单商品售后申请页面 订单信息
/// </summary>
...
...
@@ -567,5 +571,104 @@ namespace Mall.WebApi.Controllers.MallBase
}
#
endregion
#
region
订单评价
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsCommentPageList
()
{
var
parms
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Comment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Comment_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
Is_Show
=
1
;
var
list
=
orderModule
.
GetAppletGoodsCommentPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
UserId
,
UserName
=
x
.
Is_Anonymity
==
1
?
"匿名用户"
:
x
.
UserName
,
UserPhotoPath
=
x
.
UserPhotoPath
??
""
,
x
.
CommentGrade
,
CommentGradeName
=
x
.
CommentGrade
.
GetEnumName
(),
x
.
CommentImgList
,
x
.
Content
,
x
.
Reply
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取商品评论统计
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsCommentStatistics
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
return
orderModule
.
GetAppletGoodsCommentStatistics
(
GoodsId
,
userInfo
.
TenantId
,
userInfo
.
MallBaseId
);
}
/// <summary>
/// 用户新增评论
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsCommentInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Goods_Comment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Comment_Extend
>(
req
.
msg
.
ToString
());
if
((
demodel
.
GoodsId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
return
ApiResult
.
ParamIsNull
(
"请输入评价内容"
);
}
if
(!
demodel
.
CommentGrade
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择评分"
);
}
demodel
.
CommentImage
=
""
;
if
(
demodel
.
CommentImgList
!=
null
&&
demodel
.
CommentImgList
.
Any
())
{
demodel
.
CommentImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CommentImgList
);
}
demodel
.
UserPhoto
??=
0
;
demodel
.
Is_Top
??=
2
;
demodel
.
Is_Show
??=
2
;
demodel
.
Is_Anonymity
??=
2
;
demodel
.
UserId
??=
0
;
demodel
.
Reply
??=
""
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
UserName
=
userInfo
.
Name
;
demodel
.
PlatformSource
=
userInfo
.
Source
;
demodel
.
Status
=
0
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
orderModule
.
SetGoodsCommentInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/OrderController.cs
View file @
aaafd0d6
...
...
@@ -1387,6 +1387,235 @@ namespace Mall.WebApi.Controllers.MallBase
}
#
endregion
#
region
订单评论
/// <summary>
/// 获取评论模板分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsCommentTemplatePageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_CommentTemplate_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_CommentTemplate_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetGoodsCommentTemplatePageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
Content
,
x
.
CommentGrade
,
CommentGradeName
=
x
.
CommentGrade
.
GetEnumName
(),
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 新增修改模板
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsCommentTemplateInfo
()
{
var
req
=
RequestParm
;
RB_Goods_CommentTemplate_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_CommentTemplate_Extend
>(
req
.
msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
demodel
.
Name
))
{
return
ApiResult
.
ParamIsNull
(
"请输入模板名称"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
return
ApiResult
.
ParamIsNull
(
"请输入模板内容"
);
}
if
(!
demodel
.
CommentGrade
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择模板类型"
);
}
demodel
.
TenantId
=
req
.
TenantId
;
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
Status
=
0
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
orderModule
.
SetGoodsCommentTemplateInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 删除评论模板
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
DelGoodsCommentTemplateInfo
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
TemplateId
=
parms
.
GetInt
(
"TemplateId"
,
0
);
if
(
TemplateId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
bool
flag
=
orderModule
.
DelGoodsCommentTemplateInfo
(
TemplateId
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsCommentPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Comment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Comment_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
orderModule
.
GetGoodsCommentPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
UserId
,
x
.
UserName
,
x
.
GoodsId
,
x
.
GoodsName
,
x
.
CoverImage
,
x
.
CommentGrade
,
CommentGradeName
=
x
.
CommentGrade
.
GetEnumName
(),
x
.
CommentImgList
,
x
.
Content
,
x
.
Reply
,
x
.
Is_Top
,
x
.
Is_Show
,
x
.
Is_Anonymity
,
x
.
PlatformSource
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 管理新增评论
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsCommentInfo
()
{
var
req
=
RequestParm
;
RB_Goods_Comment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Comment_Extend
>(
req
.
msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
demodel
.
UserName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入用户名称"
);
}
if
(!
demodel
.
CreateDate
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请输入评论时间"
);
}
if
((
demodel
.
GoodsId
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择商品"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
return
ApiResult
.
ParamIsNull
(
"请输入评价内容"
);
}
if
(!
demodel
.
CommentGrade
.
HasValue
)
{
return
ApiResult
.
ParamIsNull
(
"请选择评分"
);
}
demodel
.
CommentImage
=
""
;
if
(
demodel
.
CommentImgList
!=
null
&&
demodel
.
CommentImgList
.
Any
())
{
demodel
.
CommentImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CommentImgList
);
}
demodel
.
UserPhoto
??=
0
;
demodel
.
Is_Top
??=
2
;
demodel
.
Is_Show
??=
2
;
demodel
.
Is_Anonymity
??=
2
;
demodel
.
UserId
??=
0
;
demodel
.
Reply
??=
""
;
demodel
.
TenantId
=
req
.
TenantId
;
demodel
.
MallBaseId
=
req
.
MallBaseId
;
demodel
.
Status
=
0
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
bool
flag
=
orderModule
.
SetGoodsCommentInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 批量操作
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsCommentBatch
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
CommentIds
=
parms
.
GetStringValue
(
"CommentIds"
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
//1批量回复 2批量隐藏 3批量显示 4批量置顶 5取消置顶 6批量删除
string
Content
=
parms
.
GetStringValue
(
"Content"
);
if
(
string
.
IsNullOrEmpty
(
CommentIds
))
{
return
ApiResult
.
ParamIsNull
();
}
if
(
Type
==
1
)
{
if
(
string
.
IsNullOrEmpty
(
Content
))
{
return
ApiResult
.
ParamIsNull
(
"回复内容不能为空"
);
}
}
bool
flag
=
orderModule
.
SetGoodsCommentBatch
(
CommentIds
,
Type
,
Content
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
/// <summary>
/// 获取商品评价类型枚举
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetGoodsCommentTypeEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
GoodsCommentTypeEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
#
endregion
#
region
订单批量发货
/// <summary>
/// 批量发货
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetOrderBatchSendGoods
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
FilePath
=
parms
.
GetStringValue
(
"FilePath"
);
int
ExpressId
=
parms
.
GetInt
(
"ExpressId"
,
0
);
if
(
string
.
IsNullOrEmpty
(
FilePath
))
{
return
ApiResult
.
ParamIsNull
(
"文件路径不存在"
);
}
if
(
ExpressId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择快递id"
);
}
string
msg
=
orderModule
.
SetOrderBatchSendGoods
(
FilePath
,
ExpressId
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
msg
==
""
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
aaafd0d6
...
...
@@ -1471,24 +1471,47 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递分销佣金列表"
);
}
//普通设置 直接根据等级验证数量
if
(
DGradeList
.
Count
()
*
TotalNum
!=
demodel
.
DistributionCommissionList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
//转换
List
<
RB_Goods_DistributionCommission_Extend
>
Rlist
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
foreach
(
var
item
in
demodel
.
DistributionCommissionList
)
{
if
(
item
.
GradeCommissionList
==
null
||
!
item
.
GradeCommissionList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递分销佣金列表"
);
}
foreach
(
var
qitem
in
item
.
GradeCommissionList
)
{
Rlist
.
Add
(
new
RB_Goods_DistributionCommission_Extend
()
{
DistributorGrade
=
qitem
.
DistributorGrade
,
Id
=
0
,
SpecificationSort
=
item
.
SpecificationSort
,
OneCommission
=
qitem
.
OneCommission
,
TwoCommission
=
qitem
.
TwoCommission
,
ThreeCommission
=
qitem
.
ThreeCommission
});
}
}
if
(
Rlist
.
Any
())
{
demodel
.
DistributionCommissionList
=
Rlist
;
}
foreach
(
var
item
in
DGradeList
)
if
(
demodel
.
SeparateDistributionType
==
1
)
{
var
gradeList
=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
item
.
Id
).
ToList
();
if
(
!
gradeList
.
Any
())
//普通设置 直接根据等级验证数量
if
(
DGradeList
.
Count
()
!=
demodel
.
DistributionCommissionList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金
"
+
item
.
Name
+
"列表不存在
"
);
return
ApiResult
.
ParamIsNull
(
"分销佣金
列表数量不正确
"
);
}
if
(
gradeList
.
Count
()
!=
TotalNum
)
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"列表数量不正确"
);
}
foreach
(
var
qitem
in
KeyList
)
{
string
keys
=
qitem
[
1.
.];
var
gcmodel
=
gradeList
.
Where
(
x
=>
x
.
SpecificationSort
==
keys
).
FirstOrDefault
();
foreach
(
var
item
in
DGradeList
)
{
var
gradeList
=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
item
.
Id
).
ToList
();
if
(!
gradeList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"列表不存在"
);
}
if
(
gradeList
.
Count
()
!=
TotalNum
)
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"列表数量不正确"
);
}
var
gcmodel
=
gradeList
.
Where
(
x
=>
x
.
SpecificationSort
==
""
).
FirstOrDefault
();
if
(
gcmodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"分销Key有误"
);
...
...
@@ -1498,6 +1521,38 @@ namespace Mall.WebApi.Controllers.MallBase
gcmodel
.
ThreeCommission
??=
0
;
}
}
else
{
//普通设置 直接根据等级验证数量
if
(
DGradeList
.
Count
()
*
TotalNum
!=
demodel
.
DistributionCommissionList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
}
foreach
(
var
item
in
DGradeList
)
{
var
gradeList
=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
item
.
Id
).
ToList
();
if
(!
gradeList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"列表不存在"
);
}
if
(
gradeList
.
Count
()
!=
TotalNum
)
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"列表数量不正确"
);
}
foreach
(
var
qitem
in
KeyList
)
{
string
keys
=
qitem
[
1.
.];
var
gcmodel
=
gradeList
.
Where
(
x
=>
x
.
SpecificationSort
==
keys
).
FirstOrDefault
();
if
(
gcmodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"分销Key有误"
);
}
gcmodel
.
OneCommission
??=
0
;
gcmodel
.
TwoCommission
??=
0
;
gcmodel
.
ThreeCommission
??=
0
;
}
}
}
}
//会员价格
...
...
@@ -1515,6 +1570,30 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请传递会员价格列表"
);
}
//转换
List
<
RB_Goods_MemberPrice_Extend
>
Rlist
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
foreach
(
var
item
in
demodel
.
MemberPriceList
)
{
if
(
item
.
GradePriceList
==
null
||
!
item
.
GradePriceList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递会员价格列表"
);
}
foreach
(
var
qitem
in
item
.
GradePriceList
)
{
Rlist
.
Add
(
new
RB_Goods_MemberPrice_Extend
()
{
MemberGrade
=
qitem
.
MemberGrade
,
Id
=
0
,
SpecificationSort
=
item
.
SpecificationSort
,
MemberPrice
=
qitem
.
MemberPrice
});
}
}
if
(
Rlist
.
Any
())
{
demodel
.
MemberPriceList
=
Rlist
;
}
//普通设置 直接根据等级验证数量
if
(
MGradeList
.
Count
()
*
TotalNum
!=
demodel
.
MemberPriceList
.
Count
())
{
...
...
Mall.WebApi/Controllers/User/AppletLoginController.cs
View file @
aaafd0d6
...
...
@@ -123,6 +123,7 @@ namespace Mall.WebApi.Controllers.User
Name
=
demodel
.
Name
,
OpenId
=
demodel
.
OpenId
,
Photo
=
demodel
.
Photo
,
Source
=
demodel
.
Source
,
SecretKey
=
demodel
.
SecretKey
,
SuperiorId
=
demodel
.
SuperiorId
??
0
,
Token
=
token
...
...
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