去除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; }
|
||||
public string start_time { get; set; } = string.Empty;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipDaqQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string data_source { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? data_source { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
public string data_type { get; set; }
|
||||
public string enabled { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string label_name { get; set; }
|
||||
public string label_point { get; set; }
|
||||
public string remark { get; set; }
|
||||
public string? create_time { get; set; }
|
||||
public string? data_type { get; set; }
|
||||
public string? enabled { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? label_name { get; set; }
|
||||
public string? label_point { get; set; }
|
||||
public string? remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,13 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipFileQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string attachment { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_id_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string equip_id_id { get; set; }
|
||||
public string file_name { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? attachment { get; set; }
|
||||
public string? create_id { get; set; }
|
||||
public string? create_id_id { get; set; }
|
||||
public string? create_time { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? equip_id_id { get; set; }
|
||||
public string? file_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,20 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipMaintainRecordQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string attachment { get; set; }
|
||||
public string create_time { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string equip_id_id { get; set; }
|
||||
public string execute_time { get; set; }
|
||||
public string execute_user_id { get; set; }
|
||||
public string repeat_remark { get; set; }
|
||||
public string repeat_result { get; set; }
|
||||
public string repeat_time { get; set; }
|
||||
public string repeat_user_id { get; set; }
|
||||
public string result { get; set; }
|
||||
public string result_remark { get; set; }
|
||||
public string maintain_tem_equip_id { get; set; }
|
||||
public string status { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? attachment { get; set; }
|
||||
public string? create_time { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? equip_id_id { get; set; }
|
||||
public string? execute_time { get; set; }
|
||||
public string? execute_user_id { get; set; }
|
||||
public string? repeat_remark { get; set; }
|
||||
public string? repeat_result { get; set; }
|
||||
public string? repeat_time { get; set; }
|
||||
public string? repeat_user_id { get; set; }
|
||||
public string? result { get; set; }
|
||||
public string? result_remark { get; set; }
|
||||
public string? maintain_tem_equip_id { get; set; }
|
||||
public string? status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipQueryInput
|
||||
{
|
||||
public string equip_id { get; set; }
|
||||
public string equip_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 当前页码:pageIndex.
|
||||
@@ -14,6 +14,6 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
/// </summary>
|
||||
public virtual int pageSize { get; set; } = 50;
|
||||
|
||||
public string queryJson { get; set; }
|
||||
public string? queryJson { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,15 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipRepairRecordQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string apply_user_id { get; set; }
|
||||
public string is_ugent { get; set; }
|
||||
public string description { get; set; }
|
||||
public string complete_time { get; set; }
|
||||
public string repairer_id { get; set; }
|
||||
public string repair_description { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? code { get; set; }
|
||||
public string? name { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? apply_user_id { get; set; }
|
||||
public string? is_ugent { get; set; }
|
||||
public string? description { get; set; }
|
||||
public string? complete_time { get; set; }
|
||||
public string? repairer_id { get; set; }
|
||||
public string? repair_description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipSparePartsInput
|
||||
{
|
||||
public string equip_id { get; set; }
|
||||
public string equip_id { get; set; } = string.Empty;
|
||||
|
||||
public List<string> spare_parts_ids { get; set; }
|
||||
public List<string>? spare_parts_ids { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipSparePartsQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string type_code { get; set; }
|
||||
public string type_name { get; set; }
|
||||
public string code { get; set; }
|
||||
public string name { get; set; }
|
||||
public string specification { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? type_code { get; set; }
|
||||
public string? type_name { get; set; }
|
||||
public string? code { get; set; }
|
||||
public string? name { get; set; }
|
||||
public string? specification { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,19 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipSpotInsRecordQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string attachment { get; set; }
|
||||
public string create_time { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string repeat_remark { get; set; }
|
||||
public string repeat_result { get; set; }
|
||||
public string repeat_time { get; set; }
|
||||
public string repeat_user_id { get; set; }
|
||||
public string result { get; set; }
|
||||
public string result_remark { get; set; }
|
||||
public string spot_ins_tem_equip_id { get; set; }
|
||||
public string spot_record_date_time { get; set; }
|
||||
public string spot_record_user_id { get; set; }
|
||||
public string status { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? attachment { get; set; }
|
||||
public string? create_time { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? repeat_remark { get; set; }
|
||||
public string? repeat_result { get; set; }
|
||||
public string? repeat_time { get; set; }
|
||||
public string? repeat_user_id { get; set; }
|
||||
public string? result { get; set; }
|
||||
public string? result_remark { get; set; }
|
||||
public string? spot_ins_tem_equip_id { get; set; }
|
||||
public string? spot_record_date_time { get; set; }
|
||||
public string? spot_record_user_id { get; set; }
|
||||
public string? status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class EquipTechnologyParameterQueryOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string definition { get; set; }
|
||||
public string remark { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? name { get; set; }
|
||||
public string? definition { get; set; }
|
||||
public string? remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class MaintainRecordRepeatInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string id { get; set; } = string.Empty;
|
||||
|
||||
public string repeat_result { get; set; }
|
||||
public string repeat_result { get; set; } = string.Empty;
|
||||
|
||||
public string repeat_remark { get; set; }
|
||||
public string? repeat_remark { get; set; }
|
||||
|
||||
public List<Dictionary<string,string>> details { get; set; }
|
||||
public List<Dictionary<string,string>>? details { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class MaintainRecordRepeatOutput
|
||||
{
|
||||
public EqpMaintainRecordH model { get; set; }
|
||||
public EqpMaintainRecordH? model { get; set; }
|
||||
|
||||
public List<EqpMaintainRecordD> details { get; set; }
|
||||
public List<EqpMaintainRecordD>? details { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairApplyDetailOutput
|
||||
{
|
||||
public EqpRepairApply eqpRepairApply { get; set; }
|
||||
public EqpRepairOutApply eqpRepairOutApply { get; set; }
|
||||
public EqpRepairApply? eqpRepairApply { get; set; }
|
||||
public EqpRepairOutApply? eqpRepairOutApply { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairApplyOutRegisterInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际维修供应商id
|
||||
@@ -37,6 +37,6 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 报修申请id
|
||||
/// </summary>
|
||||
public string repair_apply_id { get; set; }
|
||||
public string? repair_apply_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairApplyRegisterInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 故障ID
|
||||
/// </summary>
|
||||
public string fault_id { get; set; }
|
||||
public string? fault_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完成
|
||||
|
||||
@@ -2,16 +2,16 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairDelayInput
|
||||
{
|
||||
public string repair_apply_id { get; set; }
|
||||
public string? repair_apply_id { get; set; }
|
||||
|
||||
public string equip_id { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
|
||||
public string repair_request_sender_id { get; set; }
|
||||
public string? repair_request_sender_id { get; set; }
|
||||
|
||||
public string repair_sender_id { get; set; }
|
||||
public string? repair_sender_id { get; set; }
|
||||
|
||||
public DateTime expected_time { get; set; }
|
||||
|
||||
public string delay_reason { get; set; }
|
||||
public string? delay_reason { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,13 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairOutApplyInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string repair_apply_id { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? repair_apply_id { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? supplier_id { get; set; }
|
||||
public decimal? estimated_cost { get; set; }
|
||||
public string? construction_period_requirement { get; set; }
|
||||
public string out_apply_reason { get; set; }
|
||||
public string? out_apply_reason { get; set; }
|
||||
public string? remark { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class SpotInsRecordExecuteInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
public string attachment { get; set; }
|
||||
public string? attachment { get; set; }
|
||||
|
||||
public string result { get; set; }
|
||||
public string? result { get; set; }
|
||||
|
||||
public string result_remark { get; set; }
|
||||
public string? result_remark { get; set; }
|
||||
|
||||
public List<Dictionary<string,string>> details { get; set; }
|
||||
public List<Dictionary<string,string>>? details { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class SpotInsRecordRepeatInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
public string repeat_result { get; set; }
|
||||
public string? repeat_result { get; set; }
|
||||
|
||||
public string repeat_remark { get; set; }
|
||||
public string? repeat_remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class SpotInsRecordRepeatOutput
|
||||
{
|
||||
public EqpSpotInsRecordH model { get; set; }
|
||||
public EqpSpotInsRecordH? model { get; set; }
|
||||
|
||||
public List<EqpSpotInsRecordD> details { get; set; }
|
||||
public List<EqpSpotInsRecordD>? details { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class SpotInsTemPublishInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
public string[] equipIds { get; set; }
|
||||
public string[]? equipIds { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,17 @@ namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class SubEquipQueryOutput
|
||||
{
|
||||
public string code { get; set; }
|
||||
public string create_id { get; set; }
|
||||
public string create_id_id { get; set; }
|
||||
public string create_time { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string equip_id_id { get; set; }
|
||||
public string id { get; set; }
|
||||
public string modify_id { get; set; }
|
||||
public string modify_time { get; set; }
|
||||
public string name { get; set; }
|
||||
public string org_id { get; set; }
|
||||
public string specification { get; set; }
|
||||
public string? code { get; set; }
|
||||
public string? create_id { get; set; }
|
||||
public string? create_id_id { get; set; }
|
||||
public string? create_time { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
public string? equip_id_id { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? modify_id { get; set; }
|
||||
public string? modify_time { get; set; }
|
||||
public string? name { get; set; }
|
||||
public string? org_id { get; set; }
|
||||
public string? specification { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public partial class EqpEquipSpareParts : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
public string create_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
|
||||
@@ -52,7 +52,7 @@ public partial class EqpEquipment : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 安装日期
|
||||
/// </summary>
|
||||
public string? install_date { get; set; }
|
||||
public string install_date { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 使用日期
|
||||
@@ -82,7 +82,7 @@ public partial class EqpEquipment : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? remark { get; set; }
|
||||
public string remark { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
@@ -186,6 +186,6 @@ public partial class EqpEquipment : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 工位编码
|
||||
/// </summary>
|
||||
public string station_code { get; set; }
|
||||
public string? station_code { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public partial class EqpMaintainItem : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 保养类型
|
||||
/// </summary>
|
||||
public string maintain_type { get; set; }
|
||||
public string? maintain_type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养内容
|
||||
|
||||
@@ -102,12 +102,12 @@ public partial class EqpMaintainTemEquipH : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public string is_start { get; set; }
|
||||
public string? is_start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否复核
|
||||
/// </summary>
|
||||
public string is_repeat { get; set; }
|
||||
public string? is_repeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核岗位id
|
||||
|
||||
@@ -57,7 +57,7 @@ public partial class EqpMaintainTemH : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 周期方式 1 单次 2 循环
|
||||
/// </summary>
|
||||
public string plan_cycle_unit { get; set; }
|
||||
public string? plan_cycle_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量
|
||||
|
||||
@@ -47,7 +47,7 @@ public partial class EqpRepairApply : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public string equip_id { get; set; }
|
||||
public string? equip_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请用户ID
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Tnb.EquipMgr.Entities
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string delay_reason { get; set; }
|
||||
public string? delay_reason { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建用户
|
||||
|
||||
@@ -97,7 +97,7 @@ public partial class EqpSpEquipCheckRecord : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 状态 0 待检验 1 已检验
|
||||
/// </summary>
|
||||
public string status { get; set; }
|
||||
public string? status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 证书名称
|
||||
|
||||
@@ -52,6 +52,6 @@ public partial class ToolMoldsMaterial : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 物料同组标识
|
||||
/// </summary>
|
||||
public string? material_group { get; set; }
|
||||
public string material_group { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
@@ -32,30 +32,30 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipDaqList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (input!=null && !string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
}
|
||||
var result = await db.Queryable<EqpDaq>()
|
||||
.LeftJoin<UserEntity>((a,b)=>a.create_id==b.Id)
|
||||
.Where(a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("data_source"),a=>a.data_source==queryJson["data_source"])
|
||||
.WhereIF(queryJson.ContainsKey("label_name"),a=>a.label_name.Contains(queryJson["label_name"]))
|
||||
.WhereIF(queryJson.ContainsKey("label_point"),a=>a.label_point.Contains(queryJson["label_point"]))
|
||||
.WhereIF(input!=null,a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("data_source"),a=>a.data_source==queryJson["data_source"])
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("label_name"),a=>a.label_name.Contains(queryJson["label_name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("label_point"),a=>a.label_point.Contains(queryJson["label_point"]))
|
||||
.Select((a,b) => new EquipDaqQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
data_source = a.data_source,
|
||||
create_id = b.RealName,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
data_type = a.data_type,
|
||||
enabled = a.enabled==1 ? "是" : "否",
|
||||
equip_id = a.equip_id,
|
||||
label_name = a.label_name,
|
||||
label_point = a.label_point,
|
||||
remark = a.remark
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
||||
|
||||
return PageResult<EquipDaqQueryOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipFileList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -89,14 +89,14 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<UserEntity >((a, b,c) => a.modify_id == c.Id)
|
||||
.LeftJoin<EqpEquipment >((a, b,c,d) => a.equip_id == d.id)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("file_name"),(a,b,c,d)=>a.file_name.Contains(queryJson["file_name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("file_name"),(a,b,c,d)=>a.file_name.Contains(queryJson["file_name"]))
|
||||
.Select((a, b, c,d) => new EquipFileQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_id = b.RealName,
|
||||
create_id_id = a.create_id,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
equip_id=d.name,
|
||||
equip_id_id= a.equip_id,
|
||||
file_name=a.file_name,
|
||||
|
||||
@@ -14,6 +14,7 @@ using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备备品备件
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
@@ -34,20 +35,23 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
List<EqpEquipSpareParts> oldList = await _repository.GetListAsync(x => x.equip_id == input.equip_id);
|
||||
List<EqpEquipSpareParts> list = new List<EqpEquipSpareParts>();
|
||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||
foreach (var spare_parts_id in input.spare_parts_ids)
|
||||
string orgId = _userManager?.GetUserInfo().Result.organizeId ?? "";
|
||||
if (input != null && input.spare_parts_ids != null)
|
||||
{
|
||||
if (oldList.Any(x => x.spare_parts_id == spare_parts_id))
|
||||
continue;
|
||||
list.Add(new EqpEquipSpareParts()
|
||||
foreach (var spare_parts_id in input.spare_parts_ids)
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = input.equip_id,
|
||||
spare_parts_id = spare_parts_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = orgId,
|
||||
});
|
||||
if (oldList.Any(x => x.spare_parts_id == spare_parts_id))
|
||||
continue;
|
||||
list.Add(new EqpEquipSpareParts()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = input.equip_id,
|
||||
spare_parts_id = spare_parts_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.InsertRangeAsync(list);
|
||||
@@ -57,7 +61,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipSparePartsList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -67,8 +71,8 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c) => c.EnCode == Tnb.BasicData.DictConst.SparePartsType && c.DeleteMark == null)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b,c,d) => d.DictionaryTypeId == c.Id && b.type_id == d.EnCode)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("code"),(a,b,c,d)=>b.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson.ContainsKey("name"),(a,b,c,d)=>b.name.Contains(queryJson["name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>b.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>b.name.Contains(queryJson["name"]))
|
||||
.Select((a, b, c,d) => new EquipSparePartsQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetRepairRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -156,7 +156,7 @@ namespace Tnb.EquipMgr
|
||||
is_ugent = a.is_ugent==1 ? "是" : "否",
|
||||
description = a.description,
|
||||
repair_description = a.repair_description,
|
||||
complete_time = a.complete_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
complete_time = a.complete_time==null ? null : a.complete_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repairer_id = c.RealName
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 维修延期
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Delay(RepairDelayInput input)
|
||||
{
|
||||
@@ -43,7 +42,7 @@ namespace Tnb.EquipMgr
|
||||
EqpRepairDelay repairDelay = new EqpRepairDelay()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = eqpRepairApply.equip_id,
|
||||
equip_id = eqpRepairApply?.equip_id ?? "",
|
||||
repair_apply_id = input.repair_apply_id,
|
||||
delay_reason = input.delay_reason,
|
||||
expected_time = input.expected_time,
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.id))
|
||||
{
|
||||
_flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
await _flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
@@ -127,26 +127,30 @@ namespace Tnb.EquipMgr
|
||||
else
|
||||
{
|
||||
var entity = await _repository.GetSingleAsync(x=>x.id==input.id);
|
||||
_flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
if (entity != null)
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity.flow_task_id,
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
await _flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity?.flow_task_id??"",
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.IsSuccess ? "操作成功" : result.ErrorMessage;
|
||||
|
||||
@@ -37,19 +37,22 @@ namespace Tnb.EquipMgr
|
||||
throw Oops.Bah("该设备已存在检验计划");
|
||||
}
|
||||
|
||||
if (entity.warn_unit == "1")//月
|
||||
if (entity != null)
|
||||
{
|
||||
entity.next_check_time = entity.end_time.Value.AddMonths(-entity.warm_time.Value);
|
||||
}else if (entity.warn_unit == "2")//天
|
||||
{
|
||||
entity.next_check_time = entity.end_time.Value.AddDays(-entity.warm_time.Value);
|
||||
}
|
||||
if (entity.warn_unit == "1")//月
|
||||
{
|
||||
entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value);
|
||||
}else if (entity.warn_unit == "2")//天
|
||||
{
|
||||
entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value);
|
||||
}
|
||||
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
entity.create_time = DateTime.Now;
|
||||
entity.create_id = _userManager.UserId;
|
||||
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.InsertAsync(entity);
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
entity.create_time = DateTime.Now;
|
||||
entity.create_id = _userManager.UserId;
|
||||
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.InsertAsync(entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
@@ -86,7 +85,7 @@ namespace Tnb.EquipMgr
|
||||
EqpSpotInsTemEquipD eqpSpotInsTemEquipD = new EqpSpotInsTemEquipD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
spot_ins_item_id = eqpSpotInsTem.spot_ins_item_id,
|
||||
spot_ins_item_id = eqpSpotInsTem?.spot_ins_item_id ?? "",
|
||||
spot_ins_tem_equip_id = id,
|
||||
};
|
||||
insertEqpSpotInsTemEquipDs.Add(eqpSpotInsTemEquipD);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetSubEquipList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -43,19 +43,19 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<UserEntity >((a, b,c) => a.modify_id == c.Id)
|
||||
.LeftJoin<EqpEquipment >((a, b,c,d) => a.equip_id == d.id)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("code"),(a,b,c,d)=>a.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson.ContainsKey("name"),(a,b,c,d)=>a.name.Contains(queryJson["name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>a.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>a.name.Contains(queryJson["name"]))
|
||||
.Select((a, b, c,d) => new SubEquipQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
create_id = b.RealName,
|
||||
create_id_id = a.create_id,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
equip_id=d.name,
|
||||
equip_id_id= a.equip_id,
|
||||
code = a.code,
|
||||
modify_id = c.RealName,
|
||||
modify_time = a.modify_time.Value.ToString("yyyy-MM-dd"),
|
||||
modify_time = a.modify_time==null ? null : a.modify_time.Value.ToString("yyyy-MM-dd"),
|
||||
name = a.name,
|
||||
org_id = a.org_id,
|
||||
specification = a.specification,
|
||||
|
||||
@@ -31,21 +31,21 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipTechnologyParameterList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (input!=null && !string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
||||
}
|
||||
var result = await db.Queryable<EqpTechnologyParameter>()
|
||||
.Where(a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson["name"]))
|
||||
.WhereIF(input!=null,a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson["name"]))
|
||||
.Select(a => new EquipTechnologyParameterQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
name = a.name,
|
||||
definition = a.definition,
|
||||
remark = a.remark
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
||||
|
||||
return PageResult<EquipTechnologyParameterQueryOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 执行设备保养计划
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> ExecuteMaintain(SpotInsRecordExecuteInput input)
|
||||
@@ -75,13 +74,16 @@ namespace Tnb.EquipMgr
|
||||
execute_user_id = _userManager.UserId
|
||||
}, x => x.id == input.id);
|
||||
|
||||
foreach (var item in input.details)
|
||||
if (input != null && input.details != null)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item.ContainsKey("maintain_descrip"),x=>x.maintain_descrip==item["maintain_descrip"])
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item.ContainsKey("maintain_descrip"),x=>x.maintain_descrip==item["maintain_descrip"])
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +116,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 复核设备保养计划
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<string> RepeatMaintain(MaintainRecordRepeatInput input)
|
||||
@@ -123,22 +124,28 @@ namespace Tnb.EquipMgr
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
|
||||
foreach (var item in input.details)
|
||||
if (input != null && input.details != null)
|
||||
{
|
||||
await db.Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x => x.repeat_descrip == item["repeat_descrip"])
|
||||
.SetColumns(x => x.repeat_result == item["repeat_result"])
|
||||
.Where(x => x.id == item["id"]).ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await db.Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x => x.repeat_descrip == item["repeat_descrip"])
|
||||
.SetColumns(x => x.repeat_result == item["repeat_result"])
|
||||
.Where(x => x.id == item["id"]).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.UpdateAsync(x => new EqpMaintainRecordH()
|
||||
if (input != null)
|
||||
{
|
||||
repeat_result = input.repeat_result,
|
||||
repeat_remark = input.repeat_remark,
|
||||
repeat_user_id = _userManager.UserId,
|
||||
repeat_time = DateTime.Now,
|
||||
status = SpotInsRecordExecutionStatus.COMPLETED
|
||||
}, x => x.id == input.id);
|
||||
await _repository.UpdateAsync(x => new EqpMaintainRecordH()
|
||||
{
|
||||
repeat_result = input.repeat_result,
|
||||
repeat_remark = input.repeat_remark,
|
||||
repeat_user_id = _userManager.UserId,
|
||||
repeat_time = DateTime.Now,
|
||||
status = SpotInsRecordExecutionStatus.COMPLETED
|
||||
}, x => x.id == input.id);
|
||||
}
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
@@ -149,7 +156,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetMaintainRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -163,17 +170,17 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
equip_id = b.code,
|
||||
equip_id_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_user_id = d.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
maintain_tem_equip_id = a.maintain_tem_equip_id,
|
||||
execute_time = a.execute_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
execute_time = a.execute_time==null ? null : a.execute_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
execute_user_id = c.RealName,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 执行点巡检
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> ExecuteSpotIns(SpotInsRecordExecuteInput input)
|
||||
@@ -75,13 +74,16 @@ namespace Tnb.EquipMgr
|
||||
spot_record_user_id = _userManager.UserId
|
||||
}, x => x.id == input.id);
|
||||
|
||||
foreach (var item in input.details)
|
||||
if(input!=null && input.details!=null)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpSpotInsRecordD>().
|
||||
SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item["judge_type"]=="1",x=>x.real_value==Convert.ToDouble(item["real_value"]))
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpSpotInsRecordD>().
|
||||
SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item["judge_type"]=="1",x=>x.real_value==Convert.ToDouble(item["real_value"]))
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +116,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 复核点巡检
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task RepeatSpotIns(SpotInsRecordRepeatInput input)
|
||||
@@ -133,7 +134,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetSpotInsRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -145,16 +146,16 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
equip_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_user_id = b.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
spot_ins_tem_equip_id = a.spot_ins_tem_equip_id,
|
||||
spot_record_date_time = a.spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
spot_record_date_time = a.spot_record_date_time==null ? null :a.spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
spot_record_user_id = a.spot_record_user_id,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
@@ -3,17 +3,17 @@ namespace Tnb.PerMgr.Entities.Dto
|
||||
public class ProcessChildDataInput
|
||||
{
|
||||
|
||||
public string id { get; set; }
|
||||
public string process_standards_id { get; set; }
|
||||
public string id { get; set; } = string.Empty;
|
||||
public string? process_standards_id { get; set; }
|
||||
/// <summary>
|
||||
/// 工艺参数id
|
||||
/// </summary>
|
||||
public string process_param_id { get; set; }
|
||||
public string? process_param_id { get; set; }
|
||||
/// <summary>
|
||||
/// 工艺参数类型id
|
||||
/// </summary>
|
||||
public string process_param_type_id { get; set; }
|
||||
public string? process_param_type_id { get; set; }
|
||||
public decimal value { get; set; }
|
||||
public string daq_id { get; set; }
|
||||
public string? daq_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.PerMgr.Entities.Dto
|
||||
{
|
||||
public class ProcessParamOutput
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string? name { get; set; }
|
||||
|
||||
public decimal upper_value { get; set; }
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@ namespace Tnb.PerMgr.Entities.Dto
|
||||
/// <summary>
|
||||
/// 工艺标准子表id
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
/// <summary>
|
||||
/// 工艺参数id
|
||||
/// </summary>
|
||||
public string process_param_id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string? process_param_id { get; set; }
|
||||
public string? name { get; set; }
|
||||
public decimal? value { get; set; }
|
||||
public decimal upper_value { get; set; }
|
||||
public decimal lower_value { get; set; }
|
||||
|
||||
public string daq_id { get; set; }
|
||||
public string? daq_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.PerMgr.Entities.Dto
|
||||
{
|
||||
public class ProcessParamTypeDaqListOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string label_name { get; set; }
|
||||
public string? id { get; set; }
|
||||
public string? label_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace Tnb.PerMgr
|
||||
string equipId = dic["equip_id"];
|
||||
var db = _repository.AsSugarClient();
|
||||
var equipment = await db.Queryable<EqpEquipment>().Where(x => x.id == equipId).SingleAsync();
|
||||
string equipTypeId = equipment?.equip_type_id;
|
||||
string? equipTypeId = equipment?.equip_type_id;
|
||||
|
||||
//List<PerProcessParamType> perProcessParamTypes = await _repository.GetListAsync(x => x.equip_type_id == equipTypeId);
|
||||
var result = await db.Queryable<PerProcessParamType>()
|
||||
@@ -94,29 +94,29 @@ namespace Tnb.PerMgr
|
||||
{
|
||||
PerProcessParamEditRecord record = new PerProcessParamEditRecord
|
||||
{
|
||||
process_param_id = item.process_param_id,
|
||||
process_param_id = item?.process_param_id ?? "",
|
||||
old_value = processStandardsD.value,
|
||||
new_value = item.value,
|
||||
new_value = item?.value ?? 0,
|
||||
modify_id = _userManager.UserId,
|
||||
modify_time = DateTime.Now,
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId,
|
||||
equip_id = perProcessStandardsH.equip_id,
|
||||
process_param_name = processParam.name
|
||||
};
|
||||
db.Insertable<PerProcessParamEditRecord>(record).ExecuteCommandAsync();
|
||||
await db.Insertable<PerProcessParamEditRecord>(record).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(item.id))
|
||||
if (item==null || string.IsNullOrEmpty(item.id))
|
||||
{
|
||||
PerProcessStandardsD insertObj = new PerProcessStandardsD()
|
||||
{
|
||||
value = item.value,
|
||||
process_param_id = item.process_param_id,
|
||||
process_standards_id = item.process_standards_id,
|
||||
process_param_type_id = item.process_param_type_id,
|
||||
daq_id = item.daq_id,
|
||||
value = item?.value ?? 0,
|
||||
process_param_id = item?.process_param_id ?? "",
|
||||
process_standards_id = item?.process_standards_id ?? "",
|
||||
process_param_type_id = item?.process_param_type_id ?? "",
|
||||
daq_id = item?.daq_id??"",
|
||||
};
|
||||
|
||||
insertIds.Add(insertObj.id);
|
||||
@@ -152,7 +152,7 @@ namespace Tnb.PerMgr
|
||||
var db = _repository.AsSugarClient();
|
||||
var perProcessStandardsH = await db.Queryable<PerProcessStandardsH>().SingleAsync(x => x.id == id);
|
||||
var equipment = await db.Queryable<EqpEquipment>().Where(x => x.id == perProcessStandardsH.equip_id).SingleAsync();
|
||||
string equipTypeId = equipment?.equip_type_id;
|
||||
string? equipTypeId = equipment?.equip_type_id;
|
||||
|
||||
var result = await db.Queryable<PerProcessParamType>()
|
||||
.Where(a => a.equip_type_id == equipTypeId)
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Tnb.PerMgr
|
||||
sheet.SetColumnWidth(i,15 * 256);
|
||||
}
|
||||
|
||||
int rowIndex = 1;
|
||||
// int rowIndex = 1;
|
||||
|
||||
// var column = sheet.GetColumn(0);
|
||||
// 设置下拉项
|
||||
@@ -109,7 +109,7 @@ namespace Tnb.PerMgr
|
||||
{
|
||||
int rowIndex = 1;
|
||||
bool flag = false;
|
||||
IWorkbook workbook = null;
|
||||
IWorkbook? workbook = null;
|
||||
try
|
||||
{
|
||||
using (Stream stream = input.file.OpenReadStream())
|
||||
@@ -121,9 +121,12 @@ namespace Tnb.PerMgr
|
||||
else if (input.fileName.IndexOf(".xls") > 0)
|
||||
workbook = new HSSFWorkbook(stream);
|
||||
|
||||
ISheet sheet = workbook.GetSheetAt(0);
|
||||
ISheet? sheet = workbook?.GetSheetAt(0);
|
||||
|
||||
if (sheet.LastRowNum <= 1)
|
||||
if(workbook==null || sheet==null)
|
||||
throw Oops.Bah("无导入数据");
|
||||
|
||||
if (sheet?.LastRowNum <= 1)
|
||||
throw Oops.Bah("无导入数据");
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
@@ -137,7 +140,7 @@ namespace Tnb.PerMgr
|
||||
style.SetFont(font);
|
||||
|
||||
List<PerProcessStandardsD> list = new List<PerProcessStandardsD>() { };
|
||||
for (rowIndex = 1; rowIndex <= sheet.LastRowNum; rowIndex++)
|
||||
for (rowIndex = 1; rowIndex <= sheet?.LastRowNum; rowIndex++)
|
||||
{
|
||||
IRow row = sheet.GetRow(rowIndex);
|
||||
ICell cell0 = row.GetCell(0);
|
||||
@@ -146,7 +149,7 @@ namespace Tnb.PerMgr
|
||||
|
||||
PerProcessStandardsD item = new PerProcessStandardsD();
|
||||
item.process_standards_id = id;
|
||||
PerProcessParamType perProcessParamType = perProcessParamTypes.FirstOrDefault(x => x.name == cell0.StringCellValue);
|
||||
PerProcessParamType? perProcessParamType = perProcessParamTypes.FirstOrDefault(x => x.name == cell0.StringCellValue);
|
||||
if (perProcessParamType != null)
|
||||
{
|
||||
item.process_param_type_id = perProcessParamType.id;
|
||||
@@ -159,7 +162,7 @@ namespace Tnb.PerMgr
|
||||
flag = true;
|
||||
}
|
||||
|
||||
PerProcessParam perProcessParam = perProcessParams.FirstOrDefault(x => x.name == cell1.StringCellValue);
|
||||
PerProcessParam? perProcessParam = perProcessParams.FirstOrDefault(x => x.name == cell1.StringCellValue);
|
||||
if (perProcessParam != null)
|
||||
{
|
||||
item.process_param_id = perProcessParam.id;
|
||||
@@ -232,7 +235,7 @@ namespace Tnb.PerMgr
|
||||
{
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
workbook.Write(ms);
|
||||
workbook?.Write(ms);
|
||||
string fileName = $"工艺标准导入报错{DateTime.Now.Ticks}.xlsx";
|
||||
using (MemoryStream ms2 = new MemoryStream(ms.ToArray()))
|
||||
{
|
||||
@@ -278,6 +281,7 @@ namespace Tnb.PerMgr
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
||||
{
|
||||
public class MaterialReceiptInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string? id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签收单号
|
||||
@@ -59,6 +59,6 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
||||
/// </summary>
|
||||
public string? mbom_process_id { get; set; }
|
||||
|
||||
public List<Dictionary<string,string>> details { get; set; }
|
||||
public List<Dictionary<string,string>>? details { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
mo_task_id = input.data["mo_task_id"]?.ToString(),
|
||||
mo_task_code = input.data["mo_task_code"]?.ToString(),
|
||||
reported_qty = (int)item["reported_qty"],
|
||||
reported_qty = item["reported_qty"]!=null ? (int)item["reported_qty"] : 0,
|
||||
create_id = item["create_id"]?.ToString(),
|
||||
create_time = DateTime.Now,
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData.Entities", "B
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entities", "ProductionMgr\Tnb.ProductionMgr.Entities\Tnb.ProductionMgr.Entities.csproj", "{57E7491F-7876-451E-BA9F-5B007EBD432D}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerMgr", "PerMgr", "{74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "16-PerMgr", "16-PerMgr", "{74AB6486-1090-4CC9-9D1A-F1245E3ECFC3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.PerMgr", "PerMgr\Tnb.PerMgr\Tnb.PerMgr.csproj", "{D41946CF-09C6-4CA4-A1F4-42E7E1538BF7}"
|
||||
EndProject
|
||||
|
||||
Reference in New Issue
Block a user