diff --git a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
index c018ea4..0a63293 100644
--- a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
+++ b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
@@ -806,5 +806,35 @@ namespace DOAN.Admin.WebApi.Controllers
return ToResponse(new ApiResult(500, ex.Message));
}
}
+
+ ///
+ /// 获取成品综合数据
+ ///
+ /// 查询参数
+ /// 成品综合数据
+ [HttpPost("GetProductSummary")]
+ [ActionPermissionFilter(Permission = "productManagement:proworkorder:query")]
+ public IActionResult GetProductSummary([FromBody] ProductSummaryQueryDto query)
+ {
+ try
+ {
+ // 如果开始时间或结束时间为空,默认赋值为今天
+ if (query.StartTime == DateTime.MinValue)
+ {
+ query.StartTime = DateTime.Today;
+ }
+ if (query.EndTime == DateTime.MinValue)
+ {
+ query.EndTime = DateTime.Today;
+ }
+
+ var response = _ProWorkorderMaterialService.GetProductSummary(query);
+ return SUCCESS(response);
+ }
+ catch (Exception ex)
+ {
+ return ToResponse(new ApiResult(500, ex.Message));
+ }
+ }
}
}
\ No newline at end of file
diff --git a/DOAN.Model/MES/Product/Dto/WorkorderMaterialDto.cs b/DOAN.Model/MES/Product/Dto/WorkorderMaterialDto.cs
index 9047a19..809058b 100644
--- a/DOAN.Model/MES/Product/Dto/WorkorderMaterialDto.cs
+++ b/DOAN.Model/MES/Product/Dto/WorkorderMaterialDto.cs
@@ -358,4 +358,51 @@ namespace DOAN.Model.MES.product.Dto
///
public string Operator { get; set; }
}
+
+ ///
+ /// 成品综合数据传输对象
+ ///
+ public class ProductSummaryDto
+ {
+ ///
+ /// 完成品在库总数
+ ///
+ public decimal FinishedProductStockTotal { get; set; }
+
+ ///
+ /// 在制品总数
+ ///
+ public decimal WorkInProgressTotal { get; set; }
+
+ ///
+ /// 机加工在制品数
+ ///
+ public decimal MachiningWorkInProgress { get; set; }
+
+ ///
+ /// 研磨在制品数
+ ///
+ public decimal GrindingWorkInProgress { get; set; }
+ }
+
+ ///
+ /// 成品综合数据查询请求传输对象
+ ///
+ public class ProductSummaryQueryDto
+ {
+ ///
+ /// 开始时间
+ ///
+ public DateTime StartTime { get; set; }
+
+ ///
+ /// 结束时间
+ ///
+ public DateTime EndTime { get; set; }
+
+ ///
+ /// 产品编号
+ ///
+ public string ProductionCode { get; set; }
+ }
}
diff --git a/DOAN.Service/MES/Product/IService/IProWorkorderMaterialService.cs b/DOAN.Service/MES/Product/IService/IProWorkorderMaterialService.cs
index 20e0559..26ce274 100644
--- a/DOAN.Service/MES/Product/IService/IProWorkorderMaterialService.cs
+++ b/DOAN.Service/MES/Product/IService/IProWorkorderMaterialService.cs
@@ -96,6 +96,12 @@ namespace DOAN.Service.MES.product.IService
/// 操作结果
bool ShipProduct(ShipmentRequestDto request);
+ ///
+ /// 获取成品综合数据
+ ///
+ /// 查询参数
+ /// 成品综合数据
+ ProductSummaryDto GetProductSummary(ProductSummaryQueryDto query);
}
}
diff --git a/DOAN.Service/MES/Product/ProWorkorderMaterialService.cs b/DOAN.Service/MES/Product/ProWorkorderMaterialService.cs
index f3e0c32..900c1f0 100644
--- a/DOAN.Service/MES/Product/ProWorkorderMaterialService.cs
+++ b/DOAN.Service/MES/Product/ProWorkorderMaterialService.cs
@@ -82,7 +82,6 @@ namespace DOAN.Service.MES.product
/// 根据工单号查询工单已成品入库清单
///
/// 工单号
- /// 是否隐藏0库存
/// 成品入库清单数据
public List GetProductStorageList(string workorder)
{
@@ -763,5 +762,34 @@ namespace DOAN.Service.MES.product
throw new Exception(ex.Message);
}
}
+
+ ///
+ /// 获取成品综合数据
+ ///
+ /// 查询参数
+ /// 成品综合数据
+ public ProductSummaryDto GetProductSummary(ProductSummaryQueryDto query)
+ {
+ try
+ {
+ // 业务逻辑留空,待后续实现
+ // 此处应实现查询完成品在库总数,在制品总数,机加工在制品数,研磨在制品数
+ var result = new ProductSummaryDto
+ {
+ FinishedProductStockTotal = 0,
+ WorkInProgressTotal = 0,
+ MachiningWorkInProgress = 0,
+ GrindingWorkInProgress = 0
+ };
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ // 集成现有系统的日志记录
+ // Log.Error("获取成品综合数据失败", ex);
+ throw;
+ }
+ }
}
}