Commit c873ac83 authored by 黄奎's avatar 黄奎

页面修改

parent 77d2c9fe
This diff is collapsed.
This diff is collapsed.
...@@ -2709,7 +2709,7 @@ namespace Mall.Module.Product ...@@ -2709,7 +2709,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)
{ {
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)
...@@ -3893,13 +3893,11 @@ namespace Mall.Module.Product ...@@ -3893,13 +3893,11 @@ namespace Mall.Module.Product
/// 获取线下服务人员列表 /// 获取线下服务人员列表
/// </summary> /// </summary>
/// <param name="goodsId"></param> /// <param name="goodsId"></param>
/// <param name="UserId"></param>
/// <param name="SmallShopsId"></param>
/// <param name="TenantId"></param> /// <param name="TenantId"></param>
/// <param name="MallBaseId"></param> /// <param name="MallBaseId"></param>
/// <param name="storeId"></param> /// <param name="storeId"></param>
/// <returns></returns> /// <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>(); var model = goodsRepository.GetEntity(goodsId).RefMapperTo<RB_Goods_Extend>();
//查询分类 //查询分类
...@@ -6625,96 +6623,10 @@ namespace Mall.Module.Product ...@@ -6625,96 +6623,10 @@ namespace Mall.Module.Product
/// <param name="pageSize"></param> /// <param name="pageSize"></param>
/// <param name="count"></param> /// <param name="count"></param>
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <param name="IsGetSpec">是否获取规格</param>
/// <returns></returns> /// <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); 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; return list;
} }
......
...@@ -964,12 +964,11 @@ namespace Mall.Module.TradePavilion ...@@ -964,12 +964,11 @@ namespace Mall.Module.TradePavilion
} }
} }
} }
catch (Exception ex) catch
{ {
} }
} }
else else
{ {
...@@ -1176,7 +1175,7 @@ namespace Mall.Module.TradePavilion ...@@ -1176,7 +1175,7 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public bool AddOrUpdateCollect(RB_Collect_Extend model) public bool AddOrUpdateCollect(RB_Collect_Extend model)
{ {
bool flag = false; bool flag;
try try
{ {
int Id = 0; int Id = 0;
......
...@@ -6555,21 +6555,20 @@ namespace Mall.Module.User ...@@ -6555,21 +6555,20 @@ namespace Mall.Module.User
/// </summary> /// </summary>
/// <param name="billId"></param> /// <param name="billId"></param>
/// <param name="remark"></param> /// <param name="remark"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="empId"></param>
/// <returns></returns> /// <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>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Distributor_Bill.Remark),remark}, { nameof(RB_Distributor_Bill.Remark),remark},
{ nameof(RB_Distributor_Bill.UpdateDate),DateTime.Now} { nameof(RB_Distributor_Bill.UpdateDate),DateTime.Now}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>()
new WhereHelper(){ {
FiledName=nameof(RB_Distributor_Bill.Id), new WhereHelper()
FiledValue=billId, {
OperatorEnum=OperatorEnum.Equal FiledName=nameof(RB_Distributor_Bill.Id),
FiledValue=billId,
OperatorEnum=OperatorEnum.Equal
} }
}; };
bool flag = distributor_BillRepository.Update(keyValues, wheres); bool flag = distributor_BillRepository.Update(keyValues, wheres);
......
...@@ -472,15 +472,12 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -472,15 +472,12 @@ namespace Mall.WebApi.Controllers.MallBase
JObject prams = JObject.Parse(req.msg.ToString()); JObject prams = JObject.Parse(req.msg.ToString());
int GoodsId = prams.GetInt("GoodsId", 0); int GoodsId = prams.GetInt("GoodsId", 0);
int StoreId = prams.GetInt("StoreId", 0); int StoreId = prams.GetInt("StoreId", 0);
int servicePersionId = prams.GetInt("servicePersionId", 0);
//选择的日期
string chooseDate = prams.GetStringValue("chooseDate");
if (StoreId <= 0 || GoodsId <= 0) if (StoreId <= 0 || GoodsId <= 0)
{ {
return ApiResult.ParamIsNull(message: "请选择门店"); return ApiResult.ParamIsNull(message: "请选择门店");
} }
int UserId = req.UserId; 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); return ApiResult.Success("", Robj);
} }
...@@ -529,8 +526,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -529,8 +526,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.ParamIsNull(message: "请选择门店"); return ApiResult.ParamIsNull(message: "请选择门店");
} }
int UserId = req.UserId; object Robj = productModule.GetAppletOfflineServicePersionModule(GoodsId,req.TenantId, req.MallBaseId, storeId: StoreId);
object Robj = productModule.GetAppletOfflineServicePersionModule(GoodsId, UserId, req.SmallShopsId, req.TenantId, req.MallBaseId, storeId: StoreId);
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
......
...@@ -2756,7 +2756,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -2756,7 +2756,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.ParamIsNull("请选择商品分类"); return ApiResult.ParamIsNull("请选择商品分类");
} }
List<int> CategoryIdList = new List<int>(); List<int> CategoryIdList;
try try
{ {
CategoryIdList = JsonConvert.DeserializeObject<List<int>>(CategoryList); CategoryIdList = JsonConvert.DeserializeObject<List<int>>(CategoryList);
......
...@@ -2521,7 +2521,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2521,7 +2521,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.ParamIsNull("请传递报名id"); return ApiResult.ParamIsNull("请传递报名id");
} }
string path = firstShopListModule.GetFirstShopEnrollWordExport(EnrollId, req.MallBaseId, out string errmsg); string path = firstShopListModule.GetFirstShopEnrollWordExport(EnrollId, out string errmsg);
if (errmsg == "") if (errmsg == "")
{ {
return ApiResult.Success("", path); return ApiResult.Success("", path);
......
...@@ -3153,7 +3153,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -3153,7 +3153,7 @@ namespace Mall.WebApi.Controllers.User
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
bool flag = userModule.SetRecommendOrdersBillRemark(BillId, Remark, req.TenantId, req.MallBaseId, req.EmpId); bool flag = userModule.SetRecommendOrdersBillRemark(BillId, Remark);
if (flag) if (flag)
{ {
return ApiResult.Success(); return ApiResult.Success();
......
...@@ -37,13 +37,11 @@ namespace Mall.WebApi.Filter ...@@ -37,13 +37,11 @@ namespace Mall.WebApi.Filter
/// <param name="actionContext"></param> /// <param name="actionContext"></param>
public override void OnActionExecuting(ActionExecutingContext actionContext) public override void OnActionExecuting(ActionExecutingContext actionContext)
{ {
string ip = ""; string ip = actionContext.HttpContext.Request.Headers["X-Forwarded-For"].FirstOrDefault();
ip = actionContext.HttpContext.Request.Headers["X-Forwarded-For"].FirstOrDefault();
if (string.IsNullOrEmpty(ip)) if (string.IsNullOrEmpty(ip))
{ {
ip = actionContext.HttpContext.Connection.RemoteIpAddress.ToString(); ip = actionContext.HttpContext.Connection.RemoteIpAddress.ToString();
} }
if (!string.IsNullOrEmpty(ip) && Common.BackListHelper.bankList.Contains(ip)) if (!string.IsNullOrEmpty(ip) && Common.BackListHelper.bankList.Contains(ip))
{ {
actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult(new ApiResult actionContext.Result = new Microsoft.AspNetCore.Mvc.JsonResult(new ApiResult
...@@ -330,17 +328,10 @@ namespace Mall.WebApi.Filter ...@@ -330,17 +328,10 @@ namespace Mall.WebApi.Filter
#endregion #endregion
#region 根据uid获取用户私钥值 #region 根据uid获取用户私钥值
TokenUserInfo tokenUserInfo = JsonConvert.DeserializeObject<TokenUserInfo>(actionContext.HttpContext.Items[GlobalKey.TokenUserInfo].ToString());
//TODO查询用户秘钥 //TODO查询用户秘钥
string privateKey = ""; string privateKey = "";
//等封装了缓存再说 //等封装了缓存再说
// UserInfo userInfo = UserReidsCache.GetUserLoginInfo(tokenUserInfo.uid);
//if (userInfo != null)
//{
// privateKey = userInfo.SecretKey;
//}
#endregion #endregion
#region 校验签名是否合法 #region 校验签名是否合法
......
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;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment