查询工单下的扫描条码信息

This commit is contained in:
qianhao.xu 2024-11-07 11:35:17 +08:00
parent 430c9ec669
commit f6fadc36f6
3 changed files with 34 additions and 3 deletions

View File

@ -195,4 +195,17 @@ public class WorkOrderProgressController : BaseController
var response = workorderProgressService.GetWorkOrderTime(workorder);
return SUCCESS(response);
}
//TODO 查询工单下的扫描条码信息
[HttpGet("get_san_code_info)")]
public IActionResult GetWorkOrderScanCodeInfo(string workorder)
{
if (string.IsNullOrEmpty(workorder)) throw new CustomException("workorder is null");
var response = workorderProgressService.GetWorkOrderScanCodeInfo(workorder);
return SUCCESS(response);
}
}

View File

@ -37,5 +37,7 @@ namespace DOAN.Service.JobKanban.IService
(int ,int) GetWorkOrderProgress(string workorder);
(DateTime, float) GetWorkOrderTime(string workorder);
List<ProReportworkDetail> GetWorkOrderScanCodeInfo(string workorder);
}
}

View File

@ -5,6 +5,7 @@ using DOAN.Model.MES.product;
using DOAN.Model.MES.product.Dto;
using DOAN.Service.JobKanban.IService;
using Infrastructure.Attribute;
using Mapster;
using SqlSugar.SplitTableExtensions;
namespace DOAN.Service.JobKanban;
@ -25,13 +26,20 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
public List<ProReportwork> GetReportWorkRecord(string group_code, string line_code, DateTime handleDate)
{
handleDate = handleDate.ToLocalTime().Date;
return Context.Queryable<ProWorkorder>().LeftJoin<ProReportwork>((w, r) => w.Workorder == r.FkWorkorder)
.Where((w, r) => w.GroupCode == group_code)
.Where((w, r) => w.LineCode == line_code)
.Where((w, r) => w.WorkorderDate == handleDate)
.Select((w, r) => r)
.ToList();
.Select((w, r) => new
{
FkWorkorder = w.Workorder,
DispatchNum = w.DeliveryNum,
FinishedNum = r.FinishedNum,
})
.ToList().Adapt<List<ProReportwork>>();
}
@ -292,4 +300,12 @@ public class WorkorderProgressService : BaseService<ProWorkorder>, IWorkorderPro
return progress;
}
//查询工单下的扫描条码信息
public List<ProReportworkDetail> GetWorkOrderScanCodeInfo(string workorder)
{
return Context.Queryable<ProReportworkDetail>().Where(it => it.Workorder == workorder).ToList();
}
}