diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishInspectionWorkorderController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishInspectionWorkorderController.cs new file mode 100644 index 00000000..6146b079 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishInspectionWorkorderController.cs @@ -0,0 +1,109 @@ +using Microsoft.AspNetCore.Mvc; +using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Filters; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; +using ZR.Service.mes.wms.IService; + +//创建时间:2024-07-30 +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// 后道检验工单表 + /// + // [Verify] + [Route("/mes/wm/WmPolishInspectionWorkorder")] + public class WmPolishInspectionWorkorderController : BaseController + { + /// + /// 后道检验工单表接口 + /// + private readonly IWmPolishInspectionWorkorderService _WmPolishInspectionWorkorderService; + + public WmPolishInspectionWorkorderController(IWmPolishInspectionWorkorderService WmPolishInspectionWorkorderService) + { + _WmPolishInspectionWorkorderService = WmPolishInspectionWorkorderService; + } + + /// + /// 查询后道检验工单表列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "business:wmpolishinspectionworkorder:list")] + public IActionResult QueryWmPolishInspectionWorkorder([FromQuery] WmPolishInspectionWorkorderQueryDto parm) + { + var response = _WmPolishInspectionWorkorderService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询后道检验工单表详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "business:wmpolishinspectionworkorder:query")] + public IActionResult GetWmPolishInspectionWorkorder(string Id) + { + var response = _WmPolishInspectionWorkorderService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加后道检验工单表 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "business:wmpolishinspectionworkorder:add")] + [Log(Title = "后道检验工单表", BusinessType = BusinessType.INSERT)] + public IActionResult AddWmPolishInspectionWorkorder([FromBody] WmPolishInspectionWorkorderDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _WmPolishInspectionWorkorderService.AddWmPolishInspectionWorkorder(modal); + + return SUCCESS(response); + } + + /// + /// 更新后道检验工单表 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "business:wmpolishinspectionworkorder:edit")] + [Log(Title = "后道检验工单表", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateWmPolishInspectionWorkorder([FromBody] WmPolishInspectionWorkorderDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _WmPolishInspectionWorkorderService.UpdateWmPolishInspectionWorkorder(modal); + + return ToResponse(response); + } + + /// + /// 删除后道检验工单表 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "business:wmpolishinspectionworkorder:delete")] + [Log(Title = "后道检验工单表", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteWmPolishInspectionWorkorder(string ids) + { + int[] idsArr = Tools.SpitIntArrary(ids); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } + + var response = _WmPolishInspectionWorkorderService.Delete(idsArr); + + return ToResponse(response); + } + + + + + } +} \ No newline at end of file diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishWorkorderController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishWorkorderController.cs new file mode 100644 index 00000000..188b2adb --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmPolishWorkorderController.cs @@ -0,0 +1,109 @@ +using Microsoft.AspNetCore.Mvc; +using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Filters; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; +using ZR.Service.mes.wms.IService; + +//创建时间:2024-07-30 +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// + /// + // [Verify] + [Route("/mes/wm/WmPolishWorkorder")] + public class WmPolishWorkorderController : BaseController + { + /// + /// 接口 + /// + private readonly IWmPolishWorkorderService _WmPolishWorkorderService; + + public WmPolishWorkorderController(IWmPolishWorkorderService WmPolishWorkorderService) + { + _WmPolishWorkorderService = WmPolishWorkorderService; + } + + /// + /// 查询列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "business:wmpolishworkorder:list")] + public IActionResult QueryWmPolishWorkorder([FromQuery] WmPolishWorkorderQueryDto parm) + { + var response = _WmPolishWorkorderService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "business:wmpolishworkorder:query")] + public IActionResult GetWmPolishWorkorder(string Id) + { + var response = _WmPolishWorkorderService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "business:wmpolishworkorder:add")] + [Log(Title = "", BusinessType = BusinessType.INSERT)] + public IActionResult AddWmPolishWorkorder([FromBody] WmPolishWorkorderDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _WmPolishWorkorderService.AddWmPolishWorkorder(modal); + + return SUCCESS(response); + } + + /// + /// 更新 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "business:wmpolishworkorder:edit")] + [Log(Title = "", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateWmPolishWorkorder([FromBody] WmPolishWorkorderDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _WmPolishWorkorderService.UpdateWmPolishWorkorder(modal); + + return ToResponse(response); + } + + /// + /// 删除 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "business:wmpolishworkorder:delete")] + [Log(Title = "", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteWmPolishWorkorder(string ids) + { + int[] idsArr = Tools.SpitIntArrary(ids); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } + + var response = _WmPolishWorkorderService.Delete(idsArr); + + return ToResponse(response); + } + + + + + } +} \ No newline at end of file diff --git a/ZR.Admin.WebApi/appsettings.production.json b/ZR.Admin.WebApi/appsettings.production.json index f17635e2..4d394642 100644 --- a/ZR.Admin.WebApi/appsettings.production.json +++ b/ZR.Admin.WebApi/appsettings.production.json @@ -35,7 +35,7 @@ "Expire": 10080 //jwt登录过期时间(分)【7天】 }, "InjectClass": [ "ZR.Repository", "ZR.Service", "ZR.Tasks" ], //自动注入类 - "ShowDbLog": true,//是否打印db日志 + "ShowDbLog": false,//是否打印db日志 "InitDb": false, //是否初始化db "DemoMode": false, //是否演示模式 "Upload": { diff --git a/ZR.Model/MES/wms/Dto/WmPolishInspectionWorkorderDto.cs b/ZR.Model/MES/wms/Dto/WmPolishInspectionWorkorderDto.cs new file mode 100644 index 00000000..54c9a46b --- /dev/null +++ b/ZR.Model/MES/wms/Dto/WmPolishInspectionWorkorderDto.cs @@ -0,0 +1,74 @@ +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.MES.wms.Dto +{ + /// + /// 后道检验工单表查询对象 + /// + public class WmPolishInspectionWorkorderQueryDto : PagerInfo + { + public string WorkorderNo { get; set; } + + public string Partnumber { get; set; } + + public string BlankNum { get; set; } + + public List OrderTimeList { get; set; } + + public int? Type { get; set; } + + public int? IsSend { get; set; } + + public int? Status { get; set; } + } + + /// + /// 后道检验工单表输入输出对象 + /// + public class WmPolishInspectionWorkorderDto + { + [Required(ErrorMessage = "工单主键不能为空")] + public string Id { get; set; } + + public string WorkorderNo { get; set; } + + public string Partnumber { get; set; } + + public string BlankNum { get; set; } + + public int? Quantity { get; set; } + + public int? PassNum { get; set; } + + public int? PolishNum { get; set; } + + public int? SandingNum { get; set; } + + public int? DiscardNum { get; set; } + + public DateTime? OrderTime { get; set; } + + public DateTime? StartTime { get; set; } + + public DateTime? EndTime { get; set; } + + public int? Type { get; set; } + + public string Remark { get; set; } + + public int? IsSend { get; set; } + + public int? Status { get; set; } + + public string UpdatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } + + public string CreatedBy { get; set; } + + public DateTime? CreatedTime { get; set; } + + + + } +} \ No newline at end of file diff --git a/ZR.Model/MES/wms/Dto/WmPolishRecordDto.cs b/ZR.Model/MES/wms/Dto/WmPolishRecordDto.cs index c4e352d9..8352a7fd 100644 --- a/ZR.Model/MES/wms/Dto/WmPolishRecordDto.cs +++ b/ZR.Model/MES/wms/Dto/WmPolishRecordDto.cs @@ -12,6 +12,7 @@ namespace ZR.Model.MES.wms.Dto public string Code { get; set; } public string BlankNum { get; set; } public string Partnumber { get; set; } + public string Remark { get; set; } public int? ChangeType { get; set; } public DateTime? StartActionTime { get; set; } public DateTime? EndActionTime { get; set; } diff --git a/ZR.Model/MES/wms/Dto/WmPolishWorkorderDto.cs b/ZR.Model/MES/wms/Dto/WmPolishWorkorderDto.cs new file mode 100644 index 00000000..432937ec --- /dev/null +++ b/ZR.Model/MES/wms/Dto/WmPolishWorkorderDto.cs @@ -0,0 +1,72 @@ +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.MES.wms.Dto +{ + /// + /// 查询对象 + /// + public class WmPolishWorkorderQueryDto : PagerInfo + { + public string WorkorderNo { get; set; } + + public string Partnumber { get; set; } + + public string BlankNum { get; set; } + + public List OrderTimeList { get; set; } + + public int? Type { get; set; } + + public int? IsSend { get; set; } + + public int? Status { get; set; } + } + + /// + /// 输入输出对象 + /// + public class WmPolishWorkorderDto + { + [Required(ErrorMessage = "工单主键不能为空")] + public string Id { get; set; } + + public string WorkorderNo { get; set; } + + public string Partnumber { get; set; } + + public string BlankNum { get; set; } + + public int? Quantity { get; set; } + + public int? PassNum { get; set; } + + public int? SandingNum { get; set; } + + public int? DiscardNum { get; set; } + + public DateTime? OrderTime { get; set; } + + public DateTime? StartTime { get; set; } + + public DateTime? EndTime { get; set; } + + public int? Type { get; set; } + + public string Remark { get; set; } + + public int? IsSend { get; set; } + + public int? Status { get; set; } + + public string UpdatedBy { get; set; } + + public DateTime? UpdatedTime { get; set; } + + public string CreatedBy { get; set; } + + public DateTime? CreatedTime { get; set; } + + + + } +} \ No newline at end of file diff --git a/ZR.Model/MES/wms/WmPolishInspectionWorkorder.cs b/ZR.Model/MES/wms/WmPolishInspectionWorkorder.cs new file mode 100644 index 00000000..db6aa667 --- /dev/null +++ b/ZR.Model/MES/wms/WmPolishInspectionWorkorder.cs @@ -0,0 +1,126 @@ + +namespace ZR.Model.MES.wms +{ + /// + /// 后道检验工单表 + /// + [SugarTable("wm_polish_inspection_workorder")] + public class WmPolishInspectionWorkorder + { + /// + /// 工单主键 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false)] + public string Id { get; set; } + + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_no")] + public string WorkorderNo { get; set; } + + /// + /// 零件号 + /// + public string Partnumber { get; set; } + + /// + /// 毛坯号 + /// + [SugarColumn(ColumnName = "blank_num")] + public string BlankNum { get; set; } + + /// + /// 总零件数 + /// + public int? Quantity { get; set; } + + /// + /// 合格 + /// + [SugarColumn(ColumnName = "pass_num")] + public int? PassNum { get; set; } + + /// + /// 抛光 + /// + [SugarColumn(ColumnName = "polish_num")] + public int? PolishNum { get; set; } + + /// + /// 打磨 + /// + [SugarColumn(ColumnName = "sanding_num")] + public int? SandingNum { get; set; } + + /// + /// 报废 + /// + [SugarColumn(ColumnName = "discard_num")] + public int? DiscardNum { get; set; } + + /// + /// 工单日期 + /// + [SugarColumn(ColumnName = "order_time")] + public DateTime? OrderTime { get; set; } + + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + + /// + /// 工单类别 1-手动 2-自动 + /// + public int? Type { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 仓库数据是否同步 0-未发送同步数据 1-发送同步数据 + /// + [SugarColumn(ColumnName = "is_send")] + public int? IsSend { get; set; } + + /// + /// 0-未执行 1-执行中 2-已完成 + /// + public int? Status { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "uPDATED_BY")] + public string UpdatedBy { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "uPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "cREATED_BY")] + public string CreatedBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "cREATED_TIME")] + public DateTime? CreatedTime { get; set; } + + } +} \ No newline at end of file diff --git a/ZR.Model/MES/wms/WmPolishWorkorder.cs b/ZR.Model/MES/wms/WmPolishWorkorder.cs new file mode 100644 index 00000000..03684f32 --- /dev/null +++ b/ZR.Model/MES/wms/WmPolishWorkorder.cs @@ -0,0 +1,120 @@ + +namespace ZR.Model.MES.wms +{ + /// + /// + /// + [SugarTable("wm_polish_workorder")] + public class WmPolishWorkorder + { + /// + /// 工单主键 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false)] + public string Id { get; set; } + + /// + /// 工单号 + /// + [SugarColumn(ColumnName = "workorder_no")] + public string WorkorderNo { get; set; } + + /// + /// 零件号 + /// + public string Partnumber { get; set; } + + /// + /// 毛坯号 + /// + [SugarColumn(ColumnName = "blank_num")] + public string BlankNum { get; set; } + + /// + /// 总零件数 + /// + public int? Quantity { get; set; } + + /// + /// 合格 + /// + [SugarColumn(ColumnName = "pass_num")] + public int? PassNum { get; set; } + + /// + /// 打磨 + /// + [SugarColumn(ColumnName = "sanding_num")] + public int? SandingNum { get; set; } + + /// + /// 报废 + /// + [SugarColumn(ColumnName = "discard_num")] + public int? DiscardNum { get; set; } + + /// + /// 工单日期 + /// + [SugarColumn(ColumnName = "order_time")] + public DateTime? OrderTime { get; set; } + + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "start_time")] + public DateTime? StartTime { get; set; } + + /// + /// 结束时间 + /// + [SugarColumn(ColumnName = "end_time")] + public DateTime? EndTime { get; set; } + + /// + /// 工单类别 1-手动 2-自动 + /// + public int? Type { get; set; } + + /// + /// 备注 + /// + public string Remark { get; set; } + + /// + /// 仓库数据是否同步 0-未发送同步数据 1-发送同步数据 + /// + [SugarColumn(ColumnName = "is_send")] + public int? IsSend { get; set; } + + /// + /// 0-未执行 1-执行中 2-已完成 + /// + public int? Status { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "uPDATED_BY")] + public string UpdatedBy { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "uPDATED_TIME")] + public DateTime? UpdatedTime { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "cREATED_BY")] + public string CreatedBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "cREATED_TIME")] + public DateTime? CreatedTime { get; set; } + + } +} \ No newline at end of file diff --git a/ZR.Service/mes/qc/FirstFQCService.cs b/ZR.Service/mes/qc/FirstFQCService.cs index 76fc65ed..35d85ba2 100644 --- a/ZR.Service/mes/qc/FirstFQCService.cs +++ b/ZR.Service/mes/qc/FirstFQCService.cs @@ -7,7 +7,9 @@ using ZR.Model.MES.pro; using ZR.Model.MES.qc; using ZR.Model.MES.qc.DTO; using ZR.Model.MES.qu; +using ZR.Model.MES.wms; using ZR.Service.mes.qc.IService; +using ZR.Service.mes.wms; namespace ZR.Service.mes.qc { @@ -1336,12 +1338,12 @@ namespace ZR.Service.mes.qc polishPassNumber = polishNumber - 0; } - Console.ForegroundColor = ConsoleColor.Green; +/* Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"打印工单{workorder_id} 一次合格数{OnePassNumber}=计划数{workorder.PreviousNumber}-----所有缺陷数{list?.sum} "); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"打印工单{workorder_id} 计算抛光合格{polishPassNumber}=首检的抛光{polishNumber}-----抛光缺陷项{polish_defect_Number?.sum}"); Console.ForegroundColor = ConsoleColor.Green; - Console.WriteLine($"打印工单{workorder_id} 包装投入数{OnePassNumber + polishPassNumber}"); + Console.WriteLine($"打印工单{workorder_id} 包装投入数{OnePassNumber + polishPassNumber}");*/ @@ -3206,13 +3208,26 @@ namespace ZR.Service.mes.qc #endregion - - - - - - - + // 产线报表生成后自动化操作 + // 1.抛光品入库 + try + { + WmPolishInventoryService wmPolishInventoryService = new WmPolishInventoryService(); + WmPolishInventory warehousingInfo = new() + { + Partnumber = workorder_item.FinishedPartNumber, + Type = workorder_item.Remark1.Contains("返工") ? 2 : 1, + Quantity = paoguang_by_first, + ActionTime = DateTime.Now.ToLocalTime(), + CreatedBy = "包装" + team + "组", + Remark = "首检抛光自动入库。来源工单号:[" + workorder_item.ClientWorkorder + "]" + }; + wmPolishInventoryService.DoWmPolishWarehousing(warehousingInfo); + } + catch (Exception) + { + return 1; + } } return 1; } diff --git a/ZR.Service/mes/wms/IService/IWmPolishInspectionWorkorderService.cs b/ZR.Service/mes/wms/IService/IWmPolishInspectionWorkorderService.cs new file mode 100644 index 00000000..1f2f6d38 --- /dev/null +++ b/ZR.Service/mes/wms/IService/IWmPolishInspectionWorkorderService.cs @@ -0,0 +1,22 @@ +using ZR.Model; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.mes.wms.IService +{ + /// + /// 后道检验工单表service接口 + /// + public interface IWmPolishInspectionWorkorderService : IBaseService + { + PagedInfo GetList(WmPolishInspectionWorkorderQueryDto parm); + + WmPolishInspectionWorkorder GetInfo(string Id); + + WmPolishInspectionWorkorder AddWmPolishInspectionWorkorder( + WmPolishInspectionWorkorder parm + ); + + int UpdateWmPolishInspectionWorkorder(WmPolishInspectionWorkorder parm); + } +} diff --git a/ZR.Service/mes/wms/IService/IWmPolishWorkorderService.cs b/ZR.Service/mes/wms/IService/IWmPolishWorkorderService.cs new file mode 100644 index 00000000..06b83e13 --- /dev/null +++ b/ZR.Service/mes/wms/IService/IWmPolishWorkorderService.cs @@ -0,0 +1,21 @@ +using ZR.Model; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.mes.wms.IService +{ + /// + /// service接口 + /// + public interface IWmPolishWorkorderService : IBaseService + { + PagedInfo GetList(WmPolishWorkorderQueryDto parm); + + WmPolishWorkorder GetInfo(string Id); + + WmPolishWorkorder AddWmPolishWorkorder(WmPolishWorkorder parm); + + int UpdateWmPolishWorkorder(WmPolishWorkorder parm); + + } +} diff --git a/ZR.Service/mes/wms/WmPolishInspectionWorkorderService.cs b/ZR.Service/mes/wms/WmPolishInspectionWorkorderService.cs new file mode 100644 index 00000000..815f993d --- /dev/null +++ b/ZR.Service/mes/wms/WmPolishInspectionWorkorderService.cs @@ -0,0 +1,91 @@ +using Infrastructure.Attribute; +using SqlSugar; +using ZR.Model; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; +using ZR.Repository; +using ZR.Service.mes.wms.IService; + +namespace ZR.Service.mes.wms +{ + /// + /// 后道检验工单表Service业务层处理 + /// + [AppService(ServiceType = typeof(IWmPolishInspectionWorkorderService), ServiceLifetime = LifeTime.Transient)] + public class WmPolishInspectionWorkorderService : BaseService, IWmPolishInspectionWorkorderService + { + /// + /// 查询后道检验工单表列表 + /// + /// + /// + public PagedInfo GetList(WmPolishInspectionWorkorderQueryDto parm) + { + var predicate = Expressionable.Create(); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public WmPolishInspectionWorkorder GetInfo(string Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加后道检验工单表 + /// + /// + /// + public WmPolishInspectionWorkorder AddWmPolishInspectionWorkorder(WmPolishInspectionWorkorder model) + { + return Context.Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改后道检验工单表 + /// + /// + /// + public int UpdateWmPolishInspectionWorkorder(WmPolishInspectionWorkorder model) + { + //var response = Update(w => w.Id == model.Id, it => new WmPolishInspectionWorkorder() + //{ + // WorkorderNo = model.WorkorderNo, + // Partnumber = model.Partnumber, + // BlankNum = model.BlankNum, + // Quantity = model.Quantity, + // PassNum = model.PassNum, + // PolishNum = model.PolishNum, + // SandingNum = model.SandingNum, + // DiscardNum = model.DiscardNum, + // StartTime = model.StartTime, + // EndTime = model.EndTime, + // Type = model.Type, + // Remark = model.Remark, + // IsSend = model.IsSend, + // Status = model.Status, + // UpdatedBy = model.UpdatedBy, + // UpdatedTime = model.UpdatedTime, + // CreatedBy = model.CreatedBy, + // CreatedTime = model.CreatedTime, + //}); + //return response; + return Update(model, true); + } + + } +} \ No newline at end of file diff --git a/ZR.Service/mes/wms/WmPolishInventoryService.cs b/ZR.Service/mes/wms/WmPolishInventoryService.cs index 6b8db5d1..2bf09fb8 100644 --- a/ZR.Service/mes/wms/WmPolishInventoryService.cs +++ b/ZR.Service/mes/wms/WmPolishInventoryService.cs @@ -66,7 +66,7 @@ namespace ZR.Service.mes.wms .First(); if (material == null) { - item.Description = "此毛坯号不在物料清单内!"; + item.Description = "此零件号不在物料清单内!"; continue; } item.Color = material.Color; @@ -209,7 +209,7 @@ namespace ZR.Service.mes.wms Context.Ado.BeginTran(); // 零件号检查 string partnumber = parm.Partnumber; - WmMaterial material = Context + /*WmMaterial material = Context .Queryable() .Where(it => it.Partnumber == partnumber) .Where(it => it.Type == 1) @@ -219,7 +219,7 @@ namespace ZR.Service.mes.wms { Context.Ado.RollbackTran(); throw new Exception("零件号在物料清单未查到,请到物料清单新增零件号记录"); - } + }*/ // 检查是否存在库中 WmPolishInventory polishInventory = Context .Queryable() @@ -313,7 +313,7 @@ namespace ZR.Service.mes.wms Context.Ado.BeginTran(); // 零件号检查 string partnumber = parm.Partnumber; - WmMaterial material = Context + /*WmMaterial material = Context .Queryable() .Where(it => it.Partnumber == partnumber) .Where(it => it.Type == 1) @@ -323,7 +323,7 @@ namespace ZR.Service.mes.wms { Context.Ado.RollbackTran(); throw new Exception("零件号在物料清单未查到,请到物料清单新增零件号记录"); - } + }*/ // 检查是否存在库中 WmPolishInventory polishInventory = Context .Queryable() diff --git a/ZR.Service/mes/wms/WmPolishRecordService.cs b/ZR.Service/mes/wms/WmPolishRecordService.cs index acd40ede..5e748d0a 100644 --- a/ZR.Service/mes/wms/WmPolishRecordService.cs +++ b/ZR.Service/mes/wms/WmPolishRecordService.cs @@ -35,6 +35,10 @@ namespace ZR.Service.mes.wms !string.IsNullOrEmpty(parm.BlankNum), it => it.BlankNum.Contains(parm.BlankNum) ) + .AndIF( + !string.IsNullOrEmpty(parm.Remark), + it => it.Remark.Contains(parm.Remark) + ) .AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains(parm.Code)) .AndIF( !string.IsNullOrEmpty(parm.FkInventoryId), diff --git a/ZR.Service/mes/wms/WmPolishWorkorderService.cs b/ZR.Service/mes/wms/WmPolishWorkorderService.cs new file mode 100644 index 00000000..78534888 --- /dev/null +++ b/ZR.Service/mes/wms/WmPolishWorkorderService.cs @@ -0,0 +1,91 @@ +using Infrastructure.Attribute; +using SqlSugar; +using ZR.Model; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; +using ZR.Repository; +using ZR.Service.mes.wms.IService; + +namespace ZR.Service.mes.wms +{ + /// + /// Service业务层处理 + /// + [AppService( + ServiceType = typeof(IWmPolishWorkorderService), + ServiceLifetime = LifeTime.Transient + )] + public class WmPolishWorkorderService + : BaseService, + IWmPolishWorkorderService + { + /// + /// 查询列表 + /// + /// + /// + public PagedInfo GetList(WmPolishWorkorderQueryDto parm) + { + var predicate = Expressionable.Create(); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + /// + /// 获取详情 + /// + /// + /// + public WmPolishWorkorder GetInfo(string Id) + { + var response = Queryable().Where(x => x.Id == Id).First(); + + return response; + } + + /// + /// 添加 + /// + /// + /// + public WmPolishWorkorder AddWmPolishWorkorder(WmPolishWorkorder model) + { + return Context.Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改 + /// + /// + /// + public int UpdateWmPolishWorkorder(WmPolishWorkorder model) + { + //var response = Update(w => w.Id == model.Id, it => new WmPolishWorkorder() + //{ + // WorkorderNo = model.WorkorderNo, + // Partnumber = model.Partnumber, + // BlankNum = model.BlankNum, + // Quantity = model.Quantity, + // PassNum = model.PassNum, + // SandingNum = model.SandingNum, + // DiscardNum = model.DiscardNum, + // StartTime = model.StartTime, + // EndTime = model.EndTime, + // Type = model.Type, + // Remark = model.Remark, + // IsSend = model.IsSend, + // Status = model.Status, + // UpdatedBy = model.UpdatedBy, + // UpdatedTime = model.UpdatedTime, + // CreatedBy = model.CreatedBy, + // CreatedTime = model.CreatedTime, + //}); + //return response; + return Update(model, true); + } + } +}