From 6346490cad95332cebf71e84dc2e439165011475 Mon Sep 17 00:00:00 2001 From: liuwf Date: Mon, 2 Sep 2024 16:01:10 +0800 Subject: [PATCH] =?UTF-8?q?add-=E7=94=9F=E6=88=90=E5=A4=A7=E6=9D=A1?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E5=AE=8C=E5=96=84=E8=AE=A1=E5=88=92=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.Business/ProdCompletionBusiness.cs | 9 +- .../domain/MesProductPlanDetail.cs | 140 ++++++++++++++++++ 2 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 SlnMesnac.Model/domain/MesProductPlanDetail.cs diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs index d96cca2..ce7b532 100644 --- a/SlnMesnac.Business/ProdCompletionBusiness.cs +++ b/SlnMesnac.Business/ProdCompletionBusiness.cs @@ -72,12 +72,12 @@ namespace SlnMesnac.Business _mesProductOrderService = serviceProvider.GetRequiredService(); _baseMaterialInfoService = serviceProvider.GetRequiredService(); Init(); - + } private void test() { - + // MesProductPlanDetail? mesProductPlanDetail = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().First(x => x.PlanCode == "20240724144533JL001"); string epc = "A123456"; _mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto); string bigCode = GenerateBigBarcode(productPlanDto, epc); @@ -316,6 +316,11 @@ namespace SlnMesnac.Business mesBaseBarcodeInfo.productionDate = DateTime.Now; mesBaseBarcodeInfo.acceptedDate = DateTime.Now; mesBaseBarcodeInfo.planCode = productPlanDto.PlanCode; + MesProductPlanDetail? mesProductPlanDetail = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().First(x=>x.PlanCode== productPlanDto.PlanCode); + if(mesProductPlanDetail != null) + { + mesBaseBarcodeInfo.planDetailCode = mesProductPlanDetail.PlanDetailCode; + } mesBaseBarcodeInfo.safeFlag = productPlanDto.SaleOrderId == 0 ? "1" : "0"; mesBaseBarcodeInfo.saleOrderId = productPlanDto.SaleOrderId; mesBaseBarcodeInfo.saleorderCode = productPlanDto.SaleorderCode; diff --git a/SlnMesnac.Model/domain/MesProductPlanDetail.cs b/SlnMesnac.Model/domain/MesProductPlanDetail.cs new file mode 100644 index 0000000..53789b6 --- /dev/null +++ b/SlnMesnac.Model/domain/MesProductPlanDetail.cs @@ -0,0 +1,140 @@ +using SlnMesnac.Model.enums; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Text; + +#region << 版 本 注 释 >> +/*-------------------------------------------------------------------- +* 版权所有 (c) 2024 WenJY 保留所有权利。 +* CLR版本:4.0.30319.42000 +* 机器名称:LAPTOP-E0N2L34V +* 命名空间:SlnMesnac.Model.domain +* 唯一标识:15806f20-59dd-494f-90ed-add2b6f0a0a1 +* +* 创建者:WenJY +* 电子邮箱:wenjy@mesnac.com +* 创建时间:2024-04-07 16:55:41 +* 版本:V1.0.0 +* 描述: +* +*-------------------------------------------------------------------- +* 修改人: +* 时间: +* 修改说明: +* +* 版本:V1.0.0 +*--------------------------------------------------------------------*/ +#endregion << 版 本 注 释 >> +namespace SlnMesnac.Model.domain +{ + /// + /// 生产计划明细;车间生产派工 + /// + [SugarTable("mes_product_plan_detail")] + public class MesProductPlanDetail + { + /// + /// 主键标识 + /// + [SugarColumn(ColumnName = "plan_detail_id", IsPrimaryKey = true, IsIdentity = true)] + public long PlanDetailId { get; set; } + + /// + /// 明细编号 + /// + [SugarColumn(ColumnName = "plan_detail_code")] + public string PlanDetailCode { get; set; } + + /// + /// 生产计划ID + /// + [SugarColumn(ColumnName = "plan_id")] + public long PlanId { get; set; } + + /// + /// 计划编号, 关联mes_product_plan_info的plan_code + /// + [SugarColumn(ColumnName = "plan_code")] + public string PlanCode { get; set; } + + /// + /// 操作人员ID,关联sys_user的user_id + /// + [SugarColumn(ColumnName = "user_id")] + public long? UserId { get; set; } + + /// + /// 操作人员名称,关联sys_user的user_name + /// + [SugarColumn(ColumnName = "user_name")] + public string UserName { get; set; } + + /// + /// 开始时间 + /// + [SugarColumn(ColumnName = "real_begin_time")] + public DateTime? RealBeginTime { get; set; } + + /// + /// 完成时间 + /// + [SugarColumn(ColumnName = "real_end_time")] + public DateTime? RealEndTime { get; set; } + + /// + /// 文件ID,关联附件信息主键 + /// + [SugarColumn(ColumnName = "attach_id")] + public int? AttachId { get; set; } + + /// + /// 明细状态:1-未开始;2-已开始;3-已完成;9-异常完成 + /// + [SugarColumn(ColumnName = "plan_detail_status")] + public string PlanDetailStatus { get; set; } + + /// + /// 是否标识:1-是;0-否 + /// + [SugarColumn(ColumnName = "is_flag")] + public string IsFlag { get; set; } + + /// + /// 备注 + /// + [SugarColumn(ColumnName = "remark")] + public string Remark { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "create_by")] + public string CreateBy { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "create_time")] + public DateTime? CreateTime { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "update_by")] + public string UpdateBy { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "update_time")] + public DateTime? UpdateTime { get; set; } + + /// + /// 物料条码 + /// + [SugarColumn(ColumnName = "material_barcode")] + public string MaterialBarcode { get; set; } + } + +}