This commit is contained in:
2023-05-09 17:25:33 +08:00
parent bf67c0f557
commit 208e6258d3
6 changed files with 63 additions and 25 deletions

View File

@@ -334,5 +334,12 @@ namespace Tnb.BasicData.Entities
/// Nullable:True /// Nullable:True
/// </summary> /// </summary>
public string descrip { get; set; } public string descrip { get; set; }
/// <summary>
/// Desc:是否包含入库数 0 包含 1 不包含
/// Default:NULL::character varying
/// Nullable:True
/// </summary>
public int is_contain_into_num {get;set;}
} }
} }

View File

@@ -46,7 +46,7 @@ namespace Tnb.BasicData.Entities
/// Default: /// Default:
/// Nullable:False /// Nullable:False
/// </summary> /// </summary>
public int num { get; set; } public decimal? num { get; set; }
/// <summary> /// <summary>
/// Desc:所属组织id /// Desc:所属组织id

View File

@@ -1,8 +1,10 @@
using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Filter; using JNPF.Common.Filter;
using JNPF.Common.Security; using JNPF.Common.Security;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.DynamicApiController; using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Systems.Entitys.System; using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System; using JNPF.Systems.Interfaces.System;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@@ -69,11 +71,12 @@ namespace Tnb.BasicData
await _repository.AsSugarClient().Insertable<BasMaterialIntoFactorySpecifications>(materialIntoFactorySpecifications).ExecuteCommandAsync(); await _repository.AsSugarClient().Insertable<BasMaterialIntoFactorySpecifications>(materialIntoFactorySpecifications).ExecuteCommandAsync();
}); });
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "复制成功" : result.ErrorMessage; return result.IsSuccess ? "复制成功" : result.ErrorMessage;
} }
/// <summary> /// <summary>
/// 获取物料清单所有子集物料信息 /// 获取物料清单及其所有子集物料信息
/// </summary> /// </summary>
/// <param name="queryInput"></param> /// <param name="queryInput"></param>
/// <returns></returns> /// <returns></returns>
@@ -82,6 +85,8 @@ namespace Tnb.BasicData
{ {
var db = _repository.AsSugarClient(); var db = _repository.AsSugarClient();
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id); List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id);
BasEbomH ebom = await db.Queryable<BasEbomH>().Where(x => x.id == queryInput.ebom_id).SingleAsync();
ids.Add(ebom.material_id);
var result = await db.Queryable<BasMaterial>() var result = await db.Queryable<BasMaterial>()
.LeftJoin<DictionaryDataEntity>((a, b) => a.unit_id == b.EnCode) .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) .LeftJoin<DictionaryTypeEntity>((a, b, c) => b.DictionaryTypeId == c.Id && c.EnCode == DictConst.MeasurementUnit && c.DeleteMark == null)

View File

@@ -1,8 +1,10 @@
using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Filter; using JNPF.Common.Filter;
using JNPF.Common.Security; using JNPF.Common.Security;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.DynamicApiController; using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Systems.Interfaces.System; using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev; using JNPF.VisualDev;
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
@@ -177,6 +179,8 @@ namespace Tnb.BasicData
}); });
if (process.inputs != null)
{
foreach (var input in process.inputs) foreach (var input in process.inputs)
{ {
string inputId = SnowflakeIdHelper.NextId(); string inputId = SnowflakeIdHelper.NextId();
@@ -191,7 +195,10 @@ namespace Tnb.BasicData
org_id = orgId, org_id = orgId,
}); });
} }
}
if (process.outputs != null)
{
foreach (var output in process.outputs) foreach (var output in process.outputs)
{ {
string outputId = SnowflakeIdHelper.NextId(); string outputId = SnowflakeIdHelper.NextId();
@@ -207,6 +214,7 @@ namespace Tnb.BasicData
}); });
} }
} }
}
if (processes.Count > 0) if (processes.Count > 0)
{ {
@@ -322,6 +330,18 @@ namespace Tnb.BasicData
}); });
if (!result.IsSuccess)
{
if (!string.IsNullOrEmpty(mbomSaveDataInput.id))
{
throw Oops.Oh(ErrorCode.COM1001);
}
else
{
throw Oops.Oh(ErrorCode.COM1000);
}
}
return result.IsSuccess ? "保存成功" : result.ErrorMessage; return result.IsSuccess ? "保存成功" : result.ErrorMessage;
} }
} }

View File

@@ -1,9 +1,11 @@
using Aop.Api.Domain; using Aop.Api.Domain;
using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager;
using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Dtos.VisualDev;
using JNPF.Common.Enums;
using JNPF.Common.Security; using JNPF.Common.Security;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.DynamicApiController; using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using JNPF.Systems.Entitys.Permission; using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Entitys.System; using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System; using JNPF.Systems.Interfaces.System;
@@ -137,6 +139,7 @@ namespace Tnb.BasicData
await _repository.AsSugarClient().Insertable<BasProcessStation>(list).ExecuteCommandAsync(); await _repository.AsSugarClient().Insertable<BasProcessStation>(list).ExecuteCommandAsync();
}); });
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "保存成功" : result.ErrorMessage; return result.IsSuccess ? "保存成功" : result.ErrorMessage;
} }

View File

@@ -1,8 +1,10 @@
using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager;
using JNPF.Common.Enums;
using JNPF.Common.Filter; using JNPF.Common.Filter;
using JNPF.Common.Security; using JNPF.Common.Security;
using JNPF.DependencyInjection; using JNPF.DependencyInjection;
using JNPF.DynamicApiController; using JNPF.DynamicApiController;
using JNPF.FriendlyException;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SqlSugar; using SqlSugar;
using Tnb.BasicData.Entities; using Tnb.BasicData.Entities;
@@ -72,6 +74,7 @@ namespace Tnb.BasicData
await _repository.AsSugarClient().Insertable<BasRouteD>(basRouteDs).ExecuteCommandAsync(); await _repository.AsSugarClient().Insertable<BasRouteD>(basRouteDs).ExecuteCommandAsync();
}); });
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
return result.IsSuccess ? "复制成功" : result.ErrorMessage; return result.IsSuccess ? "复制成功" : result.ErrorMessage;
} }