首检添加数据看板
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
|
||||
//创建时间:2024-04-11
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
@@ -49,7 +49,7 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
public IActionResult GetQcQualityStatisticsFirst(string Id)
|
||||
{
|
||||
var response = _QcQualityStatisticsFirstService.GetInfo(Id);
|
||||
|
||||
|
||||
var info = response.Adapt<QcQualityStatisticsFirst>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
101
ZR.Admin.WebApi/Controllers/mes/qc/FQC/CommonFQCController.cs
Normal file
101
ZR.Admin.WebApi/Controllers/mes/qc/FQC/CommonFQCController.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Hubs;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
{
|
||||
|
||||
|
||||
[Route("mes/qc/FQC/common")]
|
||||
public class CommonFQCController : BaseController
|
||||
{
|
||||
private readonly ICommonFQCService _commonFQCService;
|
||||
|
||||
public CommonFQCController(ICommonFQCService commonFQCService)
|
||||
{
|
||||
this._commonFQCService = commonFQCService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查工单状态
|
||||
/// </summary>
|
||||
/// <param name="workOrderId"></param>
|
||||
/// <returns>0-未完成 1-已上线 2-已完成</returns>
|
||||
[HttpGet("checkPackageWorkOrderStatus")]
|
||||
public IActionResult CheckPackageWorkOrderStatus(string workOrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workOrderId))
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "工单号传入异常!", "工单号传入异常!"));
|
||||
}
|
||||
int result = _commonFQCService.CheckPackageWorkOrderStatus(workOrderId);
|
||||
if (result == -1)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "获取工单状态异常-01", result));
|
||||
}
|
||||
return ToResponse(new ApiResult(200, "ok", result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查工单在当日计划中的状态
|
||||
/// </summary>
|
||||
/// <param name="workOrderId"></param>
|
||||
/// <returns>-1 -未知异常 0-正常 1-前边有未完成工单 2-最开始一个工单 3-最后一个工单</returns>
|
||||
[HttpGet("checkPackageWorkOrderInListStatus")]
|
||||
public IActionResult CheckPackageWorkOrderInListStatus(string workOrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workOrderId))
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "工单号传入异常!", "工单号传入异常!"));
|
||||
}
|
||||
int result = _commonFQCService.CheckPackageWorkOrderInListStatus(workOrderId);
|
||||
if (result == -1)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "获取工单状态异常-02", result));
|
||||
}
|
||||
return ToResponse(new ApiResult(200, "ok", result));
|
||||
}
|
||||
/// <summary>
|
||||
/// 检查工单在当日未完成的工单计划中是第几个
|
||||
/// </summary>
|
||||
/// <param name="workOrderId">工单号</param>
|
||||
/// <returns>[1当前位置,2总数, 3包装已完成, 4包装未完成]</returns>
|
||||
[HttpGet("checkWorkOrderInDayListNum")]
|
||||
public IActionResult CheckWorkOrderInDayListNum(string workOrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workOrderId))
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "工单号传入异常!", "工单号传入异常!"));
|
||||
}
|
||||
var result = _commonFQCService.CheckWorkOrderInDayListNum(workOrderId);
|
||||
if (result == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "获取工单计划编号异常-01", result));
|
||||
}
|
||||
return ToResponse(new ApiResult(200, "ok", result));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取工单质量检测,首检,包装看板数据
|
||||
/// </summary>
|
||||
/// <param name="workOrderId">工单号</param>
|
||||
/// <returns>QcCommonFqcBoardDto 看板数据</returns>
|
||||
[HttpGet("getWorkOrderBoardData")]
|
||||
public IActionResult GetWorkOrderBoardData(string workOrderId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workOrderId))
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "工单号传入异常!", "工单号传入异常!"));
|
||||
}
|
||||
var result = _commonFQCService.GetWorkOrderBoardData(workOrderId);
|
||||
if (result == null)
|
||||
{
|
||||
return ToResponse(new ApiResult(500, "获取看板数据异常-01:返回值为空", result));
|
||||
}
|
||||
return ToResponse(new ApiResult(200, "ok", result));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,9 @@
|
||||
using Infrastructure.Constant;
|
||||
using Infrastructure.Extensions;
|
||||
using JinianNet.JNTemplate;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.POIFS.Crypt.Dsig;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
using System.Text.Json;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Hubs;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Model.MES.qu;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using ZR.Service.System;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
{
|
||||
@@ -42,7 +30,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("getcheckItemTable__first")]
|
||||
public IActionResult GetcheckItemTable__first(string workorderID)
|
||||
public IActionResult GetcheckItemTable__first(string workorderID)
|
||||
{
|
||||
|
||||
CheckItemTableDTO itemTableDTO = fQCService.GetCheckItemTable_first(workorderID);
|
||||
@@ -50,13 +38,13 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
return SUCCESS(itemTableDTO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 写入工序时间 (首检)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("writeProcessFlow_first")]
|
||||
public IActionResult WriteProcessFlow_first(string workorderID,DateTime time)
|
||||
public IActionResult WriteProcessFlow_first(string workorderID, DateTime time)
|
||||
{
|
||||
|
||||
int result = fQCService.WriteProcessFlow_first(workorderID, time);
|
||||
@@ -102,7 +90,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
public IActionResult GetcurrentWorkorder_first()
|
||||
{
|
||||
|
||||
QcCurrentWorkorderDto workorder= fQCService.GetcurrentWorkorder_first();
|
||||
QcCurrentWorkorderDto workorder = fQCService.GetcurrentWorkorder_first();
|
||||
|
||||
return SUCCESS(workorder);
|
||||
}
|
||||
@@ -171,7 +159,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
|
||||
Console.WriteLine("workorder" + workorder);
|
||||
|
||||
|
||||
|
||||
return SUCCESS(workorder);
|
||||
}
|
||||
|
||||
@@ -222,11 +210,11 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
/// <param name="number">要累加的值</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("accumulator_query_first")]
|
||||
public IActionResult Accumulator_first(string workorder_id,int checkid,int number, string inspectionModule)
|
||||
public IActionResult Accumulator_first(string workorder_id, int checkid, int number, string inspectionModule)
|
||||
{
|
||||
|
||||
int result= fQCService.Accumulator_first(workorder_id, checkid, number, inspectionModule, HttpContext.GetName());
|
||||
|
||||
int result = fQCService.Accumulator_first(workorder_id, checkid, number, inspectionModule, HttpContext.GetName());
|
||||
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
@@ -287,7 +275,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
/// <param name="workorder_id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("calculate_packagingInvestment")]
|
||||
public IActionResult CalculatePackagingInvestment(string workorder_id)
|
||||
public IActionResult CalculatePackagingInvestment(string workorder_id)
|
||||
{
|
||||
int AllNumber = fQCService.CalculatePackagingInvestment(workorder_id);
|
||||
return SUCCESS(AllNumber);
|
||||
@@ -297,16 +285,16 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.IQC
|
||||
|
||||
// 更改工单状态为完成态
|
||||
[HttpGet("update_workorder_status")]
|
||||
public IActionResult UpdateWorkorderStatus(string workorderID)
|
||||
public IActionResult UpdateWorkorderStatus(string workorderID)
|
||||
{
|
||||
int result= fQCService.UpdateWorkorderStatus(workorderID);
|
||||
int result = fQCService.UpdateWorkorderStatus(workorderID);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 生成质量统计报表
|
||||
[HttpGet("generateQualityStatisticsTable")]
|
||||
public IActionResult GenerateQualityStatisticsTable(string workorderID,string team, DateTime firstQuality_time)
|
||||
public IActionResult GenerateQualityStatisticsTable(string workorderID, string team, DateTime firstQuality_time)
|
||||
{
|
||||
|
||||
int result = fQCService.GenerateQualityStatisticsTable(workorderID, team, firstQuality_time.ToLocalTime());
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using ZR.Admin.WebApi.Controllers;
|
||||
using ZR.Admin.WebApi.Hubs;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.MES.qc;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.UserModel;
|
||||
using ZR.Model.MES.wms;
|
||||
using SqlSugar;
|
||||
using NPOI.SS.Util;
|
||||
using NPOI.HSSF.Util;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using ZR.Model.MES.qc;
|
||||
using ZR.Model.MES.qc.DTO;
|
||||
using ZR.Service.mes.qc.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
{
|
||||
@@ -112,11 +104,11 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
style.Alignment = HorizontalAlignment.Center;
|
||||
style.VerticalAlignment = VerticalAlignment.Center;
|
||||
// 标题列表
|
||||
string[] titleDict = { "工单号", "零件号", "颜色", "描述", "生产投入数", "班次", "合格数", "合格率", "抛光总数", "打磨总数", "报废总数", "开始时间", "结束时间"};
|
||||
string[] titleGroupDict = {"油漆", "设备", "毛坯", "程序", "班组操作" };
|
||||
string[] titleDict = { "工单号", "零件号", "颜色", "描述", "生产投入数", "班次", "合格数", "合格率", "抛光总数", "打磨总数", "报废总数", "开始时间", "结束时间" };
|
||||
string[] titleGroupDict = { "油漆", "设备", "毛坯", "程序", "班组操作" };
|
||||
int[] titleGroupIndex = { 14, 20, 27, 33, 38 };
|
||||
string[] titleDetailDict = {
|
||||
"备注",
|
||||
string[] titleDetailDict = {
|
||||
"备注",
|
||||
"缩孔", "针孔", "失光","色差","点子","其他",
|
||||
"水斑", "脏点", "变形","油珠","脱落","撞伤","其他",
|
||||
"毛刺", "缩印", "擦伤","砂印","脏点","打磨",
|
||||
@@ -132,7 +124,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
var titleCell1 = groupTitle.CreateCell(0);
|
||||
titleCell1.SetCellValue("工单信息");
|
||||
titleCell1.CellStyle = style;
|
||||
for (int i = 0; i < titleGroupDict.Length;i++)
|
||||
for (int i = 0; i < titleGroupDict.Length; i++)
|
||||
{
|
||||
var cell = groupTitle.CreateCell(titleGroupIndex[i]);
|
||||
cell.SetCellValue(titleGroupDict[i]);
|
||||
@@ -142,7 +134,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
titleDict = titleDict.Concat(titleDetailDict).ToArray();
|
||||
|
||||
// 合并标题列
|
||||
CellRangeAddress titleRange1 = new(0, 0, 0, titleGroupIndex[0]-1);
|
||||
CellRangeAddress titleRange1 = new(0, 0, 0, titleGroupIndex[0] - 1);
|
||||
sheet.AddMergedRegion(titleRange1);
|
||||
CellRangeAddress titleRange2 = new(0, 0, titleGroupIndex[0], titleGroupIndex[1] - 1);
|
||||
sheet.AddMergedRegion(titleRange2);
|
||||
@@ -165,9 +157,10 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
string _lastWorkOrderId = "";
|
||||
// 数据开始行
|
||||
int rowIndex = startTitle + 1;
|
||||
for (int i = 0;i< excelDataList.Count;i++) {
|
||||
for (int i = 0; i < excelDataList.Count; i++)
|
||||
{
|
||||
var item = excelDataList[i];
|
||||
if (!isShowDetail &&_lastWorkOrderId == item.WorkorderId)
|
||||
if (!isShowDetail && _lastWorkOrderId == item.WorkorderId)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -215,7 +208,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
var cell13 = row.CreateCell(12);
|
||||
cell13.SetCellValue(item.EndTime.ToString());
|
||||
cell13.CellStyle = style;
|
||||
if(isShowDetail)
|
||||
if (isShowDetail)
|
||||
{
|
||||
// 备注
|
||||
var cell14 = row.CreateCell(13);
|
||||
@@ -223,7 +216,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
cell14.CellStyle = style;
|
||||
// 油漆
|
||||
var cell15 = row.CreateCell(14);
|
||||
cell15.SetCellValue(item.PaintSuokong.ToString() == "0"? "": item.PaintSuokong.ToString());
|
||||
cell15.SetCellValue(item.PaintSuokong.ToString() == "0" ? "" : item.PaintSuokong.ToString());
|
||||
cell15.CellStyle = style;
|
||||
var cell16 = row.CreateCell(15);
|
||||
cell16.SetCellValue(item.PaintZhengkong.ToString() == "0" ? "" : item.PaintZhengkong.ToString());
|
||||
@@ -341,12 +334,12 @@ namespace ZR.Admin.WebApi.Controllers.mes.qc.FQC
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
_lastWorkOrderId = item.WorkorderId;
|
||||
rowIndex++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 导出
|
||||
|
||||
Reference in New Issue
Block a user