修改看板和移动端的任务单列表接口
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using JNPF.Common.Filter;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
public class PrdMoTaskListOutput : PageInputBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位id
|
||||
/// </summary>
|
||||
public string stationId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -347,9 +347,9 @@ namespace Tnb.ProductionMgr
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetPadPrdMoTaskList(PrdPackReportQueryInput input)
|
||||
public async Task<dynamic> GetPadPrdMoTaskList(PrdMoTaskListOutput input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.stationId))
|
||||
if (string.IsNullOrEmpty(input.stationId))
|
||||
{
|
||||
return new
|
||||
{
|
||||
@@ -357,7 +357,16 @@ namespace Tnb.ProductionMgr
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Dictionary<string, object> queryJson = string.IsNullOrEmpty(input.queryJson) ? new Dictionary<string, object>() : input.queryJson.ToObject<Dictionary<string, object>>();
|
||||
string mo_task_code = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : "";
|
||||
string mo_task_status = queryJson.ContainsKey("mo_task_status") ? queryJson["mo_task_status"].ToString() : "";
|
||||
if (string.IsNullOrEmpty(input.sidx))
|
||||
{
|
||||
input.sidx = "create_time";
|
||||
input.sort = "desc";
|
||||
}
|
||||
|
||||
var result = await _db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.process_id == c.id)
|
||||
@@ -366,6 +375,8 @@ namespace Tnb.ProductionMgr
|
||||
.LeftJoin<EqpEquipment>((a,b,c,d,e,f)=>a.eqp_id==f.id)
|
||||
.LeftJoin<ToolMolds>((a,b,c,d,e,f,g)=>a.mold_id==g.id)
|
||||
.Where((a, b) => a.workstation_id == input.stationId && (a.mo_task_status == DictConst.ToBeStartedEnCode || a.mo_task_status == DictConst.MoStatusPauseCode || a.mo_task_status == DictConst.ComplatedEnCode || a.mo_task_status == DictConst.InProgressEnCode) )
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),a=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_status),a=>a.mo_task_status.Contains(mo_task_status))
|
||||
.Select((a, b, c, d, e,f,g) => new PADPackageTaskPageOutput
|
||||
{
|
||||
id = a.id,
|
||||
@@ -398,7 +409,7 @@ namespace Tnb.ProductionMgr
|
||||
schedule_type = a.schedule_type,
|
||||
})
|
||||
.MergeTable()
|
||||
.OrderByDescending((a) => a.create_time)
|
||||
.OrderBy($"{input.sidx} {input.sort}")
|
||||
.ToPagedListAsync(input.currentPage, int.MaxValue);
|
||||
|
||||
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);
|
||||
|
||||
Reference in New Issue
Block a user