Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Tnb.BasicData.Entities.Dto
|
||||||
|
{
|
||||||
|
public class DefectOutput
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public string defect_code { get; set; }
|
||||||
|
public string defect_name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ using JNPF.Systems.Interfaces.System;
|
|||||||
using JNPF.VisualDev;
|
using JNPF.VisualDev;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.BasicData.Entities.Dto;
|
||||||
using Tnb.BasicData.Entities;
|
using Tnb.BasicData.Entities;
|
||||||
using Tnb.BasicData.Interfaces;
|
using Tnb.BasicData.Interfaces;
|
||||||
|
|
||||||
@@ -33,18 +34,21 @@ namespace Tnb.BasicData
|
|||||||
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
public async Task<dynamic> GetDefectListByProcessId(Dictionary<string, string> dic)
|
||||||
{
|
{
|
||||||
string processId = dic["processId"];
|
string processId = dic["processId"];
|
||||||
return await _repository.AsSugarClient().Queryable<BasProcessDefective>()
|
var db = _repository.AsSugarClient();
|
||||||
.LeftJoin<BasProcess>((a, b) => a.process_id == b.id)
|
List<string> defectIds = await db.Queryable<BasProcessDefective>().Where(x=>x.process_id==processId).Select(x=>x.defective_id).ToListAsync();
|
||||||
.LeftJoin<BasDefect>((a, b, c) => a.defective_id == c.id)
|
List<string> defectTypeIds = await db.Queryable<BasDefect>().Where(x=>defectIds.Contains(x.id) && x.enabled==1).Select(x=>x.defect_type_id).ToListAsync();
|
||||||
.LeftJoin<BasDefectType>((a,b,c,d)=>c.defect_type_id==d.id)
|
return await _repository.AsSugarClient().Queryable<BasDefectType>()
|
||||||
.Where((a, b, c) => a.process_id == processId && c.enabled==1)
|
.Where((a) => defectTypeIds.Contains(a.id))
|
||||||
.Select((a, b, c,d) => new
|
.Select(a => new
|
||||||
{
|
{
|
||||||
id = c.id,
|
defect_type_id = a.id,
|
||||||
defect_code = c.defect_code,
|
defect_type_name = a.defect_type_name,
|
||||||
defect_name = c.defect_name,
|
children = SqlFunc.Subqueryable<BasDefect>().Where(x=>x.defect_type_id==a.id && defectIds.Contains(x.id)).ToList(x=>new DefectOutput()
|
||||||
defect_type_id = d.defect_type_name,
|
{
|
||||||
defect_type_id_id = d.id
|
id = x.id,
|
||||||
|
defect_code = x.defect_code,
|
||||||
|
defect_name = x.defect_name,
|
||||||
|
})
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,7 +224,21 @@ namespace Tnb.WarehouseMgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var isOk = await _wareHouseService.GenPreTask(preTasks, null);
|
List<WmsPretaskCode> pretaskCodes = new();
|
||||||
|
foreach (var pt in preTasks)
|
||||||
|
{
|
||||||
|
var partCodes = carryCodes.FindAll(x => x.carry_id == pt.carry_id).Distinct().ToList();
|
||||||
|
var curPreTaskCodes = partCodes.Adapt<List<WmsPretaskCode>>();
|
||||||
|
curPreTaskCodes.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.id=SnowflakeIdHelper.NextId();
|
||||||
|
x.bill_id = pt.id;
|
||||||
|
x.create_time = DateTime.Now;
|
||||||
|
});
|
||||||
|
pretaskCodes.AddRange(curPreTaskCodes);
|
||||||
|
}
|
||||||
|
|
||||||
|
var isOk = await _wareHouseService.GenPreTask(preTasks, pretaskCodes);
|
||||||
GenPreTaskUpInput genPreTaskAfterUpInput = new();
|
GenPreTaskUpInput genPreTaskAfterUpInput = new();
|
||||||
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
|
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
|
||||||
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
|
genPreTaskAfterUpInput.LocationIds = new HashSet<string>(locIds).ToList();
|
||||||
|
|||||||
Reference in New Issue
Block a user