fix 修改商品sku上架后不可修改

This commit is contained in:
AERWEN\26795 2023-10-10 23:54:38 +08:00
parent d030dc0e72
commit 1040898c3e
8 changed files with 2062 additions and 18 deletions

25
.dockerignore Normal file
View File

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

View File

@ -200,6 +200,7 @@ namespace ARW.Model.Dto.Business.GoodsManager.Goodss
/// </summary>
public class SkuDto
{
public int GoodsSkuId { get; set; }
public string SpecValue{ get; set; }

View File

@ -697,18 +697,22 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.Goodss
if (model.GoodsSpecType == 2)
{
// 删除所有关于该商品的规格
var specList = await _GoodsSpecRelService.GetListAsync(s => s.GoodsGuid == model.GoodsGuid);
foreach (var item in specList)
// 如果是下架状态就修改规格
if (model.GoodsShelfStatus == 2)
{
await _SepcIService.DeleteAsync(s => s.SpecId == item.SpecId);
await _SpecValueIService.DeleteAsync(s => s.SpecId == item.SpecId);
}
// 删除所有关于该商品的规格
var specList = await _GoodsSpecRelService.GetListAsync(s => s.GoodsGuid == model.GoodsGuid);
foreach (var item in specList)
{
await _SepcIService.DeleteAsync(s => s.SpecId == item.SpecId);
await _SpecValueIService.DeleteAsync(s => s.SpecId == item.SpecId);
}
await _GoodsSpecRelService.DeleteAsync(s => s.GoodsGuid == model.GoodsGuid);
await _GoodsSkuService.DeleteAsync(s => s.GoodsGuid == model.GoodsGuid);
// 再重新添加该商品的规格
await HandleAddMultiSpec(model);
await _GoodsSpecRelService.DeleteAsync(s => s.GoodsGuid == model.GoodsGuid);
await _GoodsSkuService.DeleteAsync(s => s.GoodsGuid == model.GoodsGuid);
// 再重新添加该商品的规格
await HandleAddMultiSpec(model);
}
// 计算价格和库存总量
model = HandlMultipleSpecCompute(model);

View File

@ -7,6 +7,7 @@
<DocumentationFile></DocumentationFile>
<AssemblyName>ARW.WebApi</AssemblyName>
<RootNamespace>ARW.WebApi</RootNamespace>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>False</Optimize>
@ -49,6 +50,7 @@
<PackageReference Include="Geocoding.Google" Version="4.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.9" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.4" />
<PackageReference Include="Senparc.Weixin" Version="6.15.7" />
<PackageReference Include="Senparc.Weixin.MP" Version="16.18.9" />
<PackageReference Include="Senparc.Weixin.Open" Version="4.14.12" />

View File

@ -1,12 +1,28 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
WORKDIR /src
COPY ["ARW.WebApi/ARW.WebApi.csproj", "ARW.WebApi/"]
COPY ["ARW.CodeGenerator/ARW.CodeGenerator.csproj", "ARW.CodeGenerator/"]
COPY ["ARW.Repository/ARW.Repository.csproj", "ARW.Repository/"]
COPY ["Infrastructure/Infrastructure.csproj", "Infrastructure/"]
COPY ["ARW.Model/ARW.Model.csproj", "ARW.Model/"]
COPY ["ARW.Common/ARW.Common.csproj", "ARW.Common/"]
COPY ["ARW.Service/ARW.Service.csproj", "ARW.Service/"]
COPY ["ARW.Tasks/ARW.Tasks.csproj", "ARW.Tasks/"]
RUN dotnet restore "ARW.WebApi/ARW.WebApi.csproj"
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o publish
WORKDIR "/src/ARW.WebApi"
RUN dotnet build "ARW.WebApi.csproj" -c Release -o /app/build
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM build AS publish
RUN dotnet publish "ARW.WebApi.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=build /src/publish ./
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ARW.WebApi.dll"]

View File

@ -0,0 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o publish
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build /src/publish ./
ENTRYPOINT ["dotnet", "ARW.WebApi.dll"]

View File

@ -8,8 +8,8 @@
},
"ConnectionStrings": {
"conn_db": "server=47.242.159.172;Database=shop_template;Uid=shop_template;Pwd=tKFJjWwL2kxMYtJK;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;",
//"conn_db": "server=127.0.0.1;Database=shop_template;Uid=root;Pwd=root;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;",
"conn_db_type": "8" // MySql = 0, SqlServer = 1
//"conn_db": "server=127.0.0.1;Database=shop;Uid=root;Pwd=root;SslMode=none;CharSet=utf8mb4;AllowLoadLocalInfile=true;AllowUserVariables=true;",
"conn_db_type": "0" // MySql = 0, SqlServer = 1
},
"urls": "http://localhost:8888", //urldevServer
"corsUrls": "http://localhost:8887", //","

File diff suppressed because one or more lines are too long