入库管理
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
|
||||
//创建时间:2025-11-14
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("productManagement/ProFinishedProductReceipt")]
|
||||
public class ProFinishedProductReceiptController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)接口
|
||||
/// </summary>
|
||||
private readonly IProFinishedProductReceiptService _ProFinishedProductReceiptService;
|
||||
|
||||
public ProFinishedProductReceiptController(IProFinishedProductReceiptService ProFinishedProductReceiptService)
|
||||
{
|
||||
_ProFinishedProductReceiptService = ProFinishedProductReceiptService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单主表(含产品信息及标签打印状态)列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceipt:list")]
|
||||
public IActionResult QueryProFinishedProductReceipt([FromQuery] ProFinishedProductReceiptQueryDto parm)
|
||||
{
|
||||
var response = _ProFinishedProductReceiptService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单主表(含产品信息及标签打印状态)详情
|
||||
/// </summary>
|
||||
/// <param name="ReceiptNo"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{ReceiptNo}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceipt:query")]
|
||||
public IActionResult GetProFinishedProductReceipt(string ReceiptNo)
|
||||
{
|
||||
var response = _ProFinishedProductReceiptService.GetInfo(ReceiptNo);
|
||||
|
||||
var info = response.Adapt<ProFinishedProductReceipt>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceipt:add")]
|
||||
[Log(Title = "MES成品入库单主表(含产品信息及标签打印状态)", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddProFinishedProductReceipt([FromBody] ProFinishedProductReceiptDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProFinishedProductReceipt>().ToCreate(HttpContext);
|
||||
|
||||
var response = _ProFinishedProductReceiptService.AddProFinishedProductReceipt(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceipt:edit")]
|
||||
[Log(Title = "MES成品入库单主表(含产品信息及标签打印状态)", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateProFinishedProductReceipt([FromBody] ProFinishedProductReceiptDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProFinishedProductReceipt>().ToUpdate(HttpContext);
|
||||
var response = _ProFinishedProductReceiptService.UpdateProFinishedProductReceipt(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceipt:delete")]
|
||||
[Log(Title = "MES成品入库单主表(含产品信息及标签打印状态)", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteProFinishedProductReceipt(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _ProFinishedProductReceiptService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
|
||||
//创建时间:2025-11-14
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("productManagement/ProFinishedProductReceiptLog")]
|
||||
public class ProFinishedProductReceiptLogController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表接口
|
||||
/// </summary>
|
||||
private readonly IProFinishedProductReceiptLogService _ProFinishedProductReceiptLogService;
|
||||
|
||||
public ProFinishedProductReceiptLogController(IProFinishedProductReceiptLogService ProFinishedProductReceiptLogService)
|
||||
{
|
||||
_ProFinishedProductReceiptLogService = ProFinishedProductReceiptLogService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单操作日志表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceiptlog:list")]
|
||||
public IActionResult QueryProFinishedProductReceiptLog([FromQuery] ProFinishedProductReceiptLogQueryDto parm)
|
||||
{
|
||||
var response = _ProFinishedProductReceiptLogService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单操作日志表详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceiptlog:query")]
|
||||
public IActionResult GetProFinishedProductReceiptLog(long Id)
|
||||
{
|
||||
var response = _ProFinishedProductReceiptLogService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<ProFinishedProductReceiptLog>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceiptlog:add")]
|
||||
[Log(Title = "MES成品入库单操作日志表", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddProFinishedProductReceiptLog([FromBody] ProFinishedProductReceiptLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProFinishedProductReceiptLog>().ToCreate(HttpContext);
|
||||
|
||||
var response = _ProFinishedProductReceiptLogService.AddProFinishedProductReceiptLog(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceiptlog:edit")]
|
||||
[Log(Title = "MES成品入库单操作日志表", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateProFinishedProductReceiptLog([FromBody] ProFinishedProductReceiptLogDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<ProFinishedProductReceiptLog>().ToUpdate(HttpContext);
|
||||
var response = _ProFinishedProductReceiptLogService.UpdateProFinishedProductReceiptLog(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "productManagement:profinishedproductreceiptlog:delete")]
|
||||
[Log(Title = "MES成品入库单操作日志表", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteProFinishedProductReceiptLog(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _ProFinishedProductReceiptLogService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<key id="e60ed214-33d1-4b35-aa1e-d8d5f9423f06" version="1">
|
||||
<creationDate>2025-11-14T02:49:12.7305702Z</creationDate>
|
||||
<activationDate>2025-11-14T02:49:12.6652806Z</activationDate>
|
||||
<expirationDate>2026-02-12T02:49:12.6652806Z</expirationDate>
|
||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||
<descriptor>
|
||||
<encryption algorithm="AES_256_CBC" />
|
||||
<validation algorithm="HMACSHA256" />
|
||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||
<!-- Warning: the key below is in an unencrypted form. -->
|
||||
<value>+yuBV7XpvuKsyiwxbcTT5sL3f+rT2wOrOh14Tycwnk485eHhYsRPaLzosQaivCvSCEK+lOwkOPg+CQrr/bdO3g==</value>
|
||||
</masterKey>
|
||||
</descriptor>
|
||||
</descriptor>
|
||||
</key>
|
||||
Binary file not shown.
Binary file not shown.
109
ZR.Model/MES/pro/DTO/ProFinishedProductReceiptDto.cs
Normal file
109
ZR.Model/MES/pro/DTO/ProFinishedProductReceiptDto.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)查询对象
|
||||
/// </summary>
|
||||
public class ProFinishedProductReceiptQueryDto : PagerInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库类型
|
||||
/// </summary>
|
||||
public string ReceiptType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)输入输出对象
|
||||
/// </summary>
|
||||
public class ProFinishedProductReceiptDto
|
||||
{
|
||||
[Required(ErrorMessage = "入库单号(主键,规则:RCP+日期+流水号,如RCP20251112001)不能为空")]
|
||||
public string ReceiptNo { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "入库日期不能为空")]
|
||||
public DateTime? ReceiptDate { get; set; }
|
||||
|
||||
public string SiteNo { get; set; }
|
||||
|
||||
public string WorkOrder { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "仓库编码(关联仓库表)不能为空")]
|
||||
public string WarehouseCode { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "入库类型:NORMAL-正常入库;REWORK-返工入库;RETURN-客户退货;OTHER-其他不能为空")]
|
||||
public string ReceiptType { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "单据状态:DRAFT-草稿;SUBMITTED-已提交;APPROVED-已审核;CANCELED-已取消不能为空")]
|
||||
public string Status { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "产品编号(对应JSON中的PartNumber,如5615101DSV0000B96)不能为空")]
|
||||
public string PartNumber { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "产品名称(对应JSON中的Description,如A58左后门把手-手动版-幻彩银)不能为空")]
|
||||
public string Description { get; set; }
|
||||
|
||||
public string Color { get; set; }
|
||||
|
||||
public string Specification { get; set; }
|
||||
|
||||
public string ProductionLine { get; set; }
|
||||
|
||||
public string Team { get; set; }
|
||||
|
||||
public string ShiftNo { get; set; }
|
||||
|
||||
public string LabelFrom { get; set; }
|
||||
|
||||
public DateTime? ProductionTime { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "批次编码(对应JSON中的BatchCode,如20251016)不能为空")]
|
||||
public string BatchCode { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "计量单位(如个、箱、台)不能为空")]
|
||||
public string Unit { get; set; }
|
||||
|
||||
public string PackageCode { get; set; }
|
||||
|
||||
public int? PackageCount { get; set; }
|
||||
|
||||
public int? PackageNum { get; set; }
|
||||
|
||||
public string LabelCode { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "标签打印状态:UNPRINTED-未打印;PRINTED-已打印不能为空")]
|
||||
public string LabelPrintStatus { get; set; }
|
||||
|
||||
public string StorageLocation { get; set; }
|
||||
|
||||
public string QcStatus { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "创建人(用户ID)不能为空")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "创建时间(对应JSON中的CreatedTime)不能为空")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
public string ApprovedBy { get; set; }
|
||||
|
||||
public DateTime? ApprovedTime { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
45
ZR.Model/MES/pro/DTO/ProFinishedProductReceiptLogDto.cs
Normal file
45
ZR.Model/MES/pro/DTO/ProFinishedProductReceiptLogDto.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace ZR.Model.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表查询对象
|
||||
/// </summary>
|
||||
public class ProFinishedProductReceiptLogQueryDto : PagerInfo
|
||||
{
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表输入输出对象
|
||||
/// </summary>
|
||||
public class ProFinishedProductReceiptLogDto
|
||||
{
|
||||
[Required(ErrorMessage = "自增主键不能为空")]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "关联入库单号不能为空")]
|
||||
public string ReceiptNo { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "操作人(用户ID)不能为空")]
|
||||
public string OperatedBy { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "操作时间不能为空")]
|
||||
public DateTime? OperatedTime { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "操作类型:CREATE-创建;UPDATE-修改;APPROVE-审核;CANCEL-取消;PRINT_LABEL-打印标签;OTHER-其他不能为空")]
|
||||
public string OperationType { get; set; }
|
||||
|
||||
public string OperationContent { get; set; }
|
||||
|
||||
public string OperationResult { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
196
ZR.Model/MES/pro/ProFinishedProductReceipt.cs
Normal file
196
ZR.Model/MES/pro/ProFinishedProductReceipt.cs
Normal file
@@ -0,0 +1,196 @@
|
||||
|
||||
namespace ZR.Model.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
[SugarTable("pro_finished_product_receipt")]
|
||||
public class ProFinishedProductReceipt
|
||||
{
|
||||
/// <summary>
|
||||
/// 入库单号(主键,规则:RCP+日期+流水号,如RCP20251112001)
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "receipt_no")]
|
||||
public string ReceiptNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库日期
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "receipt_date")]
|
||||
public DateTime? ReceiptDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 站点编号(对应JSON中的SiteNo)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "site_no")]
|
||||
public string SiteNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产工单号(对应JSON中的WorkOrder)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "work_order")]
|
||||
public string WorkOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库编码(关联仓库表)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "warehouse_code")]
|
||||
public string WarehouseCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 入库类型:NORMAL-正常入库;REWORK-返工入库;RETURN-客户退货;OTHER-其他
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "receipt_type")]
|
||||
public string ReceiptType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单据状态:DRAFT-草稿;SUBMITTED-已提交;APPROVED-已审核;CANCELED-已取消
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品编号(对应JSON中的PartNumber,如5615101DSV0000B96)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "part_number")]
|
||||
public string PartNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称(对应JSON中的Description,如A58左后门把手-手动版-幻彩银)
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 颜色(对应JSON中的Color,如幻彩银)
|
||||
/// </summary>
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格型号(对应JSON中的Specification,如手动版)
|
||||
/// </summary>
|
||||
public string Specification { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产线
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "production_line")]
|
||||
public string ProductionLine { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班组(对应JSON中的Team,如B班)
|
||||
/// </summary>
|
||||
public string Team { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班次(如早班/中班/晚班)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "shift_no")]
|
||||
public string ShiftNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签来源(对应JSON中的LabelFrom,如后道)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "label_from")]
|
||||
public string LabelFrom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产时间(对应JSON中的ProductionTime)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "production_time")]
|
||||
public DateTime? ProductionTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次编码(对应JSON中的BatchCode,如20251016)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "batch_code")]
|
||||
public string BatchCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计量单位(如个、箱、台)
|
||||
/// </summary>
|
||||
public string Unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 包装编码(对应JSON中的PackageCode,如BNW20240401_001)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "package_code")]
|
||||
public string PackageCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 包装数量(对应JSON中的PackageCout,如1)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "package_count")]
|
||||
public int? PackageCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 每包数量(对应JSON中的PackageNum,如24)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "package_num")]
|
||||
public int? PackageNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签编码(对应JSON中的LabelCode,如60102853-Y73-01/2025040811//)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "label_code")]
|
||||
public string LabelCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标签打印状态:UNPRINTED-未打印;PRINTED-已打印
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "label_print_status")]
|
||||
public string LabelPrintStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 存储库位(如A区-1货架-01层)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "storage_location")]
|
||||
public string StorageLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质检状态:PENDING-待检;QUALIFIED-合格;UNQUALIFIED-不合格
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "qc_status")]
|
||||
public string QcStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人(用户ID)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_by")]
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间(对应JSON中的CreatedTime)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "created_time")]
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新人(用户ID)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_by")]
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核人(用户ID)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "approved_by")]
|
||||
public string ApprovedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 审核时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "approved_time")]
|
||||
public DateTime? ApprovedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注信息
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
58
ZR.Model/MES/pro/ProFinishedProductReceiptLog.cs
Normal file
58
ZR.Model/MES/pro/ProFinishedProductReceiptLog.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
namespace ZR.Model.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
[SugarTable("pro_finished_product_receipt_log")]
|
||||
public class ProFinishedProductReceiptLog
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关联入库单号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "receipt_no")]
|
||||
public string ReceiptNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作人(用户ID)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operated_by")]
|
||||
public string OperatedBy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operated_time")]
|
||||
public DateTime? OperatedTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型:CREATE-创建;UPDATE-修改;APPROVE-审核;CANCEL-取消;PRINT_LABEL-打印标签;OTHER-其他
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_type")]
|
||||
public string OperationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作内容(如“标签打印成功,编码:XXX”)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_content")]
|
||||
public string OperationContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作结果:SUCCESS-成功;FAIL-失败
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "operation_result")]
|
||||
public string OperationResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Service.Business.IBusinessService
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表service接口
|
||||
/// </summary>
|
||||
public interface IProFinishedProductReceiptLogService : IBaseService<ProFinishedProductReceiptLog>
|
||||
{
|
||||
PagedInfo<ProFinishedProductReceiptLogDto> GetList(ProFinishedProductReceiptLogQueryDto parm);
|
||||
|
||||
ProFinishedProductReceiptLog GetInfo(long Id);
|
||||
|
||||
ProFinishedProductReceiptLog AddProFinishedProductReceiptLog(ProFinishedProductReceiptLog parm);
|
||||
|
||||
int UpdateProFinishedProductReceiptLog(ProFinishedProductReceiptLog parm);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Service.Business.IBusinessService
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)service接口
|
||||
/// </summary>
|
||||
public interface IProFinishedProductReceiptService : IBaseService<ProFinishedProductReceipt>
|
||||
{
|
||||
PagedInfo<ProFinishedProductReceiptDto> GetList(ProFinishedProductReceiptQueryDto parm);
|
||||
|
||||
ProFinishedProductReceipt GetInfo(string ReceiptNo);
|
||||
|
||||
ProFinishedProductReceipt AddProFinishedProductReceipt(ProFinishedProductReceipt parm);
|
||||
|
||||
int UpdateProFinishedProductReceipt(ProFinishedProductReceipt parm);
|
||||
|
||||
}
|
||||
}
|
||||
83
ZR.Service/mes/pro/ProFinishedProductReceiptLogService.cs
Normal file
83
ZR.Service/mes/pro/ProFinishedProductReceiptLogService.cs
Normal file
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using SqlSugar;
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Model.Business;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using System.Linq;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单操作日志表Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProFinishedProductReceiptLogService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProFinishedProductReceiptLogService : BaseService<ProFinishedProductReceiptLog>, IProFinishedProductReceiptLogService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单操作日志表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<ProFinishedProductReceiptLogDto> GetList(ProFinishedProductReceiptLogQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProFinishedProductReceiptLog>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<ProFinishedProductReceiptLog, ProFinishedProductReceiptLogDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public ProFinishedProductReceiptLog GetInfo(long Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public ProFinishedProductReceiptLog AddProFinishedProductReceiptLog(ProFinishedProductReceiptLog model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改MES成品入库单操作日志表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateProFinishedProductReceiptLog(ProFinishedProductReceiptLog model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new ProFinishedProductReceiptLog()
|
||||
//{
|
||||
// ReceiptNo = model.ReceiptNo,
|
||||
// OperatedBy = model.OperatedBy,
|
||||
// OperatedTime = model.OperatedTime,
|
||||
// OperationType = model.OperationType,
|
||||
// OperationContent = model.OperationContent,
|
||||
// OperationResult = model.OperationResult,
|
||||
// Remark = model.Remark,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
153
ZR.Service/mes/pro/ProFinishedProductReceiptService.cs
Normal file
153
ZR.Service/mes/pro/ProFinishedProductReceiptService.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using Infrastructure.Attribute;
|
||||
using Infrastructure.Extensions;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ZR.Model;
|
||||
using ZR.Model.Business;
|
||||
using ZR.Model.Dto;
|
||||
using ZR.Repository;
|
||||
using ZR.Service.Business.IBusinessService;
|
||||
using ZR.Service.System.IService;
|
||||
|
||||
namespace ZR.Service.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// MES成品入库单主表(含产品信息及标签打印状态)Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IProFinishedProductReceiptService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class ProFinishedProductReceiptService : BaseService<ProFinishedProductReceipt>, IProFinishedProductReceiptService
|
||||
{
|
||||
private readonly IProFinishedProductReceiptLogService _receiptLogService;
|
||||
|
||||
/// <summary>
|
||||
/// 查询MES成品入库单主表(含产品信息及标签打印状态)列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<ProFinishedProductReceiptDto> GetList(ProFinishedProductReceiptQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<ProFinishedProductReceipt>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.ReceiptType), r => r.ReceiptType.Contains(parm.ReceiptType))
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Status), r => r.Status.Contains(parm.Status))
|
||||
.AndIF(parm.StartTime != null, r => r.CreatedTime >= parm.StartTime)
|
||||
.AndIF(parm.EndTime != null, r => r.CreatedTime <= parm.EndTime);
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<ProFinishedProductReceipt, ProFinishedProductReceiptDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="ReceiptNo"></param>
|
||||
/// <returns></returns>
|
||||
public ProFinishedProductReceipt GetInfo(string ReceiptNo)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.ReceiptNo == ReceiptNo)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public ProFinishedProductReceipt AddProFinishedProductReceipt(ProFinishedProductReceipt model)
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
model.CreatedTime = DateTime.Now;
|
||||
var insertedModel = Context.Insertable(model).ExecuteReturnEntity();
|
||||
|
||||
if (insertedModel != null && !string.IsNullOrEmpty(insertedModel.ReceiptNo))
|
||||
{
|
||||
_receiptLogService.AddProFinishedProductReceiptLog(
|
||||
new ProFinishedProductReceiptLog
|
||||
{
|
||||
ReceiptNo = model.ReceiptNo,
|
||||
OperatedBy = "",
|
||||
OperatedTime = DateTime.Now,
|
||||
OperationType = "CREATE",
|
||||
OperationContent = "入库单创建成功",
|
||||
OperationResult = "SUCCESS",
|
||||
Remark = ""
|
||||
});
|
||||
return insertedModel;
|
||||
} else
|
||||
{
|
||||
throw new Exception("入库单插入失败");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_receiptLogService.AddProFinishedProductReceiptLog(
|
||||
new ProFinishedProductReceiptLog
|
||||
{
|
||||
ReceiptNo = model.ReceiptNo,
|
||||
OperatedBy = "",
|
||||
OperatedTime = DateTime.Now,
|
||||
OperationType = "CREATE",
|
||||
OperationContent = "入库单创建失败",
|
||||
OperationResult = "FAIL",
|
||||
Remark = ""
|
||||
});
|
||||
throw new Exception($"添加成品入库单失败:{ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改MES成品入库单主表(含产品信息及标签打印状态)
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateProFinishedProductReceipt(ProFinishedProductReceipt model)
|
||||
{
|
||||
//var response = Update(w => w.ReceiptNo == model.ReceiptNo, it => new ProFinishedProductReceipt()
|
||||
//{
|
||||
// ReceiptDate = model.ReceiptDate,
|
||||
// SiteNo = model.SiteNo,
|
||||
// WorkOrder = model.WorkOrder,
|
||||
// WarehouseCode = model.WarehouseCode,
|
||||
// ReceiptType = model.ReceiptType,
|
||||
// Status = model.Status,
|
||||
// PartNumber = model.PartNumber,
|
||||
// Description = model.Description,
|
||||
// Color = model.Color,
|
||||
// Specification = model.Specification,
|
||||
// ProductionLine = model.ProductionLine,
|
||||
// Team = model.Team,
|
||||
// ShiftNo = model.ShiftNo,
|
||||
// LabelFrom = model.LabelFrom,
|
||||
// ProductionTime = model.ProductionTime,
|
||||
// BatchCode = model.BatchCode,
|
||||
// Unit = model.Unit,
|
||||
// PackageCode = model.PackageCode,
|
||||
// PackageCount = model.PackageCount,
|
||||
// PackageNum = model.PackageNum,
|
||||
// LabelCode = model.LabelCode,
|
||||
// LabelPrintStatus = model.LabelPrintStatus,
|
||||
// StorageLocation = model.StorageLocation,
|
||||
// QcStatus = model.QcStatus,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
// ApprovedBy = model.ApprovedBy,
|
||||
// ApprovedTime = model.ApprovedTime,
|
||||
// Remark = model.Remark,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user