diff --git a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
index 15927f5..c018ea4 100644
--- a/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
+++ b/DOAN.Admin.WebApi/Controllers/MES/Product/ProWorkorderController.cs
@@ -149,9 +149,9 @@ namespace DOAN.Admin.WebApi.Controllers
catch (Exception ex)
{
- return ToResponse(new ApiResult(500,ex.Message));
+ return ToResponse(new ApiResult(500, ex.Message));
}
-
+
}
/////
@@ -766,5 +766,45 @@ namespace DOAN.Admin.WebApi.Controllers
return ToResponse(new ApiResult(500, ex.Message));
}
}
+
+ ///
+ /// 获取审批通知列表
+ ///
+ /// 查询参数
+ ///
+ [HttpPost("getApprovalList")]
+ [ActionPermissionFilter(Permission = "productManagement:proworkorder:query")]
+ public IActionResult GetApprovalList([FromBody] ProWorkorderApprovalQueryDto parm)
+ {
+ try
+ {
+ var response = _ProWorkorderService.GetApprovalList(parm);
+ return SUCCESS(response);
+ }
+ catch (Exception ex)
+ {
+ return ToResponse(new ApiResult(500, ex.Message));
+ }
+ }
+
+ ///
+ /// 获取滞留库存列表
+ ///
+ /// 查询参数
+ ///
+ [HttpPost("getStockList")]
+ [ActionPermissionFilter(Permission = "productManagement:proworkorder:query")]
+ public IActionResult GetStockList([FromBody] ProWorkorderStockQueryDto parm)
+ {
+ try
+ {
+ var response = _ProWorkorderService.GetStockList(parm);
+ 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/Material/MmMaterial.cs b/DOAN.Model/MES/Material/MmMaterial.cs
index ad06628..f6316b0 100644
--- a/DOAN.Model/MES/Material/MmMaterial.cs
+++ b/DOAN.Model/MES/Material/MmMaterial.cs
@@ -50,7 +50,7 @@ namespace DOAN.Model.BZFM
public string Unit { get; set; }
///
- /// 物料类型(原材料/半成品/产成品/打包材料/辅料)
+ /// 快速识别标号
///
public string Type { get; set; }
diff --git a/DOAN.Model/MES/Product/Dto/ProWorkorderDto.cs b/DOAN.Model/MES/Product/Dto/ProWorkorderDto.cs
index 44416e7..659f96f 100644
--- a/DOAN.Model/MES/Product/Dto/ProWorkorderDto.cs
+++ b/DOAN.Model/MES/Product/Dto/ProWorkorderDto.cs
@@ -56,6 +56,11 @@ namespace DOAN.Model.MES.product.Dto
public string productionCode { get; set; }
+ // 成品物料标号
+ public string Type { get; set; }
+ // 原材料物料标号
+ public string SubType { get; set; }
+
public string Unit { get; set; }
public int PlanNum { get; set; } = 0;
@@ -345,4 +350,144 @@ namespace DOAN.Model.MES.product.Dto
///
public int? ActualNum { get; set; }
}
-}
+
+ ///
+ /// 审批通知查询DTO
+ ///
+ public class ProWorkorderApprovalQueryDto : PagerInfo
+ {
+ // 可以根据需要添加查询参数
+ }
+
+ ///
+ /// 审批通知响应DTO
+ ///
+ public class ProWorkorderApprovalDto
+ {
+ ///
+ /// 审批ID
+ ///
+ public long Id { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ public string Workorder { get; set; }
+
+ ///
+ /// 标号
+ ///
+ public string Type { get; set; }
+
+ ///
+ /// 主体编号
+ ///
+ public string ProductionCode { get; set; }
+
+ ///
+ /// 主体名称
+ ///
+ public string ProductionName { get; set; }
+
+ ///
+ /// 批号
+ ///
+ public string BatchNo { get; set; }
+
+ ///
+ /// 炉号
+ ///
+ public string StoveCode { get; set; }
+
+ ///
+ /// 审批内容
+ ///
+ public string Content { get; set; }
+
+ ///
+ /// 操作员
+ ///
+ public string Operator { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public DateTime CreateTime { get; set; }
+ }
+
+ ///
+ /// 滞留库存查询DTO
+ ///
+ public class ProWorkorderStockQueryDto : PagerInfo
+ {
+ ///
+ /// 主体编号
+ ///
+ public string ProductionCode { get; set; }
+ ///
+ /// 供应商
+ ///
+ public string SupplierCode { get; set; }
+ }
+
+ ///
+ /// 滞留库存响应DTO
+ ///
+ public class ProWorkorderStockDto
+ {
+ ///
+ /// ID
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ public string Workorder { get; set; }
+
+ ///
+ /// 标号
+ ///
+ public string Type { get; set; }
+
+ ///
+ /// 主体编号
+ ///
+ public string ProductionCode { get; set; }
+
+ ///
+ /// 主体名称
+ ///
+ public string ProductionName { get; set; }
+
+ ///
+ /// 批号
+ ///
+ public string BatchNo { get; set; }
+
+ ///
+ /// 炉号
+ ///
+ public string StoveCode { get; set; }
+
+ ///
+ /// 内容
+ ///
+ public string Content { get; set; }
+
+ ///
+ /// 数量
+ ///
+ public int StockQuantity { get; set; }
+
+ ///
+ /// 操作员
+ ///
+ public string Operator { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ public DateTime CreateTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Product/IService/IProWorkorderQueryService.cs b/DOAN.Service/MES/Product/IService/IProWorkorderQueryService.cs
index ac95ad2..409e44f 100644
--- a/DOAN.Service/MES/Product/IService/IProWorkorderQueryService.cs
+++ b/DOAN.Service/MES/Product/IService/IProWorkorderQueryService.cs
@@ -49,5 +49,19 @@ namespace DOAN.Service.MES.product.IService
/// 工单号
///
int GetWorkorderWithProgress(string workorder);
+
+ ///
+ /// 获取审批通知列表
+ ///
+ /// 查询参数
+ ///
+ PagedInfo GetApprovalList(ProWorkorderApprovalQueryDto parm);
+
+ ///
+ /// 获取滞留库存列表
+ ///
+ /// 查询参数
+ ///
+ PagedInfo GetStockList(ProWorkorderStockQueryDto parm);
}
}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Product/IService/IProWorkorderService.cs b/DOAN.Service/MES/Product/IService/IProWorkorderService.cs
index e2c5d30..8c4300e 100644
--- a/DOAN.Service/MES/Product/IService/IProWorkorderService.cs
+++ b/DOAN.Service/MES/Product/IService/IProWorkorderService.cs
@@ -75,5 +75,19 @@ namespace DOAN.Service.MES.product.IService
/// 工单号
///
int GetWorkorderWithProgress(string workorder);
+
+ ///
+ /// 获取审批通知列表
+ ///
+ /// 查询参数
+ ///
+ PagedInfo GetApprovalList(ProWorkorderApprovalQueryDto parm);
+
+ ///
+ /// 获取滞留库存列表
+ ///
+ /// 查询参数
+ ///
+ PagedInfo GetStockList(ProWorkorderStockQueryDto parm);
}
-}
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Product/ProWorkorderQueryService.cs b/DOAN.Service/MES/Product/ProWorkorderQueryService.cs
index df72d3d..0c40f66 100644
--- a/DOAN.Service/MES/Product/ProWorkorderQueryService.cs
+++ b/DOAN.Service/MES/Product/ProWorkorderQueryService.cs
@@ -145,6 +145,14 @@ namespace DOAN.Service.MES.product
.Where(sub => sub.Remarks != "已撤销" || sub.Remarks == null)
.Select(sub => sub.Quantity)
),
+ Type = SqlFunc
+ .Subqueryable()
+ .Where(sub => sub.MaterialCode == it.productionCode)
+ .Select(sub => sub.Type),
+ SubType = SqlFunc
+ .Subqueryable()
+ .Where(sub => sub.MaterialCode == it.MaterialCode)
+ .Select(sub => sub.Type),
InInventoryNum = it.ProductNum - it.ShipmentNum,
},
true
@@ -218,5 +226,68 @@ namespace DOAN.Service.MES.product
}
return reportInfo.ProcessId;
}
+
+ ///
+ /// 获取审批通知列表
+ ///
+ /// 查询参数
+ ///
+ public PagedInfo GetApprovalList(ProWorkorderApprovalQueryDto parm)
+ {
+ var result = Context
+ .Queryable()
+ .Where(it => it.Status == "待审批")
+ .Select(it => new ProWorkorderApprovalDto
+ {
+ Id = it.Id,
+ CreateTime = it.CreatedTime.Value,
+ Workorder = it.Workorder,
+ ProductionCode = it.ProductCode,
+ ProductionName = it.ProductName,
+ BatchNo = it.BatchNo,
+ StoveCode = it.StoveCode,
+ Operator = it.Operator,
+ Type = SqlFunc
+ .Subqueryable()
+ .Where(sub => sub.MaterialCode == it.ProductCode)
+ .Select(sub => sub.Type),
+ Content = $"有不良品待审批:{it.ScrapQuantity}个",
+ })
+ .ToPage(parm);
+ // 业务逻辑留空,暂时返回空列表
+ return result;
+ }
+
+ ///
+ /// 获取滞留库存列表
+ ///
+ /// 查询参数
+ ///
+ public PagedInfo GetStockList(ProWorkorderStockQueryDto parm)
+ {
+ var result = Context
+ .Queryable()
+ .Where(it => (it.ProductNum - it.ShipmentNum) > 0)
+ .Select(it => new ProWorkorderStockDto
+ {
+ Id = it.Id,
+ Workorder = it.Workorder,
+ ProductionCode = it.productionCode,
+ ProductionName = it.productionName,
+ Type = SqlFunc
+ .Subqueryable()
+ .Where(sub => sub.MaterialCode == it.productionCode)
+ .Select(sub => sub.Type),
+ BatchNo = it.FeedOrder,
+ StoveCode = it.StoveCode,
+ Operator = it.CreatedBy,
+ Content = $"有成品待出库",
+ StockQuantity = (it.ProductNum - it.ShipmentNum),
+ CreateTime = it.WorkorderDate.Value,
+ })
+ .ToPage(parm);
+
+ return result;
+ }
}
}
diff --git a/DOAN.Service/MES/Product/ProWorkorderService.cs b/DOAN.Service/MES/Product/ProWorkorderService.cs
index 40d29d2..1e8166b 100644
--- a/DOAN.Service/MES/Product/ProWorkorderService.cs
+++ b/DOAN.Service/MES/Product/ProWorkorderService.cs
@@ -278,5 +278,25 @@ namespace DOAN.Service.MES.product
{
return _queryService.GetWorkorderWithProgress(workorder);
}
+
+ ///
+ /// 获取审批通知列表
+ ///
+ /// 查询参数
+ ///
+ public PagedInfo GetApprovalList(ProWorkorderApprovalQueryDto parm)
+ {
+ return _queryService.GetApprovalList(parm);
+ }
+
+ ///
+ /// 获取滞留库存列表
+ ///
+ /// 查询参数
+ ///
+ public PagedInfo GetStockList(ProWorkorderStockQueryDto parm)
+ {
+ return _queryService.GetStockList(parm);
+ }
}
-}
+}
\ No newline at end of file