重新组织目录
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Dto.WorkOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单排产输入参数
|
||||
/// </summary>
|
||||
public class ProductionSchedulingCrInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产任务主键Id
|
||||
/// </summary>
|
||||
public string? Id { get; set; }
|
||||
/// <summary>
|
||||
/// 工单类型 1、注塑/挤出 2、组装/包装
|
||||
/// </summary>
|
||||
public int MoType { get; set; }
|
||||
/// <summary>
|
||||
/// 工单Id
|
||||
/// </summary>
|
||||
public int MoId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品编号
|
||||
/// </summary>
|
||||
public string ItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
public string ItemName { get; set; }
|
||||
|
||||
#region 注塑工单
|
||||
/// <summary>
|
||||
/// 模具Id
|
||||
/// </summary>
|
||||
public string MoldId { get; set; }
|
||||
/// <summary>
|
||||
/// 模具名称
|
||||
/// </summary>
|
||||
public string MoldName { get; set; }
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// </summary>
|
||||
public string EqpId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public string EqpName { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 组装包装工单
|
||||
/// <summary>
|
||||
/// 产线编号
|
||||
/// </summary>
|
||||
public string LineId { get; set; }
|
||||
/// <summary>
|
||||
/// 产线名称
|
||||
/// </summary>
|
||||
public string LineName { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单下发输入参数
|
||||
/// </summary>
|
||||
public class WorkOrderIssueCrInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产工单Id列表
|
||||
/// </summary>
|
||||
public List<string> WorkOrderIds { get; set; }
|
||||
}
|
||||
}
|
||||
142
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/MoldsEntity.cs
Normal file
142
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/MoldsEntity.cs
Normal file
@@ -0,0 +1,142 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 模具信息表
|
||||
///</summary>
|
||||
[SugarTable("tool_molds")]
|
||||
public class MoldsEntity : BaseEntity<string>
|
||||
{
|
||||
///// <summary>
|
||||
///// 主键
|
||||
/////</summary>
|
||||
// [SugarColumn(ColumnName="id" ,IsPrimaryKey = true )]
|
||||
// public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_code")]
|
||||
public string MoldCode { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具名称
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_name")]
|
||||
public string MoldName { get; set; }
|
||||
/// <summary>
|
||||
/// 产品代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_id")]
|
||||
public string ItemId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "eqp_id")]
|
||||
public string EqpId { get; set; }
|
||||
/// <summary>
|
||||
/// 设备代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "eqp_code")]
|
||||
public string EqpCode { get; set; }
|
||||
/// <summary>
|
||||
/// 生产模数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "production_modulus")]
|
||||
public int? ProductionModulus { get; set; }
|
||||
/// <summary>
|
||||
/// 保养模次
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "maintain_num")]
|
||||
public int? MaintainNum { get; set; }
|
||||
/// <summary>
|
||||
/// 磨具使用状态
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_status")]
|
||||
public string MoldStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 日定额
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "daily_rate")]
|
||||
public decimal? DailyRate { get; set; }
|
||||
/// <summary>
|
||||
/// 工时定额(H/PCS)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "hour_norm")]
|
||||
public decimal? HourNorm { get; set; }
|
||||
/// <summary>
|
||||
/// 成长周期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "growth_cycle")]
|
||||
public int? GrowthCycle { get; set; }
|
||||
/// <summary>
|
||||
/// 型腔数
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "cavity_num")]
|
||||
public int? CavityNum { get; set; }
|
||||
/// <summary>
|
||||
/// 模具寿命
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_life")]
|
||||
public int? MoldLife { get; set; }
|
||||
/// <summary>
|
||||
/// 模具剩余寿命
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mold_remaining_life")]
|
||||
public string MoldRemainingLife { get; set; }
|
||||
/// <summary>
|
||||
/// 库房编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "warehosue_id")]
|
||||
public string WarehosueId { get; set; }
|
||||
/// <summary>
|
||||
/// 库位编号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "location_id")]
|
||||
public string LocationId { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_id")]
|
||||
public string CreateId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_id")]
|
||||
public string ModifyId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_time")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "extras")]
|
||||
public string Extras { get; set; }
|
||||
}
|
||||
}
|
||||
239
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMoEntity.cs
Normal file
239
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdMoEntity.cs
Normal file
@@ -0,0 +1,239 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// MES生产工单
|
||||
///</summary>
|
||||
[SugarTable("prd_mo")]
|
||||
public class PrdMoEntity : BaseEntity<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "tenant_id")]
|
||||
public string TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 所属组织ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "org_id")]
|
||||
public string OrgId { get; set; }
|
||||
/// <summary>
|
||||
/// 工单代码
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_code")]
|
||||
public string MoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 产品代码, BAS_MATERIA.MATERIALCODE BAS_ITEM.ITEMCODE
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_code")]
|
||||
public string ItemCode { get; set; }
|
||||
/// <summary>
|
||||
/// 产品附属信息
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "item_attribute")]
|
||||
public string ItemAttribute { get; set; }
|
||||
/// <summary>
|
||||
/// 工单类型:1-正常工单、2-返工工单、3-试制工单
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_type")]
|
||||
public string MoType { get; set; }
|
||||
/// <summary>
|
||||
/// 生产状态 Initial: 初始, Confirm:确认 Release: 下发, Open: 生产中, Close: 关单, Pending: 暂停
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_status")]
|
||||
public string MoStatus { get; set; }
|
||||
/// <summary>
|
||||
/// 生产数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_qty")]
|
||||
public decimal PlanQty { get; set; }
|
||||
/// <summary>
|
||||
/// 已投入数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "input_qty")]
|
||||
public decimal? InputQty { get; set; }
|
||||
/// <summary>
|
||||
/// 已完工数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "complete_qty")]
|
||||
public decimal? CompleteQty { get; set; }
|
||||
/// <summary>
|
||||
/// 报废数量
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "scrap_qty")]
|
||||
public decimal? ScrapQty { get; set; }
|
||||
/// <summary>
|
||||
/// 计划开始时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_start_date")]
|
||||
public DateTime PlanStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 计划结束时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "plan_end_date")]
|
||||
public DateTime PlanEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 实际开工日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "act_start_date")]
|
||||
public DateTime? ActStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 实际完工日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "act_end_date")]
|
||||
public DateTime? ActEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 生产部门ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "dept_id")]
|
||||
public string DeptId { get; set; }
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "customer_code")]
|
||||
public string CustomerCode { get; set; }
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "order_no")]
|
||||
public string OrderNo { get; set; }
|
||||
/// <summary>
|
||||
/// 订单行号
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "order_seq")]
|
||||
public int? OrderSeq { get; set; }
|
||||
/// <summary>
|
||||
/// BOM版本
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "bom_version")]
|
||||
public string BomVersion { get; set; }
|
||||
/// <summary>
|
||||
/// 关联比例
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "relation_ratio")]
|
||||
public decimal? RelationRatio { get; set; }
|
||||
/// <summary>
|
||||
/// 下发人员ID
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_user_id")]
|
||||
public string MoDownUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 下发人员名称
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_user_name")]
|
||||
public string MoDownUserName { get; set; }
|
||||
/// <summary>
|
||||
/// 下发日期
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "mo_down_date")]
|
||||
public DateTime? MoDownDate { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string Remark { get; set; }
|
||||
/// <summary>
|
||||
/// 工作中心代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "work_center_code")]
|
||||
public string WorkCenterCode { get; set; }
|
||||
/// <summary>
|
||||
/// 主工单代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "parent_mo_code")]
|
||||
public string ParentMoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 排程开始时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seduling_start_date")]
|
||||
public DateTime? SedulingStartDate { get; set; }
|
||||
/// <summary>
|
||||
/// 排程结束时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seduling_end_date")]
|
||||
public DateTime? SedulingEndDate { get; set; }
|
||||
/// <summary>
|
||||
/// 是否生派工单
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "is_create_dispatch")]
|
||||
public int? IsCreateDispatch { get; set; }
|
||||
/// <summary>
|
||||
/// 子工单序号(1开始,最大+1,不强制连续)
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "seq")]
|
||||
public int? Seq { get; set; }
|
||||
/// <summary>
|
||||
/// 数据来源 10-计划,20-插入,30-导入
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "data_sources")]
|
||||
public string DataSources { get; set; }
|
||||
/// <summary>
|
||||
/// 产线代码
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "production_linecode")]
|
||||
public string ProductionLinecode { get; set; }
|
||||
/// <summary>
|
||||
/// ismerge
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "is_merge")]
|
||||
public int? IsMerge { get; set; }
|
||||
/// <summary>
|
||||
/// 组合工单
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "combine_mo_code")]
|
||||
public string CombineMoCode { get; set; }
|
||||
/// <summary>
|
||||
/// 时间戳
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "time_stamp")]
|
||||
public string TimeStamp { get; set; }
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_id")]
|
||||
public string CreateId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// 默认值: NULL::character varying
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_id")]
|
||||
public string ModifyId { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "modify_time")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 扩展字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "extras")]
|
||||
public string Extras { get; set; }
|
||||
}
|
||||
}
|
||||
203
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs
Normal file
203
ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs
Normal file
@@ -0,0 +1,203 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||
{
|
||||
///<summary>
|
||||
///生产任务信息
|
||||
///</summary>
|
||||
[SugarTable("prd_task")]
|
||||
public partial class PrdTask
|
||||
{
|
||||
public PrdTask(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:主键
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true,ColumnName="id")]
|
||||
public string Id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单类型 1、注塑/挤出工单 2、组装/包装工单
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_type")]
|
||||
public int? MoType {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:计划开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="plan_start_date")]
|
||||
public DateTime? PlanStartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:计划结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="plan_end_date")]
|
||||
public DateTime? PlanEndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:预计开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="estimated_start_date")]
|
||||
public DateTime? EstimatedStartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:预计结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="estimated_end_date")]
|
||||
public DateTime? EstimatedEndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际开工时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="start_date")]
|
||||
public DateTime? StartDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际完工时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="end_date")]
|
||||
public DateTime? EndDate {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="create_time")]
|
||||
public DateTime? CreateTime {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="modify_time")]
|
||||
public DateTime? ModifyTime {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:扩展字段
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="extras")]
|
||||
public string Extras {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_id")]
|
||||
public string MoId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:工单代码
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mo_code")]
|
||||
public string MoCode {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mold_id")]
|
||||
public string MoldId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="mold_name")]
|
||||
public string MoldName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:设备Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="eqp_id")]
|
||||
public string EqpId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:设备名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="eqp_name")]
|
||||
public string EqpName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产线编号
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="line_id")]
|
||||
public string LineId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产线名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="line_name")]
|
||||
public string LineName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产品Id
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="item_id")]
|
||||
public string ItemId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:产品名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="item_name")]
|
||||
public string ItemName {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="create_id")]
|
||||
public string CreateId {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName="modify_id")]
|
||||
public string ModifyId {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
14
ProductionMgr/Tnb.ProductionMgr.Entitys/Mapper/Mapper.cs
Normal file
14
ProductionMgr/Tnb.ProductionMgr.Entitys/Mapper/Mapper.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Mapster;
|
||||
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entitys.Mapper
|
||||
{
|
||||
public class Mapper : IRegister
|
||||
{
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.ForType<ProductionSchedulingCrInput, PrdTask>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoService.cs
Normal file
12
ProductionMgr/Tnb.ProductionMgr.Interfaces/IPrdMoService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// 工单生成
|
||||
/// </summary>
|
||||
public interface IPrdMoService
|
||||
{
|
||||
Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tnb.ProductionMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
77
ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs
Normal file
77
ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.OpenXmlFormats.Shared;
|
||||
using SqlSugar;
|
||||
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
||||
using Tnb.ProductionPlanMgr.Interfaces;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产计划管理
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = "ProductionMgr", Name = "WorkOrderCreate", Order = 700)]
|
||||
[Route("api/production/[controller]")]
|
||||
public class PrdMoService : IPrdMoService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<PrdMoEntity> _repository;
|
||||
private readonly IDataBaseManager _dataBaseManager;
|
||||
public PrdMoService(ISqlSugarRepository<PrdMoEntity> repository, IDataBaseManager dataBaseManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_dataBaseManager = dataBaseManager;
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产工单创建-生产工单下发
|
||||
/// </summary>
|
||||
/// <param name="input">生产工单下发输入参数</param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("workorder-issue")]
|
||||
public async Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input)
|
||||
{
|
||||
if (input is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
}
|
||||
var db = await GetDbContext();
|
||||
var row = await db.Updateable<PrdMoEntity>()
|
||||
.SetColumns(it => new PrdMoEntity { MoStatus = "25019232867093" })
|
||||
.Where(it => input.WorkOrderIds.Contains(it.Id))
|
||||
.ExecuteCommandAsync();
|
||||
return (row > 0);
|
||||
}
|
||||
/// <summary>
|
||||
/// 生产工单-生产排产
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("scheduling")]
|
||||
public async Task<dynamic> ProductionScheduling(ProductionSchedulingCrInput input)
|
||||
{
|
||||
var entity = input.Adapt<PrdTask>();
|
||||
entity.Id = input.Id ?? SnowflakeIdHelper.NextId();
|
||||
var db = await GetDbContext();
|
||||
var row = await db.Storageable(entity).ExecuteCommandAsync();
|
||||
return (row > 0);
|
||||
}
|
||||
|
||||
private async Task<ISqlSugarClient> GetDbContext()
|
||||
{
|
||||
var link = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == "tnb_mes");
|
||||
var db = _dataBaseManager.ChangeDataBase(link);
|
||||
return db;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
16
ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj
Normal file
16
ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="$(SolutionDir)\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||
<ProjectReference Include="..\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aspose.Cells;
|
||||
using DingTalk.Api.Request;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.UserModel;
|
||||
using SqlSugar;
|
||||
using Tnb.ProductionMgr.Entitys.Entity;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产排产
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = "ProductMgr", Name = "WorkOrderScheduling", Order = 700)]
|
||||
[Route("api/production/[controller]")]
|
||||
public class WorkOrderSchedulingService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly IDataBaseManager _dataBaseManager;
|
||||
private readonly ISqlSugarRepository<DbLinkEntity> _repository;
|
||||
public WorkOrderSchedulingService(IDataBaseManager dataBaseManager, ISqlSugarRepository<DbLinkEntity> repository)
|
||||
{
|
||||
_dataBaseManager = dataBaseManager;
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试数据导入
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("data")]
|
||||
[AllowAnonymous]
|
||||
public async Task ImportMoldsData()
|
||||
{
|
||||
List<(string pId, string eqpId)> multi = new()
|
||||
{
|
||||
("25546268026149","25530823999765"),
|
||||
("25546256076325","25530834099477"),
|
||||
};
|
||||
List<MoldsEntity> list = new();
|
||||
var index = 1;
|
||||
foreach (var item in multi)
|
||||
{
|
||||
MoldsEntity entity = new();
|
||||
entity.Id = SnowflakeIdHelper.NextId();
|
||||
entity.MoldCode = $"m00{index}";
|
||||
entity.MoldName = "磨具" + index;
|
||||
entity.ItemId = item.pId;
|
||||
entity.EqpId = item.eqpId;
|
||||
list.Add(entity);
|
||||
index++;
|
||||
}
|
||||
var link = await _repository.GetFirstAsync(x => x.FullName == "tnb_eqp");
|
||||
var db = _dataBaseManager.ChangeDataBase(link);
|
||||
var row = await db.Insertable(list).ExecuteCommandAsync();
|
||||
if (row > 0)
|
||||
{
|
||||
foreach (var item in list)
|
||||
{
|
||||
var dic = new Dictionary<string, object>
|
||||
{
|
||||
{"id",item.EqpId },
|
||||
{ "mold_id", item.Id}
|
||||
};
|
||||
var row2 = await db.Updateable(dic).AS("eqp_equipment")
|
||||
.WhereColumns("id").
|
||||
ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
ProductionMgr/Tnb.ProductionMgr/internals/BaseService.cs
Normal file
23
ProductionMgr/Tnb.ProductionMgr/internals/BaseService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.Systems.Entitys.System;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionPlanMgr
|
||||
{
|
||||
public class BaseService : ITransient
|
||||
{
|
||||
private readonly Dictionary<string, ISqlSugarClient> _dbContextDic = new(StringComparer.OrdinalIgnoreCase);
|
||||
static BaseService()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user