Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
namespace Tnb.BasicData.Entities.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料弹窗选择显示信息
|
||||
/// </summary>
|
||||
public class MaterialSelectOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string descrip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主单位名称
|
||||
/// </summary>
|
||||
public string unit_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace Tnb.BasicData.Entities.Dto
|
||||
{
|
||||
public class MaterialSelectQueryInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 物料清单id
|
||||
/// </summary>
|
||||
public string ebom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码名称查询
|
||||
/// </summary>
|
||||
public string material_info { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 当前页码:pageIndex.
|
||||
/// </summary>
|
||||
public virtual int currentPage { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 每页行数.
|
||||
/// </summary>
|
||||
public virtual int pageSize { get; set; } = 50;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -1,7 +1,9 @@
|
||||
using Tnb.BasicData.Entities.Dto;
|
||||
|
||||
namespace Tnb.BasicData.Interfaces
|
||||
{
|
||||
public interface IBasMaterialService
|
||||
{
|
||||
|
||||
public Task<dynamic> GetMaterialSelectInfo(MaterialSelectQueryInput queryInput);
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,6 @@ using Tnb.BasicData.Entities.Dto;
|
||||
namespace Tnb.BasicData.Interfaces
|
||||
{
|
||||
public interface IBasProcessService
|
||||
{
|
||||
OverideVisualDevFunc OverideFuncs { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 重写新增
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
public Task<dynamic> Create(VisualDevModelDataCrInput visualDevModelDataCrInput);
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||
<ProjectReference Include="..\Tnb.BasicData.Entitys\Tnb.BasicData.Entities.csproj" />
|
||||
<ProjectReference Include="..\Tnb.BasicData.Entities\Tnb.BasicData.Entities.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.BasicData.Entities.Dto;
|
||||
using Tnb.BasicData.Interfaces;
|
||||
|
||||
namespace Tnb.BasicData
|
||||
@@ -60,5 +63,57 @@ namespace Tnb.BasicData
|
||||
|
||||
return result.IsSuccess ? "复制成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料清单所有自己物料信息
|
||||
/// </summary>
|
||||
/// <param name="queryInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetMaterialSelectInfo(MaterialSelectQueryInput queryInput)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id);
|
||||
var result = await db.Queryable<BasMaterial>()
|
||||
.LeftJoin<DictionaryDataEntity>((a, b) => a.unit_id == b.EnCode)
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c) => b.DictionaryTypeId == c.Id && c.EnCode == DictConst.MeasurementUnit && c.DeleteMark == null)
|
||||
.WhereIF(!string.IsNullOrEmpty(queryInput.material_info), (a, b, c) => a.code.Contains(queryInput.material_info) || a.name.Contains(queryInput.material_info))
|
||||
.WhereIF(!string.IsNullOrEmpty(queryInput.ebom_id), (a, b, c) => ids.Contains(a.id))
|
||||
.Select((a, b, c) => new MaterialSelectOutput()
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
descrip = a.descrip,
|
||||
unit_id = a.unit_id,
|
||||
unit_name = b.FullName,
|
||||
}).ToPagedListAsync(queryInput.currentPage, queryInput.pageSize);
|
||||
|
||||
return PageResult<MaterialSelectOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料清单下所子集物料id
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task<List<string>> GetAllChildrenMaterialId(string ebomId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ebomId)) return new List<string>();
|
||||
List<string> ids = new List<string>();
|
||||
var list = await _repository.AsSugarClient().Queryable<BasEbomD>().Where(x => x.ebom_id == ebomId)
|
||||
.Select<string>(x => x.material_id).ToListAsync();
|
||||
if (list != null && list.Count > 0)
|
||||
{
|
||||
foreach (var id in list)
|
||||
{
|
||||
//获取最新创建的物料清单
|
||||
var ebom = await _repository.AsSugarClient().Queryable<BasEbomH>().Where(x=>x.material_id==id).OrderByDescending(x=>x.create_time).FirstAsync();
|
||||
ids.AddRange(await GetAllChildrenMaterialId(ebom?.id));
|
||||
}
|
||||
ids.AddRange(list);
|
||||
}
|
||||
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -1,15 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<GenerateDocumentationFile>False</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tnb.ProductionMgr.Entitys\Tnb.ProductionMgr.Entities.csproj" />
|
||||
<ProjectReference Include="..\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -123,11 +123,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Interfaces",
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr", "ProductionMgr\Tnb.ProductionMgr\Tnb.ProductionMgr.csproj", "{C9001973-83C5-48B8-8905-69BCC8132928}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entitys\Tnb.ProductionMgr.Entities.csproj", "{4F4EDC3F-4167-4061-AD07-4B0254977F26}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Interfaces", "ProductionMgr\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj", "{CE039C17-0037-457C-A202-486701DB7F17}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entities", "BasicData\Tnb.BasicData.Entitys\Tnb.BasicData.Entities.csproj", "{96E5FF02-E67E-4578-B334-2FC9F6A5AA08}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entities", "BasicData\Tnb.BasicData.Entities\Tnb.BasicData.Entities.csproj", "{03835631-26A5-442B-9B25-7F81D0A5594A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj", "{57E7491F-7876-451E-BA9F-5B007EBD432D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -303,18 +303,18 @@ Global
|
||||
{C9001973-83C5-48B8-8905-69BCC8132928}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9001973-83C5-48B8-8905-69BCC8132928}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9001973-83C5-48B8-8905-69BCC8132928}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4F4EDC3F-4167-4061-AD07-4B0254977F26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4F4EDC3F-4167-4061-AD07-4B0254977F26}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4F4EDC3F-4167-4061-AD07-4B0254977F26}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4F4EDC3F-4167-4061-AD07-4B0254977F26}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CE039C17-0037-457C-A202-486701DB7F17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CE039C17-0037-457C-A202-486701DB7F17}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CE039C17-0037-457C-A202-486701DB7F17}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CE039C17-0037-457C-A202-486701DB7F17}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{96E5FF02-E67E-4578-B334-2FC9F6A5AA08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{96E5FF02-E67E-4578-B334-2FC9F6A5AA08}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{96E5FF02-E67E-4578-B334-2FC9F6A5AA08}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{96E5FF02-E67E-4578-B334-2FC9F6A5AA08}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{03835631-26A5-442B-9B25-7F81D0A5594A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{03835631-26A5-442B-9B25-7F81D0A5594A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{03835631-26A5-442B-9B25-7F81D0A5594A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{03835631-26A5-442B-9B25-7F81D0A5594A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{57E7491F-7876-451E-BA9F-5B007EBD432D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -361,9 +361,9 @@ Global
|
||||
{58343F2F-E846-4CBD-8BA5-50EE3088E89D} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{3F1EB6A2-BDC3-4F86-896E-786EAEE91D0B} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{C9001973-83C5-48B8-8905-69BCC8132928} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
{4F4EDC3F-4167-4061-AD07-4B0254977F26} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
{CE039C17-0037-457C-A202-486701DB7F17} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
{96E5FF02-E67E-4578-B334-2FC9F6A5AA08} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{03835631-26A5-442B-9B25-7F81D0A5594A} = {52B19E13-6B04-444C-A38A-B9955B199A98}
|
||||
{57E7491F-7876-451E-BA9F-5B007EBD432D} = {ABE58B5E-610B-4159-BFF0-8B04BF700B3C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {646DDD1C-F143-42C2-894F-F5C7B3A0CE74}
|
||||
|
||||
Reference in New Issue
Block a user