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
0a1d624e
Commit
0a1d624e
authored
Jun 22, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
d1be9825
8dcce85e
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
562 additions
and
16 deletions
+562
-16
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+20
-1
RB_Goods_Proxy.cs
Mall.Model/Entity/Product/RB_Goods_Proxy.cs
+98
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+8
-0
RB_Goods_Proxy_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Proxy_Extend.cs
+21
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+226
-4
UserModule.cs
Mall.Module.User/UserModule.cs
+27
-1
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+9
-0
RB_Goods_ProxyRepository.cs
Mall.Repository/Product/RB_Goods_ProxyRepository.cs
+58
-0
RB_Material_InfoRepository.cs
Mall.Repository/Product/RB_Material_InfoRepository.cs
+7
-9
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+84
-1
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+4
-0
No files found.
Mall.Model/Entity/Product/RB_Goods.cs
View file @
0a1d624e
...
@@ -387,6 +387,25 @@ namespace Mall.Model.Entity.Product
...
@@ -387,6 +387,25 @@ namespace Mall.Model.Entity.Product
/// 供应商id
/// 供应商id
/// </summary>
/// </summary>
public
int
SupplierId
{
get
;
set
;
}
public
int
SupplierId
{
get
;
set
;
}
/// <summary>
/// 商品是否可代理 1是 2否
/// </summary>
public
int
?
IsProxy
{
get
;
set
;
}
/// <summary>
/// 代理成本上浮类型 1百分比 2固定金额
/// </summary>
public
int
?
ProxyType
{
get
;
set
;
}
/// <summary>
/// 价格上涨
/// </summary>
public
decimal
?
ProxyRises
{
get
;
set
;
}
/// <summary>
/// 代理价格
/// </summary>
public
decimal
?
ProxyMoney
{
get
;
set
;
}
/// <summary>
/// 是否是采购商品 1是 2否
/// </summary>
public
int
?
IsProcurement
{
get
;
set
;
}
}
}
}
}
Mall.Model/Entity/Product/RB_Goods_Proxy.cs
0 → 100644
View file @
0a1d624e
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_Proxy
{
/// <summary>
/// Id
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 原商品id
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// 原商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 原小程序id
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 代理商品id
/// </summary>
public
int
?
ProxyGoodsId
{
get
;
set
;
}
/// <summary>
/// 代理商户
/// </summary>
public
int
ProxyTenantId
{
get
;
set
;
}
/// <summary>
/// 代理小程序id
/// </summary>
public
int
ProxyMallBaseId
{
get
;
set
;
}
/// <summary>
/// 删除状态 0正常
/// </summary>
public
int
?
Status
{
get
;
set
;
}
/// <summary>
/// 描述
/// </summary>
public
string
Remark
{
get
;
set
;
}
/// <summary>
/// CreateDate
/// </summary>
public
DateTime
?
CreateDate
{
get
;
set
;
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
0a1d624e
...
@@ -22,6 +22,14 @@ namespace Mall.Model.Extend.Product
...
@@ -22,6 +22,14 @@ namespace Mall.Model.Extend.Product
/// </summary>
/// </summary>
public
int
?
GoodsId
{
get
;
set
;
}
public
int
?
GoodsId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 采购商品id
/// </summary>
public
int
?
ProcurementGoodsId
{
get
;
set
;
}
/// <summary>
/// 其他商户
/// </summary>
public
int
?
NotTenantId
{
get
;
set
;
}
/// <summary>
/// 商品购买的数量
/// 商品购买的数量
/// </summary>
/// </summary>
public
int
?
GoodsBuyNum
{
get
;
set
;
}
public
int
?
GoodsBuyNum
{
get
;
set
;
}
...
...
Mall.Model/Extend/Product/RB_Goods_Proxy_Extend.cs
0 → 100644
View file @
0a1d624e
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_Proxy_Extend
:
RB_Goods_Proxy
{
/// <summary>
/// 商品ids
/// </summary>
public
string
GoodsIds
{
get
;
set
;
}
}
}
Mall.Module.Product/ProductModule.cs
View file @
0a1d624e
...
@@ -4,6 +4,7 @@ using System.Linq;
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Text
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
Mall.Common
;
using
Mall.Common
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.Product
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Entity.User
;
...
@@ -147,6 +148,13 @@ namespace Mall.Module.Product
...
@@ -147,6 +148,13 @@ namespace Mall.Module.Product
/// 商品分销
/// 商品分销
/// </summary>
/// </summary>
private
readonly
RB_MiniProgram_GoodPosterRepository
miniProgram_GoodPosterRepository
=
new
RB_MiniProgram_GoodPosterRepository
();
private
readonly
RB_MiniProgram_GoodPosterRepository
miniProgram_GoodPosterRepository
=
new
RB_MiniProgram_GoodPosterRepository
();
/// <summary>
/// 商品代理
/// </summary>
private
readonly
RB_Goods_ProxyRepository
goods_ProxyRepository
=
new
RB_Goods_ProxyRepository
();
#
region
小程序接口
#
region
小程序接口
...
@@ -3197,6 +3205,49 @@ namespace Mall.Module.Product
...
@@ -3197,6 +3205,49 @@ namespace Mall.Module.Product
return
list
;
return
list
;
}
}
/// <summary>
/// 获取后台商品代理分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetProductGoodsProxyPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
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
});
var
olist
=
goods_OrderRepository
.
GetGoodsOrderNum
(
ids
);
//查询商品是否已代理
var
ProxyList
=
goods_ProxyRepository
.
GetList
(
new
RB_Goods_Proxy_Extend
()
{
GoodsIds
=
ids
,
ProxyTenantId
=
demodel
.
TenantId
,
ProxyMallBaseId
=
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
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
CarouselIdList
[
0
];
}
item
.
GoodsBuyNum
=
olist
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
OrderNum
??
0
;
item
.
IsProcurement
=
2
;
item
.
ProcurementGoodsId
=
0
;
if
(
ProxyList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
Any
())
{
item
.
IsProcurement
=
1
;
item
.
ProcurementGoodsId
=
ProxyList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
FirstOrDefault
()?.
GoodsId
??
0
;
}
}
}
return
list
;
}
/// <summary>
/// <summary>
/// 获取后台商品列表
/// 获取后台商品列表
/// </summary>
/// </summary>
...
@@ -3299,6 +3350,23 @@ namespace Mall.Module.Product
...
@@ -3299,6 +3350,23 @@ namespace Mall.Module.Product
/// <returns></returns>
/// <returns></returns>
public
bool
SetProductGoodsInfo
(
RB_Goods_Extend
demodel
)
public
bool
SetProductGoodsInfo
(
RB_Goods_Extend
demodel
)
{
{
if
(
demodel
.
Id
>
0
)
{
var
goodsModel
=
goodsRepository
.
GetEntity
(
demodel
.
Id
);
if
(
goodsModel
==
null
)
{
return
false
;
}
if
(
goodsModel
.
IsProcurement
==
1
)
{
//是采购的商品
if
(
demodel
.
CostPrice
!=
goodsModel
.
CostPrice
)
{
return
false
;
}
//验证 规格
}
}
var
trans
=
goodsRepository
.
DbTransaction
;
var
trans
=
goodsRepository
.
DbTransaction
;
try
try
{
{
...
@@ -3343,9 +3411,14 @@ namespace Mall.Module.Product
...
@@ -3343,9 +3411,14 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods
.
SeparateDistribution
),
demodel
.
SeparateDistribution
},
{
nameof
(
RB_Goods
.
SeparateDistribution
),
demodel
.
SeparateDistribution
},
{
nameof
(
RB_Goods
.
SeparateDistributionType
),
demodel
.
SeparateDistributionType
},
{
nameof
(
RB_Goods
.
SeparateDistributionType
),
demodel
.
SeparateDistributionType
},
{
nameof
(
RB_Goods
.
SeparateDistributionMoneyType
),
demodel
.
SeparateDistributionMoneyType
},
{
nameof
(
RB_Goods
.
SeparateDistributionMoneyType
),
demodel
.
SeparateDistributionMoneyType
},
{
nameof
(
RB_Goods
.
EnjoyMember
),
demodel
.
EnjoyMember
},
{
nameof
(
RB_Goods
.
SeparateSetMember
),
demodel
.
SeparateSetMember
},
{
nameof
(
RB_Goods
.
SeparateSetMember
),
demodel
.
SeparateSetMember
},
{
nameof
(
RB_Goods
.
IsQuickBuy
),
demodel
.
IsQuickBuy
},
{
nameof
(
RB_Goods
.
IsQuickBuy
),
demodel
.
IsQuickBuy
},
{
nameof
(
RB_Goods
.
SupplierId
),
demodel
.
SupplierId
}
{
nameof
(
RB_Goods
.
SupplierId
),
demodel
.
SupplierId
},
{
nameof
(
RB_Goods
.
IsProxy
),
demodel
.
IsProxy
},
{
nameof
(
RB_Goods
.
ProxyType
),
demodel
.
ProxyType
},
{
nameof
(
RB_Goods
.
ProxyRises
),
demodel
.
ProxyRises
},
{
nameof
(
RB_Goods
.
ProxyMoney
),
demodel
.
ProxyMoney
},
};
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
new
WhereHelper
(){
...
@@ -3935,7 +4008,7 @@ namespace Mall.Module.Product
...
@@ -3935,7 +4008,7 @@ namespace Mall.Module.Product
Id
=
0
Id
=
0
});
});
string
zdgradeStr
=
string
.
Join
(
","
,
dgradeList
.
Select
(
x
=>
x
.
Id
).
OrderBy
(
x
=>
x
));
string
zdgradeStr
=
string
.
Join
(
","
,
dgradeList
.
Select
(
x
=>
x
.
Id
).
OrderBy
(
x
=>
x
));
string
ndgradeStr
=
string
.
Join
(
","
,
model
.
DistributionCommissionList
.
Select
(
x
=>
x
.
DistributorGrade
).
OrderBy
(
x
=>
x
));
string
ndgradeStr
=
string
.
Join
(
","
,
model
.
DistributionCommissionList
.
Select
(
x
=>
x
.
DistributorGrade
).
Distinct
().
OrderBy
(
x
=>
x
));
var
KeyList
=
model
.
DistributionCommissionList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
var
KeyList
=
model
.
DistributionCommissionList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
if
(
zdgradeStr
==
ndgradeStr
)
if
(
zdgradeStr
==
ndgradeStr
)
{
{
...
@@ -4045,7 +4118,7 @@ namespace Mall.Module.Product
...
@@ -4045,7 +4118,7 @@ namespace Mall.Module.Product
var
mgradeList
=
member_GradeRepository
.
GetList
(
new
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
1
,
MallBaseId
=
1
});
var
mgradeList
=
member_GradeRepository
.
GetList
(
new
RB_Member_Grade_Extend
()
{
Enabled
=
1
,
TenantId
=
1
,
MallBaseId
=
1
});
string
zdgradeStr
=
string
.
Join
(
","
,
mgradeList
.
Select
(
x
=>
x
.
Id
).
OrderBy
(
x
=>
x
));
string
zdgradeStr
=
string
.
Join
(
","
,
mgradeList
.
Select
(
x
=>
x
.
Id
).
OrderBy
(
x
=>
x
));
string
ndgradeStr
=
string
.
Join
(
","
,
model
.
MemberPriceList
.
Select
(
x
=>
x
.
MemberGrade
).
OrderBy
(
x
=>
x
));
string
ndgradeStr
=
string
.
Join
(
","
,
model
.
MemberPriceList
.
Select
(
x
=>
x
.
MemberGrade
).
Distinct
().
OrderBy
(
x
=>
x
));
if
(
zdgradeStr
==
ndgradeStr
)
if
(
zdgradeStr
==
ndgradeStr
)
{
{
var
KeyList
=
model
.
MemberPriceList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
var
KeyList
=
model
.
MemberPriceList
.
Select
(
x
=>
x
.
SpecificationSort
??
""
).
Distinct
().
ToList
();
...
@@ -4084,7 +4157,8 @@ namespace Mall.Module.Product
...
@@ -4084,7 +4157,8 @@ namespace Mall.Module.Product
foreach
(
var
qitem
in
KeyList
)
foreach
(
var
qitem
in
KeyList
)
{
{
var
treemodel
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
FirstOrDefault
();
var
treemodel
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
FirstOrDefault
();
treemodel
.
GradePriceList
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
ToList
();
//treemodel.GradePriceList = model.MemberPriceList.Where(x => (x.SpecificationSort ?? "") == qitem).ToList();
treemodel
.
GradePriceList
=
new
List
<
RB_Goods_MemberPrice_Extend
>()
{
};
var
gradePrice
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
ToList
();
var
gradePrice
=
model
.
MemberPriceList
.
Where
(
x
=>
(
x
.
SpecificationSort
??
""
)
==
qitem
).
ToList
();
mgradeList
=
mgradeList
.
OrderByDescending
(
x
=>
x
.
Grade
).
ToList
();
mgradeList
=
mgradeList
.
OrderByDescending
(
x
=>
x
.
Grade
).
ToList
();
foreach
(
var
grade
in
mgradeList
)
foreach
(
var
grade
in
mgradeList
)
...
@@ -4434,6 +4508,148 @@ namespace Mall.Module.Product
...
@@ -4434,6 +4508,148 @@ namespace Mall.Module.Product
#
endregion
#
endregion
#
region
商品代理
/// <summary>
/// 新增代理商品
/// </summary>
/// <param name="goodsId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
ApiResult
SetProductGoodsProxy
(
int
goodsId
,
int
tenantId
,
int
mallBaseId
)
{
var
plist
=
goods_ProxyRepository
.
GetList
(
new
RB_Goods_Proxy_Extend
()
{
GoodsId
=
goodsId
,
ProxyMallBaseId
=
mallBaseId
,
ProxyTenantId
=
tenantId
});
if
(
plist
.
Any
())
{
return
ApiResult
.
Failed
(
"该商品已存在采购"
);
}
var
goodsModel
=
goodsRepository
.
GetEntity
(
goodsId
);
if
(
goodsModel
==
null
)
{
return
ApiResult
.
Failed
(
"采购商品不存在"
);
}
if
(
goodsModel
.
IsProxy
!=
1
)
{
return
ApiResult
.
Failed
(
"采购商品不可代理"
);
}
if
(
goodsModel
.
IsProcurement
==
1
)
{
return
ApiResult
.
Failed
(
"采购商品不可代理"
);
}
if
(
goodsModel
.
TenantId
==
tenantId
)
{
return
ApiResult
.
Failed
(
"不可采购同商户商品"
);
}
if
((
goodsModel
.
ProxyMoney
??
0
)
<=
0
)
{
return
ApiResult
.
Failed
(
"采购商品有误"
);
}
var
trans
=
goodsRepository
.
DbTransaction
;
try
{
//复制商品信息
int
Id
=
goodsRepository
.
Insert
(
new
RB_Goods
()
{
Name
=
goodsModel
.
Name
,
CarouselImage
=
goodsModel
.
CarouselImage
,
VideoAddress
=
goodsModel
.
VideoAddress
,
CustomShareTitles
=
goodsModel
.
CustomShareTitles
,
CustomShareImage
=
goodsModel
.
CustomShareImage
,
GoodsStatus
=
goodsModel
.
GoodsStatus
,
InventoryNum
=
goodsModel
.
InventoryNum
,
DefaultSpecificationName
=
goodsModel
.
DefaultSpecificationName
,
IsCustomSpecification
=
goodsModel
.
IsCustomSpecification
,
Sort
=
goodsModel
.
Sort
,
SellingPrice
=
goodsModel
.
SellingPrice
,
OriginalPrice
=
goodsModel
.
OriginalPrice
,
Unit
=
goodsModel
.
Unit
,
CostPrice
=
goodsModel
.
ProxyMoney
,
IsGoodsNegotiable
=
goodsModel
.
IsGoodsNegotiable
,
SalesNum
=
goodsModel
.
SalesNum
,
GoodsNumbers
=
goodsModel
.
GoodsNumbers
,
GoodsWeight
=
goodsModel
.
GoodsWeight
,
IsDefaultService
=
1
,
GoodsService
=
"[]"
,
FreightId
=
0
,
FormsId
=
0
,
LimitBuyGoodsNum
=
goodsModel
.
LimitBuyGoodsNum
,
LimitBuyOrderNum
=
goodsModel
.
LimitBuyOrderNum
,
FullNumPinkage
=
goodsModel
.
FullNumPinkage
,
FullMoneyPinkage
=
goodsModel
.
FullMoneyPinkage
,
IsAreaBuy
=
2
,
IntegralPresent
=
goodsModel
.
IntegralPresent
,
IntegralPresentType
=
goodsModel
.
IntegralPresentType
,
PointsDeduction
=
goodsModel
.
PointsDeduction
,
PointsDeductionType
=
goodsModel
.
PointsDeductionType
,
IsMultipleDeduction
=
goodsModel
.
IsMultipleDeduction
,
GoodsDetails
=
goodsModel
.
GoodsDetails
,
Status
=
0
,
TenantId
=
tenantId
,
MallBaseId
=
mallBaseId
,
CreateDate
=
DateTime
.
Now
,
UpdateDate
=
DateTime
.
Now
,
SeparateDistribution
=
2
,
SeparateDistributionType
=
1
,
SeparateDistributionMoneyType
=
1
,
EnjoyMember
=
2
,
SeparateSetMember
=
2
,
IsQuickBuy
=
2
,
IsSellWell
=
2
,
GoodsType
=
goodsModel
.
GoodsType
,
SupplierId
=
0
,
IsProxy
=
2
,
ProxyType
=
1
,
ProxyRises
=
0
,
ProxyMoney
=
0
,
IsProcurement
=
1
},
trans
);
if
(
Id
>
0
)
{
//复制规格
var
slist
=
goods_SpecificationRepository
.
GetList
(
new
RB_Goods_Specification_Extend
()
{
GoodsId
=
goodsId
});
var
svlist
=
goods_SpecificationValueRepository
.
GetList
(
new
RB_Goods_SpecificationValue_Extend
()
{
GoodsId
=
goodsId
});
foreach
(
var
item
in
slist
)
{
goods_SpecificationRepository
.
Insert
(
new
RB_Goods_Specification
()
{
EnabledImage
=
item
.
EnabledImage
,
CreateDate
=
DateTime
.
Now
,
GoodsId
=
Id
,
Id
=
0
,
MallBaseId
=
mallBaseId
,
Name
=
item
.
Name
,
Sort
=
item
.
Sort
,
Status
=
0
,
TenantId
=
tenantId
},
trans
);
}
foreach
(
var
item
in
svlist
)
{
goods_SpecificationValueRepository
.
Insert
(
new
RB_Goods_SpecificationValue
()
{
TenantId
=
tenantId
,
Status
=
0
,
Sort
=
item
.
Sort
,
CreateDate
=
DateTime
.
Now
,
GoodsId
=
Id
,
Id
=
0
,
Image
=
item
.
Image
,
MallBaseId
=
mallBaseId
,
Name
=
item
.
Name
,
SpecificationId
=
item
.
SpecificationId
},
trans
);
}
}
goodsRepository
.
DBSession
.
Commit
();
if
(
Id
>
0
)
return
ApiResult
.
Success
();
else
return
ApiResult
.
Failed
();
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"SetProductGoodsProxy"
);
goodsRepository
.
DBSession
.
Rollback
(
"SetProductGoodsProxy"
);
return
ApiResult
.
Failed
();
}
}
#
endregion
#
region
商品导入
#
region
商品导入
/// <summary>
/// <summary>
...
@@ -4767,6 +4983,12 @@ namespace Mall.Module.Product
...
@@ -4767,6 +4983,12 @@ namespace Mall.Module.Product
item
.
SeparateSetMember
??=
2
;
item
.
SeparateSetMember
??=
2
;
item
.
GoodsType
??=
Common
.
Enum
.
Goods
.
OrderTypeEnum
.
Mall
;
item
.
GoodsType
??=
Common
.
Enum
.
Goods
.
OrderTypeEnum
.
Mall
;
item
.
IsProxy
??=
2
;
item
.
ProxyType
??=
0
;
item
.
ProxyRises
??=
0
;
item
.
ProxyMoney
??=
0
;
item
.
IsProcurement
=
2
;
item
.
Status
=
0
;
item
.
Status
=
0
;
item
.
TenantId
=
tenantId
;
item
.
TenantId
=
tenantId
;
item
.
MallBaseId
=
mallBaseId
;
item
.
MallBaseId
=
mallBaseId
;
...
...
Mall.Module.User/UserModule.cs
View file @
0a1d624e
...
@@ -1557,6 +1557,12 @@ namespace Mall.Module.User
...
@@ -1557,6 +1557,12 @@ namespace Mall.Module.User
}
}
};
};
member_UserRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
member_UserRepository
.
Update
(
keyValues1
,
wheres1
,
trans
);
var
umodel
=
GetMemberUserInfo
(
item
.
UserId
??
0
);
if
(
umodel
!=
null
)
{
new
MiniProgramMsgModule
().
SendAuditResultMsg
(
item
.
TenantId
,
item
.
MallBaseId
,
umodel
.
OpenId
,
"分销商审核已通过"
,
"通过"
,
umodel
.
Name
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
));
}
}
}
}
}
}
}
...
@@ -1955,7 +1961,27 @@ namespace Mall.Module.User
...
@@ -1955,7 +1961,27 @@ namespace Mall.Module.User
OperatorEnum
=
OperatorEnum
.
Equal
OperatorEnum
=
OperatorEnum
.
Equal
}
}
};
};
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
distributor_RemitRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
//拒绝之后 需回滚提现佣金
var
remodel
=
distributor_RemitRepository
.
GetEntity
(
remitId
);
var
dmodel
=
distributor_InfoRepository
.
GetList
(
new
RB_Distributor_Info_Extend
()
{
UserId
=
remodel
.
UserId
,
TenantId
=
Convert
.
ToInt32
(
uid
),
MallBaseId
=
mallBaseId
}).
FirstOrDefault
();
if
(
dmodel
!=
null
)
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Info
.
CommissionWithdrawal
),
(
dmodel
.
CommissionWithdrawal
??
0
)
+
(
remodel
.
AppliedMoney
??
0
)}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Info
.
Id
),
FiledValue
=
dmodel
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
distributor_InfoRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
}
}
else
else
{
{
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
0a1d624e
...
@@ -27,6 +27,9 @@ namespace Mall.Repository.Product
...
@@ -27,6 +27,9 @@ namespace Mall.Repository.Product
if
(
dmodel
.
TenantId
>
0
)
{
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
}
if
(
dmodel
.
NotTenantId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
<>
{
dmodel
.
NotTenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
}
...
@@ -54,6 +57,12 @@ namespace Mall.Repository.Product
...
@@ -54,6 +57,12 @@ namespace Mall.Repository.Product
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
}
if
(
dmodel
.
IsProcurement
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProcurement
)}
=
{
dmodel
.
IsProcurement
}
"
;
}
if
(
dmodel
.
IsProxy
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
IsProxy
)}
=
{
dmodel
.
IsProxy
}
"
;
}
string
sql
=
$@"select g.* from RB_Goods g
string
sql
=
$@"select g.* from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
inner join rb_goods_category c on g.Id=c.GoodsId
...
...
Mall.Repository/Product/RB_Goods_ProxyRepository.cs
0 → 100644
View file @
0a1d624e
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_ProxyRepository
:
RepositoryBase
<
RB_Goods_Proxy
>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Proxy_Extend
>
GetList
(
RB_Goods_Proxy_Extend
dmodel
)
{
string
where
=
$" 1=1 and Status =0"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
ProxyTenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyTenantId
)}
=
{
dmodel
.
ProxyTenantId
}
"
;
}
if
(
dmodel
.
ProxyMallBaseId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyMallBaseId
)}
=
{
dmodel
.
ProxyMallBaseId
}
"
;
}
if
(
dmodel
.
GoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
GoodsId
)}
=
{
dmodel
.
GoodsId
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(
dmodel
.
ProxyGoodsId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Goods_Proxy
.
ProxyGoodsId
)}
=
{
dmodel
.
ProxyGoodsId
}
"
;
}
string
sql
=
$@"SELECT * FROM RB_Goods_Proxy where
{
where
}
order by Id asc"
;
return
Get
<
RB_Goods_Proxy_Extend
>(
sql
).
ToList
();
}
}
}
Mall.Repository/Product/RB_Material_InfoRepository.cs
View file @
0a1d624e
...
@@ -24,8 +24,7 @@ namespace Mall.Repository.Product
...
@@ -24,8 +24,7 @@ namespace Mall.Repository.Product
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
{
{
string
where
=
$" 1=1 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
string
where
=
$" 1=1 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
if
(
dmodel
.
Id
>=
100
)
{
if
(
dmodel
.
TenantId
>
0
)
if
(
dmodel
.
TenantId
>
0
)
{
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
...
@@ -34,7 +33,6 @@ namespace Mall.Repository.Product
...
@@ -34,7 +33,6 @@ namespace Mall.Repository.Product
{
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
}
}
if
(
dmodel
.
Id
>
0
)
{
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
Id
)}
=
{
dmodel
.
Id
}
"
;
where
+=
$@" and
{
nameof
(
RB_Material_Info
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
}
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
0a1d624e
...
@@ -1091,6 +1091,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1091,6 +1091,8 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
SalesNum
,
x
.
SalesNum
,
x
.
GoodsBuyNum
,
x
.
GoodsBuyNum
,
x
.
IsQuickBuy
,
x
.
IsQuickBuy
,
x
.
IsProxy
,
x
.
IsProcurement
,
x
.
GoodsStatus
,
x
.
GoodsStatus
,
x
.
TenantId
,
x
.
TenantId
,
x
.
MallBaseId
,
x
.
MallBaseId
,
...
@@ -1384,6 +1386,11 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1384,6 +1386,11 @@ namespace Mall.WebApi.Controllers.MallBase
model
.
SeparateSetMember
,
model
.
SeparateSetMember
,
model
.
IsQuickBuy
,
model
.
IsQuickBuy
,
model
.
SupplierId
,
model
.
SupplierId
,
model
.
IsProxy
,
model
.
ProxyType
,
model
.
ProxyRises
,
model
.
ProxyMoney
,
model
.
IsProcurement
,
CategoryList
=
model
.
CategoryList
.
Select
(
x
=>
new
{
CategoryList
=
model
.
CategoryList
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Id
,
x
.
CategoryId
,
x
.
CategoryId
,
...
@@ -1859,6 +1866,25 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1859,6 +1866,25 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
GoodsType
??=
Common
.
Enum
.
Goods
.
OrderTypeEnum
.
Mall
;
demodel
.
GoodsType
??=
Common
.
Enum
.
Goods
.
OrderTypeEnum
.
Mall
;
demodel
.
GoodsStatus
??=
2
;
demodel
.
GoodsStatus
??=
2
;
demodel
.
IsProxy
??=
2
;
demodel
.
ProxyType
??=
1
;
demodel
.
ProxyRises
??=
0
;
demodel
.
ProxyMoney
??=
0
;
demodel
.
IsProcurement
=
2
;
//新增时
if
(
demodel
.
IsProxy
==
1
&&
demodel
.
CostPrice
>
0
)
{
decimal
ProxyMoney
=
0
;
if
(
demodel
.
ProxyType
==
1
)
{
ProxyMoney
=
Math
.
Round
((
demodel
.
CostPrice
??
0
)
*
(
1
+
(
demodel
.
ProxyRises
??
0
)),
2
,
MidpointRounding
.
AwayFromZero
);
}
else
{
ProxyMoney
=
(
demodel
.
CostPrice
??
0
)
+
(
demodel
.
ProxyRises
??
0
);
}
if
(
ProxyMoney
!=
(
demodel
.
ProxyMoney
??
0
))
{
return
ApiResult
.
ParamIsNull
(
"代理价格不正确"
);
}
}
bool
flag
=
productModule
.
SetProductGoodsInfo
(
demodel
);
bool
flag
=
productModule
.
SetProductGoodsInfo
(
demodel
);
if
(
flag
)
if
(
flag
)
{
{
...
@@ -1939,6 +1965,63 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1939,6 +1965,63 @@ namespace Mall.WebApi.Controllers.MallBase
#
endregion
#
endregion
#
region
商品代理
/// <summary>
/// 商品代理分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetProductGoodsProxyPageList
()
{
var
parms
=
RequestParm
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
NotTenantId
=
parms
.
TenantId
;
//demodel.MallBaseId = parms.MallBaseId;
demodel
.
IsProxy
=
1
;
demodel
.
IsProcurement
=
2
;
var
list
=
productModule
.
GetProductGoodsProxyPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
Sort
,
x
.
CoverImage
,
CategoryList
=
x
.
CategoryList
.
Select
(
y
=>
new
{
y
.
Id
,
y
.
CategoryName
}),
x
.
ProxyMoney
,
x
.
InventoryNum
,
SalesNum
=
(
x
.
SalesNum
??
0
)
+
(
x
.
GoodsBuyNum
??
0
),
x
.
IsProcurement
,
x
.
ProcurementGoodsId
,
x
.
GoodsStatus
,
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
SetProductGoodsProxy
()
{
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
parms
.
GetInt
(
"GoodsId"
,
0
);
if
(
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递商品id"
);
}
return
productModule
.
SetProductGoodsProxy
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
}
#
endregion
#
region
商品导入
#
region
商品导入
/// <summary>
/// <summary>
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
0a1d624e
...
@@ -1872,6 +1872,10 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1872,6 +1872,10 @@ namespace Mall.WebApi.Controllers.User
string
msg
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
Type
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
string
msg
=
userModule
.
SetDistributorRemitAudit
(
RemitId
,
Type
,
Remark
,
re
.
uid
,
re
.
MallBaseId
);
if
(
msg
==
""
)
if
(
msg
==
""
)
{
{
if
(
Type
==
3
)
{
var
umodel
=
userModule
.
GetMemberUserInfo
(
model
.
UserId
??
0
);
new
MiniProgramMsgModule
().
SendWithdrawFailMsg
(
model
.
TenantId
,
model
.
MallBaseId
,
umodel
.
OpenId
,
(
model
.
RemitMoney
??
0
).
ToString
(),
"提现申请已被拒绝"
);
}
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
else
...
...
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