diff --git a/DOAN.Admin.WebApi/Controllers/MES/Product/ProReportworkController.cs b/DOAN.Admin.WebApi/Controllers/MES/Product/ProReportworkController.cs
new file mode 100644
index 0000000..2ac9ddc
--- /dev/null
+++ b/DOAN.Admin.WebApi/Controllers/MES/Product/ProReportworkController.cs
@@ -0,0 +1,106 @@
+using Microsoft.AspNetCore.Mvc;
+using DOAN.Model.BZFM.Dto;
+using DOAN.Model.BZFM;
+using DOAN.Service.BZFM.IBZFMService;
+using DOAN.Admin.WebApi.Filters;
+using DOAN.Model.MES.product;
+using Infrastructure.Converter;
+
+//创建时间:2024-12-03
+namespace DOAN.Admin.WebApi.Controllers.BZFM
+{
+ ///
+ /// 报工
+ ///
+ [Verify]
+ [Route("mes/productManagement/ProReportwork")]
+ public class ProReportworkController : BaseController
+ {
+ ///
+ /// 报工接口
+ ///
+ private readonly IProReportworkService _ProReportworkService;
+
+ public ProReportworkController(IProReportworkService ProReportworkService)
+ {
+ _ProReportworkService = ProReportworkService;
+ }
+
+ ///
+ /// 查询报工列表
+ ///
+ ///
+ ///
+ [HttpGet("list")]
+ [ActionPermissionFilter(Permission = "proreportwork:list")]
+ public IActionResult QueryProReportwork([FromQuery] ProReportworkQueryDto parm)
+ {
+ parm.JobDate[0] = DOANConvertDate.ConvertLocalDate(parm.JobDate[0]);
+ parm.JobDate[1] = DOANConvertDate.ConvertLocalDate(parm.JobDate[1]);
+ var response = _ProReportworkService.GetList(parm);
+ return SUCCESS(response);
+ }
+
+
+ ///
+ /// 查询报工详情
+ ///
+ ///
+ ///
+ [HttpGet("{Id}")]
+ [ActionPermissionFilter(Permission = "proreportwork:query")]
+ public IActionResult GetProReportwork(string Id)
+ {
+ var response = _ProReportworkService.GetInfo(Id);
+
+ var info = response.Adapt();
+ return SUCCESS(info);
+ }
+
+ ///
+ /// 添加报工
+ ///
+ ///
+ [HttpPost]
+ [ActionPermissionFilter(Permission = "proreportwork:add")]
+ [Log(Title = "报工", BusinessType = BusinessType.INSERT)]
+ public IActionResult AddProReportwork([FromBody] ProReportworkDto parm)
+ {
+ var modal = parm.Adapt().ToCreate(HttpContext);
+
+ var response = _ProReportworkService.AddProReportwork(modal);
+
+ return SUCCESS(response);
+ }
+
+ ///
+ /// 更新报工
+ ///
+ ///
+ [HttpPut]
+ [ActionPermissionFilter(Permission = "proreportwork:edit")]
+ [Log(Title = "报工", BusinessType = BusinessType.UPDATE)]
+ public IActionResult UpdateProReportwork([FromBody] ProReportworkDto parm)
+ {
+ var modal = parm.Adapt().ToUpdate(HttpContext);
+ var response = _ProReportworkService.UpdateProReportwork(modal);
+
+ return ToResponse(response);
+ }
+
+ ///
+ /// 删除报工
+ ///
+ ///
+ [HttpPost("delete/{ids}")]
+ [ActionPermissionFilter(Permission = "proreportwork:delete")]
+ [Log(Title = "报工", BusinessType = BusinessType.DELETE)]
+ public IActionResult DeleteProReportwork([FromRoute]string ids)
+ {
+ var idArr = Tools.SplitAndConvert(ids);
+
+ return ToResponse(_ProReportworkService.Delete(idArr));
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Model/MES/Base/Dto/BaseWorkRouteDto.cs b/DOAN.Model/MES/Base/Dto/BaseWorkRouteDto.cs
index 2ea5c8c..4c71d39 100644
--- a/DOAN.Model/MES/Base/Dto/BaseWorkRouteDto.cs
+++ b/DOAN.Model/MES/Base/Dto/BaseWorkRouteDto.cs
@@ -52,6 +52,8 @@ namespace DOAN.Model.MES.base_.Dto
{
[Required(ErrorMessage = "主键不能为空")]
public int Id { get; set; }
+
+ public string ProductionCode { get; set; }
public List BaseWorkProcessesList { get; set; }
public string Name { get; set; }
diff --git a/DOAN.Model/MES/Product/Dto/ProReportworkDto.cs b/DOAN.Model/MES/Product/Dto/ProReportworkDto.cs
new file mode 100644
index 0000000..3cac655
--- /dev/null
+++ b/DOAN.Model/MES/Product/Dto/ProReportworkDto.cs
@@ -0,0 +1,57 @@
+
+namespace DOAN.Model.BZFM.Dto
+{
+ ///
+ /// 报工查询对象
+ ///
+ public class ProReportworkQueryDto : PagerInfo
+ {
+ public string Workorder { get; set; }
+
+ public string RouteCode { get; set; }
+
+ public string ProcessCode { get; set; }
+
+ public string Worker { get; set; }
+
+ public DateTime[] JobDate { get; set; } = new DateTime[2];
+ }
+
+ ///
+ /// 报工输入输出对象
+ ///
+ public class ProReportworkDto
+ {
+ [Required(ErrorMessage = "雪花不能为空")]
+ public string Id { get; set; }
+
+ public string Workorder { get; set; }
+
+ public string RouteCode { get; set; }
+
+ public string ProcessCode { get; set; }
+
+ public int? PlanNum { get; set; }
+
+ public int? FinishNum { get; set; }
+
+ public int? BadNum { get; set; }
+
+ public string Worker { get; set; }
+
+ public DateTime? JobDate { get; set; }
+
+ public string Remark { get; set; }
+
+ public string CreatedBy { get; set; }
+
+ public DateTime? CreatedTime { get; set; }
+
+ public string UpdatedBy { get; set; }
+
+ public DateTime? UpdatedTime { get; set; }
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Model/MES/Product/ProReportwork01.cs b/DOAN.Model/MES/Product/ProReportwork01.cs
new file mode 100644
index 0000000..175809d
--- /dev/null
+++ b/DOAN.Model/MES/Product/ProReportwork01.cs
@@ -0,0 +1,92 @@
+
+namespace DOAN.Model.MES.product
+{
+ ///
+ /// 报工
+ ///
+ [SugarTable("pro_reportwork")]
+ public class ProReportwork01
+ {
+ ///
+ /// 雪花
+ ///
+ [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
+ public string Id { get; set; }
+
+ ///
+ /// 工单code
+ ///
+ public string Workorder { get; set; }
+
+ ///
+ /// 路线code
+ ///
+ [SugarColumn(ColumnName = "route_code")]
+ public string RouteCode { get; set; }
+
+ ///
+ /// 工序code
+ ///
+ [SugarColumn(ColumnName = "process_code")]
+ public string ProcessCode { get; set; }
+
+ ///
+ /// 计划数量
+ ///
+ [SugarColumn(ColumnName = "plan_num")]
+ public int? PlanNum { get; set; }
+
+ ///
+ /// 完成数量
+ ///
+ [SugarColumn(ColumnName = "finish_num")]
+ public int? FinishNum { get; set; }
+
+ ///
+ /// 不良数量
+ ///
+ [SugarColumn(ColumnName = "bad_num")]
+ public int? BadNum { get; set; }
+
+ ///
+ /// 作业员
+ ///
+ public string Worker { get; set; }
+
+ ///
+ /// 作业日期
+ ///
+ [SugarColumn(ColumnName = "job_date")]
+ public DateTime? JobDate { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string Remark { get; set; }
+
+ ///
+ /// 创建人
+ ///
+ [SugarColumn(ColumnName = "cREATED_BY")]
+ public string CreatedBy { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName = "cREATED_TIME")]
+ public DateTime? CreatedTime { get; set; }
+
+ ///
+ /// 更新人
+ ///
+ [SugarColumn(ColumnName = "uPDATED_BY")]
+ public string UpdatedBy { get; set; }
+
+ ///
+ /// 更新时间
+ ///
+ [SugarColumn(ColumnName = "uPDATED_TIME")]
+ public DateTime? UpdatedTime { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/DOAN.Service/MES/Base/BaseWorkRouteService.cs b/DOAN.Service/MES/Base/BaseWorkRouteService.cs
index 9907a80..0dcd22f 100644
--- a/DOAN.Service/MES/Base/BaseWorkRouteService.cs
+++ b/DOAN.Service/MES/Base/BaseWorkRouteService.cs
@@ -43,6 +43,7 @@ namespace DOAN.Service.MES.base_
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
+
if (response != null && response.Result.Count > 0)
{
foreach (var item in response.Result)
diff --git a/DOAN.Service/MES/Product/IService/IProReportworkService.cs b/DOAN.Service/MES/Product/IService/IProReportworkService.cs
new file mode 100644
index 0000000..38bc938
--- /dev/null
+++ b/DOAN.Service/MES/Product/IService/IProReportworkService.cs
@@ -0,0 +1,22 @@
+using DOAN.Model.BZFM.Dto;
+using DOAN.Model.BZFM;
+using DOAN.Model.MES.product;
+
+namespace DOAN.Service.BZFM.IBZFMService
+{
+ ///
+ /// 报工service接口
+ ///
+ public interface IProReportworkService : IBaseService
+ {
+ PagedInfo GetList(ProReportworkQueryDto parm);
+
+ ProReportwork01 GetInfo(string Id);
+
+
+ ProReportwork01 AddProReportwork(ProReportwork01 parm);
+ int UpdateProReportwork(ProReportwork01 parm);
+
+
+ }
+}
diff --git a/DOAN.Service/MES/Product/ProReportworkService.cs b/DOAN.Service/MES/Product/ProReportworkService.cs
new file mode 100644
index 0000000..c859ffd
--- /dev/null
+++ b/DOAN.Service/MES/Product/ProReportworkService.cs
@@ -0,0 +1,88 @@
+using Infrastructure.Attribute;
+using Infrastructure.Extensions;
+using DOAN.Model.BZFM.Dto;
+using DOAN.Model.BZFM;
+using DOAN.Model.MES.product;
+using DOAN.Repository;
+using DOAN.Service.BZFM.IBZFMService;
+
+namespace DOAN.Service.BZFM
+{
+ ///
+ /// 报工Service业务层处理
+ ///
+ [AppService(ServiceType = typeof(IProReportworkService), ServiceLifetime = LifeTime.Transient)]
+ public class ProReportworkService : BaseService, IProReportworkService
+ {
+ ///
+ /// 查询报工列表
+ ///
+ ///
+ ///
+ public PagedInfo GetList(ProReportworkQueryDto parm)
+ {
+ var predicate = QueryExp(parm);
+
+ var response = Queryable()
+ .Where(predicate.ToExpression())
+ .ToPage(parm);
+
+ return response;
+ }
+
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ public ProReportwork01 GetInfo(string Id)
+ {
+ var response = Queryable()
+ .Where(x => x.Id == Id)
+ .First();
+
+ return response;
+ }
+
+ ///
+ /// 添加报工
+ ///
+ ///
+ ///
+ public ProReportwork01 AddProReportwork(ProReportwork01 model)
+ {
+ return Insertable(model).ExecuteReturnEntity();
+ }
+
+ ///
+ /// 修改报工
+ ///
+ ///
+ ///
+ public int UpdateProReportwork(ProReportwork01 model)
+ {
+ return Update(model, true);
+ }
+
+ ///
+ /// 查询导出表达式
+ ///
+ ///
+ ///
+ private static Expressionable QueryExp(ProReportworkQueryDto parm)
+ {
+ var predicate = Expressionable.Create()
+ .AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
+ .AndIF(!string.IsNullOrEmpty(parm.Worker), it => it.Worker.Contains(parm.Worker))
+ .AndIF(!string.IsNullOrEmpty(parm.RouteCode), it => it.RouteCode==parm.RouteCode)
+ .AndIF(!string.IsNullOrEmpty(parm.ProcessCode), it => it.ProcessCode==parm.ProcessCode)
+ .AndIF(parm.JobDate != null && parm.JobDate[0] > DateTime.MinValue, it => it.JobDate >= parm.JobDate[0])
+ .AndIF(parm.JobDate != null && parm.JobDate[1] > DateTime.MinValue, it => it.JobDate <= parm.JobDate[1])
+
+ ;
+
+ return predicate;
+ }
+ }
+}
\ No newline at end of file