Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -43,7 +43,7 @@ public partial class BasLocation : BaseEntity<string>
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否使用
|
/// 是否使用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnDataType = "varchar(1)", SqlParameterDbType = typeof(CommonPropertyConvert))]
|
//[SugarColumn(ColumnDataType = "varchar(32)", SqlParameterDbType = typeof(CommonPropertyConvert))]
|
||||||
public int is_use { get; set; }
|
public int is_use { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ namespace Tnb.ProductionMgr
|
|||||||
}
|
}
|
||||||
var items = await _db.Queryable<PrdMoTask>().LeftJoin<BasProcess>((a, b) => a.process_id == b.id).LeftJoin<PrdMo>((a, b, c) => a.mo_id == c.id)
|
var items = await _db.Queryable<PrdMoTask>().LeftJoin<BasProcess>((a, b) => a.process_id == b.id).LeftJoin<PrdMo>((a, b, c) => a.mo_id == c.id)
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.mo_task_code), a => a.mo_task_code == input.mo_task_code.Trim())
|
.WhereIF(!string.IsNullOrEmpty(input.mo_task_code), a => a.mo_task_code == input.mo_task_code.Trim())
|
||||||
.WhereIF(start, a => startTimes[0] <= a.estimated_start_date && startTimes[1] >= a.estimated_start_date)
|
// .WhereIF(start, a => a.estimated_start_date != null&& startTimes[0] <= a.estimated_start_date && startTimes[1] >= a.estimated_start_date)
|
||||||
.WhereIF(end, a => endTimes[0] <= a.estimated_end_date && endTimes[1] >= a.estimated_end_date)
|
// .WhereIF(end, a => a.estimated_end_date != null && endTimes[0] <= a.estimated_end_date && endTimes[1] >= a.estimated_end_date)
|
||||||
.WhereIF(!string.IsNullOrEmpty(input.workline), a => list.Where(p => p.EnCode.Contains(input.workline) || p.FullName.Contains(input.workline)).Select(p => p.Id).ToList().Contains(a.workline_id!))
|
.WhereIF(!string.IsNullOrEmpty(input.workline), a => list.Where(p => p.EnCode.Contains(input.workline) || p.FullName.Contains(input.workline)).Select(p => p.Id).ToList().Contains(a.workline_id!))
|
||||||
.Where(a => string.IsNullOrEmpty(a.parent_id) && a.schedule_type == 2 && a.mo_task_status != "ToBeScheduled")
|
.Where(a => string.IsNullOrEmpty(a.parent_id) && a.schedule_type == 2 && a.mo_task_status != "ToBeScheduled")
|
||||||
.Select((a, b, c) => new PrdMoTask
|
.Select((a, b, c) => new PrdMoTask
|
||||||
@@ -96,6 +96,10 @@ namespace Tnb.ProductionMgr
|
|||||||
|
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input.currentPage, input.pageSize);
|
.ToPagedListAsync(input.currentPage, input.pageSize);
|
||||||
|
if (start)
|
||||||
|
items.list= items.list.Where(a => startTimes[0] <= a.plan_start_date && startTimes[1] >= a.plan_start_date).ToList();
|
||||||
|
if (end)
|
||||||
|
items.list= items.list.Where(a => endTimes[0] <= a.plan_end_date && endTimes[1] >= a.plan_end_date).ToList();
|
||||||
_db.ThenMapper(items.list, it =>
|
_db.ThenMapper(items.list, it =>
|
||||||
{
|
{
|
||||||
it.mo_task_status = it.mo_task_status.IsNotEmptyOrNull() && dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "";
|
it.mo_task_status = it.mo_task_status.IsNotEmptyOrNull() && dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "";
|
||||||
@@ -124,20 +128,24 @@ namespace Tnb.ProductionMgr
|
|||||||
var treeList = trees.ToTree();
|
var treeList = trees.ToTree();
|
||||||
if (!string.IsNullOrEmpty(input.process))
|
if (!string.IsNullOrEmpty(input.process))
|
||||||
{
|
{
|
||||||
|
List< PackReportTreeOutput > removelist = new List< PackReportTreeOutput >();
|
||||||
foreach (var item in treeList)
|
foreach (var item in treeList)
|
||||||
{
|
{
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
if (item.process_id != null && item.process_id.Contains(input.process))
|
if (item.process_id != null && item.process_id.Contains(input.process))
|
||||||
flag = true;
|
flag = true;
|
||||||
if (item.children != null)
|
if (item.children != null&& item.children.Count>0)
|
||||||
{
|
{
|
||||||
List<PackReportTreeOutput> childs = (List<PackReportTreeOutput>)(Object)item.children;
|
var childs = item.children.Adapt<List<PackReportTreeOutput>>();
|
||||||
if (childs.Where(p => p.process_id.Contains(input.process)).Any())
|
if (childs.Where(p => p.process_id.Contains(input.process)).Any())
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
if (!flag)
|
if (!flag)
|
||||||
treeList.Remove(item);
|
removelist.Add(item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
removelist.ForEach(p => treeList.Remove(p));
|
||||||
|
|
||||||
}
|
}
|
||||||
SqlSugarPagedList<PackReportTreeOutput> pagedList = new()
|
SqlSugarPagedList<PackReportTreeOutput> pagedList = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -210,7 +210,19 @@ namespace Tnb.WarehouseMgr
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public async Task<List<BasLocation>> InStockStrategy([FromQuery] InStockStrategyQuery input)
|
public async Task<List<BasLocation>> InStockStrategy([FromQuery] InStockStrategyQuery input)
|
||||||
{
|
{
|
||||||
var items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_use == (int)EnumCarryStatus.空闲 && it.is_type == "0").OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
var items = new List<BasLocation>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
//var stauts = (int)EnumCarryStatus.空闲;
|
||||||
|
items = await _db.Queryable<BasLocation>().Where(it => it.wh_id == input.warehouse_id && it.is_lock == 0 && it.is_type == "0" && it.is_use == (int)EnumCarryStatus.空闲).OrderBy(it => new { it.layers, it.loc_line, it.loc_column }, OrderByType.Asc).ToListAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw;
|
||||||
|
}
|
||||||
return items.Take(input.Size).ToList();
|
return items.Take(input.Size).ToList();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ namespace Tnb.WarehouseMgr
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
//[HttpPost]
|
||||||
public async Task<dynamic> ScanCodeInStock(VisualDevModelDataCrInput input)
|
private async Task<dynamic> ScanCodeInStock(VisualDevModelDataCrInput input)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user