diff --git a/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs new file mode 100644 index 00000000..93baa9f6 --- /dev/null +++ b/ZR.Admin.WebApi/Controllers/mes/wms/WmGoodsNowProductionController.cs @@ -0,0 +1,110 @@ +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.Business.IBusinessService; + +//创建时间:2024-03-22 +namespace ZR.Admin.WebApi.Controllers +{ + /// + /// 成品库当前货物表 + /// + [Verify] + [Route("/mes/wm/WmGoodsNowProduction")] + public class WmGoodsNowProductionController : BaseController + { + /// + /// 成品库当前货物表接口 + /// + private readonly IWmGoodsNowProductionService _WmGoodsNowProductionService; + + public WmGoodsNowProductionController(IWmGoodsNowProductionService WmGoodsNowProductionService) + { + _WmGoodsNowProductionService = WmGoodsNowProductionService; + } + + /// + /// 查询成品库当前货物表列表 + /// + /// + /// + [HttpGet("list")] + [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:list")] + public IActionResult QueryWmGoodsNowProduction([FromQuery] WmGoodsNowProductionQueryDto parm) + { + var response = _WmGoodsNowProductionService.GetList(parm); + return SUCCESS(response); + } + + + /// + /// 查询成品库当前货物表详情 + /// + /// + /// + [HttpGet("{Id}")] + [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:query")] + public IActionResult GetWmGoodsNowProduction(string Id) + { + var response = _WmGoodsNowProductionService.GetInfo(Id); + + var info = response.Adapt(); + return SUCCESS(info); + } + + /// + /// 添加成品库当前货物表 + /// + /// + [HttpPost] + [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:add")] + [Log(Title = "成品库当前货物表", BusinessType = BusinessType.INSERT)] + public IActionResult AddWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm) + { + var modal = parm.Adapt().ToCreate(HttpContext); + + var response = _WmGoodsNowProductionService.AddWmGoodsNowProduction(modal); + + return SUCCESS(response); + } + + /// + /// 更新成品库当前货物表 + /// + /// + [HttpPut] + [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:edit")] + [Log(Title = "成品库当前货物表", BusinessType = BusinessType.UPDATE)] + public IActionResult UpdateWmGoodsNowProduction([FromBody] WmGoodsNowProductionDto parm) + { + var modal = parm.Adapt().ToUpdate(HttpContext); + var response = _WmGoodsNowProductionService.UpdateWmGoodsNowProduction(modal); + + return ToResponse(response); + } + + /// + /// 删除成品库当前货物表 + /// + /// + [HttpDelete("{ids}")] + [ActionPermissionFilter(Permission = "wmsManagement:wmgoodsnowproduction:delete")] + [Log(Title = "成品库当前货物表", BusinessType = BusinessType.DELETE)] + public IActionResult DeleteWmGoodsNowProduction(string ids) + { + int[] idsArr = Tools.SpitIntArrary(ids); + if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } + + var response = _WmGoodsNowProductionService.Delete(idsArr); + + return ToResponse(response); + } + + + + + } +} \ No newline at end of file diff --git a/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-出库货物记录表-0322091020.zip b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-出库货物记录表-0322091020.zip new file mode 100644 index 00000000..8e473e96 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-出库货物记录表-0322091020.zip differ diff --git a/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-成品库当前货物表-0322091432.zip b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-成品库当前货物表-0322091432.zip new file mode 100644 index 00000000..ced6fcf0 Binary files /dev/null and b/ZR.Admin.WebApi/wwwroot/Generatecode/ZrAdmin.NET-成品库当前货物表-0322091432.zip differ diff --git a/ZR.Model/MES/wms/Dto/WmGoodsNowProductionDto.cs b/ZR.Model/MES/wms/Dto/WmGoodsNowProductionDto.cs new file mode 100644 index 00000000..c4b45140 --- /dev/null +++ b/ZR.Model/MES/wms/Dto/WmGoodsNowProductionDto.cs @@ -0,0 +1,52 @@ +using System.ComponentModel.DataAnnotations; + +namespace ZR.Model.MES.wms.Dto +{ + /// + /// 成品库当前货物表查询对象 + /// + public class WmGoodsNowProductionQueryDto : PagerInfo + { + } + + /// + /// 成品库当前货物表输入输出对象 + /// + public class WmGoodsNowProductionDto + { + [Required(ErrorMessage = "雪花id不能为空")] + public string Id { get; set; } + + [Required(ErrorMessage = "箱子编号(MES)不能为空")] + public string PackageCode { get; set; } + + [Required(ErrorMessage = "箱子编号(客户)不能为空")] + public string PackageCodeClient { get; set; } + + public string PackageCodeOriginal { get; set; } + + [Required(ErrorMessage = "库位编号不能为空")] + public string LocationCode { get; set; } + + public string Partnumber { get; set; } + + public int? GoodsNumLogic { get; set; } + + public int? GoodsNumAction { get; set; } + + public DateTime? EntryWarehouseTime { get; set; } + + public string Remark { 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.Service/mes/wms/IService/IWmGoodsNowProductionService.cs b/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs new file mode 100644 index 00000000..e9b25ab9 --- /dev/null +++ b/ZR.Service/mes/wms/IService/IWmGoodsNowProductionService.cs @@ -0,0 +1,25 @@ +using System; +using ZR.Model; +using ZR.Model.Dto; + +using System.Collections.Generic; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.Business.IBusinessService +{ + /// + /// 成品库当前货物表service接口 + /// + public interface IWmGoodsNowProductionService : IBaseService + { + PagedInfo GetList(WmGoodsNowProductionQueryDto parm); + + WmGoodsNowProduction GetInfo(string Id); + + WmGoodsNowProduction AddWmGoodsNowProduction(WmGoodsNowProduction parm); + + int UpdateWmGoodsNowProduction(WmGoodsNowProduction parm); + + } +} diff --git a/ZR.Service/mes/wms/WmGoodsNowProductionService.cs b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs new file mode 100644 index 00000000..e6014436 --- /dev/null +++ b/ZR.Service/mes/wms/WmGoodsNowProductionService.cs @@ -0,0 +1,89 @@ +using System; +using SqlSugar; +using Infrastructure.Attribute; +using Infrastructure.Extensions; +using ZR.Model; +using ZR.Repository; +using ZR.Service.Business.IBusinessService; +using System.Linq; +using ZR.Model.MES.wms; +using ZR.Model.MES.wms.Dto; + +namespace ZR.Service.Business +{ + /// + /// 成品库当前货物表Service业务层处理 + /// + [AppService(ServiceType = typeof(IWmGoodsNowProductionService), ServiceLifetime = LifeTime.Transient)] + public class WmGoodsNowProductionService : BaseService, IWmGoodsNowProductionService + { + /// + /// 查询成品库当前货物表列表 + /// + /// + /// + public PagedInfo GetList(WmGoodsNowProductionQueryDto parm) + { + var predicate = Expressionable.Create(); + + var response = Queryable() + .Where(predicate.ToExpression()) + .ToPage(parm); + + return response; + } + + + /// + /// 获取详情 + /// + /// + /// + public WmGoodsNowProduction GetInfo(string Id) + { + var response = Queryable() + .Where(x => x.Id == Id) + .First(); + + return response; + } + + /// + /// 添加成品库当前货物表 + /// + /// + /// + public WmGoodsNowProduction AddWmGoodsNowProduction(WmGoodsNowProduction model) + { + return Context.Insertable(model).ExecuteReturnEntity(); + } + + /// + /// 修改成品库当前货物表 + /// + /// + /// + public int UpdateWmGoodsNowProduction(WmGoodsNowProduction model) + { + //var response = Update(w => w.Id == model.Id, it => new WmGoodsNowProduction() + //{ + // PackageCode = model.PackageCode, + // PackageCodeClient = model.PackageCodeClient, + // PackageCodeOriginal = model.PackageCodeOriginal, + // LocationCode = model.LocationCode, + // Partnumber = model.Partnumber, + // GoodsNumLogic = model.GoodsNumLogic, + // GoodsNumAction = model.GoodsNumAction, + // EntryWarehouseTime = model.EntryWarehouseTime, + // Remark = model.Remark, + // UpdatedBy = model.UpdatedBy, + // UpdatedTime = model.UpdatedTime, + // CreatedBy = model.CreatedBy, + // CreatedTime = model.CreatedTime, + //}); + //return response; + return Update(model, true); + } + + } +} \ No newline at end of file