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
Hide 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
...
@@ -48,7 +48,7 @@ namespace Mall.Common
...
@@ -48,7 +48,7 @@ namespace Mall.Common
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 姓名/企业名称
/// 姓名/企业名称
/// </summary>
/// </summary>
...
@@ -137,6 +137,11 @@ namespace Mall.Common
...
@@ -137,6 +137,11 @@ namespace Mall.Common
/// </summary>
/// </summary>
public
int
EmpId
{
get
;
set
;
}
public
int
EmpId
{
get
;
set
;
}
/// <summary>
/// 修改他人商品角色权限
/// </summary>
public
int
IsOtherUpdateGoods
{
get
;
set
;
}
public
string
erptoken
{
get
;
set
;
}
public
string
erptoken
{
get
;
set
;
}
/// <summary>
/// <summary>
...
...
Mall.Model/Entity/Product/RB_Goods.cs
View file @
2ebb16f4
...
@@ -611,5 +611,37 @@ namespace Mall.Model.Entity.Product
...
@@ -611,5 +611,37 @@ namespace Mall.Model.Entity.Product
/// 商品Logo
/// 商品Logo
/// </summary>
/// </summary>
public
string
goodsLogo
{
get
;
set
;
}
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
...
@@ -44,5 +44,10 @@ namespace Mall.Model.Extend.User
/// 当前登录员工编号
/// 当前登录员工编号
/// </summary>
/// </summary>
public
int
EmpId
{
get
;
set
;
}
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
...
@@ -3432,6 +3432,10 @@ namespace Mall.Module.Product
else
else
{
{
string
simage
=
goods_SpecificationValueRepository
.
GetSpecificationImage
(
item
.
GoodsId
??
0
,
item
.
SpecificationSort
);
string
simage
=
goods_SpecificationValueRepository
.
GetSpecificationImage
(
item
.
GoodsId
??
0
,
item
.
SpecificationSort
);
if
(!
string
.
IsNullOrEmpty
(
simage
))
{
item
.
CoverImage
=
simage
;
//规格图片赋值
}
}
}
#
endregion
#
endregion
...
...
Mall.Module.Product/ProductModule.cs
View file @
2ebb16f4
...
@@ -1520,7 +1520,7 @@ namespace Mall.Module.Product
...
@@ -1520,7 +1520,7 @@ namespace Mall.Module.Product
//2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W
//2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W
if
(
model
.
CategoryList
!=
null
&&
model
.
CategoryList
.
Any
())
if
(
model
.
CategoryList
!=
null
&&
model
.
CategoryList
.
Any
())
{
{
string
categoryIds
=
string
.
Join
(
","
,
model
.
CategoryList
.
Select
(
x
=>
x
.
CategoryId
));
string
categoryIds
=
string
.
Join
(
","
,
model
.
CategoryList
.
Select
(
x
=>
x
.
CategoryId
));
var
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
CategoryIds
=
categoryIds
});
var
freeShippingList
=
freeShippingRepository
.
GetFreeShippingListByCategoryIds
(
new
RB_FreeShipping_Extend
{
MallBaseId
=
model
.
MallBaseId
,
TenantId
=
model
.
TenantId
,
CategoryIds
=
categoryIds
});
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
()
&&
((
model
.
FullNumPinkage
??
0
)
==
0
)
&&
((
model
.
FullMoneyPinkage
??
0
)
==
0
))
if
(
freeShippingList
!=
null
&&
freeShippingList
.
Any
()
&&
((
model
.
FullNumPinkage
??
0
)
==
0
)
&&
((
model
.
FullMoneyPinkage
??
0
)
==
0
))
...
@@ -2353,7 +2353,7 @@ namespace Mall.Module.Product
...
@@ -2353,7 +2353,7 @@ namespace Mall.Module.Product
else
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_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
);
price_member_max
=
price_max
=
model
.
SpecificationPriceList
.
Where
(
x
=>
x
.
SellingPrice
>
0
).
Max
(
x
=>
x
.
SellingPrice
??
0
);
...
@@ -2460,15 +2460,15 @@ namespace Mall.Module.Product
...
@@ -2460,15 +2460,15 @@ namespace Mall.Module.Product
List
<
RB_Goods_Preferential_Extend
>
goodsPreferentialList
=
new
List
<
RB_Goods_Preferential_Extend
>();
List
<
RB_Goods_Preferential_Extend
>
goodsPreferentialList
=
new
List
<
RB_Goods_Preferential_Extend
>();
goodsPreferentialList
=
RB_Goods_PreferentialRepository
.
GetGoodsPreferentialListRepostory
(
new
RB_Goods_Preferential_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
GoodsId
=
model
.
Id
});
goodsPreferentialList
=
RB_Goods_PreferentialRepository
.
GetGoodsPreferentialListRepostory
(
new
RB_Goods_Preferential_Extend
{
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
GoodsId
=
model
.
Id
});
return
new
return
new
{
{
goods
=
new
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
,
id
=
model
.
Id
,
mall_id
=
model
.
MallBaseId
,
mall_id
=
model
.
MallBaseId
,
mch_id
=
model
.
TenantId
,
//暂 商户id
mch_id
=
model
.
TenantId
,
//暂 商户id
...
@@ -2530,7 +2530,7 @@ namespace Mall.Module.Product
...
@@ -2530,7 +2530,7 @@ namespace Mall.Module.Product
form_id
=
model
.
FormsId
,
form_id
=
model
.
FormsId
,
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
sales
=
(
model
.
SalesNum
??
0
)
+
payment_num
,
//已售出数量 + 订单商品数量//
name
=
model
.
Name
,
name
=
model
.
Name
,
subname
=
model
.
SubName
,
subname
=
model
.
SubName
,
original_price
=
model
.
OriginalPrice
,
original_price
=
model
.
OriginalPrice
,
cover_pic
=
model
.
CoverImage
,
cover_pic
=
model
.
CoverImage
,
unit
=
model
.
Unit
,
unit
=
model
.
Unit
,
...
@@ -2606,14 +2606,16 @@ namespace Mall.Module.Product
...
@@ -2606,14 +2606,16 @@ namespace Mall.Module.Product
x
.
CategoryName
x
.
CategoryName
}),
}),
video_type
=
model
.
VideoType
,
video_type
=
model
.
VideoType
,
goods_country
=
model
.
GoodsCountry
,
goods_country
=
model
.
GoodsCountry
,
fatcode
=
model
.
FatCode
,
fatcode
=
model
.
FatCode
,
goodsurl
=
model
.
GoodsUrl
,
goodsurl
=
model
.
GoodsUrl
,
goodsLogo
=
model
.
goodsLogo
,
goodsLogo
=
model
.
goodsLogo
,
goodsPreferentialList
=
goodsPreferentialList
?.
Select
(
x
=>
new
{
x
.
Id
,
goodsPreferentialList
=
goodsPreferentialList
?.
Select
(
x
=>
new
x
.
PriceDiscountTypeStr
,
{
x
.
PriceDiscountType
,
x
.
Id
,
x
.
PriceMoney
x
.
PriceDiscountTypeStr
,
x
.
PriceDiscountType
,
x
.
PriceMoney
})
})
},
},
delivery
=
""
delivery
=
""
...
@@ -2679,8 +2681,8 @@ namespace Mall.Module.Product
...
@@ -2679,8 +2681,8 @@ namespace Mall.Module.Product
var
obj
=
new
var
obj
=
new
{
{
id
=
model
.
Id
,
id
=
model
.
Id
,
name
=
model
.
Name
,
name
=
model
.
Name
,
cover_pic
=
model
.
CoverImage
,
cover_pic
=
model
.
CoverImage
,
};
};
list
.
Add
(
obj
);
list
.
Add
(
obj
);
}
}
...
@@ -2700,7 +2702,7 @@ namespace Mall.Module.Product
...
@@ -2700,7 +2702,7 @@ namespace Mall.Module.Product
/// <param name="storeId">门店编号</param>
/// <param name="storeId">门店编号</param>
/// <param name="chooseDate">选择日期</param>
/// <param name="chooseDate">选择日期</param>
/// <returns></returns>
/// <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
>();
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
)
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
)
...
@@ -3602,7 +3604,7 @@ namespace Mall.Module.Product
...
@@ -3602,7 +3604,7 @@ namespace Mall.Module.Product
string
tempTimeStr
=
""
;
string
tempTimeStr
=
""
;
if
(
j
%
2
==
0
)
if
(
j
%
2
==
0
)
{
{
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
tempTimeStr
=
currentDay
.
AddHours
((
j
/
2
)).
ToString
(
"HH:mm"
);
}
}
else
else
{
{
...
@@ -3668,7 +3670,7 @@ namespace Mall.Module.Product
...
@@ -3668,7 +3670,7 @@ namespace Mall.Module.Product
#
endregion
#
endregion
var
minModel
=
new
RB_MiniProgramRepository
().
GetMiniProgramRepository
(
new
RB_MiniProgram_Extend
()
var
minModel
=
new
RB_MiniProgramRepository
().
GetMiniProgramRepository
(
new
RB_MiniProgram_Extend
()
{
{
MallBaseId
=
MallBaseId
MallBaseId
=
MallBaseId
});
});
...
@@ -3826,7 +3828,7 @@ namespace Mall.Module.Product
...
@@ -3826,7 +3828,7 @@ namespace Mall.Module.Product
isChooseServicePerson
=
model
.
IsChooseServicePerson
,
isChooseServicePerson
=
model
.
IsChooseServicePerson
,
depositMoney
=
model
.
DepositMoney
,
depositMoney
=
model
.
DepositMoney
,
categoryIdList
=
model
.
CategoryList
.
Select
(
x
=>
x
.
CategoryId
??
0
).
ToList
(),
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
=
""
delivery
=
""
};
};
...
@@ -5233,6 +5235,113 @@ namespace Mall.Module.Product
...
@@ -5233,6 +5235,113 @@ namespace Mall.Module.Product
return
material_InfoRepository
.
SetMaterialInfoTransfer
(
materialIds
,
groupId
,
uid
,
mallBaseId
);
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
#
endregion
#
region
商品分类
#
region
商品分类
...
@@ -7318,7 +7427,7 @@ namespace Mall.Module.Product
...
@@ -7318,7 +7427,7 @@ namespace Mall.Module.Product
{
nameof
(
RB_Goods_SpecificationValue
.
Name
),
supModel1
?.
Name
??
""
},
{
nameof
(
RB_Goods_SpecificationValue
.
Name
),
supModel1
?.
Name
??
""
},
{
nameof
(
RB_Goods_SpecificationValue
.
Sort
),
supModel1
?.
Sort
??
0
}
{
nameof
(
RB_Goods_SpecificationValue
.
Sort
),
supModel1
?.
Sort
??
0
}
};
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
{
new
WhereHelper
()
new
WhereHelper
()
{
{
...
@@ -8225,7 +8334,7 @@ namespace Mall.Module.Product
...
@@ -8225,7 +8334,7 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
/// <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
;
Dictionary
<
string
,
object
>
keyValues
;
if
(
type
==
1
)
if
(
type
==
1
)
...
@@ -8309,7 +8418,15 @@ namespace Mall.Module.Product
...
@@ -8309,7 +8418,15 @@ namespace Mall.Module.Product
keyValues
=
new
Dictionary
<
string
,
object
>()
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
SupplierId
),
SupplierId
}
{
nameof
(
RB_Goods
.
SupplierId
),
SupplierId
}
};
};
}
//面议
}
else
if
(
type
==
13
)
{
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
RetailStore
),(
RetailStore
-
1
)}
};
}
//面议
else
else
{
{
return
false
;
return
false
;
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
2ebb16f4
...
@@ -50,6 +50,10 @@ namespace Mall.Repository.Product
...
@@ -50,6 +50,10 @@ namespace Mall.Repository.Product
{
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
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
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StoresIds
))
{
{
where
+=
$@" and FIND_IN_SET('
{
dmodel
.
StoresIds
}
',g.
{
nameof
(
RB_Goods_Extend
.
StoresIds
)}
)"
;
where
+=
$@" and FIND_IN_SET('
{
dmodel
.
StoresIds
}
',g.
{
nameof
(
RB_Goods_Extend
.
StoresIds
)}
)"
;
...
@@ -99,7 +103,8 @@ namespace Mall.Repository.Product
...
@@ -99,7 +103,8 @@ namespace Mall.Repository.Product
{
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
SupplierId
)}
=
{
dmodel
.
SupplierId
}
"
;
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
}
"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
MinProfitRate
)}
<
{
dmodel
.
MinProfitRate
}
"
;
}
}
if
(
dmodel
.
GoodsPageType
.
HasValue
)
if
(
dmodel
.
GoodsPageType
.
HasValue
)
...
...
Mall.Repository/User/RB_TenantRepository.cs
View file @
2ebb16f4
...
@@ -59,12 +59,12 @@ namespace Mall.Repository.User
...
@@ -59,12 +59,12 @@ namespace Mall.Repository.User
StringBuilder
builder1
=
new
StringBuilder
();
StringBuilder
builder1
=
new
StringBuilder
();
builder1
.
AppendFormat
(
@"
builder1
.
AppendFormat
(
@"
SELECT A.TenantId,A.Account AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
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
FROM RB_Tenant AS A
WHERE 1=1 AND A.Account='{0}'
WHERE 1=1 AND A.Account='{0}'
UNION ALL
UNION ALL
SELECT A.TenantId,B.EmpAccount AS Account,A.Name,A.MobilePhone,A.WeChatNum,A.IsEffective,A.AccountValidate,A.CreateMiniPrograme
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
FROM RB_Tenant AS A INNER JOIN rb_employee AS B ON A.TenantId=B.TenantId
WHERE 1=1 AND B.EmpAccount='{0}'
WHERE 1=1 AND B.EmpAccount='{0}'
"
,
query
.
Account
.
Trim
());
"
,
query
.
Account
.
Trim
());
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
2ebb16f4
...
@@ -416,6 +416,86 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -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
#
endregion
#
region
商品分类
#
region
商品分类
...
@@ -453,7 +533,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -453,7 +533,7 @@ namespace Mall.WebApi.Controllers.MallBase
x
.
IsShow
,
x
.
IsShow
,
x
.
TenantId
,
x
.
TenantId
,
x
.
MallBaseId
,
x
.
MallBaseId
,
CategoryPageTypeStr
=
x
.
CategoryPageType
.
GetEnumName
(),
CategoryPageTypeStr
=
x
.
CategoryPageType
.
GetEnumName
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
});
});
return
ApiResult
.
Success
(
""
,
pagelist
);
return
ApiResult
.
Success
(
""
,
pagelist
);
...
@@ -1220,7 +1300,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1220,7 +1300,8 @@ namespace Mall.WebApi.Controllers.MallBase
Id
=
parameters
.
GetInt
(
"Id"
),
Id
=
parameters
.
GetInt
(
"Id"
),
StartTime
=
parameters
.
GetStringValue
(
"StartTime"
),
StartTime
=
parameters
.
GetStringValue
(
"StartTime"
),
EndTime
=
parameters
.
GetStringValue
(
"EndTime"
),
EndTime
=
parameters
.
GetStringValue
(
"EndTime"
),
OrderBy
=
parameters
.
GetInt
(
"OrderBy"
)
OrderBy
=
parameters
.
GetInt
(
"OrderBy"
),
RetailStore
=
parameters
.
GetInt
(
"RetailStore"
,
-
1
),
};
};
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
TenantId
=
parms
.
TenantId
;
...
@@ -1260,7 +1341,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1260,7 +1341,8 @@ namespace Mall.WebApi.Controllers.MallBase
CarouselImageList
=
x
.
CarouselImageList
.
Select
(
qitem
=>
qitem
.
Path
).
ToList
(),
CarouselImageList
=
x
.
CarouselImageList
.
Select
(
qitem
=>
qitem
.
Path
).
ToList
(),
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IsNoTax
,
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
);
return
ApiResult
.
Success
(
""
,
pagelist
);
}
}
...
@@ -1786,7 +1868,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1786,7 +1868,7 @@ namespace Mall.WebApi.Controllers.MallBase
model
?.
PresentFXMonth
,
model
?.
PresentFXMonth
,
model
?.
Advertising
,
model
?.
Advertising
,
model
?.
SubName
,
model
?.
SubName
,
MarketingLogo
=
tempLogo
,
MarketingLogo
=
tempLogo
,
model
?.
ShelvesDate
,
model
?.
ShelvesDate
,
model
?.
DownDate
,
model
?.
DownDate
,
model
?.
VideoType
,
model
?.
VideoType
,
...
@@ -1890,7 +1972,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1890,7 +1972,7 @@ namespace Mall.WebApi.Controllers.MallBase
int
IsKorea
=
parms
.
GetInt
(
"IsKorea"
,
0
);
//是否为韩国馆项目(1-是)
int
IsKorea
=
parms
.
GetInt
(
"IsKorea"
,
0
);
//是否为韩国馆项目(1-是)
demodel
.
CategoryList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Category_Extend
>>(
parms
.
GetStringValue
(
"CategoryList"
));
demodel
.
CategoryList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Category_Extend
>>(
parms
.
GetStringValue
(
"CategoryList"
));
demodel
.
CarouselImageList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_ImageCommonModel
>>(
parms
.
GetStringValue
(
"CarouselImageList"
));
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
>();
demodel
.
SpecificationPriceList
=
new
List
<
RB_Goods_SpecificationPrice_Extend
>();
JArray
priceArray
=
JArray
.
Parse
(
parms
.
GetStringValue
(
"SpecificationPriceList"
));
JArray
priceArray
=
JArray
.
Parse
(
parms
.
GetStringValue
(
"SpecificationPriceList"
));
foreach
(
var
item
in
priceArray
)
foreach
(
var
item
in
priceArray
)
...
@@ -1898,14 +1980,14 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1898,14 +1980,14 @@ namespace Mall.WebApi.Controllers.MallBase
JObject
jObj
=
JObject
.
Parse
(
item
.
ToString
());
JObject
jObj
=
JObject
.
Parse
(
item
.
ToString
());
RB_Goods_SpecificationPrice_Extend
pModel
=
new
RB_Goods_SpecificationPrice_Extend
()
RB_Goods_SpecificationPrice_Extend
pModel
=
new
RB_Goods_SpecificationPrice_Extend
()
{
{
Commission
=
jObj
.
GetDecimal
(
"Commission"
),
Commission
=
jObj
.
GetDecimal
(
"Commission"
),
CostMoney
=
jObj
.
GetDecimal
(
"CostMoney"
),
CostMoney
=
jObj
.
GetDecimal
(
"CostMoney"
),
GoodsNumbers
=
jObj
.
GetStringValue
(
"GoodsNumbers"
),
GoodsNumbers
=
jObj
.
GetStringValue
(
"GoodsNumbers"
),
GoodsWeight
=
jObj
.
GetInt
(
"GoodsWeight"
),
GoodsWeight
=
jObj
.
GetInt
(
"GoodsWeight"
),
InventoryNum
=
jObj
.
GetInt
(
"InventoryNum"
),
InventoryNum
=
jObj
.
GetInt
(
"InventoryNum"
),
SellingPrice
=
jObj
.
GetDecimal
(
"SellingPrice"
),
SellingPrice
=
jObj
.
GetDecimal
(
"SellingPrice"
),
SpecificationSort
=
jObj
.
GetStringValue
(
"SpecificationSort"
),
SpecificationSort
=
jObj
.
GetStringValue
(
"SpecificationSort"
),
AttrList
=
new
object
()
AttrList
=
new
object
()
};
};
var
arrList
=
new
List
<
object
>();
var
arrList
=
new
List
<
object
>();
JArray
sArray
=
JArray
.
Parse
(
jObj
.
GetStringValue
(
"AttrList"
));
JArray
sArray
=
JArray
.
Parse
(
jObj
.
GetStringValue
(
"AttrList"
));
...
@@ -1914,19 +1996,19 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1914,19 +1996,19 @@ namespace Mall.WebApi.Controllers.MallBase
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
arrList
.
Add
(
new
arrList
.
Add
(
new
{
{
SName
=
sObj
.
GetStringValue
(
"SName"
),
SName
=
sObj
.
GetStringValue
(
"SName"
),
SVId
=
sObj
.
GetInt
(
"SVId"
),
SVId
=
sObj
.
GetInt
(
"SVId"
),
SVName
=
sObj
.
GetStringValue
(
"SVName"
)
SVName
=
sObj
.
GetStringValue
(
"SVName"
)
});
});
}
}
pModel
.
AttrList
=
arrList
;
pModel
.
AttrList
=
arrList
;
demodel
.
SpecificationPriceList
.
Add
(
pModel
);
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
.
AreaList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_Area_Extend
>>(
parms
.
GetStringValue
(
"AreaList"
));
demodel
.
DistributionCommissionList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_DistributionCommission_Extend
>>(
parms
.
GetStringValue
(
"DistributionCommissionList"
));
demodel
.
DistributionCommissionList
=
JsonHelper
.
DeserializeObject
<
List
<
RB_Goods_DistributionCommission_Extend
>>(
parms
.
GetStringValue
(
"DistributionCommissionList"
));
var
marketingLogo
=
JsonHelper
.
DeserializeObject
<
MarketingLogoItem
>(
parms
.
GetStringValue
(
"MarketingLogo"
));
var
marketingLogo
=
JsonHelper
.
DeserializeObject
<
MarketingLogoItem
>(
parms
.
GetStringValue
(
"MarketingLogo"
));
demodel
.
MarketingLogo
=
JsonHelper
.
Serialize
(
marketingLogo
);
//待完善
demodel
.
MarketingLogo
=
JsonHelper
.
Serialize
(
marketingLogo
);
//待完善
demodel
.
TenantId
=
RequestParm
.
TenantId
;
demodel
.
TenantId
=
RequestParm
.
TenantId
;
demodel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
demodel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
...
@@ -1940,7 +2022,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1940,7 +2022,7 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请添加商品轮播图"
);
return
ApiResult
.
ParamIsNull
(
"请添加商品轮播图"
);
}
}
demodel
.
CarouselImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CarouselImageList
.
Select
(
x
=>
x
.
Path
));
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
(
"请输入售价"
);
return
ApiResult
.
ParamIsNull
(
"请输入售价"
);
}
}
...
@@ -2065,8 +2147,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2065,8 +2147,8 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
}
}
catch
catch
{
{
}
}
}
}
...
@@ -2291,6 +2373,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2291,6 +2373,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel
.
IsMultipleDeduction
??=
2
;
demodel
.
IsMultipleDeduction
??=
2
;
demodel
.
Status
=
0
;
demodel
.
Status
=
0
;
demodel
.
CreateBy
=
UserInfo
.
EmpId
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
CreateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
#
endregion
#
endregion
...
@@ -2438,7 +2521,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2438,7 +2521,7 @@ namespace Mall.WebApi.Controllers.MallBase
var
req
=
RequestParm
;
var
req
=
RequestParm
;
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
string
GoodsIds
=
parms
.
GetStringValue
(
"GoodsIds"
);
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
);
int
Sort
=
parms
.
GetInt
(
"Sort"
,
0
);
string
GoodsName
=
parms
.
GetStringValue
(
"GoodsName"
);
string
GoodsName
=
parms
.
GetStringValue
(
"GoodsName"
);
int
FreightId
=
parms
.
GetInt
(
"FreightId"
,
0
);
//运费
int
FreightId
=
parms
.
GetInt
(
"FreightId"
,
0
);
//运费
...
@@ -2452,6 +2535,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2452,6 +2535,7 @@ namespace Mall.WebApi.Controllers.MallBase
int
IsQuickBuy
=
parms
.
GetInt
(
"IsQuickBuy"
,
2
);
//快速购买
int
IsQuickBuy
=
parms
.
GetInt
(
"IsQuickBuy"
,
2
);
//快速购买
int
IsGoodsNegotiable
=
parms
.
GetInt
(
"IsGoodsNegotiable"
,
2
);
//商品面议
int
IsGoodsNegotiable
=
parms
.
GetInt
(
"IsGoodsNegotiable"
,
2
);
//商品面议
int
SupplierId
=
parms
.
GetInt
(
"SupplierId"
,
0
);
//供应商
int
SupplierId
=
parms
.
GetInt
(
"SupplierId"
,
0
);
//供应商
int
RetailStore
=
parms
.
GetInt
(
"RetailStore"
,
0
);
//是否同步到分销平台1-取消,2-是
if
(
string
.
IsNullOrEmpty
(
GoodsIds
))
if
(
string
.
IsNullOrEmpty
(
GoodsIds
))
{
{
return
ApiResult
.
ParamIsNull
();
return
ApiResult
.
ParamIsNull
();
...
@@ -2472,7 +2556,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2472,7 +2556,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
bool
flag
=
productModule
.
SetProductGoodsQuickUpdate
(
GoodsIds
,
Type
,
Sort
,
GoodsName
,
FreightId
,
LimitBuyGoodsNum
,
LimitBuyOrderNum
,
IntegralPresent
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
)
if
(
flag
)
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
...
@@ -2858,10 +2942,12 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2858,10 +2942,12 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetGoodsActivityInfo
()
{
public
ApiResult
SetGoodsActivityInfo
()
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
RB_Goods_Activity_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Activity_Extend
>(
parms
.
msg
.
ToString
());
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
(
"请输入活动名称"
);
return
ApiResult
.
ParamIsNull
(
"请输入活动名称"
);
}
}
if
(
demodel
.
Type
==
1
)
if
(
demodel
.
Type
==
1
)
...
@@ -2878,25 +2964,31 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2878,25 +2964,31 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
ParamIsNull
(
"请输入分销订单金额"
);
return
ApiResult
.
ParamIsNull
(
"请输入分销订单金额"
);
}
}
}
}
else
{
else
{
if
(
demodel
.
GoodsNum
<=
0
)
if
(
demodel
.
GoodsNum
<=
0
)
{
{
return
ApiResult
.
ParamIsNull
(
"请输入分销商品数量"
);
return
ApiResult
.
ParamIsNull
(
"请输入分销商品数量"
);
}
}
}
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
RangeIds
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
RangeIds
))
{
return
ApiResult
.
ParamIsNull
(
"请选择适配分类/商品"
);
return
ApiResult
.
ParamIsNull
(
"请选择适配分类/商品"
);
}
}
if
(
demodel
.
CodeLength
<
4
)
{
if
(
demodel
.
CodeLength
<
4
)
{
return
ApiResult
.
ParamIsNull
(
"请选择验证码长度"
);
return
ApiResult
.
ParamIsNull
(
"请选择验证码长度"
);
}
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeName
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeName
))
{
return
ApiResult
.
ParamIsNull
(
"请输入奖品名称"
);
return
ApiResult
.
ParamIsNull
(
"请输入奖品名称"
);
}
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeImage
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
PrizeImage
))
{
return
ApiResult
.
ParamIsNull
(
"请选择奖品图片"
);
return
ApiResult
.
ParamIsNull
(
"请选择奖品图片"
);
}
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
CoverImage
))
{
if
(
string
.
IsNullOrEmpty
(
demodel
.
CoverImage
))
{
return
ApiResult
.
ParamIsNull
(
"请选择封面图"
);
return
ApiResult
.
ParamIsNull
(
"请选择封面图"
);
}
}
...
@@ -2926,12 +3018,14 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2926,12 +3018,14 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetGoodsActivityState
()
{
public
ApiResult
SetGoodsActivityState
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ActivityId
=
parms
.
GetInt
(
"ActivityId"
,
0
);
int
ActivityId
=
parms
.
GetInt
(
"ActivityId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1启用 2禁用 3删除
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1启用 2禁用 3删除
if
(
ActivityId
<=
0
)
{
if
(
ActivityId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递活动参数"
);
return
ApiResult
.
ParamIsNull
(
"请传递活动参数"
);
}
}
string
msg
=
activityModule
.
SetGoodsActivityState
(
ActivityId
,
Type
);
string
msg
=
activityModule
.
SetGoodsActivityState
(
ActivityId
,
Type
);
...
@@ -2939,7 +3033,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2939,7 +3033,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
return
ApiResult
.
Success
();
return
ApiResult
.
Success
();
}
}
else
{
else
{
return
ApiResult
.
Failed
(
msg
);
return
ApiResult
.
Failed
(
msg
);
}
}
}
}
...
@@ -2986,7 +3081,8 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -2986,7 +3081,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
ApiResult
SetGoodsActivityUserState
()
{
public
ApiResult
SetGoodsActivityUserState
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
PrizeId
=
parms
.
GetInt
(
"PrizeId"
,
0
);
int
PrizeId
=
parms
.
GetInt
(
"PrizeId"
,
0
);
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1已兑换 2已失效
int
Type
=
parms
.
GetInt
(
"Type"
,
1
);
// 类型 1已兑换 2已失效
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
2ebb16f4
...
@@ -49,7 +49,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -49,7 +49,7 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// </summary>
private
readonly
Module
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
private
readonly
Module
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
/// <summary>
/// <summary>
/// 小程序图标处理类对象
/// 小程序图标处理类对象
...
@@ -123,6 +123,14 @@ namespace Mall.WebApi.Controllers.User
...
@@ -123,6 +123,14 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Failed
(
"密码错误"
);
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
授权信息
#
region
add
by
:
W
2020
-
07
-
06
erp
授权信息
var
erpUserInfo
=
new
Mall
.
Model
.
Entity
.
Property
.
RB_Employee
();
var
erpUserInfo
=
new
Mall
.
Model
.
Entity
.
Property
.
RB_Employee
();
string
erptoken
=
""
;
string
erptoken
=
""
;
...
@@ -182,6 +190,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -182,6 +190,7 @@ namespace Mall.WebApi.Controllers.User
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
string
secret
=
Config
.
JwtSecretKey
;
string
secret
=
Config
.
JwtSecretKey
;
string
token
=
encoder
.
Encode
(
payload
,
secret
);
string
token
=
encoder
.
Encode
(
payload
,
secret
);
#
endregion
#
endregion
UserInfo
obj
=
new
UserInfo
UserInfo
obj
=
new
UserInfo
{
{
...
@@ -197,13 +206,14 @@ namespace Mall.WebApi.Controllers.User
...
@@ -197,13 +206,14 @@ namespace Mall.WebApi.Controllers.User
Token
=
token
,
Token
=
token
,
SecretKey
=
""
,
SecretKey
=
""
,
MallBaseId
=
0
,
MallBaseId
=
0
,
IsOtherUpdateGoods
=
RoleAuth
,
EmpId
=
model
.
EmpId
,
EmpId
=
model
.
EmpId
,
erptoken
=
erptoken
,
erptoken
=
erptoken
,
ERPEmpId
=
(
erpUserInfo
?.
EmployeeId
??
0
),
ERPEmpId
=
(
erpUserInfo
?.
EmployeeId
??
0
),
ERPBranchId
=
(
erpUserInfo
?.
RB_Branch_id
??
-
1
),
ERPBranchId
=
(
erpUserInfo
?.
RB_Branch_id
??
-
1
),
ERPGroupId
=
(
erpUserInfo
?.
RB_Group_id
??
0
),
ERPGroupId
=
(
erpUserInfo
?.
RB_Group_id
??
0
),
IsOpenSchool
=
0
,
IsOpenSchool
=
0
,
IsKorea
=
0
,
IsKorea
=
0
,
};
};
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
UserReidsCache
.
UserInfoSet
(
UserModuleCacheKeyConfig
.
Mall_Login_Info
+
model
.
TenantId
,
obj
,
Config
.
JwtExpirTime
);
return
ApiResult
.
Success
(
""
,
obj
);
return
ApiResult
.
Success
(
""
,
obj
);
...
@@ -455,7 +465,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -455,7 +465,7 @@ namespace Mall.WebApi.Controllers.User
var
flag
=
programModule
.
SetMiniProgramActivityStyleModule
(
extModel
);
var
flag
=
programModule
.
SetMiniProgramActivityStyleModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// <summary>
/// 修改微信小程序分销订阅配置信息
/// 修改微信小程序分销订阅配置信息
...
@@ -1327,7 +1337,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1327,7 +1337,7 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
GetMenuList
()
public
ApiResult
GetMenuList
()
{
{
List
<
object
>
resultList
=
new
List
<
object
>();
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
>();
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
if
(
RequestParm
.
EmpId
>
0
)
{
{
...
@@ -1791,7 +1801,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1791,7 +1801,7 @@ namespace Mall.WebApi.Controllers.User
{
{
var
extModel
=
new
RB_PlugIn_Extend
()
var
extModel
=
new
RB_PlugIn_Extend
()
{
{
TenantId
=
RequestParm
.
TenantId
TenantId
=
RequestParm
.
TenantId
};
};
var
list
=
plugInModule
.
GetPlugInListModule
(
extModel
);
var
list
=
plugInModule
.
GetPlugInListModule
(
extModel
);
var
distinctList
=
list
.
GroupBy
(
qitem
=>
new
{
qitem
.
PlugType
,
qitem
.
GroupName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
PlugType
,
qitem
.
Key
.
GroupName
});
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
...
@@ -2184,7 +2194,7 @@ namespace Mall.WebApi.Controllers.User
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
TenantId
=
RequestParm
.
TenantId
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
CreateDate
=
DateTime
.
Now
;
var
flag
=
programModule
.
SetLiveConfigModule
(
extModel
);
var
flag
=
programModule
.
SetLiveConfigModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
):
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
}
#
endregion
#
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