表格形式查询工单 任务及其详情
This commit is contained in:
parent
ffc8387b19
commit
ff72e15edb
@ -110,6 +110,16 @@ namespace DOAN.WebApi.Controllers.MES.mm
|
||||
}
|
||||
|
||||
|
||||
//TODO 表格形式查询工单 任务及其详情
|
||||
[HttpPost("table_task")]
|
||||
public IActionResult TableQuerytaskInfo([FromBody] FormsWorkoderAndTaskQuery parm)
|
||||
{
|
||||
if (parm == null) { return SUCCESS(null); };
|
||||
|
||||
var response = preparantTaskService.TableQuerytaskInfo(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -78,4 +78,81 @@ namespace DOAN.Model.MES.mm.Dto
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 表格形式查看搜索查询
|
||||
/// </summary>
|
||||
public class FormsWorkoderAndTaskQuery : PagerInfo
|
||||
{
|
||||
public string Workorder { get; set; }
|
||||
public DateTime[] searchDate { get; set; }
|
||||
|
||||
public string route_code { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Forms show work orders and tasks
|
||||
/// </summary>
|
||||
public class FormsWorkoderAndTaskInfo
|
||||
{
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public int SerialNum { get; set; }
|
||||
|
||||
public string TaskCode { get; set; }
|
||||
|
||||
public string FkWorkorder { get; set; }
|
||||
|
||||
public int? PreparationStatus { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// task_info
|
||||
/// </summary>
|
||||
public string SubId { get; set; }
|
||||
|
||||
|
||||
public string FkTaskCode { get; set; }
|
||||
|
||||
public string MaterialCode { get; set; }
|
||||
|
||||
public string MaterialName { get; set; }
|
||||
|
||||
public string Specification { get; set; }
|
||||
|
||||
public decimal Quantity { get; set; }
|
||||
|
||||
public string Unit { get; set; }
|
||||
/// <summary>
|
||||
/// task_info
|
||||
/// </summary>
|
||||
public string SubCreatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// task_info
|
||||
/// </summary>
|
||||
public DateTime? SubCreatedTime { get; set; }
|
||||
/// <summary>
|
||||
/// task_info
|
||||
/// </summary>
|
||||
public string SubUpdatedBy { get; set; }
|
||||
/// <summary>
|
||||
/// task_info
|
||||
/// </summary>
|
||||
public DateTime? SubUpdatedTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.mm.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@ -30,6 +31,8 @@ namespace DOAN.Service.MES.mm.IService
|
||||
|
||||
int ModifyTaskNum(MmTaskMaterialInfoDto2 parm, string name);
|
||||
|
||||
PagedInfo<FormsWorkoderAndTaskInfo> TableQuerytaskInfo(FormsWorkoderAndTaskQuery parm);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Model.MES.base_.Dto;
|
||||
using DOAN.Model.MES.mm;
|
||||
using DOAN.Model.MES.mm.Dto;
|
||||
using DOAN.Model.MES.product;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.group.IService;
|
||||
using DOAN.Service.MES.mm.IService;
|
||||
using Infrastructure.Attribute;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Http.HttpResults;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@ -50,7 +53,7 @@ namespace DOAN.Service.MES.mm
|
||||
List<BaseMaterialBom> subMaterialReq = Context.Queryable<BaseMaterialBom>()
|
||||
.Where(it => it.InvCode == workorder1.ProductionCode).ToList();
|
||||
|
||||
float MaterialRequire_totals = workorder1.DeliveryNum.Value*subMaterialReq.Sum(it => float.Parse(it.Iusequantity));
|
||||
float MaterialRequire_totals = workorder1.DeliveryNum.Value * subMaterialReq.Sum(it => float.Parse(it.Iusequantity));
|
||||
float sum = 0;
|
||||
foreach (var item in MmPreparationTaskList)
|
||||
{
|
||||
@ -241,8 +244,6 @@ namespace DOAN.Service.MES.mm
|
||||
if (parm.MaterialCode != null)
|
||||
{
|
||||
material = Context.Queryable<BaseMaterialList>().Where(it => it.Code == parm.MaterialCode).First();
|
||||
|
||||
|
||||
}
|
||||
info.MaterialName = material?.Name;
|
||||
info.Specification = material?.Specification;
|
||||
@ -266,5 +267,60 @@ namespace DOAN.Service.MES.mm
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 表格形式查询工单 任务及其详情
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<FormsWorkoderAndTaskInfo> TableQuerytaskInfo(FormsWorkoderAndTaskQuery parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProWorkorder>()
|
||||
.AndIF(parm.searchDate != null && parm.searchDate.Length >= 2 && parm.searchDate[0] > DateTime.MinValue, it => it.WorkorderDate >= parm.searchDate[0].ToLocalTime().Date)
|
||||
.AndIF(parm.searchDate != null && parm.searchDate.Length >= 2 && parm.searchDate[1] > DateTime.MinValue, it => it.WorkorderDate >= parm.searchDate[1].ToLocalTime().Date)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.route_code), it => it.FkRouteCode == parm.route_code)
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder));
|
||||
|
||||
|
||||
|
||||
|
||||
var query1 = Context.Queryable<ProWorkorder>().Where(predicate.ToExpression());
|
||||
//查询工单绑定的任务
|
||||
return Context.Queryable(query1).LeftJoin<MmPreparationTask>((q, t) => q.Workorder == t.FkWorkorder)
|
||||
.LeftJoin<MmTaskMaterialInfo>((q, t, i) => t.Id == i.FkTaskCode)
|
||||
.Select((q, t, i) => new FormsWorkoderAndTaskInfo()
|
||||
{
|
||||
Id = t.Id,
|
||||
SerialNum = t.SerialNum,
|
||||
TaskCode = t.TaskCode,
|
||||
FkWorkorder = t.FkWorkorder,
|
||||
PreparationStatus = t.PreparationStatus,
|
||||
CreatedBy = t.CreatedBy,
|
||||
CreatedTime = t.CreatedTime,
|
||||
UpdatedTime = t.UpdatedTime,
|
||||
UpdatedBy = t.UpdatedBy,
|
||||
SubId = i.Id,
|
||||
FkTaskCode = i.FkTaskCode,
|
||||
MaterialCode = i.MaterialCode,
|
||||
MaterialName = i.MaterialName,
|
||||
Specification = i.Specification,
|
||||
Quantity = i.Quantity,
|
||||
Unit = i.Unit,
|
||||
SubCreatedBy = i.CreatedBy,
|
||||
SubCreatedTime = i.CreatedTime,
|
||||
SubUpdatedBy = i.UpdatedBy,
|
||||
SubUpdatedTime = i.UpdatedTime,
|
||||
|
||||
|
||||
}).ToPage<FormsWorkoderAndTaskInfo, FormsWorkoderAndTaskInfo>(parm);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user