质量大屏接口
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
public class ZlBiOutput
|
||||
{
|
||||
public int mo_task_count { get; set; }
|
||||
public int qc_all_count { get; set; }
|
||||
public int qc_complete_count { get; set; }
|
||||
public int qc_ok_count { get; set; }
|
||||
public List<ZlBiQcTaskListOutput> qc_task_list { get; set; }
|
||||
public List<ZlBiQcTaskDetailListOutput> qc_sj_task_list { get; set; }
|
||||
public List<ZlBiQcTaskDetailListOutput> qc_xj_task_list { get; set; }
|
||||
public List<ZlBiQcTaskDetailListOutput> qc_mj_task_list { get; set; }
|
||||
public List<ZlBiQcTaskDetailListOutput> qc_lbjj_task_list { get; set; }
|
||||
}
|
||||
|
||||
public class ZlBiQcTaskListOutput
|
||||
{
|
||||
public string mo_task_code { get; set; }
|
||||
public string equip_workline_name { get; set; }
|
||||
public string checktype { get; set; }
|
||||
public string material_name { get; set; }
|
||||
/// <summary>
|
||||
/// 物料规格
|
||||
/// </summary>
|
||||
public string material_specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料型号(箱号)
|
||||
/// </summary>
|
||||
public string material_standard { get; set; }
|
||||
public int? qty { get; set; }
|
||||
public int? rqty { get; set; }
|
||||
public string result { get; set; }
|
||||
public string execuser { get; set; }
|
||||
public string exectime{ get; set; }
|
||||
}
|
||||
|
||||
public class ZlBiQcTaskDetailListOutput
|
||||
{
|
||||
public string mo_task_code { get; set; }
|
||||
public string equip_workline_name { get; set; }
|
||||
public string execuser { get; set; }
|
||||
public string create_time{ get; set; }
|
||||
public string checktype{ get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using JNPF.Common.Extension;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev.Engine.Enum.VisualDevModelData;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -15,6 +16,8 @@ using Tnb.EquipMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities;
|
||||
using Tnb.ProductionMgr.Entities.Dto.PrdManage;
|
||||
using Tnb.Common.Redis;
|
||||
using Tnb.QcMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
@@ -149,5 +152,67 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<ZlBiOutput> GetZlBiData()
|
||||
{
|
||||
ZlBiOutput result = new ZlBiOutput();
|
||||
int mo_task_count = await _db.Queryable<PrdMoTask>().Where(x=>x.mo_task_status==DictConst.InProgressEnCode && (x.schedule_type==1 || (x.schedule_type==2 && x.parent_id!=null))).CountAsync();
|
||||
int qc_all_count = await _db.Queryable<QcCheckExecH>().Where(x=>x.status=="26745591857941").CountAsync();
|
||||
int qc_complete_count = await _db.Queryable<QcCheckExecH>().Where(x=>x.status=="26745885292053").CountAsync();
|
||||
int qc_ok_count = await _db.Queryable<QcCheckExecH>().Where(x=>x.result=="ok" || x.result=="barelyOk").CountAsync();
|
||||
|
||||
List<ZlBiQcTaskListOutput> list = await _db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<PrdMoTask>((a, b) => a.mo_task_code == b.mo_task_code)
|
||||
.LeftJoin<EqpEquipment>((a, b, c) => b.eqp_id == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => b.workline_id == d.Id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e) => a.materialid == e.id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e, f) => a.execuser == f.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e,f,g)=>a.checktype==g.Id)
|
||||
.Where((a) => a.status == "26745885292053")
|
||||
.Select((a, b, c, d, e, f,g) => new ZlBiQcTaskListOutput
|
||||
{
|
||||
mo_task_code = a.mo_task_code,
|
||||
equip_workline_name = c.name!=null ? c.name : d.FullName,
|
||||
checktype = g.FullName,
|
||||
material_name = e.name,
|
||||
material_specification = e.material_specification,
|
||||
material_standard = e.material_standard,
|
||||
qty = a.qty,
|
||||
rqty = a.rqty,
|
||||
result = a.result,
|
||||
execuser = f.RealName,
|
||||
exectime = a.exectime
|
||||
}).OrderByDescending(a => a.exectime).Take(10).ToListAsync();
|
||||
|
||||
List<ZlBiQcTaskDetailListOutput> detailList = await _db.Queryable<QcCheckExecH>()
|
||||
.LeftJoin<PrdMoTask>((a, b) => a.mo_task_code == b.mo_task_code)
|
||||
.LeftJoin<EqpEquipment>((a, b, c) => b.eqp_id == c.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => b.workline_id == d.Id)
|
||||
.LeftJoin<BasMaterial>((a, b, c, d, e) => a.materialid == e.id)
|
||||
.LeftJoin<UserEntity>((a, b, c, d, e, f) => a.execuser == f.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a,b,c,d,e,f,g)=>a.checktype==g.Id)
|
||||
.Where((a) => a.status == "26745591857941")
|
||||
.Select((a, b, c, d, e, f,g) => new ZlBiQcTaskDetailListOutput
|
||||
{
|
||||
mo_task_code = a.mo_task_code,
|
||||
equip_workline_name = c.name!=null ? c.name : d.FullName,
|
||||
checktype = a.checktype,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||
execuser = f.RealName,
|
||||
}).OrderBy(a => a.create_time).ToListAsync();
|
||||
|
||||
result.mo_task_count = mo_task_count;
|
||||
result.qc_all_count = qc_all_count;
|
||||
result.qc_complete_count = qc_complete_count;
|
||||
result.qc_ok_count = qc_ok_count;
|
||||
result.qc_task_list = list;
|
||||
result.qc_sj_task_list = detailList.Where(x=>x.checktype==WmsWareHouseConst.SHOUJIAN_ID).ToList();
|
||||
result.qc_xj_task_list = detailList.Where(x=>x.checktype==WmsWareHouseConst.XUNJIAN_ID).ToList();
|
||||
result.qc_mj_task_list = detailList.Where(x=>x.checktype==WmsWareHouseConst.MOJIAN_ID).ToList();
|
||||
result.qc_lbjj_task_list = detailList.Where(x=>x.checktype==WmsWareHouseConst.LINGBUJIANZUIZHONGJIANYAN_ID).ToList();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ namespace Tnb.QcMgr
|
||||
QcCheckExecH.status = DictionaryData.Id;
|
||||
QcCheckExecH.result = CheckTaskInput.result;
|
||||
QcCheckExecH.execuser = _userManager.UserId;
|
||||
QcCheckExecH.exectime = DateTime.Now.ToString();
|
||||
QcCheckExecH.exectime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
QcCheckExecH.check_type = CheckTaskInput.check_type;
|
||||
QcCheckExecH.remark = CheckTaskInput.remark;
|
||||
QcCheckExecH.attachment = CheckTaskInput.attachment;
|
||||
|
||||
Reference in New Issue
Block a user