Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
public class PADPackageTaskPageOutput
|
||||
{
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产任务编号
|
||||
/// </summary>
|
||||
public string? mo_task_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工单Id
|
||||
/// </summary>
|
||||
public string? mo_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料Id
|
||||
/// </summary>
|
||||
public string material_id { get; set; }
|
||||
|
||||
public string material_code { get; set; }
|
||||
public string material_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产线id
|
||||
/// </summary>
|
||||
public string? workline_id { get; set; }
|
||||
|
||||
public string? workline_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产bom id
|
||||
/// </summary>
|
||||
public string? bom_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务单状态
|
||||
/// </summary>
|
||||
public string? mo_task_status { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 已完工数量
|
||||
/// </summary>
|
||||
public int? complete_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
/// </summary>
|
||||
public int? scrap_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已排产数量
|
||||
/// </summary>
|
||||
public int? scheduled_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排产类型:1、注塑、挤出2、组装、包装
|
||||
/// </summary>
|
||||
public int? schedule_type { get; set; }
|
||||
|
||||
public int? reported_work_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划开始时间
|
||||
/// </summary>
|
||||
public string? estimated_start_date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划结束时间
|
||||
/// </summary>
|
||||
public string? estimated_end_date { get; set; }
|
||||
/// <summary>
|
||||
/// 父任务Id
|
||||
/// </summary>
|
||||
public string? parent_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工序id
|
||||
/// </summary>
|
||||
public string process_id { get; set; }
|
||||
|
||||
public string process_name { get; set; }
|
||||
|
||||
public string mbom_process_id { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
public string equip_code { get; set; }
|
||||
public string equip_name { get; set; }
|
||||
public string mold_id { get; set; }
|
||||
public string mold_code { get; set; }
|
||||
public string mold_name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Entity
|
||||
{
|
||||
public class CheckMoldInput
|
||||
{
|
||||
public string mo_task_id { get; set; }
|
||||
|
||||
public string mold_qrcode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aspose.Cells.Drawing;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
using NPOI.POIFS.Properties;
|
||||
using Spire.Pdf.Widget;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
using Tnb.ProductionMgr.Interfaces;
|
||||
using Tnb.ProductionMgr.Entities.Entity;
|
||||
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -239,5 +234,129 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pda端根据工位获取注塑挤出列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetInjectionMoldingList(PrdPackReportQueryInput input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.stationId))
|
||||
{
|
||||
return new
|
||||
{
|
||||
pagination = new PageResult(),
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
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)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
|
||||
.LeftJoin<EqpEquipment>((a,b,c,e,f)=>a.eqp_id==f.id)
|
||||
.LeftJoin<ToolMolds>((a,b,c,e,f,g)=>a.mold_id==g.id)
|
||||
.Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==1)
|
||||
.OrderByDescending((a, b) => a.create_time)
|
||||
.Select((a, b, c, e,f,g) => new PADPackageTaskPageOutput
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = a.mo_id,
|
||||
material_id = a.material_id,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
workline_id = a.workline_id,
|
||||
// workline_name = d.FullName,
|
||||
bom_id = a.bom_id,
|
||||
mo_task_status = e.FullName,
|
||||
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
|
||||
scrap_qty = a.scrap_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
parent_id = a.parent_id,
|
||||
process_id = a.process_id,
|
||||
process_name = c.process_name,
|
||||
mbom_process_id = a.mbom_process_id,
|
||||
equip_id = a.eqp_id,
|
||||
equip_code = f.code,
|
||||
equip_name = f.name,
|
||||
mold_id = a.mold_id,
|
||||
mold_code = g.mold_code,
|
||||
mold_name = g.mold_name,
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pda端根据工位获取组装包装列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetPadList(PrdPackReportQueryInput input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.stationId))
|
||||
{
|
||||
return new
|
||||
{
|
||||
pagination = new PageResult(),
|
||||
list = Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
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)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => a.workline_id == d.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => e.DictionaryTypeId == DictConst.PrdTaskStatusTypeId && a.mo_task_status == e.EnCode)
|
||||
.Where((a, b) => a.workstation_id == input.stationId && a.mo_task_status != DictConst.ToBeScheduledEncode && a.schedule_type==2)
|
||||
.OrderByDescending((a, b) => a.create_time)
|
||||
.Select((a, b, c, d, e) => new PADPackageTaskPageOutput
|
||||
{
|
||||
id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
mo_id = a.mo_id,
|
||||
material_id = a.material_id,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
workline_id = a.workline_id,
|
||||
workline_name = d.FullName,
|
||||
bom_id = a.bom_id,
|
||||
mo_task_status = e.FullName,
|
||||
complete_qty = SqlFunc.IsNull(a.reported_work_qty,0) + SqlFunc.IsNull(a.scrap_qty,0),
|
||||
scrap_qty = a.scrap_qty,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
estimated_start_date = a.estimated_start_date==null ? "" : a.estimated_start_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
estimated_end_date = a.estimated_end_date==null ? "" : a.estimated_end_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
parent_id = a.parent_id,
|
||||
process_id = a.process_id,
|
||||
process_name = c.process_name,
|
||||
mbom_process_id = a.mbom_process_id,
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<PADPackageTaskPageOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pda端根据工位获取组装包装列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> CheckMold(CheckMoldInput input)
|
||||
{
|
||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == input.mo_task_id);
|
||||
BasQrcode basQrcode = await _db.Queryable<BasQrcode>().Where(x=>x.source_name=="TOOL_MOLDS" && x.code==input.mold_qrcode).FirstAsync();
|
||||
if (prdMoTask != null && basQrcode!=null)
|
||||
{
|
||||
return prdMoTask.mold_id == basQrcode.source_id;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user