去除warn
This commit is contained in:
@@ -5,26 +5,26 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// </summary>
|
||||
public class EbomListOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
/// <summary>
|
||||
/// 物料编码-物料名称
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
public string? material_id { get; set; }
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string material_id_id { get; set; }
|
||||
public string status { get; set; }
|
||||
public string descrip { get; set; }
|
||||
public string unit_id { get; set; }
|
||||
public string version { get; set; }
|
||||
public string? material_id_id { get; set; }
|
||||
public string? status { get; set; }
|
||||
public string? descrip { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
public string? version { get; set; }
|
||||
/// <summary>
|
||||
/// 工艺路线名称
|
||||
/// </summary>
|
||||
public string route_id { get; set; }
|
||||
public string? route_id { get; set; }
|
||||
/// <summary>
|
||||
/// 工艺路线id
|
||||
/// </summary>
|
||||
public string route_id_id { get; set; }
|
||||
public string? route_id_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,15 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
public string? material_id { get; set; }
|
||||
/// <summary>
|
||||
/// 规格描述
|
||||
/// </summary>
|
||||
public string material_id_descrip { get; set; }
|
||||
public string? material_id_descrip { get; set; }
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string material_id_id { get; set; }
|
||||
public string? material_id_id { get; set; }
|
||||
/// <summary>
|
||||
/// 最小包装
|
||||
/// </summary>
|
||||
@@ -21,11 +21,11 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string material_id_remark { get; set; }
|
||||
public string? material_id_remark { get; set; }
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string material_id_unit_id { get; set; }
|
||||
public string? material_id_unit_id { get; set; }
|
||||
/// <summary>
|
||||
/// 是否有下级
|
||||
/// </summary>
|
||||
@@ -36,49 +36,49 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string feeding_control {get;set;}
|
||||
public string? feeding_control {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:损耗率
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string loss_rate {get;set;}
|
||||
public string? loss_rate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:数量
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string quantity {get;set;}
|
||||
public string? quantity {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:需要称量
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string require_weight {get;set;}
|
||||
public string? require_weight {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:替代物料
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string substitute_material_id {get;set;}
|
||||
public string? substitute_material_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工艺路线
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string route_name {get;set;}
|
||||
public string? route_name {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:版本号
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string version {get;set;}
|
||||
public string? version {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料清单id
|
||||
/// </summary>
|
||||
public string ebomId { get; set; }
|
||||
public string? ebomId { get; set; }
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string materialId { get; set; }
|
||||
public string? materialId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,31 +8,31 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string code { get; set; }
|
||||
public string? code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
public string? name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string descrip { get; set; }
|
||||
public string? descrip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主单位名称
|
||||
/// </summary>
|
||||
public string unit_name { get; set; }
|
||||
public string? unit_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料清单id
|
||||
/// </summary>
|
||||
public string ebom_id { get; set; }
|
||||
|
||||
public string? ebom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码名称查询
|
||||
/// </summary>
|
||||
public string material_info { get; set; }
|
||||
public string material_info { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 当前页码:pageIndex.
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 生产bomid
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
public string? material_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
@@ -22,12 +22,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public string version { get; set; }
|
||||
public string? version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有效开始时间
|
||||
@@ -42,12 +42,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料清单id
|
||||
/// </summary>
|
||||
public string ebom_id { get; set; }
|
||||
public string? ebom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工艺路线id
|
||||
/// </summary>
|
||||
public string route_id { get; set; }
|
||||
public string? route_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料均再首道工序投产
|
||||
@@ -57,12 +57,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
public string? remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序
|
||||
/// </summary>
|
||||
public List<MbomProcessOutDto> processes { get; set; }
|
||||
public List<MbomProcessOutDto>? processes { get; set; }
|
||||
}
|
||||
|
||||
public class MbomProcessOutDto
|
||||
@@ -72,14 +72,14 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string mbom_id { get; set; }
|
||||
public string? mbom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工序id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string process_id { get; set; }
|
||||
public string? process_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:准备时间
|
||||
@@ -93,7 +93,7 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string station { get; set; }
|
||||
public string? station { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:副产出管控 0 不启用 1 启用
|
||||
@@ -107,16 +107,16 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string production_method {get;set;}
|
||||
public string? production_method {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// 投入物料
|
||||
/// </summary>
|
||||
public List<BasMbomInput> inputs { get; set; }
|
||||
public List<BasMbomInput>? inputs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产出物料
|
||||
/// </summary>
|
||||
public List<BasMbomOutput> outputs { get; set; }
|
||||
public List<BasMbomOutput>? outputs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,17 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
{
|
||||
public class MbomListOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string ebom_id { get; set; }
|
||||
public string num { get; set; }
|
||||
public string unit_id { get; set; }
|
||||
public string version { get; set; }
|
||||
public string start_time { get; set; }
|
||||
public string end_time { get; set; }
|
||||
public string material_id { get; set; }
|
||||
public string material_id_id { get; set; }
|
||||
public string route_id { get; set; }
|
||||
public string route_id_id { get; set; }
|
||||
public string is_first { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? ebom_id { get; set; }
|
||||
public string? num { get; set; }
|
||||
public string? unit_id { get; set; }
|
||||
public string? version { get; set; }
|
||||
public string start_time { get; set; } = string.Empty;
|
||||
public string end_time { get; set; } = string.Empty;
|
||||
public string? material_id { get; set; }
|
||||
public string? material_id_id { get; set; }
|
||||
public string? route_id { get; set; }
|
||||
public string? route_id_id { get; set; }
|
||||
public string? is_first { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 生产bomid
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
public string id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
public string material_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 数量
|
||||
@@ -22,12 +22,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; }
|
||||
public string unit_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public string version { get; set; }
|
||||
public string version { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 有效开始时间
|
||||
@@ -42,12 +42,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 物料清单id
|
||||
/// </summary>
|
||||
public string ebom_id { get; set; }
|
||||
public string ebom_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工艺路线id
|
||||
/// </summary>
|
||||
public string route_id { get; set; }
|
||||
public string route_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 物料均再首道工序投产
|
||||
@@ -57,12 +57,12 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string remark { get; set; }
|
||||
public string remark { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 工序
|
||||
/// </summary>
|
||||
public List<MbomProcessDto> processes { get; set; }
|
||||
public List<MbomProcessDto>? processes { get; set; }
|
||||
}
|
||||
|
||||
public class MbomProcessDto
|
||||
@@ -72,14 +72,14 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string mbom_id { get; set; }
|
||||
public string? mbom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工序id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string process_id { get; set; }
|
||||
public string? process_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:准备时间
|
||||
@@ -93,7 +93,7 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string station { get; set; }
|
||||
public string? station { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:副产出管控 0 不启用 1 启用
|
||||
@@ -107,16 +107,16 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string production_method {get;set;}
|
||||
public string? production_method {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// 投入物料
|
||||
/// </summary>
|
||||
public List<BasMbomInput> inputs { get; set; }
|
||||
public List<BasMbomInput>? inputs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产出物料
|
||||
/// </summary>
|
||||
public List<BasMbomOutput> outputs { get; set; }
|
||||
public List<BasMbomOutput>? outputs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
/// <summary>
|
||||
/// 工序id
|
||||
/// </summary>
|
||||
public string process_id { get; set; }
|
||||
public string? process_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工位id集合
|
||||
/// </summary>
|
||||
public List<string> stationIds { get; set; }
|
||||
public List<string>? stationIds { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,14 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
{
|
||||
public class VaildRouteOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
public string code { get; set; }
|
||||
public string? code { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
public string? name { get; set; }
|
||||
|
||||
public string start_time { get; set; } = string.Empty;
|
||||
|
||||
public string start_time { get; set; }
|
||||
|
||||
public string end_time { get; set; }
|
||||
public string end_time { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ namespace Tnb.BasicData.Entitys
|
||||
{
|
||||
public class ElementSelectDto
|
||||
{
|
||||
public string label { get; set; }
|
||||
public string?label { get; set; }
|
||||
|
||||
public string value { get; set; }
|
||||
public string? value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public partial class BasEbomD : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 物料编号/名称
|
||||
/// </summary>
|
||||
public string? material_id { get; set; }
|
||||
public string material_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace Tnb.BasicData
|
||||
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string materialInfo = queryJson?["query_info"]?.ToString();
|
||||
Dictionary<string, object>? queryJson = (input==null || string.IsNullOrEmpty(input.queryJson)) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
||||
var list = await db.Queryable<BasEbomH, BasMaterial, BasRouteH>((a, b, c) => new object[]
|
||||
{
|
||||
JoinType.Left, a.material_id == b.id,
|
||||
@@ -67,7 +67,7 @@ namespace Tnb.BasicData
|
||||
route_id = c.name,
|
||||
route_id_id = c.id,
|
||||
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}).ToPagedListAsync((input?.currentPage ?? 1), (input?.pageSize ?? 50));
|
||||
|
||||
return PageResult<EbomListOutput>.SqlSugarPageResult(list);
|
||||
}
|
||||
@@ -75,7 +75,6 @@ namespace Tnb.BasicData
|
||||
/// <summary>
|
||||
/// 获取物料清单树.
|
||||
/// </summary>
|
||||
/// <param name="input">获取物料清单树.</param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetTree(EbomTreeQueryInput queryInput)
|
||||
@@ -115,7 +114,7 @@ namespace Tnb.BasicData
|
||||
hasChildren = SqlFunc.Subqueryable<BasEbomH>().Where(x=>x.material_id==a.material_id).Any(),
|
||||
}).Mapper(it =>
|
||||
{
|
||||
it.material_id_unit_id = dic[it.material_id_unit_id].ToString();
|
||||
it.material_id_unit_id = !string.IsNullOrEmpty(it.material_id_unit_id) ? dic[it.material_id_unit_id].ToString() : "";
|
||||
}).ToListAsync();
|
||||
return data;
|
||||
}
|
||||
@@ -145,7 +144,7 @@ namespace Tnb.BasicData
|
||||
hasChildren = SqlFunc.Subqueryable<BasEbomH>().Where(x=>x.material_id==a.material_id).Any(),
|
||||
}).Mapper(it =>
|
||||
{
|
||||
it.material_id_unit_id = dic[it.material_id_unit_id].ToString();
|
||||
it.material_id_unit_id = !string.IsNullOrEmpty(it.material_id_unit_id) ? dic[it.material_id_unit_id].ToString() : "";
|
||||
}).ToListAsync();
|
||||
return data;
|
||||
}
|
||||
@@ -182,9 +181,9 @@ namespace Tnb.BasicData
|
||||
}).FirstAsync();
|
||||
return new Dictionary<string,string>()
|
||||
{
|
||||
["version"] = ebom?.version,
|
||||
["routeName"] = ebom?.name,
|
||||
["routeId"] = ebom?.id
|
||||
["version"] = ebom?.version ?? "",
|
||||
["routeName"] = ebom?.name ?? "",
|
||||
["routeId"] = ebom?.id ?? ""
|
||||
,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -88,7 +88,8 @@ namespace Tnb.BasicData
|
||||
{
|
||||
List<string> ids = await GetAllChildrenMaterialId(queryInput.ebom_id,0);
|
||||
BasEbomH ebom = await db.Queryable<BasEbomH>().Where(x => x.id == queryInput.ebom_id).SingleAsync();
|
||||
ids.Add(ebom.material_id);
|
||||
if(ebom!=null && !string.IsNullOrEmpty(ebom.material_id))
|
||||
ids.Add(ebom.material_id);
|
||||
var result = await db.Queryable<BasMaterial>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => b.EnCode == DictConst.MeasurementUnit && b.DeleteMark == null)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.DictionaryTypeId == b.Id && a.unit_id == c.EnCode)
|
||||
@@ -144,7 +145,7 @@ namespace Tnb.BasicData
|
||||
{
|
||||
//获取最新创建的物料清单
|
||||
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,index));
|
||||
ids.AddRange(await GetAllChildrenMaterialId(ebom?.id ?? "",index));
|
||||
}
|
||||
ids.AddRange(list);
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace Tnb.BasicData
|
||||
public async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string materialInfo = queryJson?["query_info"]?.ToString();
|
||||
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string materialInfo = queryJson?["query_info"]?.ToString() ?? "";
|
||||
var list = await db.Queryable<BasMbom, BasMaterial, BasEbomH, BasRouteH>((a, b, c, d) => new object[]
|
||||
{
|
||||
JoinType.Left, a.material_id == b.id,
|
||||
@@ -75,8 +75,8 @@ namespace Tnb.BasicData
|
||||
ebom_id = c.version,
|
||||
route_id = d.name,
|
||||
route_id_id = c.id,
|
||||
start_time = a.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
end_time = a.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
start_time = a.start_time==null ? "" : a.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
end_time = a.end_time==null ? "" : a.end_time.Value.ToString("yyyy-MM-dd"),
|
||||
is_first = SqlFunc.IIF(a.is_first == 0, "否", "是"),
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
@@ -278,55 +278,58 @@ namespace Tnb.BasicData
|
||||
List<BasMbomInput> inputs = new List<BasMbomInput>();
|
||||
List<BasMbomOutput> outputs = new List<BasMbomOutput>();
|
||||
|
||||
foreach (var process in mbomSaveDataInput.processes)
|
||||
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
||||
{
|
||||
string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||
processes.Add(new BasMbomProcess()
|
||||
foreach (var process in mbomSaveDataInput.processes)
|
||||
{
|
||||
id = mbomProcessId,
|
||||
org_id = orgId,
|
||||
mbom_id = mbomId,
|
||||
process_id = process.process_id,
|
||||
preparation_time = process.preparation_time,
|
||||
station = process.station,
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
|
||||
});
|
||||
|
||||
if (process.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||
processes.Add(new BasMbomProcess()
|
||||
{
|
||||
string inputId = SnowflakeIdHelper.NextId();
|
||||
inputs.Add(new BasMbomInput()
|
||||
id = mbomProcessId,
|
||||
org_id = orgId,
|
||||
mbom_id = mbomId,
|
||||
process_id = process?.process_id ?? "",
|
||||
preparation_time = process?.preparation_time ?? 0,
|
||||
station = process?.station ?? "",
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
|
||||
});
|
||||
|
||||
if (process.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
{
|
||||
id = inputId,
|
||||
mbom_id = mbomId,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process.process_id,
|
||||
material_id = input.material_id,
|
||||
num = input.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
string inputId = SnowflakeIdHelper.NextId();
|
||||
inputs.Add(new BasMbomInput()
|
||||
{
|
||||
id = inputId,
|
||||
mbom_id = mbomId,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process?.process_id ?? "",
|
||||
material_id = input.material_id,
|
||||
num = input.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process.outputs != null)
|
||||
{
|
||||
foreach (var output in process.outputs)
|
||||
if (process.outputs != null)
|
||||
{
|
||||
string outputId = SnowflakeIdHelper.NextId();
|
||||
outputs.Add(new BasMbomOutput()
|
||||
foreach (var output in process.outputs)
|
||||
{
|
||||
id = outputId,
|
||||
mbom_id = mbomId,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process.process_id,
|
||||
material_id = output.material_id,
|
||||
num = output.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
string outputId = SnowflakeIdHelper.NextId();
|
||||
outputs.Add(new BasMbomOutput()
|
||||
{
|
||||
id = outputId,
|
||||
mbom_id = mbomId,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process?.process_id ?? "",
|
||||
material_id = output.material_id,
|
||||
num = output.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,84 +359,93 @@ namespace Tnb.BasicData
|
||||
}
|
||||
|
||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.UpdateAsync(x => new BasMbom()
|
||||
if (mbomSaveDataInput != null)
|
||||
{
|
||||
// org_id = orgId,
|
||||
material_id = mbomSaveDataInput.material_id,
|
||||
num = mbomSaveDataInput.num,
|
||||
unit_id = mbomSaveDataInput.unit_id,
|
||||
version = mbomSaveDataInput.version,
|
||||
start_time = mbomSaveDataInput.start_time,
|
||||
end_time = mbomSaveDataInput.end_time,
|
||||
ebom_id = mbomSaveDataInput.ebom_id,
|
||||
route_id = mbomSaveDataInput.route_id,
|
||||
is_first = mbomSaveDataInput.is_first,
|
||||
remark = mbomSaveDataInput.remark,
|
||||
modify_id = _userManager.UserId,
|
||||
modify_time = DateTime.Now,
|
||||
await _repository.UpdateAsync(x => new BasMbom()
|
||||
{
|
||||
// org_id = orgId,
|
||||
material_id = mbomSaveDataInput.material_id,
|
||||
num = mbomSaveDataInput.num,
|
||||
unit_id = mbomSaveDataInput.unit_id,
|
||||
version = mbomSaveDataInput.version,
|
||||
start_time = mbomSaveDataInput.start_time,
|
||||
end_time = mbomSaveDataInput.end_time,
|
||||
ebom_id = mbomSaveDataInput.ebom_id,
|
||||
route_id = mbomSaveDataInput.route_id,
|
||||
is_first = mbomSaveDataInput.is_first,
|
||||
remark = mbomSaveDataInput.remark,
|
||||
modify_id = _userManager.UserId,
|
||||
modify_time = DateTime.Now,
|
||||
|
||||
}, x => x.id == mbomSaveDataInput.id);
|
||||
}, x => x.id == mbomSaveDataInput.id);
|
||||
}
|
||||
List<BasMbomProcess> processes = new List<BasMbomProcess>();
|
||||
List<BasMbomInput> inputs = new List<BasMbomInput>();
|
||||
List<BasMbomOutput> outputs = new List<BasMbomOutput>();
|
||||
|
||||
foreach (var process in mbomSaveDataInput.processes)
|
||||
if (mbomSaveDataInput != null && mbomSaveDataInput.processes != null)
|
||||
{
|
||||
string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||
processes.Add(new BasMbomProcess()
|
||||
foreach (var process in mbomSaveDataInput.processes)
|
||||
{
|
||||
id = mbomProcessId,
|
||||
org_id = orgId,
|
||||
mbom_id = mbomSaveDataInput.id,
|
||||
process_id = process.process_id,
|
||||
preparation_time = process.preparation_time,
|
||||
station = process.station,
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
|
||||
});
|
||||
|
||||
if (process.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
string mbomProcessId = SnowflakeIdHelper.NextId();
|
||||
processes.Add(new BasMbomProcess()
|
||||
{
|
||||
string inputId = SnowflakeIdHelper.NextId();
|
||||
inputs.Add(new BasMbomInput()
|
||||
{
|
||||
id = inputId,
|
||||
mbom_id = mbomSaveDataInput.id,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process.process_id,
|
||||
material_id = input.material_id,
|
||||
num = input.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
id = mbomProcessId,
|
||||
org_id = orgId ?? "",
|
||||
mbom_id = mbomSaveDataInput?.id ?? "",
|
||||
process_id = process?.process_id ?? "",
|
||||
preparation_time = process?.preparation_time ?? 0,
|
||||
station = process.station,
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
|
||||
if (process.outputs != null)
|
||||
{
|
||||
foreach (var output in process.outputs)
|
||||
});
|
||||
|
||||
if (process.inputs != null)
|
||||
{
|
||||
string outputId = SnowflakeIdHelper.NextId();
|
||||
outputs.Add(new BasMbomOutput()
|
||||
foreach (var input in process.inputs)
|
||||
{
|
||||
id = outputId,
|
||||
mbom_id = mbomSaveDataInput.id,
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process.process_id,
|
||||
material_id = output.material_id,
|
||||
num = output.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
string inputId = SnowflakeIdHelper.NextId();
|
||||
inputs.Add(new BasMbomInput()
|
||||
{
|
||||
id = inputId,
|
||||
mbom_id = mbomSaveDataInput?.id ?? "",
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process?.process_id ?? "",
|
||||
material_id = input.material_id,
|
||||
num = input.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process.outputs != null)
|
||||
{
|
||||
foreach (var output in process.outputs)
|
||||
{
|
||||
string outputId = SnowflakeIdHelper.NextId();
|
||||
outputs.Add(new BasMbomOutput()
|
||||
{
|
||||
id = outputId,
|
||||
mbom_id = mbomSaveDataInput?.id ?? "",
|
||||
mbom_process_id = mbomProcessId,
|
||||
process_id = process?.process_id ?? "",
|
||||
material_id = output.material_id,
|
||||
num = output.num,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomProcess>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomInput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomOutput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
if (mbomSaveDataInput != null && !string.IsNullOrEmpty(mbomSaveDataInput.id))
|
||||
{
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomProcess>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomInput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
await _repository.AsSugarClient().Deleteable<BasMbomOutput>().Where(x => x.mbom_id == mbomSaveDataInput.id).ExecuteCommandAsync();
|
||||
}
|
||||
if (processes.Count > 0)
|
||||
{
|
||||
await _repository.AsSugarClient().Insertable<BasMbomProcess>(processes).ExecuteCommandAsync();
|
||||
|
||||
@@ -108,8 +108,6 @@ namespace Tnb.BasicData
|
||||
/// <summary>
|
||||
/// 保存工序工位关联表
|
||||
/// </summary>
|
||||
/// <param name="processStationInput">process_id 工序id</param>
|
||||
/// <param name="processStationInput">stationIds 工位id集合</param>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> Create(VisualDevModelDataCrInput visualDevModelDataCrInput)
|
||||
{
|
||||
@@ -118,7 +116,7 @@ namespace Tnb.BasicData
|
||||
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModelId, true);
|
||||
await _runService.Create(templateEntity, visualDevModelDataCrInput);
|
||||
|
||||
string processId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString();
|
||||
string processId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? "";
|
||||
|
||||
List<BasProcessStation> list = new List<BasProcessStation>();
|
||||
foreach (var item in (JArray)visualDevModelDataCrInput.data["station"])
|
||||
|
||||
@@ -83,7 +83,6 @@ namespace Tnb.BasicData
|
||||
/// <summary>
|
||||
/// 获取有效的已发布的工艺路线
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetValidRouteList([FromBody]VisualDevDataFieldDataListInput pageInput)
|
||||
{
|
||||
@@ -99,8 +98,8 @@ namespace Tnb.BasicData
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
name = x.name,
|
||||
start_time = x.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
end_time = x.end_time.Value.ToString("yyyy-MM-dd"),
|
||||
start_time = x.start_time==null ? "" : x.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
end_time = x.end_time==null ? "" : x.end_time.Value.ToString("yyyy-MM-dd"),
|
||||
}).ToPagedListAsync(pageInput.currentPage, pageInput.pageSize);
|
||||
return PageResult<VaildRouteOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user