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
c873ac83
Commit
c873ac83
authored
Sep 23, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
77d2c9fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
211 additions
and
750 deletions
+211
-750
ExcelTempLateHelper.cs
Mall.Common/Plugin/ExcelTempLateHelper.cs
+52
-138
NPOIHelper.cs
Mall.Common/Plugin/NPOIHelper.cs
+1
-396
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+3
-91
CarrierModule.cs
Mall.Module.TradePavilion/CarrierModule.cs
+2
-3
FirstShopListModule.cs
Mall.Module.TradePavilion/FirstShopListModule.cs
+66
-94
UserModule.cs
Mall.Module.User/UserModule.cs
+8
-9
AppletGoodsController.cs
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
+2
-6
ProductController.cs
Mall.WebApi/Controllers/Product/ProductController.cs
+1
-1
TradeController.cs
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
+1
-1
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+1
-1
ApiFilterAttribute.cs
Mall.WebApi/Filter/ApiFilterAttribute.cs
+1
-10
ApiTokenHelper.cs
Mall.WebApi/Helper/ApiTokenHelper.cs
+73
-0
No files found.
Mall.Common/Plugin/ExcelTempLateHelper.cs
View file @
c873ac83
This diff is collapsed.
Click to expand it.
Mall.Common/Plugin/NPOIHelper.cs
View file @
c873ac83
This diff is collapsed.
Click to expand it.
Mall.Module.Product/ProductModule.cs
View file @
c873ac83
...
...
@@ -2709,7 +2709,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
)
{
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
if
(
model
==
null
||
model
.
TenantId
!=
TenantId
||
model
.
MallBaseId
!=
MallBaseId
)
...
...
@@ -3893,13 +3893,11 @@ namespace Mall.Module.Product
/// 获取线下服务人员列表
/// </summary>
/// <param name="goodsId"></param>
/// <param name="UserId"></param>
/// <param name="SmallShopsId"></param>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <param name="storeId"></param>
/// <returns></returns>
public
object
GetAppletOfflineServicePersionModule
(
int
goodsId
,
int
UserId
,
int
SmallShopsId
,
int
TenantId
,
int
MallBaseId
,
int
storeId
=
0
)
public
object
GetAppletOfflineServicePersionModule
(
int
goodsId
,
int
TenantId
,
int
MallBaseId
,
int
storeId
=
0
)
{
var
model
=
goodsRepository
.
GetEntity
(
goodsId
).
RefMapperTo
<
RB_Goods_Extend
>();
//查询分类
...
...
@@ -6625,96 +6623,10 @@ namespace Mall.Module.Product
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <param name="IsGetSpec">是否获取规格</param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetListByGoodsClassify
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
,
int
IsGetSpec
=
0
)
public
List
<
RB_Goods_Extend
>
GetListByGoodsClassify
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetPageList_V2
(
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);
// //规格列表
// List<RB_Goods_Specification_Extend> SpecificationList = new List<RB_Goods_Specification_Extend>();
// //规格值
// List<RB_Goods_SpecificationValue_Extend> svlist = new List<RB_Goods_SpecificationValue_Extend>();
// //规格值列表
// List<RB_Goods_SpecificationPrice_Extend> SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
// if (IsGetSpec == 1)
// {
// SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// SpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
// }
// foreach (var item in list)
// {
// item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
// //轮播图
// item.CoverImage = "";
// item.CarouselImageList = new List<RB_ImageCommonModel>();
// if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
// {
// List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(item.CarouselImage);
// //封面图
// item.CoverImage = CarouselIdList[0];
// //轮播图
// //轮播图
// foreach (var qitem in CarouselIdList)
// {
// item.CarouselImageList.Add(new RB_ImageCommonModel()
// {
// Id = 0,
// Name = "",
// Path = qitem
// });
// }
// }
// item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
// if (IsGetSpec == 1)
// {
// item.SpecificationList = SpecificationList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList() ?? new List<RB_Goods_Specification_Extend>();
// if (item.SpecificationList != null && item.SpecificationList.Count > 0)
// {
// foreach (var subItem in item.SpecificationList)
// {
// subItem.SpecificationValueList = svlist.Where(x => x.SpecificationId == subItem.Id).ToList();
// }
// }
// var tempPriceList = SpecificationPriceList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>();
// int SortNum = 1;
// foreach (var childItem in tempPriceList)
// {
// if (!string.IsNullOrEmpty(childItem.SpecificationSort))
// {
// var ssarr = childItem.SpecificationSort.Split(':');
// int Sort = Convert.ToInt32(ssarr[0]);
// string pic_url = item.SpecificationList[0].SpecificationValueList.Where(x => x.Sort == Sort).FirstOrDefault()?.ImagePath;
// List<object> AttrList = new List<object>();
// for (int i = 0; i < ssarr.Length; i++)
// {
// var smodel = item.SpecificationList[i];
// var svmodel = smodel.SpecificationValueList.Where(x => x.Sort == Convert.ToInt32(ssarr[i])).FirstOrDefault();
// AttrList.Add(new
// {
// SName = smodel.Name,
// SId = smodel.Id,
// SVId = svmodel.Sort,
// SVName = svmodel.Name
// });
// }
// childItem.AttrList = AttrList;
// }
// childItem.SortNum = SortNum;
// SortNum++;
// }
// item.SpecificationPriceList = tempPriceList.OrderByDescending(x => x.SortNum).ToList();
// }
// }
//}
return
list
;
}
...
...
Mall.Module.TradePavilion/CarrierModule.cs
View file @
c873ac83
...
...
@@ -964,12 +964,11 @@ namespace Mall.Module.TradePavilion
}
}
}
catch
(
Exception
ex
)
catch
{
}
}
else
{
...
...
@@ -1176,7 +1175,7 @@ namespace Mall.Module.TradePavilion
/// <returns></returns>
public
bool
AddOrUpdateCollect
(
RB_Collect_Extend
model
)
{
bool
flag
=
false
;
bool
flag
;
try
{
int
Id
=
0
;
...
...
Mall.Module.TradePavilion/FirstShopListModule.cs
View file @
c873ac83
This diff is collapsed.
Click to expand it.
Mall.Module.User/UserModule.cs
View file @
c873ac83
...
...
@@ -6555,21 +6555,20 @@ namespace Mall.Module.User
/// </summary>
/// <param name="billId"></param>
/// <param name="remark"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="empId"></param>
/// <returns></returns>
public
bool
SetRecommendOrdersBillRemark
(
int
billId
,
string
remark
,
int
tenantId
,
int
mallBaseId
,
int
empId
)
public
bool
SetRecommendOrdersBillRemark
(
int
billId
,
string
remark
)
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Distributor_Bill
.
Remark
),
remark
},
{
nameof
(
RB_Distributor_Bill
.
UpdateDate
),
DateTime
.
Now
}
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Distributor_Bill
.
Id
),
FiledValue
=
billId
,
OperatorEnum
=
OperatorEnum
.
Equal
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
FiledName
=
nameof
(
RB_Distributor_Bill
.
Id
),
FiledValue
=
billId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
bool
flag
=
distributor_BillRepository
.
Update
(
keyValues
,
wheres
);
...
...
Mall.WebApi/Controllers/Product/AppletGoodsController.cs
View file @
c873ac83
...
...
@@ -472,15 +472,12 @@ namespace Mall.WebApi.Controllers.MallBase
JObject
prams
=
JObject
.
Parse
(
req
.
msg
.
ToString
());
int
GoodsId
=
prams
.
GetInt
(
"GoodsId"
,
0
);
int
StoreId
=
prams
.
GetInt
(
"StoreId"
,
0
);
int
servicePersionId
=
prams
.
GetInt
(
"servicePersionId"
,
0
);
//选择的日期
string
chooseDate
=
prams
.
GetStringValue
(
"chooseDate"
);
if
(
StoreId
<=
0
||
GoodsId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择门店"
);
}
int
UserId
=
req
.
UserId
;
object
Robj
=
productModule
.
GetAppletOfflineGoodsInfoModule
(
GoodsId
,
UserId
,
req
.
SmallShopsId
,
req
.
TenantId
,
req
.
MallBaseId
,
storeId
:
StoreId
,
servicePersionId
:
servicePersionId
,
chooseDate
:
chooseDate
);
object
Robj
=
productModule
.
GetAppletOfflineGoodsInfoModule
(
GoodsId
,
UserId
,
req
.
SmallShopsId
,
req
.
TenantId
,
req
.
MallBaseId
,
storeId
:
StoreId
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
...
...
@@ -529,8 +526,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择门店"
);
}
int
UserId
=
req
.
UserId
;
object
Robj
=
productModule
.
GetAppletOfflineServicePersionModule
(
GoodsId
,
UserId
,
req
.
SmallShopsId
,
req
.
TenantId
,
req
.
MallBaseId
,
storeId
:
StoreId
);
object
Robj
=
productModule
.
GetAppletOfflineServicePersionModule
(
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
,
storeId
:
StoreId
);
return
ApiResult
.
Success
(
""
,
Robj
);
}
...
...
Mall.WebApi/Controllers/Product/ProductController.cs
View file @
c873ac83
...
...
@@ -2756,7 +2756,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
return
ApiResult
.
ParamIsNull
(
"请选择商品分类"
);
}
List
<
int
>
CategoryIdList
=
new
List
<
int
>()
;
List
<
int
>
CategoryIdList
;
try
{
CategoryIdList
=
JsonConvert
.
DeserializeObject
<
List
<
int
>>(
CategoryList
);
...
...
Mall.WebApi/Controllers/TradePavilion/TradeController.cs
View file @
c873ac83
...
...
@@ -2521,7 +2521,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
return
ApiResult
.
ParamIsNull
(
"请传递报名id"
);
}
string
path
=
firstShopListModule
.
GetFirstShopEnrollWordExport
(
EnrollId
,
req
.
MallBaseId
,
out
string
errmsg
);
string
path
=
firstShopListModule
.
GetFirstShopEnrollWordExport
(
EnrollId
,
out
string
errmsg
);
if
(
errmsg
==
""
)
{
return
ApiResult
.
Success
(
""
,
path
);
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
c873ac83
...
...
@@ -3153,7 +3153,7 @@ namespace Mall.WebApi.Controllers.User
{
return
ApiResult
.
ParamIsNull
();
}
bool
flag
=
userModule
.
SetRecommendOrdersBillRemark
(
BillId
,
Remark
,
req
.
TenantId
,
req
.
MallBaseId
,
req
.
EmpId
);
bool
flag
=
userModule
.
SetRecommendOrdersBillRemark
(
BillId
,
Remark
);
if
(
flag
)
{
return
ApiResult
.
Success
();
...
...
Mall.WebApi/Filter/ApiFilterAttribute.cs
View file @
c873ac83
...
...
@@ -37,13 +37,11 @@ namespace Mall.WebApi.Filter
/// <param name="actionContext"></param>
public
override
void
OnActionExecuting
(
ActionExecutingContext
actionContext
)
{
string
ip
=
""
;
ip
=
actionContext
.
HttpContext
.
Request
.
Headers
[
"X-Forwarded-For"
].
FirstOrDefault
();
string
ip
=
actionContext
.
HttpContext
.
Request
.
Headers
[
"X-Forwarded-For"
].
FirstOrDefault
();
if
(
string
.
IsNullOrEmpty
(
ip
))
{
ip
=
actionContext
.
HttpContext
.
Connection
.
RemoteIpAddress
.
ToString
();
}
if
(!
string
.
IsNullOrEmpty
(
ip
)
&&
Common
.
BackListHelper
.
bankList
.
Contains
(
ip
))
{
actionContext
.
Result
=
new
Microsoft
.
AspNetCore
.
Mvc
.
JsonResult
(
new
ApiResult
...
...
@@ -330,17 +328,10 @@ namespace Mall.WebApi.Filter
#
endregion
#
region
根据
uid
获取用户私钥值
TokenUserInfo
tokenUserInfo
=
JsonConvert
.
DeserializeObject
<
TokenUserInfo
>(
actionContext
.
HttpContext
.
Items
[
GlobalKey
.
TokenUserInfo
].
ToString
());
//TODO查询用户秘钥
string
privateKey
=
""
;
//等封装了缓存再说
// UserInfo userInfo = UserReidsCache.GetUserLoginInfo(tokenUserInfo.uid);
//if (userInfo != null)
//{
// privateKey = userInfo.SecretKey;
//}
#
endregion
#
region
校验签名是否合法
...
...
Mall.WebApi/Helper/ApiTokenHelper.cs
0 → 100644
View file @
c873ac83
using
JWT
;
using
JWT.Algorithms
;
using
JWT.Serializers
;
using
Mall.Common.API
;
using
Mall.Common.Plugin
;
using
Newtonsoft.Json.Linq
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Mall.WebApi.Helper
{
/// <summary>
/// Token帮助类
/// </summary>
public
class
ApiTokenHelper
{
/// <summary>
/// 生成Token
/// </summary>
/// <param name="tokenUser"></param>
/// <returns></returns>
public
static
string
CreateToken
(
TokenUserInfo
tokenUser
)
{
IDateTimeProvider
provider
=
new
UtcDateTimeProvider
();
var
now
=
provider
.
GetNow
().
AddMinutes
(-
1
);
var
unixEpoch
=
new
DateTime
(
1970
,
1
,
1
,
0
,
0
,
0
,
DateTimeKind
.
Utc
);
// or use JwtValidator.UnixEpoch
var
secondsSinceEpoch
=
Math
.
Round
((
now
-
unixEpoch
).
TotalSeconds
);
var
payload
=
new
Dictionary
<
string
,
object
>
{
{
"iat"
,
secondsSinceEpoch
},
{
"exp"
,
secondsSinceEpoch
+
Common
.
Config
.
JwtExpirTime
},
{
"mall_userInfo"
,
tokenUser
}
};
IJwtAlgorithm
algorithm
=
new
HMACSHA256Algorithm
();
IJsonSerializer
serializer
=
new
JsonNetSerializer
();
IBase64UrlEncoder
urlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtEncoder
encoder
=
new
JwtEncoder
(
algorithm
,
serializer
,
urlEncoder
);
string
secret
=
Common
.
Config
.
JwtSecretKey
;
string
token
=
encoder
.
Encode
(
payload
,
secret
);
return
token
;
}
/// <summary>
/// 解析Token
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
public
static
TokenUserInfo
ParsingToken
(
string
token
)
{
TokenUserInfo
tokenUser
=
new
TokenUserInfo
();
if
(
string
.
IsNullOrEmpty
(
token
))
{
IJsonSerializer
serializer
=
new
JsonNetSerializer
();
IDateTimeProvider
provider
=
new
UtcDateTimeProvider
();
IJwtValidator
validator
=
new
JwtValidator
(
serializer
,
provider
);
IBase64UrlEncoder
urlEncoder
=
new
JwtBase64UrlEncoder
();
IJwtDecoder
decoder
=
new
JwtDecoder
(
serializer
,
validator
,
urlEncoder
);
string
secret
=
Common
.
Config
.
JwtSecretKey
;
var
json
=
decoder
.
Decode
(
token
,
secret
,
verify
:
true
);
//token为之前生成的字符串
if
(!
string
.
IsNullOrEmpty
(
json
))
{
JObject
jwtJson
=
JObject
.
Parse
(
json
);
var
mall_userInfo
=
JObject
.
Parse
(
jwtJson
.
GetStringValue
(
"mall_userInfo"
));
tokenUser
.
requestFrom
=
(
Common
.
Enum
.
ApiRequestFromEnum
)
mall_userInfo
.
GetInt
(
"requestFrom"
);
tokenUser
.
uid
=
mall_userInfo
.
GetStringValue
(
"uid"
);
}
}
return
tokenUser
;
}
}
}
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