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
2ebb16f4
Commit
2ebb16f4
authored
Aug 17, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
88aa08a7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
345 additions
and
71 deletions
+345
-71
UserInfo.cs
Mall.Common/API/UserInfo.cs
+6
-1
RB_Goods.cs
Mall.Model/Entity/Product/RB_Goods.cs
+32
-0
RB_Tenant_Extend.cs
Mall.Model/Extend/User/RB_Tenant_Extend.cs
+5
-0
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+4
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+141
-24
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+6
-1
RB_TenantRepository.cs
Mall.Repository/User/RB_TenantRepository.cs
+2
-2
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+133
-37
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+16
-6
No files found.
Mall.Common/API/UserInfo.cs
View file @
2ebb16f4
...
...
@@ -137,6 +137,11 @@ namespace Mall.Common
/// </summary>
public
int
EmpId
{
get
;
set
;
}
/// <summary>
/// 修改他人商品角色权限
/// </summary>
public
int
IsOtherUpdateGoods
{
get
;
set
;
}
public
string
erptoken
{
get
;
set
;
}
/// <summary>
...
...
Mall.Model/Entity/Product/RB_Goods.cs
View file @
2ebb16f4
...
...
@@ -611,5 +611,37 @@ namespace Mall.Model.Entity.Product
/// 商品Logo
/// </summary>
public
string
goodsLogo
{
get
;
set
;
}
/// <summary>
/// 分销平台,0-否,1-是
/// </summary>
public
int
RetailStore
{
get
;
set
;
}
/// <summary>
/// 源数据商品id
/// </summary>
public
int
SourceGoodsId
{
get
;
set
;
}
/// <summary>
/// 源数据商户号
/// </summary>
public
int
SourceTenantId
{
get
;
set
;
}
/// <summary>
/// 源数据小程序id
/// </summary>
public
int
SourceMallBaseId
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Tenant_Extend.cs
View file @
2ebb16f4
...
...
@@ -44,5 +44,10 @@ namespace Mall.Model.Extend.User
/// 当前登录员工编号
/// </summary>
public
int
EmpId
{
get
;
set
;
}
/// <summary>
/// 权限
/// </summary>
public
string
RoleAuth
{
get
;
set
;
}
}
}
Mall.Module.Product/OrderModule.cs
View file @
2ebb16f4
...
...
@@ -3432,6 +3432,10 @@ namespace Mall.Module.Product
else
{
string
simage
=
goods_SpecificationValueRepository
.
GetSpecificationImage
(
item
.
GoodsId
??
0
,
item
.
SpecificationSort
);
if
(!
string
.
IsNullOrEmpty
(
simage
))
{
item
.
CoverImage
=
simage
;
//规格图片赋值
}
}
#
endregion
...
...
Mall.Module.Product/ProductModule.cs
View file @
2ebb16f4
...
...
@@ -2353,7 +2353,7 @@ namespace Mall.Module.Product
else
{
if
(
model
.
IsCustomSpecification
==
1
&&
model
.
SpecificationPriceList
!=
null
&&
model
.
SpecificationPriceList
.
Count
>
0
)
if
(
model
.
IsCustomSpecification
==
1
&&
model
.
SpecificationPriceList
!=
null
&&
model
.
SpecificationPriceList
.
Count
>
0
)
{
price_member_min
=
price_min
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Min
(
x
=>
x
.
SellingPrice
??
0
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Max
(
x
=>
x
.
SellingPrice
??
0
);
...
...
@@ -2468,7 +2468,7 @@ namespace Mall.Module.Product
{
goods
=
new
{
friendUrl
=
IsExistsShare
==
1
?
"/pages/quick_share/index?GoodsId="
+
model
.
Id
+
"&KeyWords="
+
model
.
Name
:
""
,
friendUrl
=
IsExistsShare
==
1
?
"/pages/quick_share/index?GoodsId="
+
model
.
Id
+
"&KeyWords="
+
model
.
Name
:
""
,
id
=
model
.
Id
,
mall_id
=
model
.
MallBaseId
,
mch_id
=
model
.
TenantId
,
//暂 商户id
...
...
@@ -2530,7 +2530,7 @@ namespace Mall.Module.Product
form_id
=
model
.
FormsId
,
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
name
=
model
.
Name
,
subname
=
model
.
SubName
,
subname
=
model
.
SubName
,
original_price
=
model
.
OriginalPrice
,
cover_pic
=
model
.
CoverImage
,
unit
=
model
.
Unit
,
...
...
@@ -2606,11 +2606,13 @@ namespace Mall.Module.Product
x
.
CategoryName
}),
video_type
=
model
.
VideoType
,
goods_country
=
model
.
GoodsCountry
,
fatcode
=
model
.
FatCode
,
goodsurl
=
model
.
GoodsUrl
,
goodsLogo
=
model
.
goodsLogo
,
goodsPreferentialList
=
goodsPreferentialList
?.
Select
(
x
=>
new
{
x
.
Id
,
goods_country
=
model
.
GoodsCountry
,
fatcode
=
model
.
FatCode
,
goodsurl
=
model
.
GoodsUrl
,
goodsLogo
=
model
.
goodsLogo
,
goodsPreferentialList
=
goodsPreferentialList
?.
Select
(
x
=>
new
{
x
.
Id
,
x
.
PriceDiscountTypeStr
,
x
.
PriceDiscountType
,
x
.
PriceMoney
...
...
@@ -2679,7 +2681,7 @@ namespace Mall.Module.Product
var
obj
=
new
{
id
=
model
.
Id
,
name
=
model
.
Name
,
name
=
model
.
Name
,
cover_pic
=
model
.
CoverImage
,
};
list
.
Add
(
obj
);
...
...
@@ -2700,7 +2702,7 @@ namespace Mall.Module.Product
/// <param name="storeId">门店编号</param>
/// <param name="chooseDate">选择日期</param>
/// <returns></returns>
public
object
GetAppletOfflineGoodsInfoModule
(
int
goodsId
,
int
UserId
,
int
SmallShopsId
,
int
TenantId
,
int
MallBaseId
,
int
storeId
=
0
,
int
servicePersionId
=
0
,
string
chooseDate
=
""
)
public
object
GetAppletOfflineGoodsInfoModule
(
int
goodsId
,
int
UserId
,
int
SmallShopsId
,
int
TenantId
,
int
MallBaseId
,
int
storeId
=
0
,
int
servicePersionId
=
0
,
string
chooseDate
=
""
)
{
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
)
...
...
@@ -3602,7 +3604,7 @@ namespace Mall.Module.Product
string
tempTimeStr
=
""
;
if
(
j
%
2
==
0
)
{
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
}
else
{
...
...
@@ -3668,7 +3670,7 @@ namespace Mall.Module.Product
#
endregion
var
minModel
=
new
RB_MiniProgramRepository
().
GetMiniProgramRepository
(
new
RB_MiniProgram_Extend
()
var
minModel
=
new
RB_MiniProgramRepository
().
GetMiniProgramRepository
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
MallBaseId
});
...
...
@@ -3826,7 +3828,7 @@ namespace Mall.Module.Product
isChooseServicePerson
=
model
.
IsChooseServicePerson
,
depositMoney
=
model
.
DepositMoney
,
categoryIdList
=
model
.
CategoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
ToList
(),
storeDateList
=
storeDateList
.
Select
(
qitem
=>
new
{
qitem
.
DayDateStr
,
qitem
.
WeekDayStr
,
qitem
.
TimeList
})
storeDateList
=
storeDateList
.
Select
(
qitem
=>
new
{
qitem
.
DayDateStr
,
qitem
.
WeekDayStr
,
qitem
.
TimeList
})
},
delivery
=
""
};
...
...
@@ -5233,6 +5235,113 @@ namespace Mall.Module.Product
return
material_InfoRepository
.
SetMaterialInfoTransfer
(
materialIds
,
groupId
,
uid
,
mallBaseId
);
}
/// <summary>
/// 设置分组转移
/// </summary>
/// <param name="materialIds"></param>
/// <param name="groupId"></param>
/// <param name="Type"></param>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public
bool
SynchroGoods
(
List
<
RB_Goods_Extend
>
list
)
{
bool
flag
=
false
;
try
{
foreach
(
var
demodel
in
list
)
{
int
Id
=
goodsRepository
.
Insert
(
demodel
);
flag
=
Id
>
0
;
if
(
flag
)
{
//插入分类
foreach
(
var
item
in
demodel
.
CategoryList
)
{
goods_CategoryRepository
.
Insert
(
new
RB_Goods_Category
()
{
CategoryId
=
item
.
CategoryId
,
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
Id
,
Id
=
0
,
MallBaseId
=
demodel
.
MallBaseId
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
});
}
//插入规格
if
(
demodel
.
IsCustomSpecification
==
1
)
{
foreach
(
var
item
in
demodel
.
SpecificationList
)
{
int
sid
=
goods_SpecificationRepository
.
Insert
(
new
RB_Goods_Specification
()
{
CreateDate
=
demodel
.
CreateDate
,
EnabledImage
=
item
.
EnabledImage
,
GoodsId
=
Id
,
Id
=
0
,
MallBaseId
=
demodel
.
MallBaseId
,
Name
=
item
.
Name
,
Sort
=
item
.
Sort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
});
if
(
sid
>
0
)
{
foreach
(
var
qitem
in
item
.
SpecificationValueList
)
{
goods_SpecificationValueRepository
.
Insert
(
new
RB_Goods_SpecificationValue
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
Id
,
Id
=
0
,
Image
=
qitem
.
Image
,
MallBaseId
=
demodel
.
MallBaseId
,
Name
=
qitem
.
Name
,
Sort
=
qitem
.
Sort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
SpecificationId
=
sid
});
}
}
}
foreach
(
var
item
in
demodel
.
SpecificationPriceList
)
{
goods_SpecificationPriceRepository
.
Insert
(
new
RB_Goods_SpecificationPrice
()
{
CreateDate
=
demodel
.
CreateDate
,
GoodsId
=
Id
,
Id
=
0
,
GoodsNumbers
=
item
.
GoodsNumbers
,
GoodsWeight
=
item
.
GoodsWeight
,
InventoryNum
=
item
.
InventoryNum
,
MallBaseId
=
demodel
.
MallBaseId
,
SellingPrice
=
item
.
SellingPrice
,
SpecificationSort
=
item
.
SpecificationSort
,
Status
=
0
,
TenantId
=
demodel
.
TenantId
,
UpdateDate
=
demodel
.
UpdateDate
,
Commission
=
item
.
Commission
,
CostMoney
=
item
.
CostMoney
});
}
}
}
}
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
"SynchroGoods:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
list
));
return
false
;
}
return
flag
;
}
#
endregion
#
region
商品分类
...
...
@@ -8225,7 +8334,7 @@ namespace Mall.Module.Product
/// <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
SupplierId
,
int
tenantId
,
int
mallBaseId
)
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
SupplierId
,
int
RetailStore
,
int
tenantId
,
int
mallBaseId
)
{
Dictionary
<
string
,
object
>
keyValues
;
if
(
type
==
1
)
...
...
@@ -8309,7 +8418,15 @@ namespace Mall.Module.Product
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
SupplierId
),
SupplierId
}
};
}
//面议
}
else
if
(
type
==
13
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
RetailStore
),(
RetailStore
-
1
)}
};
}
//面议
else
{
return
false
;
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
2ebb16f4
...
...
@@ -50,6 +50,10 @@ namespace Mall.Repository.Product
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
RetailStore
>
-
1
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
RetailStore
)}
=
{
dmodel
.
RetailStore
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StoresIds
))
{
where
+=
$@" and FIND_IN_SET('
{
dmodel
.
StoresIds
}
',g.
{
nameof
(
RB_Goods_Extend
.
StoresIds
)}
)"
;
...
...
@@ -99,7 +103,8 @@ namespace Mall.Repository.Product
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
}
if
(
dmodel
.
MinProfitRate
>
0
)
{
if
(
dmodel
.
MinProfitRate
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MinProfitRate
)}
<
{
dmodel
.
MinProfitRate
}
"
;
}
if
(
dmodel
.
GoodsPageType
.
HasValue
)
...
...
Mall.Repository/User/RB_TenantRepository.cs
View file @
2ebb16f4
...
...
@@ -59,12 +59,12 @@ namespace Mall.Repository.User
StringBuilder
builder1
=
new
StringBuilder
();
builder1
.
AppendFormat
(
@"
SELECT A.TenantId,A.Account AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
,A.AccountStatus,A.`Password` AS Password,0 AS EmpId,0 AS MallBaseId
,A.AccountStatus,A.`Password` AS Password,0 AS EmpId,0 AS MallBaseId
,'-1' as RoleAuth
FROM RB_Tenant AS A
WHERE 1=1 AND A.Account='{0}'
UNION ALL
SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
,B.`Status` AS AccountStatus,B.EmpPwd AS Password,B.EmpId,B.MallBaseId
,B.`Status` AS AccountStatus,B.EmpPwd AS Password,B.EmpId,B.MallBaseId
,b.RoleAuth
FROM RB_Tenant AS A INNER JOIN rb_employee AS B ON A.TenantId=B.TenantId
WHERE 1=1 AND B.EmpAccount='{0}'
"
,
query
.
Account
.
Trim
());
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
2ebb16f4
...
...
@@ -416,6 +416,86 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 把分享平台的商品加入商品列表
/// </summary>
/// <returns></returns>
public
ApiResult
SynchroGoods
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
CategoryList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Category_Extend
>>(
parms
.
GetStringValue
(
"CategoryList"
));
//商品分类
string
GoodsIds
=
parms
.
GetStringValue
(
"GoodsIds"
);
//商品ids
//根据商品id获取商品信息
var
goodsList
=
productModule
.
GetGoodsList
(
new
RB_Goods_Extend
{
GoodsIds
=
GoodsIds
});
if
(
goodsList
.
Any
(
x
=>
x
.
SourceGoodsId
>
0
))
{
return
ApiResult
.
Failed
(
"分享平台的商品不能多次分享添加"
);
}
//获取商品的规格以及价格
var
goodsSpecificationList
=
productModule
.
GetSpecificationList
(
new
RB_Goods_Specification_Extend
{
GoodsIds
=
GoodsIds
});
var
goodsSpecificationValueList
=
productModule
.
GetSpecificationValueList
(
new
RB_Goods_SpecificationValue_Extend
{
GoodsIds
=
GoodsIds
});
var
goodsSpecificationPriceList
=
productModule
.
GetSpecificationPriceList
(
new
RB_Goods_SpecificationPrice_Extend
{
GoodsIds
=
GoodsIds
});
var
newGoodsList
=
new
List
<
RB_Goods_Extend
>();
foreach
(
var
item
in
goodsList
)
{
RB_Goods_Extend
model
=
new
RB_Goods_Extend
();
item
.
IsDefaultService
=
1
;
item
.
IsAreaBuy
=
2
;
item
.
SeparateDistribution
=
2
;
item
.
SeparateSetMember
=
2
;
item
.
EnjoyMember
=
2
;
item
.
FreightId
=
0
;
item
.
FreightName
=
""
;
item
.
FormsId
=
-
1
;
item
.
FormsName
=
""
;
item
.
PresentFXGrade
=
0
;
item
.
PresentFXMonth
=
0
;
item
.
IsNoTax
=
0
;
item
.
CategoryList
=
CategoryList
;
item
.
SpecificationList
=
new
List
<
RB_Goods_Specification_Extend
>();
item
.
SpecificationList
=
goodsSpecificationList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
foreach
(
var
itemSpecification
in
item
.
SpecificationList
)
{
itemSpecification
.
SpecificationValueList
=
new
List
<
RB_Goods_SpecificationValue_Extend
>();
itemSpecification
.
SpecificationValueList
=
goodsSpecificationValueList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationId
==
itemSpecification
.
Id
).
ToList
();
if
(
itemSpecification
.
SpecificationValueList
!=
null
&&
itemSpecification
.
SpecificationValueList
.
Any
())
{
itemSpecification
.
SpecificationValueList
.
ForEach
(
x
=>
x
.
Id
=
0
);
itemSpecification
.
SpecificationValueList
.
ForEach
(
x
=>
x
.
TenantId
=
RequestParm
.
TenantId
);
itemSpecification
.
SpecificationValueList
.
ForEach
(
x
=>
x
.
MallBaseId
=
RequestParm
.
MallBaseId
);
itemSpecification
.
SpecificationValueList
.
ForEach
(
x
=>
x
.
CreateDate
=
System
.
DateTime
.
Now
);
}
}
item
.
SpecificationList
.
ForEach
(
x
=>
x
.
Id
=
0
);
item
.
SpecificationList
.
ForEach
(
x
=>
x
.
TenantId
=
RequestParm
.
TenantId
);
item
.
SpecificationList
.
ForEach
(
x
=>
x
.
CreateDate
=
System
.
DateTime
.
Now
);
item
.
SpecificationList
.
ForEach
(
x
=>
x
.
MallBaseId
=
RequestParm
.
MallBaseId
);
item
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
item
.
SpecificationPriceList
=
goodsSpecificationPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
item
.
SpecificationPriceList
.
ForEach
(
x
=>
x
.
Id
=
0
);
item
.
SpecificationPriceList
.
ForEach
(
x
=>
x
.
TenantId
=
RequestParm
.
TenantId
);
item
.
SpecificationPriceList
.
ForEach
(
x
=>
x
.
CreateDate
=
System
.
DateTime
.
Now
);
item
.
SpecificationPriceList
.
ForEach
(
x
=>
x
.
MallBaseId
=
RequestParm
.
MallBaseId
);
model
=
item
;
model
.
TenantId
=
RequestParm
.
TenantId
;
model
.
MallBaseId
=
RequestParm
.
MallBaseId
;
model
.
SourceTenantId
=
item
.
TenantId
;
model
.
SourceMallBaseId
=
item
.
MallBaseId
;
model
.
SourceGoodsId
=
item
.
Id
;
model
.
RetailStore
=
0
;
model
.
Id
=
0
;
model
.
CreateDate
=
System
.
DateTime
.
Now
;
model
.
UpdateDate
=
System
.
DateTime
.
Now
;
newGoodsList
.
Add
(
model
);
}
bool
result
=
productModule
.
SynchroGoods
(
newGoodsList
);
return
result
?
ApiResult
.
Success
(
""
)
:
ApiResult
.
Failed
(
"加入到商品列表失败"
);
}
#
endregion
#
region
商品分类
...
...
@@ -453,7 +533,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
IsShow
,
x
.
TenantId
,
x
.
MallBaseId
,
CategoryPageTypeStr
=
x
.
CategoryPageType
.
GetEnumName
(),
CategoryPageTypeStr
=
x
.
CategoryPageType
.
GetEnumName
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
...
...
@@ -1220,7 +1300,8 @@ namespace Mall.WebApi.Controllers.MallBase
Id
=
parameters
.
GetInt
(
"Id"
),
StartTime
=
parameters
.
GetStringValue
(
"StartTime"
),
EndTime
=
parameters
.
GetStringValue
(
"EndTime"
),
OrderBy
=
parameters
.
GetInt
(
"OrderBy"
)
OrderBy
=
parameters
.
GetInt
(
"OrderBy"
),
RetailStore
=
parameters
.
GetInt
(
"RetailStore"
,
-
1
),
};
demodel
.
TenantId
=
parms
.
TenantId
;
...
...
@@ -1260,7 +1341,8 @@ namespace Mall.WebApi.Controllers.MallBase
CarouselImageList
=
x
.
CarouselImageList
.
Select
(
qitem
=>
qitem
.
Path
).
ToList
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IsNoTax
,
IsLowProfit
=
MinProfitRate
>
0
?
x
.
MinProfitRate
<
MinProfitRate
?
1
:
2
:
2
IsLowProfit
=
MinProfitRate
>
0
?
x
.
MinProfitRate
<
MinProfitRate
?
1
:
2
:
2
,
x
.
CreateBy
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -1786,7 +1868,7 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
PresentFXMonth
,
model
?.
Advertising
,
model
?.
SubName
,
MarketingLogo
=
tempLogo
,
MarketingLogo
=
tempLogo
,
model
?.
ShelvesDate
,
model
?.
DownDate
,
model
?.
VideoType
,
...
...
@@ -1890,7 +1972,7 @@ namespace Mall.WebApi.Controllers.MallBase
int
IsKorea
=
parms
.
GetInt
(
"IsKorea"
,
0
);
//是否为韩国馆项目(1-是)
demodel
.
CategoryList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Category_Extend
>>(
parms
.
GetStringValue
(
"CategoryList"
));
demodel
.
CarouselImageList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_ImageCommonModel
>>(
parms
.
GetStringValue
(
"CarouselImageList"
));
demodel
.
SpecificationList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Specification_Extend
>>(
parms
.
GetStringValue
(
"SpecificationList"
));
demodel
.
SpecificationList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Specification_Extend
>>(
parms
.
GetStringValue
(
"SpecificationList"
));
demodel
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
JArray
priceArray
=
JArray
.
Parse
(
parms
.
GetStringValue
(
"SpecificationPriceList"
));
foreach
(
var
item
in
priceArray
)
...
...
@@ -1898,14 +1980,14 @@ namespace Mall.WebApi.Controllers.MallBase
JObject
jObj
=
JObject
.
Parse
(
item
.
ToString
());
RB_Goods_SpecificationPrice_Extend
pModel
=
new
RB_Goods_SpecificationPrice_Extend
()
{
Commission
=
jObj
.
GetDecimal
(
"Commission"
),
CostMoney
=
jObj
.
GetDecimal
(
"CostMoney"
),
GoodsNumbers
=
jObj
.
GetStringValue
(
"GoodsNumbers"
),
GoodsWeight
=
jObj
.
GetInt
(
"GoodsWeight"
),
InventoryNum
=
jObj
.
GetInt
(
"InventoryNum"
),
SellingPrice
=
jObj
.
GetDecimal
(
"SellingPrice"
),
SpecificationSort
=
jObj
.
GetStringValue
(
"SpecificationSort"
),
AttrList
=
new
object
()
Commission
=
jObj
.
GetDecimal
(
"Commission"
),
CostMoney
=
jObj
.
GetDecimal
(
"CostMoney"
),
GoodsNumbers
=
jObj
.
GetStringValue
(
"GoodsNumbers"
),
GoodsWeight
=
jObj
.
GetInt
(
"GoodsWeight"
),
InventoryNum
=
jObj
.
GetInt
(
"InventoryNum"
),
SellingPrice
=
jObj
.
GetDecimal
(
"SellingPrice"
),
SpecificationSort
=
jObj
.
GetStringValue
(
"SpecificationSort"
),
AttrList
=
new
object
()
};
var
arrList
=
new
List
<
object
>();
JArray
sArray
=
JArray
.
Parse
(
jObj
.
GetStringValue
(
"AttrList"
));
...
...
@@ -1914,19 +1996,19 @@ namespace Mall.WebApi.Controllers.MallBase
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
arrList
.
Add
(
new
{
SName
=
sObj
.
GetStringValue
(
"SName"
),
SVId
=
sObj
.
GetInt
(
"SVId"
),
SVName
=
sObj
.
GetStringValue
(
"SVName"
)
SName
=
sObj
.
GetStringValue
(
"SName"
),
SVId
=
sObj
.
GetInt
(
"SVId"
),
SVName
=
sObj
.
GetStringValue
(
"SVName"
)
});
}
pModel
.
AttrList
=
arrList
;
demodel
.
SpecificationPriceList
.
Add
(
pModel
);
}
demodel
.
ServiceList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_ImageCommonModel
>>(
parms
.
GetStringValue
(
"ServiceList"
));
demodel
.
ServiceList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_ImageCommonModel
>>(
parms
.
GetStringValue
(
"ServiceList"
));
demodel
.
AreaList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Area_Extend
>>(
parms
.
GetStringValue
(
"AreaList"
));
demodel
.
DistributionCommissionList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_DistributionCommission_Extend
>>(
parms
.
GetStringValue
(
"DistributionCommissionList"
));
var
marketingLogo
=
JsonHelper
.
DeserializeObject
<
MarketingLogoItem
>(
parms
.
GetStringValue
(
"MarketingLogo"
));
demodel
.
DistributionCommissionList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_DistributionCommission_Extend
>>(
parms
.
GetStringValue
(
"DistributionCommissionList"
));
var
marketingLogo
=
JsonHelper
.
DeserializeObject
<
MarketingLogoItem
>(
parms
.
GetStringValue
(
"MarketingLogo"
));
demodel
.
MarketingLogo
=
JsonHelper
.
Serialize
(
marketingLogo
);
//待完善
demodel
.
TenantId
=
RequestParm
.
TenantId
;
demodel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
...
...
@@ -1940,7 +2022,7 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请添加商品轮播图"
);
}
demodel
.
CarouselImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CarouselImageList
.
Select
(
x
=>
x
.
Path
));
if
(
IsKorea
==
0
&&
(
demodel
.
SellingPrice
??
0
)
<
0
)
if
(
IsKorea
==
0
&&
(
demodel
.
SellingPrice
??
0
)
<
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入售价"
);
}
...
...
@@ -2291,6 +2373,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
IsMultipleDeduction
??=
2
;
demodel
.
Status
=
0
;
demodel
.
CreateBy
=
UserInfo
.
EmpId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
#
endregion
...
...
@@ -2438,7 +2521,7 @@ namespace Mall.WebApi.Controllers.MallBase
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
GoodsIds
=
parms
.
GetStringValue
(
"GoodsIds"
);
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
//1排序 2商品名称 3快速购买 4上架 5下架 6删除 7运费 8限购 9积分 10快速购买 11面议,12 供应商
int
Type
=
parms
.
GetInt
(
"Type"
,
0
);
//1排序 2商品名称 3快速购买 4上架 5下架 6删除 7运费 8限购 9积分 10快速购买 11面议,12 供应商
,13 同步到分销平台
int
Sort
=
parms
.
GetInt
(
"Sort"
,
0
);
string
GoodsName
=
parms
.
GetStringValue
(
"GoodsName"
);
int
FreightId
=
parms
.
GetInt
(
"FreightId"
,
0
);
//运费
...
...
@@ -2452,6 +2535,7 @@ namespace Mall.WebApi.Controllers.MallBase
int
IsQuickBuy
=
parms
.
GetInt
(
"IsQuickBuy"
,
2
);
//快速购买
int
IsGoodsNegotiable
=
parms
.
GetInt
(
"IsGoodsNegotiable"
,
2
);
//商品面议
int
SupplierId
=
parms
.
GetInt
(
"SupplierId"
,
0
);
//供应商
int
RetailStore
=
parms
.
GetInt
(
"RetailStore"
,
0
);
//是否同步到分销平台1-取消,2-是
if
(
string
.
IsNullOrEmpty
(
GoodsIds
))
{
return
ApiResult
.
ParamIsNull
();
...
...
@@ -2472,7 +2556,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
bool
flag
=
productModule
.
SetProductGoodsQuickUpdate
(
GoodsIds
,
Type
,
Sort
,
GoodsName
,
FreightId
,
LimitBuyGoodsNum
,
LimitBuyOrderNum
,
IntegralPresent
,
IntegralPresentType
,
PointsDeduction
,
PointsDeductionType
,
IsMultipleDeduction
,
IsQuickBuy
,
IsGoodsNegotiable
,
SupplierId
,
req
.
TenantId
,
req
.
MallBaseId
);
,
IntegralPresentType
,
PointsDeduction
,
PointsDeductionType
,
IsMultipleDeduction
,
IsQuickBuy
,
IsGoodsNegotiable
,
SupplierId
,
RetailStore
,
req
.
TenantId
,
req
.
MallBaseId
);
if
(
flag
)
{
return
ApiResult
.
Success
();
...
...
@@ -2858,10 +2942,12 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsActivityInfo
()
{
public
ApiResult
SetGoodsActivityInfo
()
{
var
parms
=
RequestParm
;
RB_Goods_Activity_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Activity_Extend
>(
parms
.
msg
.
ToString
());
if
(
string
.
IsNullOrEmpty
(
demodel
.
ActivityName
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
ActivityName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入活动名称"
);
}
if
(
demodel
.
Type
==
1
)
...
...
@@ -2878,25 +2964,31 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请输入分销订单金额"
);
}
}
else
{
else
{
if
(
demodel
.
GoodsNum
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请输入分销商品数量"
);
}
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
RangeIds
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
RangeIds
))
{
return
ApiResult
.
ParamIsNull
(
"请选择适配分类/商品"
);
}
if
(
demodel
.
CodeLength
<
4
)
{
if
(
demodel
.
CodeLength
<
4
)
{
return
ApiResult
.
ParamIsNull
(
"请选择验证码长度"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeName
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入奖品名称"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeImage
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeImage
))
{
return
ApiResult
.
ParamIsNull
(
"请选择奖品图片"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
CoverImage
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
CoverImage
))
{
return
ApiResult
.
ParamIsNull
(
"请选择封面图"
);
}
...
...
@@ -2926,12 +3018,14 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsActivityState
()
{
public
ApiResult
SetGoodsActivityState
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ActivityId
=
parms
.
GetInt
(
"ActivityId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1启用 2禁用 3删除
if
(
ActivityId
<=
0
)
{
if
(
ActivityId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递活动参数"
);
}
string
msg
=
activityModule
.
SetGoodsActivityState
(
ActivityId
,
Type
);
...
...
@@ -2939,7 +3033,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
Success
();
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
}
}
...
...
@@ -2986,7 +3081,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetGoodsActivityUserState
()
{
public
ApiResult
SetGoodsActivityUserState
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
PrizeId
=
parms
.
GetInt
(
"PrizeId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1已兑换 2已失效
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
2ebb16f4
...
...
@@ -123,6 +123,14 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Failed
(
"密码错误"
);
}
}
int
RoleAuth
=
0
;
if
(
model
.
TenantId
==
1
&&
!
string
.
IsNullOrEmpty
(
model
.
RoleAuth
))
{
if
(
model
.
RoleAuth
.
Split
(
","
).
Any
(
x
=>
x
==
"-1"
))
{
RoleAuth
=
1
;
}
}
#
region
add
by
:
W
2020
-
07
-
06
erp
授权信息
var
erpUserInfo
=
new
Mall
.
Model
.
Entity
.
Property
.
RB_Employee
();
string
erptoken
=
""
;
...
...
@@ -182,6 +190,7 @@ namespace Mall.WebApi.Controllers.User
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
string
secret
=
Config
.
JwtSecretKey
;
string
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
UserInfo
obj
=
new
UserInfo
{
...
...
@@ -197,13 +206,14 @@ namespace Mall.WebApi.Controllers.User
Token
=
token
,
SecretKey
=
""
,
MallBaseId
=
0
,
IsOtherUpdateGoods
=
RoleAuth
,
EmpId
=
model
.
EmpId
,
erptoken
=
erptoken
,
ERPEmpId
=
(
erpUserInfo
?.
EmployeeId
??
0
),
ERPBranchId
=
(
erpUserInfo
?.
RB_Branch_id
??
-
1
),
ERPGroupId
=
(
erpUserInfo
?.
RB_Group_id
??
0
),
IsOpenSchool
=
0
,
IsKorea
=
0
,
IsKorea
=
0
,
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
...
...
@@ -1327,7 +1337,7 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
GetMenuList
()
{
List
<
object
>
resultList
=
new
List
<
object
>();
var
menuList
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
TenantId
=
RequestParm
.
TenantId
});
var
menuList
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
TenantId
=
RequestParm
.
TenantId
});
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
{
...
...
@@ -1791,7 +1801,7 @@ namespace Mall.WebApi.Controllers.User
{
var
extModel
=
new
RB_PlugIn_Extend
()
{
TenantId
=
RequestParm
.
TenantId
TenantId
=
RequestParm
.
TenantId
};
var
list
=
plugInModule
.
GetPlugInListModule
(
extModel
);
var
distinctList
=
list
.
GroupBy
(
qitem
=>
new
{
qitem
.
PlugType
,
qitem
.
GroupName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
PlugType
,
qitem
.
Key
.
GroupName
});
...
...
@@ -2184,7 +2194,7 @@ namespace Mall.WebApi.Controllers.User
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
CreateDate
=
DateTime
.
Now
;
var
flag
=
programModule
.
SetLiveConfigModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
):
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
#
endregion
}
...
...
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