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
4e9e81d0
Commit
4e9e81d0
authored
Apr 30, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品功能+订单表实体
parent
0e5110ee
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1898 additions
and
33 deletions
+1898
-33
RB_Goods_DistributionCommission.cs
Mall.Model/Entity/Product/RB_Goods_DistributionCommission.cs
+114
-0
RB_Goods_ExpressRelevance.cs
Mall.Model/Entity/Product/RB_Goods_ExpressRelevance.cs
+82
-0
RB_Goods_MemberPrice.cs
Mall.Model/Entity/Product/RB_Goods_MemberPrice.cs
+98
-0
RB_Goods_Order.cs
Mall.Model/Entity/Product/RB_Goods_Order.cs
+266
-0
RB_Goods_OrderDetail.cs
Mall.Model/Entity/Product/RB_Goods_OrderDetail.cs
+162
-0
RB_Goods_OrderExpress.cs
Mall.Model/Entity/Product/RB_Goods_OrderExpress.cs
+98
-0
RB_Goods_DistributionCommission_Extend.cs
.../Extend/Product/RB_Goods_DistributionCommission_Extend.cs
+21
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+20
-0
RB_Goods_MemberPrice_Extend.cs
Mall.Model/Extend/Product/RB_Goods_MemberPrice_Extend.cs
+21
-0
RB_Product_Service_Extend.cs
Mall.Model/Extend/Product/RB_Product_Service_Extend.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+494
-17
UserModule.cs
Mall.Module.User/UserModule.cs
+1
-1
RB_Goods_DistributionCommissionRepository.cs
...tory/Product/RB_Goods_DistributionCommissionRepository.cs
+44
-0
RB_Goods_MemberPriceRepository.cs
Mall.Repository/Product/RB_Goods_MemberPriceRepository.cs
+44
-0
RB_Product_ServiceRepository.cs
Mall.Repository/Product/RB_Product_ServiceRepository.cs
+3
-0
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+426
-15
No files found.
Mall.Model/Entity/Product/RB_Goods_DistributionCommission.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_DistributionCommission
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 商品id
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 规格排序组 逗号分隔每规格值
/// </summary>
public
string
SpecificationSort
{
get
;
set
;
}
/// <summary>
/// 分销商等级 0普通等级
/// </summary>
public
int
?
DistributorGrade
{
get
;
set
;
}
/// <summary>
/// 一级佣金
/// </summary>
public
decimal
?
OneCommission
{
get
;
set
;
}
/// <summary>
/// 二级佣金
/// </summary>
public
decimal
?
TwoCommission
{
get
;
set
;
}
/// <summary>
/// 三级佣金
/// </summary>
public
decimal
?
ThreeCommission
{
get
;
set
;
}
/// <summary>
/// Status
/// </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_ExpressRelevance.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_ExpressRelevance
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 订单id
/// </summary>
public
int
?
OrderId
{
get
;
set
;
}
/// <summary>
/// 订单明细id
/// </summary>
public
int
?
OrderDetailId
{
get
;
set
;
}
/// <summary>
/// 订单快递id
/// </summary>
public
int
?
OrderExpressId
{
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_MemberPrice.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_MemberPrice
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 商品id
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 规格排序组 逗号分隔每规格值
/// </summary>
public
string
SpecificationSort
{
get
;
set
;
}
/// <summary>
/// 分销商等级 0普通等级
/// </summary>
public
int
?
MemberGrade
{
get
;
set
;
}
/// <summary>
/// 会员价格
/// </summary>
public
decimal
?
MemberPrice
{
get
;
set
;
}
/// <summary>
/// Status
/// </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_Order.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_Order
{
/// <summary>
/// OrderId
/// </summary>
public
int
OrderId
{
get
;
set
;
}
/// <summary>
/// 订单号
/// </summary>
public
string
OrderNo
{
get
;
set
;
}
/// <summary>
/// 商户单号
/// </summary>
public
string
MerchantsNo
{
get
;
set
;
}
/// <summary>
/// 用户id
/// </summary>
public
int
?
UserId
{
get
;
set
;
}
/// <summary>
/// 订单来源(平台) 枚举
/// </summary>
public
int
?
OrderSource
{
get
;
set
;
}
/// <summary>
/// 订单类型 枚举
/// </summary>
public
int
?
OrderType
{
get
;
set
;
}
/// <summary>
/// 支付方式 枚举
/// </summary>
public
int
?
PaymentWay
{
get
;
set
;
}
/// <summary>
/// 应收金额
/// </summary>
public
decimal
?
PreferPrice
{
get
;
set
;
}
/// <summary>
/// 实收金额
/// </summary>
public
decimal
?
Income
{
get
;
set
;
}
/// <summary>
/// 运费
/// </summary>
public
decimal
?
FreightMoney
{
get
;
set
;
}
/// <summary>
/// 配送方式
/// </summary>
public
int
?
DeliveryMethod
{
get
;
set
;
}
/// <summary>
/// 手续费
/// </summary>
public
decimal
?
Fee
{
get
;
set
;
}
/// <summary>
/// 退款
/// </summary>
public
decimal
?
Refund
{
get
;
set
;
}
/// <summary>
/// 优惠金额
/// </summary>
public
decimal
?
CouponMoney
{
get
;
set
;
}
/// <summary>
/// 优惠卷ids
/// </summary>
public
string
CouponsIds
{
get
;
set
;
}
/// <summary>
/// 收件人
/// </summary>
public
string
Consignee
{
get
;
set
;
}
/// <summary>
/// 手机号码
/// </summary>
public
string
Mobile
{
get
;
set
;
}
/// <summary>
/// 国家
/// </summary>
public
int
?
Country
{
get
;
set
;
}
/// <summary>
/// 省
/// </summary>
public
int
?
Province
{
get
;
set
;
}
/// <summary>
/// 市
/// </summary>
public
int
?
City
{
get
;
set
;
}
/// <summary>
/// 区
/// </summary>
public
int
?
District
{
get
;
set
;
}
/// <summary>
/// 收货地址
/// </summary>
public
string
ShippingAddress
{
get
;
set
;
}
/// <summary>
/// 买家留言
/// </summary>
public
string
BuyerMessage
{
get
;
set
;
}
/// <summary>
/// 下单备注
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// 订单状态 枚举
/// </summary>
public
int
?
OrderStatus
{
get
;
set
;
}
/// <summary>
/// 回收 1是 2否
/// </summary>
public
int
?
Recycled
{
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_OrderDetail.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_OrderDetail
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 订单id
/// </summary>
public
int
?
OrderId
{
get
;
set
;
}
/// <summary>
/// 商品id
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 订单类型 枚举
/// </summary>
public
int
?
OrderType
{
get
;
set
;
}
/// <summary>
/// 商品名称
/// </summary>
public
string
GoodsName
{
get
;
set
;
}
/// <summary>
/// 封面图
/// </summary>
public
int
?
CoverImage
{
get
;
set
;
}
/// <summary>
/// 规格
/// </summary>
public
string
Specification
{
get
;
set
;
}
/// <summary>
/// 货号
/// </summary>
public
string
ProductCode
{
get
;
set
;
}
/// <summary>
/// 单价
/// </summary>
public
decimal
?
Unit_Price
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
?
Number
{
get
;
set
;
}
/// <summary>
/// 原价 (=单价*数量)
/// </summary>
public
decimal
?
Original_Price
{
get
;
set
;
}
/// <summary>
/// 最终价格
/// </summary>
public
decimal
?
Final_Price
{
get
;
set
;
}
/// <summary>
/// 折扣
/// </summary>
public
decimal
?
DiscountRate
{
get
;
set
;
}
/// <summary>
/// 是否商品单独会员价购买 1是 2否
/// </summary>
public
int
?
IsMemberPrice
{
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_OrderExpress.cs
0 → 100644
View file @
4e9e81d0
using
Mall.Common.AOP
;
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_OrderExpress
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 类型 1快递 2其他方式
/// </summary>
public
int
?
Type
{
get
;
set
;
}
/// <summary>
/// 快递id
/// </summary>
public
int
?
ExpressId
{
get
;
set
;
}
/// <summary>
/// 邮编
/// </summary>
public
string
PostCode
{
get
;
set
;
}
/// <summary>
/// 快递单号
/// </summary>
public
string
ExpressNumber
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remark
{
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_DistributionCommission_Extend.cs
0 → 100644
View file @
4e9e81d0
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_DistributionCommission_Extend
:
RB_Goods_DistributionCommission
{
/// <summary>
/// 商品ids
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
4e9e81d0
...
...
@@ -38,6 +38,18 @@ namespace Mall.Model.Extend.Product
/// </summary>
public
string
CoverImage
{
get
;
set
;
}
/// <summary>
/// 自定义分享图片
/// </summary>
public
string
CustomShareImagePath
{
get
;
set
;
}
/// <summary>
/// 运费名称
/// </summary>
public
string
FreightName
{
get
;
set
;
}
/// <summary>
/// 表单名称
/// </summary>
public
string
FormsName
{
get
;
set
;
}
/// <summary>
/// 轮播图列表
/// </summary>
public
List
<
RB_ImageCommonModel
>
CarouselImageList
{
get
;
set
;
}
...
...
@@ -61,6 +73,14 @@ namespace Mall.Model.Extend.Product
/// 规格价格列表
/// </summary>
public
List
<
RB_Goods_SpecificationPrice_Extend
>
SpecificationPriceList
{
get
;
set
;
}
/// <summary>
/// 分销佣金列表
/// </summary>
public
List
<
RB_Goods_DistributionCommission_Extend
>
DistributionCommissionList
{
get
;
set
;
}
/// <summary>
/// 会员价格列表
/// </summary>
public
List
<
RB_Goods_MemberPrice_Extend
>
MemberPriceList
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_MemberPrice_Extend.cs
0 → 100644
View file @
4e9e81d0
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_MemberPrice_Extend
:
RB_Goods_MemberPrice
{
/// <summary>
/// 商品ids
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Product_Service_Extend.cs
View file @
4e9e81d0
...
...
@@ -17,5 +17,9 @@ namespace Mall.Model.Extend.Product
/// 更新类型
/// </summary>
public
int
?
UpdateType
{
get
;
set
;
}
/// <summary>
/// ids
/// </summary>
public
string
ServiceIds
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
4e9e81d0
...
...
@@ -7,8 +7,11 @@ using Mall.Common.API;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
Mall.Model.Extend.User
;
using
Mall.Repository
;
using
Mall.Repository.BaseSetUp
;
using
Mall.Repository.Product
;
using
Mall.Repository.User
;
using
Newtonsoft.Json
;
namespace
Mall.Module.Product
...
...
@@ -74,6 +77,26 @@ namespace Mall.Module.Product
/// 商品规格价格
/// </summary>
private
readonly
RB_Goods_SpecificationPriceRepository
goods_SpecificationPriceRepository
=
new
RB_Goods_SpecificationPriceRepository
();
/// <summary>
/// 分销商等级
/// </summary>
private
readonly
RB_Distributor_GradeRepository
distributor_GradeRepository
=
new
RB_Distributor_GradeRepository
();
/// <summary>
/// 会员等级
/// </summary>
private
readonly
RB_Member_GradeRepository
member_GradeRepository
=
new
RB_Member_GradeRepository
();
/// <summary>
/// 商品分销佣金
/// </summary>
private
readonly
RB_Goods_DistributionCommissionRepository
goods_DistributionCommissionRepository
=
new
RB_Goods_DistributionCommissionRepository
();
/// <summary>
/// 商品会员价格
/// </summary>
private
readonly
RB_Goods_MemberPriceRepository
goods_MemberPriceRepository
=
new
RB_Goods_MemberPriceRepository
();
/// <summary>
/// 运费
/// </summary>
private
readonly
RB_Logistics_RulesRepository
logistics_RulesRepository
=
new
RB_Logistics_RulesRepository
();
#
region
素材管理
...
...
@@ -700,10 +723,12 @@ namespace Mall.Module.Product
public
RB_Product_Category_Extend
GetProductCategoryInfo
(
int
categoryId
)
{
var
model
=
product_CategoryRepository
.
GetEntity
(
categoryId
).
RefMapperTo
<
RB_Product_Category_Extend
>();
List
<
int
>
ImgIds
=
new
List
<
int
>();
ImgIds
.
Add
(
model
.
Icon
??
0
);
ImgIds
.
Add
(
model
.
BigIcon
??
0
);
ImgIds
.
Add
(
model
.
AdvertisingImage
??
0
);
List
<
int
>
ImgIds
=
new
List
<
int
>
{
model
.
Icon
??
0
,
model
.
BigIcon
??
0
,
model
.
AdvertisingImage
??
0
};
List
<
RB_Material_Info_Extend
>
mlist
=
new
List
<
RB_Material_Info_Extend
>();
if
(
ImgIds
.
Any
())
{
...
...
@@ -1102,12 +1127,50 @@ namespace Mall.Module.Product
return
new
RB_Product_Recommend_Extend
();
}
model
.
OrderProductList
=
new
List
<
RB_ProductRecommendModel
>();
if
(
model
.
IsOrderRecommend
==
1
)
{
if
(
model
.
IsOrderRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
model
.
OrderProductIds
)
)
{
//查询商品
var
glist
=
goodsRepository
.
GetList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
model
.
OrderProductIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
foreach
(
var
item
in
glist
)
{
//轮播图
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
material_InfoRepository
.
GetEntity
(
CarouselIdList
[
0
])?.
Path
??
""
;
}
}
foreach
(
var
item
in
glist
)
{
model
.
OrderProductList
.
Add
(
new
RB_ProductRecommendModel
()
{
Id
=
item
.
Id
,
Image
=
item
.
CoverImage
,
Name
=
item
.
Name
});
}
}
model
.
CommentProductList
=
new
List
<
RB_ProductRecommendModel
>();
if
(
model
.
IsCommentRecommend
==
1
)
{
if
(
model
.
IsCommentRecommend
==
1
&&
!
string
.
IsNullOrEmpty
(
model
.
CommentProductIds
))
{
var
glist
=
goodsRepository
.
GetList
(
new
RB_Goods_Extend
()
{
GoodsIds
=
model
.
CommentProductIds
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
});
foreach
(
var
item
in
glist
)
{
//轮播图
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
material_InfoRepository
.
GetEntity
(
CarouselIdList
[
0
])?.
Path
??
""
;
}
}
foreach
(
var
item
in
glist
)
{
model
.
CommentProductList
.
Add
(
new
RB_ProductRecommendModel
()
{
Id
=
item
.
Id
,
Image
=
item
.
CoverImage
,
Name
=
item
.
Name
});
}
}
return
model
;
}
...
...
@@ -1123,14 +1186,14 @@ namespace Mall.Module.Product
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Product_Recommend
.
CommentProductIds
),
demodel
.
CommentProductIds
},
{
nameof
(
RB_Product_Recommend
.
CommentRecommentStatus
),
demodel
.
Comment
ProductId
s
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendNum
),
demodel
.
CommentProductIds
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendStatus
),
demodel
.
CommentProductId
s
},
{
nameof
(
RB_Product_Recommend
.
IsCommentRecommend
),
demodel
.
CommentProductIds
},
{
nameof
(
RB_Product_Recommend
.
IsOrderRecommend
),
demodel
.
CommentProductIds
},
{
nameof
(
RB_Product_Recommend
.
OrderCompleteStatus
),
demodel
.
CommentProductId
s
},
{
nameof
(
RB_Product_Recommend
.
OrderProductIds
),
demodel
.
Comment
ProductIds
},
{
nameof
(
RB_Product_Recommend
.
UpdateDate
),
demodel
.
CommentProductIds
}
{
nameof
(
RB_Product_Recommend
.
CommentRecommentStatus
),
demodel
.
Comment
RecommentStatu
s
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendNum
),
demodel
.
DetailRecommendNum
},
{
nameof
(
RB_Product_Recommend
.
DetailRecommendStatus
),
demodel
.
DetailRecommendStatu
s
},
{
nameof
(
RB_Product_Recommend
.
IsCommentRecommend
),
demodel
.
IsCommentRecommend
},
{
nameof
(
RB_Product_Recommend
.
IsOrderRecommend
),
demodel
.
IsOrderRecommend
},
{
nameof
(
RB_Product_Recommend
.
OrderCompleteStatus
),
demodel
.
OrderCompleteStatu
s
},
{
nameof
(
RB_Product_Recommend
.
OrderProductIds
),
demodel
.
Order
ProductIds
},
{
nameof
(
RB_Product_Recommend
.
UpdateDate
),
demodel
.
UpdateDate
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
...
...
@@ -1291,6 +1354,36 @@ namespace Mall.Module.Product
return
list
;
}
/// <summary>
/// 获取后台商品列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsList
(
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetList
(
demodel
);
if
(
list
.
Any
())
{
//查询分类
string
ids
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
clist
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsIds
=
ids
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
foreach
(
var
item
in
list
)
{
item
.
CategoryList
=
clist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
//轮播图
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
material_InfoRepository
.
GetEntity
(
CarouselIdList
[
0
])?.
Path
??
""
;
//轮播图
}
}
}
return
list
;
}
/// <summary>
/// 新增修改商品信息
/// </summary>
...
...
@@ -1588,8 +1681,111 @@ namespace Mall.Module.Product
#
endregion
//修改卡卷
//修改分销佣金
//修改会员价格
#
region
修改分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
//价格新增/更新
var
dclist
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
dclist
.
Count
()
!=
demodel
.
DistributionCommissionList
.
Count
()
||
dclist
.
Count
()
!=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
dclist
.
Select
(
y
=>
y
.
SpecificationSort
).
Contains
(
x
.
SpecificationSort
)).
Count
()
||
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
!=
demodel
.
DistributionCommissionList
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
||
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Count
()
!=
dclist
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
Where
(
x
=>
demodel
.
DistributionCommissionList
.
Select
(
y
=>
y
.
DistributorGrade
).
Distinct
().
Contains
(
x
)).
Count
())
{
goods_DistributionCommissionRepository
.
DeleteBatch
(
dclist
,
trans
);
foreach
(
var
item
in
demodel
.
DistributionCommissionList
)
{
goods_DistributionCommissionRepository
.
Insert
(
new
RB_Goods_DistributionCommission
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
demodel
.
Id
,
Id
=
0
,
DistributorGrade
=
item
.
DistributorGrade
,
OneCommission
=
item
.
OneCommission
,
ThreeCommission
=
item
.
ThreeCommission
,
TwoCommission
=
item
.
TwoCommission
,
MallBaseId
=
demodel
.
MallBaseId
,
SpecificationSort
=
item
.
SpecificationSort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
}
}
else
{
foreach
(
var
item
in
dclist
)
{
var
pupmodel
=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
&&
x
.
DistributorGrade
==
item
.
DistributorGrade
).
FirstOrDefault
();
if
(
item
.
OneCommission
!=
pupmodel
.
OneCommission
||
item
.
TwoCommission
!=
pupmodel
.
TwoCommission
||
item
.
ThreeCommission
!=
pupmodel
.
ThreeCommission
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_DistributionCommission
.
OneCommission
),
pupmodel
.
OneCommission
},
{
nameof
(
RB_Goods_DistributionCommission
.
TwoCommission
),
pupmodel
.
TwoCommission
},
{
nameof
(
RB_Goods_DistributionCommission
.
ThreeCommission
),
pupmodel
.
ThreeCommission
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_DistributionCommission
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_DistributionCommissionRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
}
}
}
}
#
endregion
#
region
修改会员价格
if
(
demodel
.
EnjoyMember
==
1
&&
demodel
.
SeparateSetMember
==
1
)
{
var
mplist
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsId
=
demodel
.
Id
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
if
(
mplist
.
Count
()
!=
demodel
.
MemberPriceList
.
Count
()
||
mplist
.
Count
()
!=
demodel
.
MemberPriceList
.
Where
(
x
=>
mplist
.
Select
(
y
=>
y
.
SpecificationSort
).
Contains
(
x
.
SpecificationSort
)).
Count
()
||
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
!=
demodel
.
MemberPriceList
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
||
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Count
()
!=
mplist
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
Where
(
x
=>
demodel
.
MemberPriceList
.
Select
(
y
=>
y
.
MemberGrade
).
Distinct
().
Contains
(
x
)).
Count
())
{
goods_MemberPriceRepository
.
DeleteBatch
(
mplist
,
trans
);
foreach
(
var
item
in
demodel
.
MemberPriceList
)
{
goods_MemberPriceRepository
.
Insert
(
new
RB_Goods_MemberPrice
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
demodel
.
Id
,
Id
=
0
,
MemberGrade
=
item
.
MemberGrade
,
MemberPrice
=
item
.
MemberPrice
,
MallBaseId
=
demodel
.
MallBaseId
,
SpecificationSort
=
item
.
SpecificationSort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
}
}
else
{
foreach
(
var
item
in
mplist
)
{
var
pupmodel
=
demodel
.
MemberPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
item
.
SpecificationSort
&&
x
.
MemberGrade
==
item
.
MemberGrade
).
FirstOrDefault
();
if
(
item
.
MemberPrice
!=
pupmodel
.
MemberPrice
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods_MemberPrice
.
MemberPrice
),
pupmodel
.
MemberPrice
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods_MemberPrice
.
Id
),
FiledValue
=
item
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goods_MemberPriceRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
}
}
}
}
#
endregion
}
}
else
{
...
...
@@ -1678,7 +1874,45 @@ namespace Mall.Module.Product
}
//插入卡卷
//插入分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
foreach
(
var
item
in
demodel
.
DistributionCommissionList
)
{
goods_DistributionCommissionRepository
.
Insert
(
new
RB_Goods_DistributionCommission
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
Id
,
Id
=
0
,
DistributorGrade
=
item
.
DistributorGrade
,
OneCommission
=
item
.
OneCommission
,
ThreeCommission
=
item
.
ThreeCommission
,
TwoCommission
=
item
.
TwoCommission
,
MallBaseId
=
demodel
.
MallBaseId
,
SpecificationSort
=
item
.
SpecificationSort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
}
}
//插入会员价格
if
(
demodel
.
EnjoyMember
==
1
&&
demodel
.
SeparateSetMember
==
1
)
{
foreach
(
var
item
in
demodel
.
MemberPriceList
)
{
goods_MemberPriceRepository
.
Insert
(
new
RB_Goods_MemberPrice
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
Id
,
Id
=
0
,
MemberGrade
=
item
.
MemberGrade
,
MemberPrice
=
item
.
MemberPrice
,
MallBaseId
=
demodel
.
MallBaseId
,
SpecificationSort
=
item
.
SpecificationSort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
},
trans
);
}
}
}
}
goodsRepository
.
DBSession
.
Commit
();
...
...
@@ -1692,6 +1926,104 @@ namespace Mall.Module.Product
}
}
/// <summary>
/// 获取商品详情
/// </summary>
/// <param name="goodsId"></param>
/// <returns></returns>
public
RB_Goods_Extend
GetProductGoodsInfo
(
int
goodsId
,
int
TenantId
,
int
MallBaseId
)
{
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
){
return
null
;
}
model
.
CategoryList
=
goods_CategoryRepository
.
GetList
(
new
RB_Goods_Category_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
model
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
model
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
if
(
model
.
IsCustomSpecification
==
1
)
{
model
.
SpecificationList
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
model
.
SpecificationList
.
Any
())
{
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
if
(
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Any
())
{
string
imgIds
=
string
.
Join
(
","
,
svlist
.
Where
(
x
=>
x
.
Image
>
0
).
Select
(
x
=>
x
.
Image
).
Distinct
());
var
mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
MaterialIds
=
imgIds
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
svlist
.
Where
(
x
=>
x
.
Image
>
0
))
{
item
.
ImagePath
=
mlist
.
Where
(
x
=>
x
.
Id
==
item
.
Image
).
FirstOrDefault
()?.
Path
??
""
;
}
}
foreach
(
var
item
in
model
.
SpecificationList
)
{
item
.
SpecificationValueList
=
svlist
.
Where
(
x
=>
x
.
SpecificationId
==
item
.
Id
).
ToList
();
}
}
model
.
SpecificationPriceList
=
goods_SpecificationPriceRepository
.
GetList
(
new
RB_Goods_SpecificationPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
model
.
AreaList
=
new
List
<
RB_Goods_Area_Extend
>();
if
(
model
.
IsAreaBuy
==
1
)
{
model
.
AreaList
=
goods_AreaRepository
.
GetList
(
new
RB_Goods_Area_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
model
.
DistributionCommissionList
=
new
List
<
RB_Goods_DistributionCommission_Extend
>();
if
(
model
.
SeparateDistribution
==
1
)
{
model
.
DistributionCommissionList
=
goods_DistributionCommissionRepository
.
GetList
(
new
RB_Goods_DistributionCommission_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
model
.
MemberPriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>();
if
(
model
.
EnjoyMember
==
1
&&
model
.
SeparateSetMember
==
1
){
model
.
MemberPriceList
=
goods_MemberPriceRepository
.
GetList
(
new
RB_Goods_MemberPrice_Extend
()
{
GoodsId
=
goodsId
,
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
}
model
.
CarouselImageList
=
new
List
<
RB_ImageCommonModel
>();
if
(!
string
.
IsNullOrEmpty
(
model
.
CarouselImage
)
&&
model
.
CarouselImage
!=
"[]"
)
{
List
<
int
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
model
.
CarouselImage
);
//轮播图
var
mlist
=
material_InfoRepository
.
GetList
(
new
RB_Material_Info_Extend
()
{
MaterialIds
=
string
.
Join
(
","
,
CarouselIdList
),
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
CarouselIdList
)
{
var
cmodel
=
mlist
.
Where
(
x
=>
x
.
Id
==
item
).
FirstOrDefault
();
model
.
CarouselImageList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
item
,
Name
=
cmodel
?.
Name
??
""
,
Path
=
cmodel
?.
Path
??
""
});
}
}
if
(
model
.
CustomShareImage
>
0
)
{
model
.
CustomShareImagePath
=
material_InfoRepository
.
GetEntity
(
model
.
CustomShareImage
)?.
Path
??
""
;
}
//服务列表
model
.
ServiceList
=
new
List
<
RB_ImageCommonModel
>();
if
(
model
.
IsDefaultService
==
2
)
{
if
(!
string
.
IsNullOrEmpty
(
model
.
GoodsService
)
&&
model
.
GoodsService
!=
"[]"
)
{
List
<
int
>
ServiceIds
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
model
.
GoodsService
);
var
slist
=
product_ServiceRepository
.
GetList
(
new
RB_Product_Service_Extend
()
{
ServiceIds
=
string
.
Join
(
","
,
ServiceIds
),
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
});
foreach
(
var
item
in
slist
)
{
model
.
ServiceList
.
Add
(
new
RB_ImageCommonModel
()
{
Id
=
item
.
Id
,
Name
=
item
.
Name
});
}
}
}
//运费
if
(
model
.
FreightId
>
0
)
{
model
.
FreightName
=
logistics_RulesRepository
.
GetEntity
(
model
.
FreightId
)?.
RulesName
??
""
;
}
else
{
model
.
FreightName
=
"默认运费"
;
}
//表单
if
(
model
.
FormsId
>
0
)
{
model
.
FormsName
=
"未建表"
;
}
else
{
model
.
FormsName
=
"默认表单"
;
}
return
model
;
}
/// <summary>
/// 快速修改
/// </summary>
...
...
@@ -1750,6 +2082,129 @@ namespace Mall.Module.Product
return
goodsRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 快速修改
/// </summary>
/// <param name="goodsIds"></param>
/// <param name="type"></param>
/// <param name="sort"></param>
/// <param name="goodsName"></param>
/// <param name="freightId"></param>
/// <param name="limitBuyGoodsNum"></param>
/// <param name="limitBuyOrderNum"></param>
/// <param name="integralPresent"></param>
/// <param name="integralPresentType"></param>
/// <param name="pointsDeduction"></param>
/// <param name="pointsDeductionType"></param>
/// <param name="isMultipleDeduction"></param>
/// <param name="isQuickBuy"></param>
/// <param name="isGoodsNegotiable"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
bool
SetProductGoodsQuickUpdate
(
string
goodsIds
,
int
type
,
int
sort
,
string
goodsName
,
int
freightId
,
int
limitBuyGoodsNum
,
int
limitBuyOrderNum
,
int
integralPresent
,
int
integralPresentType
,
decimal
pointsDeduction
,
int
pointsDeductionType
,
int
isMultipleDeduction
,
int
isQuickBuy
,
int
isGoodsNegotiable
,
int
tenantId
,
int
mallBaseId
)
{
Dictionary
<
string
,
object
>
keyValues
;
if
(
type
==
1
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
Sort
),
sort
}
};
}
//排序
else
if
(
type
==
2
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
Name
),
goodsName
}
};
}
//商品名称
else
if
(
type
==
3
)
{
var
model
=
goodsRepository
.
GetEntity
(
Convert
.
ToInt32
(
goodsIds
));
if
(
model
==
null
)
{
return
false
;
}
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
IsQuickBuy
),
model
.
IsQuickBuy
==
1
?
2
:
1
}
};
}
//单个快速购买
else
if
(
type
==
4
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
GoodsStatus
),
1
}
};
}
//上架
else
if
(
type
==
5
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
GoodsStatus
),
2
}
};
}
//下架
else
if
(
type
==
6
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
Status
),
1
}
};
}
//删除
else
if
(
type
==
7
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
FreightId
),
freightId
}
};
}
//运费
else
if
(
type
==
8
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
LimitBuyGoodsNum
),
limitBuyGoodsNum
},
{
nameof
(
RB_Goods
.
LimitBuyOrderNum
),
limitBuyOrderNum
},
};
}
//限购
else
if
(
type
==
9
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
IntegralPresent
),
integralPresent
},
{
nameof
(
RB_Goods
.
IntegralPresentType
),
integralPresentType
},
{
nameof
(
RB_Goods
.
PointsDeduction
),
pointsDeduction
},
{
nameof
(
RB_Goods
.
PointsDeductionType
),
pointsDeductionType
},
{
nameof
(
RB_Goods
.
IsMultipleDeduction
),
isMultipleDeduction
},
};
}
//积分
else
if
(
type
==
10
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
IsQuickBuy
),
isQuickBuy
}
};
}
//批量快速购买
else
if
(
type
==
11
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
IsGoodsNegotiable
),
isGoodsNegotiable
}
};
}
//面议
else
{
return
false
;
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods
.
Id
),
FiledValue
=
goodsIds
,
OperatorEnum
=
OperatorEnum
.
IN
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods
.
TenantId
),
FiledValue
=
tenantId
,
OperatorEnum
=
OperatorEnum
.
Equal
},
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods
.
MallBaseId
),
FiledValue
=
mallBaseId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
goodsRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 删除商品
/// </summary>
...
...
@@ -1783,6 +2238,28 @@ namespace Mall.Module.Product
return
goodsRepository
.
Update
(
keyValues
,
wheres
);
}
/// <summary>
/// 获取会员等级列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Member_Grade_Extend
>
GetMemberGradeList
(
RB_Member_Grade_Extend
dmodel
)
{
var
list
=
member_GradeRepository
.
GetList
(
dmodel
);
return
list
;
}
/// <summary>
/// 获取分销等级列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Distributor_Grade_Extend
>
GetDistributorGradeList
(
RB_Distributor_Grade_Extend
demodel
)
{
var
list
=
distributor_GradeRepository
.
GetList
(
demodel
);
return
list
;
}
#
endregion
}
}
Mall.Module.User/UserModule.cs
View file @
4e9e81d0
...
...
@@ -448,7 +448,7 @@ namespace Mall.Module.User
public
bool
SetMemberIntegralInfo
(
RB_Member_Integral_Extend
demodel
)
{
var
umodel
=
member_UserRepository
.
GetEntity
(
demodel
.
UserId
);
int
Integral
=
0
;
int
Integral
;
if
((
int
)
demodel
.
Type
==
1
)
{
Integral
=
(
umodel
.
Integral
??
0
)
+
(
demodel
.
Integral
??
0
);
...
...
Mall.Repository/Product/RB_Goods_DistributionCommissionRepository.cs
0 → 100644
View file @
4e9e81d0
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品关联分销佣金仓储层
/// </summary>
public
class
RB_Goods_DistributionCommissionRepository
:
RepositoryBase
<
RB_Goods_DistributionCommission
>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Goods_DistributionCommission_Extend
>
GetList
(
RB_Goods_DistributionCommission_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Goods_DistributionCommission
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_DistributionCommission
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_SpecificationPrice
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_DistributionCommission
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_DistributionCommission
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_DistributionCommission
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from RB_Goods_DistributionCommission where
{
where
}
order by Id desc"
;
return
Get
<
RB_Goods_DistributionCommission_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Goods_MemberPriceRepository.cs
0 → 100644
View file @
4e9e81d0
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Extend.Product
;
using
System.Linq
;
namespace
Mall.Repository.Product
{
/// <summary>
/// 商品关联会员价格仓储层
/// </summary>
public
class
RB_Goods_MemberPriceRepository
:
RepositoryBase
<
RB_Goods_MemberPrice
>
{
/// <summary>
/// 列表
/// </summary>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Goods_MemberPrice_Extend
>
GetList
(
RB_Goods_MemberPrice_Extend
dmodel
)
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Goods_MemberPrice
.
Status
)}
=0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_MemberPrice
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_MemberPrice
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_MemberPrice
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_MemberPrice
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_MemberPrice
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
string
sql
=
$@"select * from RB_Goods_MemberPrice where
{
where
}
order by Id desc"
;
return
Get
<
RB_Goods_MemberPrice_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Product_ServiceRepository.cs
View file @
4e9e81d0
...
...
@@ -64,6 +64,9 @@ namespace Mall.Repository.Product
{
where
+=
$@" and
{
nameof
(
RB_Product_Service
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
ServiceIds
))
{
where
+=
$@" and
{
nameof
(
RB_Product_Service
.
Id
)}
in(
{
dmodel
.
ServiceIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Product_Service
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
4e9e81d0
...
...
@@ -1070,6 +1070,240 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 商品信息下载
/// </summary>
[
HttpPost
]
public
FileContentResult
GetProductGoodsListToExcel
()
{
var
parms
=
RequestParm
;
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
string
ExcelName
=
"商品列表"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"序号"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"商品名称"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"原价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"成本价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"商品详情"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"商品轮播图"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"商品视频"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"单位"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"售价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"商品库存"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"虚拟销量"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"购物数量限制"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"单品满件包邮"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"单品满额包邮"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"赠送积分"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"赠送积分类型"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"可抵扣积分"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"可抵扣积分类型"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"允许多件累计折扣"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"自定义分享图片"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"自定义分享标题"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"排序"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"限购订单"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"是否快速购买"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"是否面议"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
}
};
slist
.
Add
(
header
);
try
{
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetProductGoodsList
(
demodel
);
#
region
组装数据
int
Num
=
0
;
foreach
(
var
item
in
list
)
{
Num
++;
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
Num
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
Name
){
},
new
ExcelColumn
(
value
:(
item
.
OriginalPrice
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
CostPrice
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
GoodsDetails
){
},
new
ExcelColumn
(
value
:
item
.
CarouselImage
){
},
new
ExcelColumn
(
value
:
item
.
VideoAddress
){
},
new
ExcelColumn
(
value
:
item
.
Unit
){
},
new
ExcelColumn
(
value
:(
item
.
SellingPrice
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
InventoryNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
SalesNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
LimitBuyGoodsNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
FullNumPinkage
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
FullMoneyPinkage
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
IntegralPresent
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
IntegralPresentType
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
PointsDeduction
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
PointsDeductionType
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
IsMultipleDeduction
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
CustomShareImage
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
CustomShareTitles
){
},
new
ExcelColumn
(
value
:(
item
.
Sort
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
LimitBuyOrderNum
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
IsQuickBuy
??
0
).
ToString
()){
},
new
ExcelColumn
(
value
:(
item
.
IsGoodsNegotiable
??
0
).
ToString
()){
},
}
};
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetFileFromWebApi_requestData: {0}"
,
JsonHelper
.
Serialize
(
RequestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
/// <summary>
/// 获取商品列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductGoodsDialogList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
productModule
.
GetProductGoodsPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
CoverImage
,
CategoryList
=
x
.
CategoryList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
CategoryName
})
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
/// <summary>
/// 获取商品详情
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductGoodsInfo
()
{
var
req
=
RequestParm
;
JObject
prams
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
prams
.
GetInt
(
"GoodsId"
,
0
);
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
();
}
var
model
=
productModule
.
GetProductGoodsInfo
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
return
ApiResult
.
Success
(
""
,
new
{
model
.
Id
,
model
.
Name
,
model
.
CarouselImage
,
model
.
VideoAddress
,
model
.
CustomShareTitles
,
model
.
CustomShareImage
,
model
.
CustomShareImagePath
,
model
.
GoodsStatus
,
model
.
InventoryNum
,
model
.
DefaultSpecificationName
,
model
.
IsCustomSpecification
,
model
.
Sort
,
model
.
SellingPrice
,
model
.
OriginalPrice
,
model
.
Unit
,
model
.
CostPrice
,
model
.
IsGoodsNegotiable
,
model
.
SalesNum
,
model
.
GoodsNumbers
,
model
.
GoodsWeight
,
model
.
IsDefaultService
,
model
.
GoodsService
,
model
.
FreightId
,
model
.
FreightName
,
model
.
FormsId
,
model
.
FormsName
,
model
.
LimitBuyGoodsNum
,
model
.
LimitBuyOrderNum
,
model
.
FullNumPinkage
,
model
.
FullMoneyPinkage
,
model
.
IsAreaBuy
,
model
.
IntegralPresent
,
model
.
IntegralPresentType
,
model
.
PointsDeduction
,
model
.
PointsDeductionType
,
model
.
IsMultipleDeduction
,
model
.
GoodsDetails
,
model
.
SeparateDistribution
,
model
.
SeparateDistributionType
,
model
.
SeparateDistributionMoneyType
,
model
.
EnjoyMember
,
model
.
SeparateSetMember
,
model
.
IsQuickBuy
,
CategoryList
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
CategoryId
,
x
.
CategoryName
}),
SpecificationList
=
model
.
SpecificationList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
EnabledImage
,
x
.
Name
,
x
.
Sort
,
SpecificationValueList
=
x
.
SpecificationValueList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
Image
,
y
.
ImagePath
,
y
.
Name
,
y
.
Sort
})
}),
SpecificationPriceList
=
model
.
SpecificationPriceList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
GoodsNumbers
,
x
.
GoodsWeight
,
x
.
InventoryNum
,
x
.
SellingPrice
,
x
.
SpecificationSort
}),
AreaList
=
model
.
AreaList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
AreaId
,
x
.
AreaName
,
x
.
AreaType
}),
DistributionCommissionList
=
model
.
DistributionCommissionList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
DistributorGrade
,
x
.
OneCommission
,
x
.
SpecificationSort
,
x
.
ThreeCommission
,
x
.
TwoCommission
}),
MemberPriceList
=
model
.
MemberPriceList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
MemberGrade
,
x
.
MemberPrice
,
x
.
SpecificationSort
}),
model
.
CarouselImageList
,
model
.
ServiceList
});
}
/// <summary>
/// 新增修改商品信息
/// </summary>
...
...
@@ -1084,8 +1318,20 @@ namespace Mall.WebApi.Controllers.MallBase
if
(
demodel
.
CarouselImageList
==
null
||
!
demodel
.
CarouselImageList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请添加商品轮播图"
);
}
demodel
.
CarouselImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CarouselImageList
.
Select
(
x
=>
x
.
Id
));
if
((
demodel
.
SellingPrice
??
0
)
<=
0
){
return
ApiResult
.
ParamIsNull
(
"请输入售价"
);
}
if
((
demodel
.
OriginalPrice
??
0
)
<=
0
){
return
ApiResult
.
ParamIsNull
(
"请输入原价"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Unit
)){
return
ApiResult
.
ParamIsNull
(
"请输入单位"
);
}
demodel
.
IsCustomSpecification
??=
1
;
demodel
.
InventoryNum
??=
0
;
List
<
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
>
DGradeList
=
null
;
List
<
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
>
MGradeList
=
null
;
if
(
demodel
.
IsCustomSpecification
==
1
)
{
if
(
demodel
.
SpecificationList
==
null
||
!
demodel
.
SpecificationList
.
Any
())
{
...
...
@@ -1129,7 +1375,7 @@ namespace Mall.WebApi.Controllers.MallBase
//组装所有keys
foreach
(
var
item
in
demodel
.
SpecificationList
)
{
int
LBBJNum
=
TotalNum
/
item
.
SpecificationValueList
.
Count
()
/
MGBJNum
;
int
KeyIndex
=
1
;
int
KeyIndex
=
0
;
for
(
var
i
=
1
;
i
<=
LBBJNum
;
i
++)
{
foreach
(
var
qitem
in
item
.
SpecificationValueList
)
...
...
@@ -1143,7 +1389,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
//验证所有keys
foreach
(
var
item
in
KeyList
)
{
string
keys
=
item
.
Substring
(
1
,
item
.
Length
);
string
keys
=
item
.
Substring
(
1
,
item
.
Length
-
1
);
var
pricemodel
=
demodel
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SpecificationSort
==
keys
).
FirstOrDefault
();
if
(
pricemodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"规格价格Key有误"
);
...
...
@@ -1160,17 +1406,98 @@ namespace Mall.WebApi.Controllers.MallBase
pricemodel
.
GoodsWeight
??=
0
;
demodel
.
InventoryNum
+=
(
pricemodel
.
InventoryNum
??
0
);
}
}
if
((
demodel
.
SellingPrice
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入售价"
);
}
if
((
demodel
.
OriginalPrice
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入原价"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Unit
))
{
return
ApiResult
.
ParamIsNull
(
"请输入单位"
);
//分销佣金
if
(
demodel
.
SeparateDistribution
==
1
)
{
if
(
DGradeList
==
null
)
{
DGradeList
=
productModule
.
GetDistributorGradeList
(
new
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
DGradeList
.
Add
(
new
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
()
{
Grade
=
0
,
Name
=
"默认等级"
,
Id
=
0
});
}
if
(
demodel
.
DistributionCommissionList
==
null
||
!
demodel
.
DistributionCommissionList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递分销佣金列表"
);
}
//普通设置 直接根据等级验证数量
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
.
Substring
(
1
,
qitem
.
Length
-
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
;
}
}
}
//会员价格
if
(
demodel
.
EnjoyMember
==
1
&&
demodel
.
SeparateSetMember
==
1
)
{
// 获取所有会员等级
if
(
MGradeList
==
null
)
{
MGradeList
=
productModule
.
GetMemberGradeList
(
new
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
if
(!
MGradeList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"单独设置会员价需先添加会员等级"
);
}
if
(
demodel
.
MemberPriceList
==
null
||
!
demodel
.
MemberPriceList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递会员价格列表"
);
}
//普通设置 直接根据等级验证数量
if
(
MGradeList
.
Count
()
*
TotalNum
!=
demodel
.
MemberPriceList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
}
foreach
(
var
item
in
MGradeList
)
{
var
gradeList
=
demodel
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
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
.
Substring
(
1
,
qitem
.
Length
-
1
);
var
gcmodel
=
gradeList
.
Where
(
x
=>
x
.
SpecificationSort
==
keys
).
FirstOrDefault
();
if
(
gcmodel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"会员价格Key有误"
);
}
gcmodel
.
MemberPrice
??=
0
;
}
}
}
}
#
region
默认值
demodel
.
VideoAddress
??=
""
;
demodel
.
CustomShareTitles
??=
""
;
demodel
.
CustomShareImage
??=
0
;
...
...
@@ -1218,11 +1545,83 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
#
endregion
demodel
.
SeparateDistribution
??=
2
;
demodel
.
SeparateDistributionType
??=
1
;
if
(
demodel
.
SeparateDistribution
==
1
)
{
//获取所有分销商等级
if
(
DGradeList
==
null
)
{
DGradeList
=
productModule
.
GetDistributorGradeList
(
new
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
DGradeList
.
Add
(
new
Model
.
Extend
.
User
.
RB_Distributor_Grade_Extend
()
{
Grade
=
0
,
Name
=
"默认等级"
,
Id
=
0
});
}
if
(
demodel
.
SeparateDistributionType
==
1
)
{
if
(
demodel
.
DistributionCommissionList
==
null
||
!
demodel
.
DistributionCommissionList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递分销佣金列表"
);
}
//普通设置 直接根据等级验证数量
if
(
DGradeList
.
Count
()
!=
demodel
.
DistributionCommissionList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"分销佣金列表数量不正确"
);
}
foreach
(
var
item
in
DGradeList
)
{
var
defaultModel
=
demodel
.
DistributionCommissionList
.
Where
(
x
=>
x
.
DistributorGrade
==
item
.
Id
).
FirstOrDefault
();
if
(
defaultModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"分销佣金"
+
item
.
Name
+
"不存在"
);
}
defaultModel
.
OneCommission
??=
0
;
defaultModel
.
TwoCommission
??=
0
;
defaultModel
.
ThreeCommission
??=
0
;
defaultModel
.
SpecificationSort
=
""
;
}
}
else
{
if
(
demodel
.
IsCustomSpecification
!=
1
)
{
return
ApiResult
.
ParamIsNull
(
"无法开启详细设置"
);
}
}
}
demodel
.
SeparateDistributionMoneyType
??=
1
;
demodel
.
EnjoyMember
??=
2
;
demodel
.
SeparateSetMember
??=
2
;
if
(
demodel
.
EnjoyMember
==
1
&&
demodel
.
SeparateSetMember
==
1
)
{
//获取所有会员等级
if
(
MGradeList
==
null
)
{
MGradeList
=
productModule
.
GetMemberGradeList
(
new
Model
.
Extend
.
User
.
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
}
if
(!
MGradeList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"单独设置会员价需先添加会员等级"
);
}
if
(
demodel
.
IsCustomSpecification
==
2
)
{
if
(
demodel
.
MemberPriceList
==
null
||
!
demodel
.
MemberPriceList
.
Any
())
{
return
ApiResult
.
ParamIsNull
(
"请传递会员价格列表"
);
}
if
(
MGradeList
.
Count
()
!=
demodel
.
MemberPriceList
.
Count
())
{
return
ApiResult
.
ParamIsNull
(
"会员价格列表数量不正确"
);
}
foreach
(
var
item
in
MGradeList
)
{
var
defaultModel
=
demodel
.
MemberPriceList
.
Where
(
x
=>
x
.
MemberGrade
==
item
.
Id
).
FirstOrDefault
();
if
(
defaultModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"会员价格"
+
item
.
Name
+
"不存在"
);
}
defaultModel
.
MemberPrice
??=
0
;
defaultModel
.
SpecificationSort
=
""
;
}
}
}
demodel
.
IsQuickBuy
??=
2
;
bool
flag
=
productModule
.
SetProductGoodsInfo
(
demodel
);
...
...
@@ -1243,11 +1642,22 @@ namespace Mall.WebApi.Controllers.MallBase
public
ApiResult
SetProductGoodsQuickUpdate
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
//1排序 2商品名称
3快速购买
string
GoodsIds
=
parms
.
GetStringValue
(
"GoodsIds"
);
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
//1排序 2商品名称
3快速购买 4上架 5下架 6删除 7运费 8限购 9积分 10快速购买 11面议
int
Sort
=
parms
.
GetInt
(
"Sort"
,
0
);
string
GoodsName
=
parms
.
GetStringValue
(
"GoodsName"
);
if
(
GoodsId
<=
0
)
int
FreightId
=
parms
.
GetInt
(
"FreightId"
,
0
);
//运费
int
LimitBuyGoodsNum
=
parms
.
GetInt
(
"LimitBuyGoodsNum"
,
0
);
//限制商品数量
int
LimitBuyOrderNum
=
parms
.
GetInt
(
"LimitBuyOrderNum"
,
0
);
//限制订单数量
int
IntegralPresent
=
parms
.
GetInt
(
"IntegralPresent"
,
0
);
//积分
int
IntegralPresentType
=
parms
.
GetInt
(
"IntegralPresentType"
,
1
);
//积分类型f
decimal
PointsDeduction
=
parms
.
GetDecimal
(
"PointsDeduction"
);
//积分抵扣
int
PointsDeductionType
=
parms
.
GetInt
(
"PointsDeductionType"
,
1
);
//抵扣类型
int
IsMultipleDeduction
=
parms
.
GetInt
(
"IsMultipleDeduction"
,
2
);
//是否多件抵扣
int
IsQuickBuy
=
parms
.
GetInt
(
"IsQuickBuy"
,
2
);
//快速购买
int
IsGoodsNegotiable
=
parms
.
GetInt
(
"IsGoodsNegotiable"
,
2
);
//商品面议
if
(
string
.
IsNullOrEmpty
(
GoodsIds
))
{
return
ApiResult
.
ParamIsNull
();
}
...
...
@@ -1257,7 +1667,8 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
bool
flag
=
productModule
.
SetProductGoodsQuickUpdate
(
GoodsId
,
Type
,
Sort
,
GoodsName
,
req
.
TenantId
,
req
.
MallBaseId
);
bool
flag
=
productModule
.
SetProductGoodsQuickUpdate
(
GoodsIds
,
Type
,
Sort
,
GoodsName
,
FreightId
,
LimitBuyGoodsNum
,
LimitBuyOrderNum
,
IntegralPresent
,
IntegralPresentType
,
PointsDeduction
,
PointsDeductionType
,
IsMultipleDeduction
,
IsQuickBuy
,
IsGoodsNegotiable
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
...
...
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