消除warning
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Tnb.BasicData
|
||||
string processId = dic["processId"];
|
||||
var db = _repository.AsSugarClient();
|
||||
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x=>x.process_id==processId).Select(x=>x.defective_id).ToListAsync();
|
||||
List<string> defectTypeIds = await db.Queryable<BasDefect>().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync();
|
||||
List<string?> defectTypeIds = await db.Queryable<BasDefect>().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync();
|
||||
return await _repository.AsSugarClient().Queryable<BasDefectType>()
|
||||
.Where((a) => defectTypeIds.Contains(a.id))
|
||||
.Select(a => new
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace Tnb.BasicData
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, object>? queryJson = string.IsNullOrEmpty(input.queryJson) ? null : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||
string name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||
string version = queryJson!=null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
||||
string? code = queryJson!=null && queryJson.ContainsKey("code") ? queryJson["code"].ToString() : "";
|
||||
string? name = queryJson!=null && queryJson.ContainsKey("name") ? queryJson["name"].ToString() : "";
|
||||
string? version = queryJson!=null && queryJson.ContainsKey("version") ? queryJson["version"].ToString() : "";
|
||||
var list = await db.Queryable<BasESop, BasMbom, BasMbomProcess, UserEntity,BasProcess>((a, b, c, d,e) => new object[]
|
||||
{
|
||||
JoinType.Left, a.mbom_id == b.id,
|
||||
@@ -60,17 +60,17 @@ namespace Tnb.BasicData
|
||||
JoinType.Left, a.create_id == d.Id,
|
||||
JoinType.Left, c.process_id == e.id,
|
||||
})
|
||||
.WhereIF(!string.IsNullOrEmpty(code), (a, b, c, d) => a.code.Contains(code))
|
||||
.WhereIF(!string.IsNullOrEmpty(name), (a, b, c, d) => a.name.Contains(name))
|
||||
.WhereIF(!string.IsNullOrEmpty(version), (a, b, c, d) => a.version.Contains(version))
|
||||
.WhereIF(!string.IsNullOrEmpty(code), (a, b, c, d) => a.code.Contains(code!))
|
||||
.WhereIF(!string.IsNullOrEmpty(name), (a, b, c, d) => a.name.Contains(name!))
|
||||
.WhereIF(!string.IsNullOrEmpty(version), (a, b, c, d) => a.version.Contains(version!))
|
||||
.Where((a,b,c)=>a.enabled==1)
|
||||
.Select((a, b, c, d,e) => new ESopListOutput
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
mbom_id = b.version,
|
||||
mbom_process_id = e.process_name,
|
||||
mbom_id = b.version!,
|
||||
mbom_process_id = e.process_name!,
|
||||
version = a.version,
|
||||
enabled = a.enabled==1 ? "是" : "否",
|
||||
attachment = a.attachment,
|
||||
@@ -106,14 +106,14 @@ namespace Tnb.BasicData
|
||||
.WhereIF(!string.IsNullOrEmpty(code), (a, b, c, d) => a.code.Contains(code))
|
||||
.WhereIF(!string.IsNullOrEmpty(name), (a, b, c, d) => a.name.Contains(name))
|
||||
.WhereIF(!string.IsNullOrEmpty(version), (a, b, c, d) => a.version.Contains(version))
|
||||
.Where((a,b,c)=>a.mbom_id==input.mbom_id && a.mbom_process_id==input.mbom_process_id)
|
||||
.Where((a,b,c)=>a.mbom_id==input!.mbom_id && a.mbom_process_id==input!.mbom_process_id)
|
||||
.Select((a, b, c, d,e) => new ESopListOutput
|
||||
{
|
||||
id = a.id,
|
||||
code = a.code,
|
||||
name = a.name,
|
||||
mbom_id = b.version,
|
||||
mbom_process_id = e.process_name,
|
||||
mbom_id = b.version!,
|
||||
mbom_process_id = e.process_name!,
|
||||
version = a.version,
|
||||
enabled = a.enabled==1 ? "是" : "否",
|
||||
attachment = a.attachment,
|
||||
@@ -135,7 +135,7 @@ namespace Tnb.BasicData
|
||||
return await _repository.GetFirstAsync(x => x.mbom_process_id == mbomProcessId && x.enabled == 1);
|
||||
}
|
||||
|
||||
return null;
|
||||
return null!;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
@@ -187,16 +187,16 @@ namespace Tnb.BasicData
|
||||
}
|
||||
|
||||
List<string> typeList = new List<string>();
|
||||
if(!string.IsNullOrEmpty(input.types))
|
||||
if(!string.IsNullOrEmpty(input!.types))
|
||||
{
|
||||
typeList = JsonConvert.DeserializeObject<List<string>>(input.types);
|
||||
typeList = JsonConvert.DeserializeObject<List<string>>((input?.types??"")) ?? new List<string>();
|
||||
}
|
||||
var query = db.Queryable<BasMaterial>()
|
||||
.Where(x => x.state == "1")
|
||||
.WhereIF(queryJson != null && queryJson.ContainsKey("name"), a => a.name.Contains(queryJson["name"]))
|
||||
.WhereIF(queryJson != null && queryJson.ContainsKey("code"), a => a.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson != null && queryJson.ContainsKey("name"), x => x.name.Contains(queryJson!["name"]))
|
||||
.WhereIF(queryJson != null && queryJson.ContainsKey("code"), x => x.code.Contains(queryJson!["code"]))
|
||||
.WhereIF(queryJson != null && queryJson.ContainsKey("material_standard"),
|
||||
a => a.material_standard.Contains(queryJson["material_standard"]))
|
||||
x => x.material_standard!.Contains(queryJson!["material_standard"]))
|
||||
.Select(x => x);
|
||||
|
||||
var list = new List<ISugarQueryable<BasMaterial>>();
|
||||
|
||||
@@ -297,15 +297,15 @@ namespace Tnb.BasicData
|
||||
process_id = process?.process_id ?? "",
|
||||
preparation_time = process?.preparation_time ?? 0,
|
||||
station = process?.station ?? "",
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
route_detail_id = process.route_detail_id,
|
||||
byproduct_status = process?.byproduct_status ?? 0,
|
||||
production_method = process?.production_method,
|
||||
route_detail_id = process?.route_detail_id ?? "",
|
||||
ordinal = ++index,
|
||||
is_last = index==mbomSaveDataInput.processes.Count ? 1 : 0,
|
||||
|
||||
});
|
||||
|
||||
if (process.inputs != null)
|
||||
if (process!.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
{
|
||||
@@ -415,12 +415,12 @@ namespace Tnb.BasicData
|
||||
decimal preparation_time = process?.preparation_time ?? 0;
|
||||
await _repository.AsSugarClient().Updateable<BasMbomProcess>()
|
||||
.SetColumns(x => x.preparation_time == preparation_time)
|
||||
.SetColumns(x => x.station == process.station)
|
||||
.SetColumns(x => x.byproduct_status == process.byproduct_status)
|
||||
.SetColumns(x => x.production_method == process.production_method)
|
||||
.Where(x => x.id == process.id).ExecuteCommandAsync();
|
||||
.SetColumns(x => x.station == process!.station)
|
||||
.SetColumns(x => x.byproduct_status == process!.byproduct_status)
|
||||
.SetColumns(x => x.production_method == process!.production_method)
|
||||
.Where(x => x.id == process!.id).ExecuteCommandAsync();
|
||||
|
||||
if (process.inputs != null)
|
||||
if (process!.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
{
|
||||
@@ -572,14 +572,14 @@ namespace Tnb.BasicData
|
||||
process_id = process?.process_id ?? "",
|
||||
preparation_time = process?.preparation_time ?? 0,
|
||||
station = process?.station ?? "",
|
||||
byproduct_status = process.byproduct_status,
|
||||
production_method = process.production_method,
|
||||
route_detail_id = process.route_detail_id,
|
||||
byproduct_status = process!.byproduct_status,
|
||||
production_method = process!.production_method,
|
||||
route_detail_id = process!.route_detail_id,
|
||||
ordinal = ++index,
|
||||
is_last = index==mbomSaveDataInput.processes.Count ? 1 : 0,
|
||||
no = process.no,
|
||||
last_process_no = process.last_process_no,
|
||||
next_process_no = process.next_process_no,
|
||||
no = process!.no,
|
||||
last_process_no = process!.last_process_no,
|
||||
next_process_no = process!.next_process_no,
|
||||
|
||||
});
|
||||
|
||||
@@ -693,12 +693,12 @@ namespace Tnb.BasicData
|
||||
decimal preparation_time = process?.preparation_time ?? 0;
|
||||
await _repository.AsSugarClient().Updateable<BasMbomProcess>()
|
||||
.SetColumns(x => x.preparation_time == preparation_time)
|
||||
.SetColumns(x => x.station == process.station)
|
||||
.SetColumns(x => x.byproduct_status == process.byproduct_status)
|
||||
.SetColumns(x => x.production_method == process.production_method)
|
||||
.Where(x => x.id == process.id).ExecuteCommandAsync();
|
||||
.SetColumns(x => x.station == process!.station)
|
||||
.SetColumns(x => x.byproduct_status == process!.byproduct_status)
|
||||
.SetColumns(x => x.production_method == process!.production_method)
|
||||
.Where(x => x.id == process!.id).ExecuteCommandAsync();
|
||||
|
||||
if (process.inputs != null)
|
||||
if (process!.inputs != null)
|
||||
{
|
||||
foreach (var input in process.inputs)
|
||||
{
|
||||
|
||||
@@ -17,17 +17,11 @@ namespace Tnb.BasicData
|
||||
public class BasPushRuleLogService : IBasPushRuleLogService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<BasPushRuleLog> _repository;
|
||||
private readonly DataBaseManager _dbManager;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
|
||||
public BasPushRuleLogService(
|
||||
ISqlSugarRepository<BasPushRuleLog> repository,
|
||||
IUserManager userManager)
|
||||
ISqlSugarRepository<BasPushRuleLog> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
|
||||
Reference in New Issue
Block a user