组织管理代码调整
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using JNPF.Systems.Entitys.System;
|
using Mapster;
|
||||||
using Mapster;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.BasicData.Entitys.Dto.ProcessManage;
|
using Tnb.BasicData.Entitys.Dto.ProcessManage;
|
||||||
using Tnb.BasicData.Entitys.Entity;
|
using Tnb.BasicData.Entitys.Entity;
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace Tnb.ProductionPlanMgr.Entitys
|
|
||||||
{
|
|
||||||
public class Class1
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
142
Tnb.ProductionPlanMgr.Entitys/Entity/MoldsEntity.cs
Normal file
142
Tnb.ProductionPlanMgr.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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using Tnb.Common.Contracts;
|
using Tnb.Common.Contracts;
|
||||||
|
|
||||||
namespace Tnb.ProductionPlanMgr.Entitys.Entity
|
namespace Tnb.ProductionMgr.Entitys.Entity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MES生产工单
|
/// MES生产工单
|
||||||
|
|||||||
203
Tnb.ProductionPlanMgr.Entitys/Entity/PrdTask.cs
Normal file
203
Tnb.ProductionPlanMgr.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
Tnb.ProductionPlanMgr.Entitys/Mapper/Mapper.cs
Normal file
14
Tnb.ProductionPlanMgr.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>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ namespace Tnb.ProductionPlanMgr.Interfaces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工单生成
|
/// 工单生成
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IWorkOrderCreateService
|
public interface IPrdMoService
|
||||||
{
|
{
|
||||||
Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input);
|
Task<dynamic> WorkOrderIssue(WorkOrderIssueCrInput input);
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionPlanMgr.Entitys.csproj" />
|
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
using JNPF.Common.Core.Manager;
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Extension;
|
||||||
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.OpenXmlFormats.Shared;
|
using NPOI.OpenXmlFormats.Shared;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
using Tnb.ProductionMgr.Entitys.Dto.WorkOrder;
|
||||||
|
using Tnb.ProductionMgr.Entitys.Entity;
|
||||||
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
using Tnb.ProductionPlanMgr.Entitys.Dto.WorkOrder;
|
||||||
using Tnb.ProductionPlanMgr.Entitys.Entity;
|
|
||||||
using Tnb.ProductionPlanMgr.Interfaces;
|
using Tnb.ProductionPlanMgr.Interfaces;
|
||||||
|
|
||||||
namespace Tnb.ProductionPlanMgr
|
namespace Tnb.ProductionPlanMgr
|
||||||
@@ -15,13 +19,13 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生产计划管理
|
/// 生产计划管理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiDescriptionSettings(Tag = "ProductPlanMgr", Name = "WorkOrderCreate", Order = 700)]
|
[ApiDescriptionSettings(Tag = "ProductionMgr", Name = "WorkOrderCreate", Order = 700)]
|
||||||
[Route("api/production/[controller]")]
|
[Route("api/production/[controller]")]
|
||||||
public class WorkOrderCreateService :IWorkOrderCreateService,IDynamicApiController, ITransient
|
public class PrdMoService : IPrdMoService, IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
private readonly ISqlSugarRepository<PrdMoEntity> _repository;
|
private readonly ISqlSugarRepository<PrdMoEntity> _repository;
|
||||||
private readonly IDataBaseManager _dataBaseManager;
|
private readonly IDataBaseManager _dataBaseManager;
|
||||||
public WorkOrderCreateService(ISqlSugarRepository<PrdMoEntity> repository, IDataBaseManager dataBaseManager)
|
public PrdMoService(ISqlSugarRepository<PrdMoEntity> repository, IDataBaseManager dataBaseManager)
|
||||||
{
|
{
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
_dataBaseManager = dataBaseManager;
|
_dataBaseManager = dataBaseManager;
|
||||||
@@ -38,13 +42,36 @@ namespace Tnb.ProductionPlanMgr
|
|||||||
{
|
{
|
||||||
throw new ArgumentNullException(nameof(input));
|
throw new ArgumentNullException(nameof(input));
|
||||||
}
|
}
|
||||||
var link = await _repository.AsSugarClient().Queryable<DbLinkEntity>().FirstAsync(x => x.FullName == "tnb_mes");
|
var db = await GetDbContext();
|
||||||
var db = _dataBaseManager.ChangeDataBase(link);
|
|
||||||
var row = await db.Updateable<PrdMoEntity>()
|
var row = await db.Updateable<PrdMoEntity>()
|
||||||
.SetColumns(it => new PrdMoEntity { MoStatus = "25019232867093" })
|
.SetColumns(it => new PrdMoEntity { MoStatus = "25019232867093" })
|
||||||
.Where(it => input.WorkOrderIds.Contains(it.Id))
|
.Where(it => input.WorkOrderIds.Contains(it.Id))
|
||||||
.ExecuteCommandAsync();
|
.ExecuteCommandAsync();
|
||||||
return (row > 0);
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
<ProjectReference Include="..\common\Tnb.Common.Core\Tnb.Common.Core.csproj" />
|
||||||
<ProjectReference Include="..\common\Tnb.Common\Tnb.Common.csproj" />
|
<ProjectReference Include="..\common\Tnb.Common\Tnb.Common.csproj" />
|
||||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionPlanMgr.Entitys.csproj" />
|
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj" />
|
||||||
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionPlanMgr.Interfaces.csproj" />
|
<ProjectReference Include="..\Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -4,20 +4,80 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Aspose.Cells;
|
using Aspose.Cells;
|
||||||
|
using DingTalk.Api.Request;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Security;
|
||||||
using JNPF.DependencyInjection;
|
using JNPF.DependencyInjection;
|
||||||
using JNPF.DynamicApiController;
|
using JNPF.DynamicApiController;
|
||||||
|
using JNPF.Systems.Entitys.System;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.SS.UserModel;
|
||||||
|
using SqlSugar;
|
||||||
|
using Tnb.ProductionMgr.Entitys.Entity;
|
||||||
|
|
||||||
namespace Tnb.ProductionPlanMgr
|
namespace Tnb.ProductionPlanMgr
|
||||||
{
|
{
|
||||||
[ApiDescriptionSettings(Tag = "ProductPlanMgr", Name = "WorkOrderScheduling", Order = 700)]
|
/// <summary>
|
||||||
|
/// 生产排产
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(Tag = "ProductMgr", Name = "WorkOrderScheduling", Order = 700)]
|
||||||
[Route("api/production/[controller]")]
|
[Route("api/production/[controller]")]
|
||||||
public class WorkOrderSchedulingService: IDynamicApiController, ITransient
|
public class WorkOrderSchedulingService : IDynamicApiController, ITransient
|
||||||
{
|
{
|
||||||
|
private readonly IDataBaseManager _dataBaseManager;
|
||||||
public WorkOrderSchedulingService()
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,13 @@ using JNPF.DependencyInjection;
|
|||||||
using JNPF.Systems.Entitys.System;
|
using JNPF.Systems.Entitys.System;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace Tnb.ProductionPlanMgr.internals
|
namespace Tnb.ProductionPlanMgr
|
||||||
{
|
{
|
||||||
public class BaseService : ITransient
|
public class BaseService : ITransient
|
||||||
{
|
{
|
||||||
private readonly Dictionary<string, ISqlSugarClient> _dbContextDic = new(StringComparer.OrdinalIgnoreCase);
|
private readonly Dictionary<string, ISqlSugarClient> _dbContextDic = new(StringComparer.OrdinalIgnoreCase);
|
||||||
static BaseService()
|
static BaseService()
|
||||||
{
|
{
|
||||||
var repo = App.GetService<ISqlSugarRepository<DbLinkEntity>>();
|
|
||||||
//var = await repo.GetListAsync();
|
|
||||||
var dbMgr = App.GetService<IDataBaseManager>();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -99,11 +99,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.BasicData", "Tnb.BasicD
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10-ProductionPlanMgr", "10-ProductionPlanMgr", "{ABE58B5E-610B-4159-BFF0-8B04BF700B3C}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "10-ProductionPlanMgr", "10-ProductionPlanMgr", "{ABE58B5E-610B-4159-BFF0-8B04BF700B3C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.ProductionPlanMgr", "Tnb.ProductionPlanMgr\Tnb.ProductionPlanMgr.csproj", "{1E8D442B-D136-4D1A-A265-16E2DE19D938}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr", "Tnb.ProductionPlanMgr\Tnb.ProductionMgr.csproj", "{1E8D442B-D136-4D1A-A265-16E2DE19D938}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.ProductionPlanMgr.Entitys", "Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionPlanMgr.Entitys.csproj", "{CE77DCAE-5210-4876-8C52-443823FF886F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Entitys", "Tnb.ProductionPlanMgr.Entitys\Tnb.ProductionMgr.Entitys.csproj", "{CE77DCAE-5210-4876-8C52-443823FF886F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tnb.ProductionPlanMgr.Interfaces", "Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionPlanMgr.Interfaces.csproj", "{BCC64BB9-B22C-475E-BF6C-BF22B644C359}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tnb.ProductionMgr.Interfaces", "Tnb.ProductionPlanMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj", "{BCC64BB9-B22C-475E-BF6C-BF22B644C359}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
|
<ProjectReference Include="..\..\system\Tnb.Systems\Tnb.Systems.csproj" />
|
||||||
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
|
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
|
||||||
<ProjectReference Include="..\..\Tnb.BasicData\Tnb.BasicData.csproj" />
|
<ProjectReference Include="..\..\Tnb.BasicData\Tnb.BasicData.csproj" />
|
||||||
<ProjectReference Include="..\..\Tnb.ProductionPlanMgr\Tnb.ProductionPlanMgr.csproj" />
|
<ProjectReference Include="..\..\Tnb.ProductionPlanMgr\Tnb.ProductionMgr.csproj" />
|
||||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev\Tnb.VisualDev.csproj" />
|
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev\Tnb.VisualDev.csproj" />
|
||||||
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow\Tnb.WorkFlow.csproj" />
|
<ProjectReference Include="..\..\workflow\Tnb.WorkFlow\Tnb.WorkFlow.csproj" />
|
||||||
<ProjectReference Include="..\..\extend\Tnb.Extend\Tnb.Extend.csproj" />
|
<ProjectReference Include="..\..\extend\Tnb.Extend\Tnb.Extend.csproj" />
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ public class DataBaseManager : IDataBaseManager, ITransient
|
|||||||
if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson);
|
if (pageInput.superQueryJson.IsNotEmptyOrNull()) superQueryJson = _sqlSugarClient.Utilities.JsonToConditionalModels(pageInput.superQueryJson);
|
||||||
// var sql = _sqlSugarClient.SqlQueryable<object>(strSql)
|
// var sql = _sqlSugarClient.SqlQueryable<object>(strSql)
|
||||||
// .Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString();
|
// .Where(querJson).Where(superQueryJson).Where(dataPermissions).ToSqlString();
|
||||||
DataTable dt = _sqlSugarClient.SqlQueryable<object>(strSql)
|
DataTable dt = _sqlSugarClient.CopyNew().SqlQueryable<object>(strSql)
|
||||||
.Where(querJson).Where(superQueryJson).Where(dataPermissions)
|
.Where(querJson).Where(superQueryJson).Where(dataPermissions)
|
||||||
.OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort)
|
.OrderByIF(sidx, pageInput.sidx + " " + pageInput.sort).OrderByIF(!sidx && defaultSidx, columnDesign.defaultSidx + " " + columnDesign.sort)
|
||||||
.ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total);
|
.ToDataTablePage(pageInput.currentPage, pageInput.pageSize, ref total);
|
||||||
|
|||||||
@@ -42,4 +42,8 @@ public class DepartmentCrInput
|
|||||||
/// 排序码.
|
/// 排序码.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? sortCode { get; set; }
|
public long? sortCode { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 组织类型
|
||||||
|
/// </summary>
|
||||||
|
public string category { get; set; }
|
||||||
}
|
}
|
||||||
@@ -52,4 +52,9 @@ public class DepartmentInfoOutput
|
|||||||
/// 所属组织 组织树.
|
/// 所属组织 组织树.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> organizeIdTree { get; set; }
|
public List<string> organizeIdTree { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 机构类型
|
||||||
|
/// added by ly on 20230420
|
||||||
|
/// </summary>
|
||||||
|
public string category { get; set; }
|
||||||
}
|
}
|
||||||
@@ -36,8 +36,12 @@ public class PermissionMapper : IRegister
|
|||||||
config.ForType<OrganizeAdminIsTratorCrInput, OrganizeAdministratorEntity>()
|
config.ForType<OrganizeAdminIsTratorCrInput, OrganizeAdministratorEntity>()
|
||||||
.Ignore(dest => dest.UserId);
|
.Ignore(dest => dest.UserId);
|
||||||
config.ForType<OrganizeEntity, DepartmentInfoOutput>()
|
config.ForType<OrganizeEntity, DepartmentInfoOutput>()
|
||||||
.Ignore(dest => dest.organizeIdTree);
|
.Ignore(dest => dest.organizeIdTree)
|
||||||
|
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase); //modified by ly on 20230420
|
||||||
config.ForType<OrganizeEntity, OrganizeInfoOutput>()
|
config.ForType<OrganizeEntity, OrganizeInfoOutput>()
|
||||||
.Ignore(dest => dest.organizeIdTree);
|
.Ignore(dest => dest.organizeIdTree);
|
||||||
|
//modified by ly on 20230420
|
||||||
|
config.ForType<DepartmentUpInput, OrganizeEntity>()
|
||||||
|
.NameMatchingStrategy(NameMatchingStrategy.IgnoreCase); //忽略字段大小写
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -70,6 +70,13 @@ public class TestService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task ImportMoldData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void xx(UserEntity user)
|
public void xx(UserEntity user)
|
||||||
{
|
{
|
||||||
user.Account = "2312321";
|
user.Account = "2312321";
|
||||||
|
|||||||
Reference in New Issue
Block a user