diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs new file mode 100644 index 00000000..d04636eb --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmFgentryInspectController.cs @@ -0,0 +1,111 @@ +using Microsoft.AspNetCore.Mvc; +using ZR.Model.Dto; +using ZR.Service.Business.IBusinessService; +using ZR.Admin.WebApi.Extensions; +using ZR.Admin.WebApi.Filters; +using ZR.Service.mes.wms.IService; +using ZR.Model.MES.wms.Dto; +using ZR.Model.MES.wms; + +//创建时间:2024-04-17 +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// 成品入库检验 + /// + [Verify] + [Route("/mes/wm/WmFgentryInspect")] + public class WmFgentryInspectController : BaseController + { + /// + /// 成品入库检验接口 + /// + private readonly IWmFgentryInspectService _WmFgentryInspectService; + + public WmFgentryInspectController(IWmFgentryInspectService WmFgentryInspectService) + { + _WmFgentryInspectService = WmFgentryInspectService; + } + + /// + /// 查询成品入库检验列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:list")] + public IActionResult QueryWmFgentryInspect([FromQuery] WmFgentryInspectQueryDto parm) + { + var response = _WmFgentryInspectService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询成品入库检验详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:query")] + public IActionResult GetWmFgentryInspect(int Id) + { + var response = _WmFgentryInspectService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加成品入库检验 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:add")] + [Log(Title = "成品入库检验", BusinessType = BusinessType.INSERT)] + public IActionResult AddWmFgentryInspect([FromBody] WmFgentryInspectDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _WmFgentryInspectService.AddWmFgentryInspect(modal); + + return SUCCESS(response); + } + + /// + /// 更新成品入库检验 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:edit")] + [Log(Title = "成品入库检验", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateWmFgentryInspect([FromBody] WmFgentryInspectDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _WmFgentryInspectService.UpdateWmFgentryInspect(modal); + + return ToResponse(response); + } + + /// + /// 删除成品入库检验 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:delete")] + [Log(Title = "成品入库检验", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteWmFgentryInspect(string ids) + { + int[] idsArr = Tools.SpitIntArrary(ids); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } + + var response = _WmFgentryInspectService.Delete(idsArr); + + return ToResponse(response); + } + + + + + } +} \ No newline at end of file diff --git a/ZR.Admin.WebApi/wwwroot/ImportTemplate/物料清单模版.xls b/ZR.Admin.WebApi/wwwroot/ImportTemplate/物料清单模版.xls deleted file mode 100644 index 8fa7b1c3..00000000 Binary files a/ZR.Admin.WebApi/wwwroot/ImportTemplate/物料清单模版.xls and /dev/null differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716250689e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716250689e699b8e595a8e788.xlsx new file mode 100644 index 00000000..a5e75782 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716250689e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716324289e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716324289e699b8e595a8e788.xlsx new file mode 100644 index 00000000..7f55f9bc Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716324289e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716345389e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716345389e699b8e595a8e788.xlsx new file mode 100644 index 00000000..7f55f9bc Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716345389e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171646022024年报销.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171646022024年报销.xlsx new file mode 100644 index 00000000..b41f86af Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171646022024年报销.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716512089e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716512089e699b8e595a8e788.xlsx new file mode 100644 index 00000000..a5e75782 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716512089e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716572089e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716572089e699b8e595a8e788.xlsx new file mode 100644 index 00000000..a5e75782 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041716572089e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171657562024年报销.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171657562024年报销.xlsx new file mode 100644 index 00000000..b41f86af Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171657562024年报销.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041717021389e699b8e595a8e788.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041717021389e699b8e595a8e788.xlsx new file mode 100644 index 00000000..a5e75782 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/2024041717021389e699b8e595a8e788.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171702522024年报销.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171702522024年报销.xlsx new file mode 100644 index 00000000..b41f86af Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171702522024年报销.xlsx differ diff --git a/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171704052024年报销.xlsx b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171704052024年报销.xlsx new file mode 100644 index 00000000..b41f86af Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/wmmaterial/202404171704052024年报销.xlsx differ diff --git a/ZR.Model/MES/wms/Dto/WmFgentryInspectDto.cs b/ZR.Model/MES/wms/Dto/WmFgentryInspectDto.cs new file mode 100644 index 00000000..dc7b3dab --- /dev/null +++ b/ZR.Model/MES/wms/Dto/WmFgentryInspectDto.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.MES.wms.Dto +{ + /// + /// 成品入库检验查询对象 + /// + public class WmFgentryInspectQueryDto : PagerInfo + { + } + + /// + /// 成品入库检验输入输出对象 + /// + public class WmFgentryInspectDto + { + [Required(ErrorMessage = "主键不能为空")] + public int Id { get; set; } + + public string Workorder { get; set; } + + [Required(ErrorMessage = "箱子号不能为空")] + public string Packcode { get; set; } + + public string Machine { get; set; } + + public int? ProductionNum { get; set; } + + public string Partnumber { get; set; } + + public int? Bfilled { get; set; } + + public int? Result { 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/ZR.Model/MES/wms/WmFgentryInspect.cs b/ZR.Model/MES/wms/WmFgentryInspect.cs new file mode 100644 index 00000000..f9fc88c3 --- /dev/null +++ b/ZR.Model/MES/wms/WmFgentryInspect.cs @@ -0,0 +1,78 @@ + +namespace ZR.Model.MES.wms +{ + /// + /// 成品入库检验 + /// + [SugarTable("wm_fgentry_inspect")] + public class WmFgentryInspect + { + /// + /// 主键 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 工单号 + /// + public string Workorder { get; set; } + + /// + /// 箱子号 + /// + [SugarColumn(IsPrimaryKey = true, IsIdentity = false)] + public string Packcode { get; set; } + + /// + /// 工位 + /// + public string Machine { get; set; } + + /// + /// 箱子里产品个数 + /// + [SugarColumn(ColumnName = "production_num")] + public int? ProductionNum { get; set; } + + /// + /// 零件号 + /// + public string Partnumber { get; set; } + + /// + /// 是否满箱 + /// + public int? Bfilled { get; set; } + + /// + /// 检验结果(0未检,1合格,2不合格) + /// + public int? Result { 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/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs b/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs new file mode 100644 index 00000000..8c887a6e --- /dev/null +++ b/ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs @@ -0,0 +1,24 @@ +using System; +using ZR.Model; +using ZR.Model.Dto; +using ZR.Model.MES.wms; +using System.Collections.Generic; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.mes.wms.IService +{ + /// + /// 成品入库检验service接口 + /// + public interface IWmFgentryInspectService : IBaseService + { + PagedInfo GetList(WmFgentryInspectQueryDto parm); + + WmFgentryInspect GetInfo(int Id); + + WmFgentryInspect AddWmFgentryInspect(WmFgentryInspect parm); + + int UpdateWmFgentryInspect(WmFgentryInspect parm); + + } +} diff --git a/ZR.Service/mes/wms/WmFgentryInspectService.cs b/ZR.Service/mes/wms/WmFgentryInspectService.cs new file mode 100644 index 00000000..3bf77ebb --- /dev/null +++ b/ZR.Service/mes/wms/WmFgentryInspectService.cs @@ -0,0 +1,88 @@ +using System; +using SqlSugar; +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using ZR.Model; +using ZR.Model.Dto; + +using ZR.Repository; +using System.Linq; +using ZR.Service.mes.wms.IService; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.mes.wms +{ + /// + /// 成品入库检验Service业务层处理 + /// + [AppService(ServiceType = typeof(IWmFgentryInspectService), ServiceLifetime = LifeTime.Transient)] + public class WmFgentryInspectService : BaseService, IWmFgentryInspectService + { + /// + /// 查询成品入库检验列表 + /// + /// + /// + public PagedInfo GetList(WmFgentryInspectQueryDto parm) + { + var predicate = Expressionable.Create(); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public WmFgentryInspect GetInfo(int Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加成品入库检验 + /// + /// + /// + public WmFgentryInspect AddWmFgentryInspect(WmFgentryInspect model) + { + return Context.Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改成品入库检验 + /// + /// + /// + public int UpdateWmFgentryInspect(WmFgentryInspect model) + { + //var response = Update(w => w.Id == model.Id, it => new WmFgentryInspect() + //{ + // Workorder = model.Workorder, + // Machine = model.Machine, + // ProductionNum = model.ProductionNum, + // Partnumber = model.Partnumber, + // Bfilled = model.Bfilled, + // Result = model.Result, + // CreatedBy = model.CreatedBy, + // CreatedTime = model.CreatedTime, + // UpdatedBy = model.UpdatedBy, + // UpdatedTime = model.UpdatedTime, + //}); + //return response; + return Update(model, true); + } + + } +} \ No newline at end of file diff --git a/ZR.Service/mes/wms/WmOutOrderService.cs b/ZR.Service/mes/wms/WmOutOrderService.cs index 1f17c5b3..77a65afa 100644 --- a/ZR.Service/mes/wms/WmOutOrderService.cs +++ b/ZR.Service/mes/wms/WmOutOrderService.cs @@ -223,7 +223,6 @@ namespace ZR.Service.mes.wms List materialList = Context.Queryable() .Where(predicate.ToExpression()) - .OrderByDescending(it => it.CreatedTime) .ToPageList(parm.PageNum, parm.PageSize, ref total); @@ -251,11 +250,11 @@ namespace ZR.Service.mes.wms material_num = material_num + (int)product.GoodsNumLogic; } } - if (material_num > 0) - { + + wmMaterialQuery_Stock_item.stockQuantity = material_num; material_stockQuantity_list.Add(wmMaterialQuery_Stock_item); - } +