mirror of
https://github.com/CoreUnion/CoreShop.git
synced 2026-10-17 05:12:39 +08:00
!187 【修复】修复自动生成sku模式价格出现货号重复情况,【修复】修复全局定义微信配置引用的配置文件命名错误问题。
Merge pull request !187 from 大灰灰/dahuihui/develop
This commit is contained in:
@@ -30,6 +30,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using SqlSugar;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
@@ -938,8 +939,8 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
||||
var obj = new CoreCmsProducts();
|
||||
|
||||
if (count == 0) obj.isDefalut = true;
|
||||
var sn = list.Find(p => p.name == "goods[sn]");
|
||||
obj.sn = sn != null ? sn.value + "_" + (count + 1) : null;
|
||||
//var sn = list.Find(p => p.name == "goods[sn]");
|
||||
obj.sn = "SN" + YitIdHelper.NextId();
|
||||
var price = list.Find(p => p.name == "goods[price]");
|
||||
obj.price = price != null && !string.IsNullOrEmpty(price.value)
|
||||
? Convert.ToDecimal(price.value)
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
|
||||
<PackageReference Include="Tencent.QCloud.Cos.Sdk" Version="5.4.24" />
|
||||
<PackageReference Include="ToolGood.Words" Version="3.0.2.8" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.12" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -26,6 +26,7 @@ using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Yitter.IdGenerator;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin
|
||||
{
|
||||
@@ -137,6 +138,15 @@ namespace CoreCms.Net.Web.Admin
|
||||
p.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 雪花漂移算法
|
||||
// 创建 IdGeneratorOptions 对象,请在构造函数中输入 WorkerId:
|
||||
var options = new IdGeneratorOptions(1);
|
||||
// 保存参数(必须的操作,否则以上设置都不能生效):
|
||||
YitIdHelper.SetIdGenerator(options);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1174,7 +1174,7 @@
|
||||
if (e.data.products) {
|
||||
for (var i = 0; i < e.data.products.length; i++) {
|
||||
e.data.products[i].isDefalut = false;
|
||||
e.data.products[i].sn = layui.coreHelper.getSN('SN');
|
||||
//e.data.products[i].sn = layui.coreHelper.getSN('SN');
|
||||
tmpData.push(e.data.products[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1284,7 +1284,7 @@
|
||||
if (e.data.products) {
|
||||
for (var i = 0; i < e.data.products.length; i++) {
|
||||
e.data.products[i].isDefalut = false;
|
||||
e.data.products[i].sn = layui.coreHelper.getSN('SN');
|
||||
//e.data.products[i].sn = layui.coreHelper.getSN('SN');
|
||||
tmpData.push(e.data.products[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user