Commit 58472ea7 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 4bfdcc7a 3d2ca414
...@@ -1646,8 +1646,12 @@ namespace Mall.Module.Product ...@@ -1646,8 +1646,12 @@ namespace Mall.Module.Product
} }
} }
} }
MaxSellMoney = model.SpecificationPriceList.Max(x => x.SellingPrice ?? 0);
model.SellingPrice = model.SpecificationPriceList.Min(x => x.SellingPrice ?? 0); if (model.SpecificationPriceList != null && model.SpecificationPriceList.Count > 0)
{
MaxSellMoney = model.SpecificationPriceList.Max(x => x.SellingPrice ?? 0);
model.SellingPrice = model.SpecificationPriceList.Min(x => x.SellingPrice ?? 0);
}
decimal MaxPrice = MaxSellMoney + Math.Ceiling(MaxSellMoney / 10); decimal MaxPrice = MaxSellMoney + Math.Ceiling(MaxSellMoney / 10);
if (MaxPrice > model.OriginalPrice) if (MaxPrice > model.OriginalPrice)
{ {
...@@ -2141,8 +2145,8 @@ namespace Mall.Module.Product ...@@ -2141,8 +2145,8 @@ namespace Mall.Module.Product
{ {
attr_group_name = smodel.Name, attr_group_name = smodel.Name,
attr_group_id = smodel.Sort, attr_group_id = smodel.Sort,
attr_id = svmodel.Id, attr_id = svmodel?.Id??0,
attr_name = svmodel.Name attr_name = svmodel?.Name??""
}); });
} }
decimal price_member = item.SellingPrice ?? 0;//未设会员价格的话 就为销售价格 decimal price_member = item.SellingPrice ?? 0;//未设会员价格的话 就为销售价格
...@@ -2352,11 +2356,14 @@ namespace Mall.Module.Product ...@@ -2352,11 +2356,14 @@ 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); var tempList = model.SpecificationPriceList.Where(x => x.SellingPrice > 0)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>();
price_member_max = price_max = model.SpecificationPriceList.Where(x => x.SellingPrice > 0).Max(x => x.SellingPrice ?? 0); if (tempList != null && tempList.Count > 0)
{
price_member_min = price_min = tempList?.Min(x => x.SellingPrice ?? 0) ?? 0;
price_member_max = price_max = tempList?.Max(x => x.SellingPrice ?? 0) ?? 0;
}
} }
else else
{ {
...@@ -2458,9 +2465,6 @@ namespace Mall.Module.Product ...@@ -2458,9 +2465,6 @@ 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 });
...@@ -2476,9 +2480,9 @@ namespace Mall.Module.Product ...@@ -2476,9 +2480,9 @@ namespace Mall.Module.Product
categoryIdList = model?.CategoryList?.Select(x => x.CategoryId ?? 0).ToList(), categoryIdList = model?.CategoryList?.Select(x => x.CategoryId ?? 0).ToList(),
status = model.GoodsStatus, status = model.GoodsStatus,
isAllowShare = IsAllowShare,//是否可以分享 isAllowShare = IsAllowShare,//是否可以分享
advertising = model.Advertising,//广告词 advertising = model?.Advertising??"",//广告词
price = model.SellingPrice, price = model.SellingPrice,
sendArea = model.SendArea, sendArea = model?.SendArea??"",
use_attr = model.IsCustomSpecification, use_attr = model.IsCustomSpecification,
attr_groups = model.SpecificationList.Select(x => new attr_groups = model.SpecificationList.Select(x => new
{ {
...@@ -2508,8 +2512,8 @@ namespace Mall.Module.Product ...@@ -2508,8 +2512,8 @@ namespace Mall.Module.Product
is_level_alone = model.SeparateSetMember,//是否单独设置会员价 is_level_alone = model.SeparateSetMember,//是否单独设置会员价
share_type = model.SeparateDistributionMoneyType,//分销佣金类型 share_type = model.SeparateDistributionMoneyType,//分销佣金类型
//sign = "", //sign = "",
app_share_pic = model.CustomShareImagePath, app_share_pic = model?.CustomShareImagePath??"",
app_share_title = model.CustomShareTitles, app_share_title = model?.CustomShareTitles??"",
is_default_services = model.IsDefaultService, is_default_services = model.IsDefaultService,
sort = model.Sort, sort = model.Sort,
created_at = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", created_at = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
...@@ -2530,12 +2534,12 @@ namespace Mall.Module.Product ...@@ -2530,12 +2534,12 @@ 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,
detail = model.GoodsDetails, detail = model.GoodsDetails,
video_url = model.VideoAddress, video_url = model?.VideoAddress??"",
level_show = (userModel?.MemberGrade ?? 0) > 0 ? 1 : 2,//是否显示会员价 level_show = (userModel?.MemberGrade ?? 0) > 0 ? 1 : 2,//是否显示会员价
is_sales = model.GoodsStatus == 1 && model.InventoryNum > 0 ? 1 : 2,//是否可购买 is_sales = model.GoodsStatus == 1 && model.InventoryNum > 0 ? 1 : 2,//是否可购买
attr = priceList, attr = priceList,
...@@ -2594,10 +2598,10 @@ namespace Mall.Module.Product ...@@ -2594,10 +2598,10 @@ namespace Mall.Module.Product
is_quick_shop = model.IsQuickBuy, is_quick_shop = model.IsQuickBuy,
is_sell_well = model.IsSellWell, is_sell_well = model.IsSellWell,
is_negotiable = model.IsGoodsNegotiable, is_negotiable = model.IsGoodsNegotiable,
freeShippingName = model.FreeShippingModel.Name, freeShippingName = model.FreeShippingModel?.Name??"",
fullMoneyPinkage = model.FreeShippingModel.FullMoneyPinkage ?? 0, fullMoneyPinkage = model.FreeShippingModel?.FullMoneyPinkage ?? 0,
fullNumPinkage = model.FreeShippingModel.FullNumPinkage ?? 0, fullNumPinkage = model?.FreeShippingModel?.FullNumPinkage ?? 0,
freeShippingUrl = model.FreeShippingModel.FreeShippingUrl, freeShippingUrl = model?.FreeShippingModel?.FreeShippingUrl,
marketingLogo = JsonHelper.Serialize(tempLogo), marketingLogo = JsonHelper.Serialize(tempLogo),
//分类 //分类
cats = model.CategoryList.Select(x => new cats = model.CategoryList.Select(x => new
......
...@@ -1056,26 +1056,33 @@ namespace Mall.Module.TradePavilion ...@@ -1056,26 +1056,33 @@ namespace Mall.Module.TradePavilion
string tempFoldr = ""; string tempFoldr = "";
#region 解析表单内容 #region 解析表单内容
foreach (var listItem in listModel) foreach (var enrollItem in enrollList.GroupBy(x => x.UserId))
{ {
foreach (var enrollModel in enrollList.Where(x => x.ListId == listItem.Id))//榜单下面的公司 var companyName = clist.Where(x => x.CreateBy == enrollItem.Key).FirstOrDefault()?.CompanyName ?? System.DateTime.Now.ToString("yyyyMMddHHmmssfff");
var nowEnroList = enrollList.Where(x => x.UserId == enrollItem.Key);
var templistPath = Path.Combine(tempPath + "file\\" + timeStr + "\\" + companyName + "\\");//路径
if (!Directory.Exists(templistPath))
{ {
if (string.IsNullOrEmpty(enrollModel.Content)) Directory.CreateDirectory(templistPath);
{ }
errorMsg = "报名内容不存在,请核实后再试"; foreach (var item in nowEnroList)
return ""; {
} var enrollModel = listModel.Where(x => x.Id == item.ListId).FirstOrDefault();
List<FormDataItem> elist = JsonHelper.DeserializeObject<List<FormDataItem>>(enrollModel.Content); if (enrollModel != null && enrollModel.Id > 0)
elist = elist.Where(x => x.CompKey == "ImageUploadComp" || x.CompKey == "VideoUploadComp").ToList();
if (elist.Any())
{ {
var companyName = clist.Where(x => x.CreateBy == enrollModel.UserId).FirstOrDefault()?.CompanyName ?? System.DateTime.Now.ToString("yyyyMMddHHmmssfff"); if (string.IsNullOrEmpty(item.Content))
var templistPath = Path.Combine(tempPath + "file\\" + timeStr + "\\" + listItem.ListName + "\\" + companyName + "\\");//路径 {
if (!Directory.Exists(templistPath)) errorMsg = "报名内容不存在,请核实后再试";
return "";
}
List<FormDataItem> elist = JsonHelper.DeserializeObject<List<FormDataItem>>(item.Content);
elist = elist.Where(x => x.CompKey == "ImageUploadComp" || x.CompKey == "VideoUploadComp"||x.CompKey== "CommonUploadComp").ToList();
var templistnowPath = Path.Combine(templistPath + enrollModel.ListName + "\\");//路径
if (!Directory.Exists(templistnowPath))
{ {
Directory.CreateDirectory(templistPath); Directory.CreateDirectory(templistnowPath);
} }
//开始下载图片视频至临时文件
foreach (var itemFile in elist) foreach (var itemFile in elist)
{ {
...@@ -1096,7 +1103,7 @@ namespace Mall.Module.TradePavilion ...@@ -1096,7 +1103,7 @@ namespace Mall.Module.TradePavilion
{ {
Bitmap bitmap = new Bitmap(webResponse.GetResponseStream()); Bitmap bitmap = new Bitmap(webResponse.GetResponseStream());
bitmap.Save(templistPath + Path.GetFileName(qitem), System.Drawing.Imaging.ImageFormat.Jpeg); bitmap.Save(templistnowPath + Path.GetFileName(qitem), System.Drawing.Imaging.ImageFormat.Jpeg);
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -1105,12 +1112,11 @@ namespace Mall.Module.TradePavilion ...@@ -1105,12 +1112,11 @@ namespace Mall.Module.TradePavilion
} }
} }
} }
else if (itemFile.CompKey == "VideoUploadComp") else if (itemFile.CompKey == "VideoUploadComp" || itemFile.CompKey == "CommonUploadComp")
{ {
//视频处理 //视频处理
foreach (var qitem in obj.FileList) foreach (var qitem in obj.FileList)
{ {
try try
{ {
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(qitem); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(qitem);
...@@ -1133,7 +1139,7 @@ namespace Mall.Module.TradePavilion ...@@ -1133,7 +1139,7 @@ namespace Mall.Module.TradePavilion
stmMemory.Write(buffer, 0, i); stmMemory.Write(buffer, 0, i);
} }
fileBytes = stmMemory.ToArray();//文件流Byte fileBytes = stmMemory.ToArray();//文件流Byte
FileStream fs = new FileStream(templistPath + Path.GetFileName(qitem), FileMode.OpenOrCreate); FileStream fs = new FileStream(templistnowPath + Path.GetFileName(qitem), FileMode.OpenOrCreate);
stmMemory.WriteTo(fs); stmMemory.WriteTo(fs);
stmMemory.Close(); stmMemory.Close();
fs.Close(); fs.Close();
...@@ -1149,6 +1155,7 @@ namespace Mall.Module.TradePavilion ...@@ -1149,6 +1155,7 @@ namespace Mall.Module.TradePavilion
} }
} }
} }
#endregion
var templistZipPath = Path.Combine(tempPath + "zip\\" + timeStr + "\\");//路径 var templistZipPath = Path.Combine(tempPath + "zip\\" + timeStr + "\\");//路径
if (!Directory.Exists(templistZipPath)) if (!Directory.Exists(templistZipPath))
{ {
...@@ -1184,7 +1191,7 @@ namespace Mall.Module.TradePavilion ...@@ -1184,7 +1191,7 @@ namespace Mall.Module.TradePavilion
{ {
return ""; return "";
} }
#endregion
} }
...@@ -1201,18 +1208,19 @@ namespace Mall.Module.TradePavilion ...@@ -1201,18 +1208,19 @@ namespace Mall.Module.TradePavilion
{ {
//存储的临时文件地址 //存储的临时文件地址
string rootBook = AppDomain.CurrentDomain.BaseDirectory; string rootBook = AppDomain.CurrentDomain.BaseDirectory;
string tempPath = Path.Combine(rootBook + Url.TrimStart('/')); try
#region 解析表单内容
string timeStr = Url.TrimStart('/').Split("/")[4];
if (!File.Exists(tempPath))
{ {
return true; string tempPath = Path.Combine(rootBook + Url.TrimStart('/'));
} #region 解析表单内容
else
{ string timeStr = Url.TrimStart('/').Split("/")[4];
try if (!File.Exists(tempPath))
{
return true;
}
else
{ {
DirectoryInfo dir = new DirectoryInfo(Path.Combine(rootBook + "upfile\\temporary\\firstshopenrollzip\\" + "zip\\")); DirectoryInfo dir = new DirectoryInfo(Path.Combine(rootBook + "upfile\\temporary\\firstshopenrollzip\\" + "zip\\"));
DirectoryInfo[] dirArr = dir.GetDirectories(); DirectoryInfo[] dirArr = dir.GetDirectories();
foreach (DirectoryInfo item in dirArr) foreach (DirectoryInfo item in dirArr)
...@@ -1227,15 +1235,15 @@ namespace Mall.Module.TradePavilion ...@@ -1227,15 +1235,15 @@ namespace Mall.Module.TradePavilion
} }
} }
return true; return true;
}
catch (Exception ex)
{
return false;
}
}
} }
catch (Exception ex)
{
return false;
}
#endregion #endregion
......
...@@ -444,7 +444,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -444,7 +444,6 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
int UserId = req.UserId; int UserId = req.UserId;
var Robj = new object(); var Robj = new object();
try try
{ {
...@@ -452,7 +451,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -452,7 +451,7 @@ namespace Mall.WebApi.Controllers.MallBase
} }
catch (Exception ex) catch (Exception ex)
{ {
Common.Plugin.LogHelper.Write(ex, string.Format("GetAppletGoodsInfo:{0}",Common.Plugin.JsonHelper.Serialize(requestMsg))); Common.Plugin.LogHelper.Write(ex, string.Format("GetAppletGoodsInfo_GoodsId:{0}", GoodsId));
} }
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
......
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