入库检验
This commit is contained in:
@@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
[Verify]
|
||||||
|
[Route("/mes/wm/WmFgentryInspect")]
|
||||||
|
public class WmFgentryInspectController : BaseController
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验接口
|
||||||
|
/// </summary>
|
||||||
|
private readonly IWmFgentryInspectService _WmFgentryInspectService;
|
||||||
|
|
||||||
|
public WmFgentryInspectController(IWmFgentryInspectService WmFgentryInspectService)
|
||||||
|
{
|
||||||
|
_WmFgentryInspectService = WmFgentryInspectService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询成品入库检验列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("list")]
|
||||||
|
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:list")]
|
||||||
|
public IActionResult QueryWmFgentryInspect([FromQuery] WmFgentryInspectQueryDto parm)
|
||||||
|
{
|
||||||
|
var response = _WmFgentryInspectService.GetList(parm);
|
||||||
|
return SUCCESS(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询成品入库检验详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("{Id}")]
|
||||||
|
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:query")]
|
||||||
|
public IActionResult GetWmFgentryInspect(int Id)
|
||||||
|
{
|
||||||
|
var response = _WmFgentryInspectService.GetInfo(Id);
|
||||||
|
|
||||||
|
var info = response.Adapt<WmFgentryInspect>();
|
||||||
|
return SUCCESS(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:add")]
|
||||||
|
[Log(Title = "成品入库检验", BusinessType = BusinessType.INSERT)]
|
||||||
|
public IActionResult AddWmFgentryInspect([FromBody] WmFgentryInspectDto parm)
|
||||||
|
{
|
||||||
|
var modal = parm.Adapt<WmFgentryInspect>().ToCreate(HttpContext);
|
||||||
|
|
||||||
|
var response = _WmFgentryInspectService.AddWmFgentryInspect(modal);
|
||||||
|
|
||||||
|
return SUCCESS(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut]
|
||||||
|
[ActionPermissionFilter(Permission = "wmsManagement:wmfgentryinspect:edit")]
|
||||||
|
[Log(Title = "成品入库检验", BusinessType = BusinessType.UPDATE)]
|
||||||
|
public IActionResult UpdateWmFgentryInspect([FromBody] WmFgentryInspectDto parm)
|
||||||
|
{
|
||||||
|
var modal = parm.Adapt<WmFgentryInspect>().ToUpdate(HttpContext);
|
||||||
|
var response = _WmFgentryInspectService.UpdateWmFgentryInspect(modal);
|
||||||
|
|
||||||
|
return ToResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171646022024年报销.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171646022024年报销.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171657562024年报销.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171657562024年报销.xlsx
Normal file
Binary file not shown.
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171702522024年报销.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171702522024年报销.xlsx
Normal file
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171704052024年报销.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/wmmaterial/202404171704052024年报销.xlsx
Normal file
Binary file not shown.
46
ZR.Model/MES/wms/Dto/WmFgentryInspectDto.cs
Normal file
46
ZR.Model/MES/wms/Dto/WmFgentryInspectDto.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace ZR.Model.MES.wms.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验查询对象
|
||||||
|
/// </summary>
|
||||||
|
public class WmFgentryInspectQueryDto : PagerInfo
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验输入输出对象
|
||||||
|
/// </summary>
|
||||||
|
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; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
78
ZR.Model/MES/wms/WmFgentryInspect.cs
Normal file
78
ZR.Model/MES/wms/WmFgentryInspect.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
namespace ZR.Model.MES.wms
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("wm_fgentry_inspect")]
|
||||||
|
public class WmFgentryInspect
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 主键
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工单号
|
||||||
|
/// </summary>
|
||||||
|
public string Workorder { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 箱子号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
|
||||||
|
public string Packcode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工位
|
||||||
|
/// </summary>
|
||||||
|
public string Machine { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 箱子里产品个数
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "production_num")]
|
||||||
|
public int? ProductionNum { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 零件号
|
||||||
|
/// </summary>
|
||||||
|
public string Partnumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否满箱
|
||||||
|
/// </summary>
|
||||||
|
public int? Bfilled { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检验结果(0未检,1合格,2不合格)
|
||||||
|
/// </summary>
|
||||||
|
public int? Result { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "cREATED_BY")]
|
||||||
|
public string CreatedBy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "cREATED_TIME")]
|
||||||
|
public DateTime? CreatedTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新人
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "uPDATED_BY")]
|
||||||
|
public string UpdatedBy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "uPDATED_TIME")]
|
||||||
|
public DateTime? UpdatedTime { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
24
ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs
Normal file
24
ZR.Service/mes/wms/IService/IWmFgentryInspectService.cs
Normal file
@@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验service接口
|
||||||
|
/// </summary>
|
||||||
|
public interface IWmFgentryInspectService : IBaseService<WmFgentryInspect>
|
||||||
|
{
|
||||||
|
PagedInfo<WmFgentryInspectDto> GetList(WmFgentryInspectQueryDto parm);
|
||||||
|
|
||||||
|
WmFgentryInspect GetInfo(int Id);
|
||||||
|
|
||||||
|
WmFgentryInspect AddWmFgentryInspect(WmFgentryInspect parm);
|
||||||
|
|
||||||
|
int UpdateWmFgentryInspect(WmFgentryInspect parm);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
88
ZR.Service/mes/wms/WmFgentryInspectService.cs
Normal file
88
ZR.Service/mes/wms/WmFgentryInspectService.cs
Normal file
@@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 成品入库检验Service业务层处理
|
||||||
|
/// </summary>
|
||||||
|
[AppService(ServiceType = typeof(IWmFgentryInspectService), ServiceLifetime = LifeTime.Transient)]
|
||||||
|
public class WmFgentryInspectService : BaseService<WmFgentryInspect>, IWmFgentryInspectService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 查询成品入库检验列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public PagedInfo<WmFgentryInspectDto> GetList(WmFgentryInspectQueryDto parm)
|
||||||
|
{
|
||||||
|
var predicate = Expressionable.Create<WmFgentryInspect>();
|
||||||
|
|
||||||
|
var response = Queryable()
|
||||||
|
.Where(predicate.ToExpression())
|
||||||
|
.ToPage<WmFgentryInspect, WmFgentryInspectDto>(parm);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public WmFgentryInspect GetInfo(int Id)
|
||||||
|
{
|
||||||
|
var response = Queryable()
|
||||||
|
.Where(x => x.Id == Id)
|
||||||
|
.First();
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public WmFgentryInspect AddWmFgentryInspect(WmFgentryInspect model)
|
||||||
|
{
|
||||||
|
return Context.Insertable(model).ExecuteReturnEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改成品入库检验
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -223,7 +223,6 @@ namespace ZR.Service.mes.wms
|
|||||||
|
|
||||||
List<WmMaterial> materialList = Context.Queryable<WmMaterial>()
|
List<WmMaterial> materialList = Context.Queryable<WmMaterial>()
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
|
|
||||||
.OrderByDescending(it => it.CreatedTime)
|
.OrderByDescending(it => it.CreatedTime)
|
||||||
.ToPageList(parm.PageNum, parm.PageSize, ref total);
|
.ToPageList(parm.PageNum, parm.PageSize, ref total);
|
||||||
|
|
||||||
@@ -251,11 +250,11 @@ namespace ZR.Service.mes.wms
|
|||||||
material_num = material_num + (int)product.GoodsNumLogic;
|
material_num = material_num + (int)product.GoodsNumLogic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (material_num > 0)
|
|
||||||
{
|
|
||||||
wmMaterialQuery_Stock_item.stockQuantity = material_num;
|
wmMaterialQuery_Stock_item.stockQuantity = material_num;
|
||||||
material_stockQuantity_list.Add(wmMaterialQuery_Stock_item);
|
material_stockQuantity_list.Add(wmMaterialQuery_Stock_item);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user