修复错误
This commit is contained in:
@@ -52,7 +52,7 @@ namespace Tnb.BasicData.Entities.Dto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物料均再首道工序投产
|
/// 物料均再首道工序投产
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int is_first { get; set; }
|
public int? is_first { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 备注
|
/// 备注
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.BasicData.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
23
EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs
Normal file
23
EquipMgr/Tnb.EquipMgr.Entities/Dto/RelevanceMoldInput.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.EquipMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 模具规则定义,关键模具输入参数
|
||||||
|
/// </summary>
|
||||||
|
public class RelevanceMoldInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 规则Id
|
||||||
|
/// </summary>
|
||||||
|
public string? rule_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模具Id
|
||||||
|
/// </summary>
|
||||||
|
public string? mold_id { get; set;}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,13 +8,9 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
///<summary>
|
///<summary>
|
||||||
///模具保养
|
///模具保养
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("mold_maintenance")]
|
[SugarTable("tool_mold_maintenance")]
|
||||||
public partial class MoldMaintenance
|
public partial class MoldMaintenance
|
||||||
{
|
{
|
||||||
public MoldMaintenance(){
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:编号
|
/// Desc:编号
|
||||||
/// Default:
|
/// Default:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -11,19 +11,8 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
///模具保养项目组与保养项关系
|
///模具保养项目组与保养项关系
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("tool_mold_maintain_group_item")]
|
[SugarTable("tool_mold_maintain_group_item")]
|
||||||
public partial class ToolMoldMaintainGroupItem
|
public partial class ToolMoldMaintainGroupItem : BaseEntity<string>
|
||||||
{
|
{
|
||||||
public ToolMoldMaintainGroupItem(){
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
|
||||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:项目组id
|
/// Desc:项目组id
|
||||||
|
|||||||
@@ -11,20 +11,10 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
///模具保养组与磨具关联
|
///模具保养组与磨具关联
|
||||||
///</summary>
|
///</summary>
|
||||||
[SugarTable("tool_mold_maintain_group_relation")]
|
[SugarTable("tool_mold_maintain_group_relation")]
|
||||||
public partial class ToolMoldMaintainGroupRelation
|
public partial class ToolMoldMaintainGroupRelation :BaseEntity<string>
|
||||||
{
|
{
|
||||||
public ToolMoldMaintainGroupRelation(){
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Desc:主键
|
|
||||||
/// Default:
|
|
||||||
/// Nullable:False
|
|
||||||
/// </summary>
|
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
|
||||||
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:项目组Id
|
/// Desc:项目组Id
|
||||||
/// Default:
|
/// Default:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.EquipMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public long id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.EquipMgr.Interfaces
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 设备保养规则定义
|
||||||
|
/// </summary>
|
||||||
|
public interface IToolMoldMaintainRuleService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
12
EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs
Normal file
12
EquipMgr/Tnb.EquipMgr/MoldMaintainBaseService.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.EquipMgr
|
||||||
|
{
|
||||||
|
public class MoldMaintainBaseService
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
52
EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs
Normal file
52
EquipMgr/Tnb.EquipMgr/ToolMoldMaintainRuleService.cs
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Aspose.Cells.Drawing;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Enums;
|
||||||
|
using JNPF.DependencyInjection;
|
||||||
|
using JNPF.DynamicApiController;
|
||||||
|
using JNPF.FriendlyException;
|
||||||
|
using Mapster;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using SqlSugar;
|
||||||
|
using Tnb.EquipMgr.Entities;
|
||||||
|
using Tnb.EquipMgr.Entities.Dto;
|
||||||
|
using Tnb.EquipMgr.Interfaces;
|
||||||
|
|
||||||
|
namespace Tnb.EquipMgr
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 模具保养规则定义服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||||
|
[Route("api/[area]/[controller]/[action]")]
|
||||||
|
public class ToolMoldMaintainRuleService : IToolMoldMaintainRuleService, IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly ISqlSugarRepository<ToolMoldMaintainRule> _repository;
|
||||||
|
private readonly IUserManager _userManager;
|
||||||
|
private readonly ISqlSugarClient _db;
|
||||||
|
public ToolMoldMaintainRuleService(ISqlSugarRepository<ToolMoldMaintainRule> repository, IUserManager userManager)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
_userManager = userManager;
|
||||||
|
_db = repository.AsSugarClient();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 关联模具
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input">关联模具输入参数</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task RelevanceMold(RelevanceMoldInput input)
|
||||||
|
{
|
||||||
|
if (input is null) throw new ArgumentNullException(nameof(input));
|
||||||
|
var entity = input.Adapt<ToolMoldMaintainRuleRelation>();
|
||||||
|
var row = await _db.Insertable(entity).ExecuteCommandAsync();
|
||||||
|
if (row < 1) throw Oops.Oh(ErrorCode.COM1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,15 +43,15 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 生产任务数量
|
/// 生产任务数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int scheduled_qty { get; set; }
|
public int? scheduled_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计划数量
|
/// 计划数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int plan_qty { get; set; }
|
public int? plan_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工序任务量
|
/// 工序任务量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int process_task_qty { get; set; }
|
public int? process_task_qty { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,24 +18,24 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
|||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string mo_task_code { get; set; }
|
public string? mo_task_code { get; set; }
|
||||||
public List<BatchItem> batchItems { get; set; }
|
public List<BatchItem>? batchItems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BatchItem
|
public class BatchItem
|
||||||
{
|
{
|
||||||
public string batch { get; set; }
|
public string? batch { get; set; }
|
||||||
|
|
||||||
public string create_time { get; set; }
|
public string? create_time { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报废数量
|
/// 报废数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int scrap_qty { get; set; }
|
public int? scrap_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///次品分类数组
|
///次品分类数组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<CategoryItem> categoryItems { get; set; }
|
public List<CategoryItem>? categoryItems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CategoryItem
|
public class CategoryItem
|
||||||
@@ -43,16 +43,16 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 次品分类名称
|
/// 次品分类名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string name { get; set; }
|
public string? name { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 次品分类数量
|
/// 次品分类数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int qty { get; set; }
|
public int? qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 次品项数组
|
/// 次品项数组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<DefectItem> defectItems { get; set; }
|
public List<DefectItem>? defectItems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DefectItem
|
public class DefectItem
|
||||||
@@ -60,10 +60,10 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 次品分类名称
|
/// 次品分类名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string name { get; set; }
|
public string? name { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 次品分类数量
|
/// 次品分类数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int qty { get; set; }
|
public int? qty { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,20 +61,20 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 完成数量
|
/// 完成数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int complete_qty { get; set; }
|
public int? complete_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计划生产数量
|
/// 计划生产数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int plan_qty { get; set; }
|
public int? plan_qty { get; set; }
|
||||||
public int scheduled_qty { get; set; }
|
public int? scheduled_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 预计开工时间
|
/// 预计开工时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime estimated_start_date { get; set; }
|
public DateTime? estimated_start_date { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 预计完工时间
|
/// 预计完工时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime estimated_end_date { get; set; }
|
public DateTime? estimated_end_date { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ namespace Tnb.ProductionMgr.Entities.Dto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否同组标识
|
/// 是否同组标识
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int group_flag { get; set; }
|
public int? group_flag { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计划生产量
|
/// 计划生产量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int plan_qty { get; set; }
|
public int? plan_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 已完工数量
|
/// 已完工数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int comple_qty { get; set; }
|
public int? comple_qty { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 产品名称
|
/// 产品名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -64,28 +64,28 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? plan_qty {get;set;}
|
public int? plan_qty {get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:已投入数量
|
/// Desc:已投入数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? input_qty {get;set;}
|
public int? input_qty {get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:已完工数量
|
/// Desc:已完工数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? complete_qty {get;set;}
|
public int? complete_qty {get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:报废数量
|
/// Desc:报废数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? scrap_qty {get;set;}
|
public int? scrap_qty {get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:计划开始时间
|
/// Desc:计划开始时间
|
||||||
@@ -155,7 +155,7 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? relation_ratio {get;set;}
|
public int? relation_ratio {get;set;}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:下发人员ID
|
/// Desc:下发人员ID
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
[SugarTable("prd_mo_task")]
|
[SugarTable("prd_mo_task")]
|
||||||
public partial class PrdMoTask
|
public partial class PrdMoTask
|
||||||
{
|
{
|
||||||
public PrdMoTask(){
|
public PrdMoTask()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -99,35 +100,35 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? plan_qty {get;set;}
|
public int? plan_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:已投入数量
|
/// Desc:已投入数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? input_qty {get;set;}
|
public int? input_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:已完工数量
|
/// Desc:已完工数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? complete_qty {get;set;}
|
public int? complete_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:报废数量
|
/// Desc:报废数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? scrap_qty {get;set;}
|
public int? scrap_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:已排产数量
|
/// Desc:已排产数量
|
||||||
/// Default:
|
/// Default:
|
||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal? scheduled_qty {get;set;}
|
public int? scheduled_qty { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:排产类型:1、注塑、挤出2、组装、包装
|
/// Desc:排产类型:1、注塑、挤出2、组装、包装
|
||||||
@@ -240,6 +241,26 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
/// Nullable:True
|
/// Nullable:True
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? process_task_qty { get; set; }
|
public int? process_task_qty { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 设备类型编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string eqp_type_code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模具编号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string mold_code { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模具名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string mold_name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模具型腔数
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public int mold_cavity_qty { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Tnb.ProductionMgr.Entities
|
|||||||
/// Nullable:False
|
/// Nullable:False
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(IsPrimaryKey=true)]
|
[SugarColumn(IsPrimaryKey=true)]
|
||||||
public char id {get;set;} = SnowflakeIdHelper.NextId();
|
public string id {get;set;} = SnowflakeIdHelper.NextId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Desc:TODO
|
/// Desc:TODO
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ namespace Tnb.ProductionMgr
|
|||||||
})
|
})
|
||||||
.Mapper(it =>
|
.Mapper(it =>
|
||||||
{
|
{
|
||||||
it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "";
|
it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "";
|
||||||
})
|
})
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
@@ -434,7 +434,7 @@ namespace Tnb.ProductionMgr
|
|||||||
scheduled_qty = a.scheduled_qty,
|
scheduled_qty = a.scheduled_qty,
|
||||||
plan_qty = d.plan_qty
|
plan_qty = d.plan_qty
|
||||||
})
|
})
|
||||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "")
|
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -465,7 +465,7 @@ namespace Tnb.ProductionMgr
|
|||||||
plan_qty = d.plan_qty,
|
plan_qty = d.plan_qty,
|
||||||
process_task_qty = a.process_task_qty,
|
process_task_qty = a.process_task_qty,
|
||||||
})
|
})
|
||||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString() : "")
|
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -699,7 +699,7 @@ namespace Tnb.ProductionMgr
|
|||||||
var mo = await _db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id);
|
var mo = await _db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id);
|
||||||
var moCode = mo?.mo_code;
|
var moCode = mo?.mo_code;
|
||||||
var taskCode = await _db.Queryable<PrdMoTask>().Where(it => !string.IsNullOrEmpty(it.mo_task_code) && it.mo_task_code.Contains(moCode)).OrderByDescending(it => it.mo_task_code).Select(it => it.mo_task_code).FirstAsync();
|
var taskCode = await _db.Queryable<PrdMoTask>().Where(it => !string.IsNullOrEmpty(it.mo_task_code) && it.mo_task_code.Contains(moCode)).OrderByDescending(it => it.mo_task_code).Select(it => it.mo_task_code).FirstAsync();
|
||||||
if (taskCode.IsNullOrEmpty())
|
if (taskCode!.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
moTask.mo_task_code = $"{moCode}-01";
|
moTask.mo_task_code = $"{moCode}-01";
|
||||||
}
|
}
|
||||||
@@ -727,7 +727,7 @@ namespace Tnb.ProductionMgr
|
|||||||
taskLog.create_id = _userManager.UserId;
|
taskLog.create_id = _userManager.UserId;
|
||||||
taskLog.create_time = DateTime.Now;
|
taskLog.create_time = DateTime.Now;
|
||||||
taskLog.mo_task_id = moTask.id;
|
taskLog.mo_task_id = moTask.id;
|
||||||
taskLog.mo_task_code = moTask.mo_task_code;
|
taskLog.mo_task_code = moTask.mo_task_code!;
|
||||||
row = await _db.Insertable(taskLog).ExecuteCommandAsync();
|
row = await _db.Insertable(taskLog).ExecuteCommandAsync();
|
||||||
//根据工单号获取当前工单包含的已排产数
|
//根据工单号获取当前工单包含的已排产数
|
||||||
var schedQty = _db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
var schedQty = _db.Queryable<PrdMoTask>().Where(it => it.mo_id == input.mo_id)?.Sum(d => d.scheduled_qty);
|
||||||
@@ -781,7 +781,7 @@ namespace Tnb.ProductionMgr
|
|||||||
subMoTasks.Add(subMoTask);
|
subMoTasks.Add(subMoTask);
|
||||||
}
|
}
|
||||||
//根据生产任务编号生成子任务编号
|
//根据生产任务编号生成子任务编号
|
||||||
if (moTask.mo_task_code.IsNotEmptyOrNull())
|
if (moTask.mo_task_code!.IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= subMoTasks.Count; i++)
|
for (int i = 1; i <= subMoTasks.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -884,19 +884,19 @@ namespace Tnb.ProductionMgr
|
|||||||
taskLog.id = SnowflakeIdHelper.NextId();
|
taskLog.id = SnowflakeIdHelper.NextId();
|
||||||
if (taskItem != null)
|
if (taskItem != null)
|
||||||
{
|
{
|
||||||
if (taskItem.mo_id.IsNotEmptyOrNull())
|
if (taskItem.mo_id!.IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == taskItem.mo_id))?.mo_code!;
|
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == taskItem.mo_id))?.mo_code!;
|
||||||
}
|
}
|
||||||
if (taskItem.eqp_id.IsNotEmptyOrNull())
|
if (taskItem.eqp_id!.IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == taskItem.eqp_id))?.code!;
|
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == taskItem.eqp_id))?.code!;
|
||||||
}
|
}
|
||||||
if (taskItem.mold_id.IsNotEmptyOrNull())
|
if (taskItem.mold_id!.IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
|
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == taskItem.mold_id))?.mold_code!;
|
||||||
}
|
}
|
||||||
if (taskItem.material_id.IsNotEmptyOrNull())
|
if (taskItem.material_id!.IsNotEmptyOrNull())
|
||||||
{
|
{
|
||||||
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == taskItem.material_id);
|
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == taskItem.material_id);
|
||||||
taskLog.item_code = material?.code!;
|
taskLog.item_code = material?.code!;
|
||||||
|
|||||||
Reference in New Issue
Block a user