模具保养管理接口代码提交
This commit is contained in:
27
EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs
Normal file
27
EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldListOutput.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RelevanceMoldListOutput
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具编号
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string mold_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具名称
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string mold_name { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 MoldMaintainGroupItemRelationInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目组Id
|
||||
/// </summary>
|
||||
public string item_group_id { get; set; }
|
||||
/// <summary>
|
||||
/// 模具Id
|
||||
/// </summary>
|
||||
public string mold_id { get; set; }
|
||||
}
|
||||
}
|
||||
24
EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs
Normal file
24
EquipMgr/Tnb.EquipMgr.Entities/Dto/MoldMaintainItemInput.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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 MoldMaintainGroupItemInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目组Id
|
||||
/// </summary>
|
||||
public string item_group_id { get; set; }
|
||||
/// <summary>
|
||||
/// 保养项Id
|
||||
/// </summary>
|
||||
public string item_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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 MoldMaintainItemListOutput
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
public string descrip { get; set; }
|
||||
}
|
||||
}
|
||||
97
EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs
Normal file
97
EquipMgr/Tnb.EquipMgr.Entities/Entity/MoldMaintenance.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///模具保养
|
||||
///</summary>
|
||||
[SugarTable("mold_maintenance")]
|
||||
public partial class MoldMaintenance
|
||||
{
|
||||
public MoldMaintenance(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:编号
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public string id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:所属组织
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? org_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:项目
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? name {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:描述
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? descrip {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:备注
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? remark {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:查看照片
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? image {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:扩展
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? extras {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? create_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? create_time {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改用户
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? modify_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? modify_time {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarTable("tool_mold_maintain_group")]
|
||||
public partial class ToolMoldMaintainGroup
|
||||
{
|
||||
public ToolMoldMaintainGroup(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:主键
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public string id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:项目组名称
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? name {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养类型
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? service_type {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:描述
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? describe {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建人
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? create_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? create_time {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarTable("tool_mold_maintain_group_item")]
|
||||
public partial class ToolMoldMaintainGroupItem : BaseEntity<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Desc:项目组id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string item_group_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养项id
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? item_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarTable("tool_mold_maintain_group_relation")]
|
||||
public partial class ToolMoldMaintainGroupRelation :BaseEntity<string>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Desc:项目组Id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string item_group_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具Id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string mold_id {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///模具保养规则
|
||||
///</summary>
|
||||
[SugarTable("tool_mold_maintain_rule")]
|
||||
public partial class ToolMoldMaintainRule
|
||||
{
|
||||
public ToolMoldMaintainRule(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:主键
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public string id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养方式
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? mode {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养起止日期
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? startandend_date {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养周期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public int? cycle {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建人
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? create_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:创建时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? create_time {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改人
|
||||
/// Default:NULL::character varying
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? modify_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? modify_time {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///模具保养规则与模具关联
|
||||
///</summary>
|
||||
[SugarTable("tool_mold_maintain_rule_relation")]
|
||||
public partial class ToolMoldMaintainRuleRelation
|
||||
{
|
||||
public ToolMoldMaintainRuleRelation(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:主键
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey=true)]
|
||||
public string id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:保养规则id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string rule_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:模具id
|
||||
/// Default:
|
||||
/// Nullable:False
|
||||
/// </summary>
|
||||
public string mold_id {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
13
EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs
Normal file
13
EquipMgr/Tnb.EquipMgr.Entities/Mapper/Mapper.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Mapster;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities.Mapper
|
||||
{
|
||||
public class Mapper : IRegister
|
||||
{
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 IToolMoldMaintainGroupService
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
109
EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs
Normal file
109
EquipMgr/Tnb.EquipMgr/ToolMoldMaintainGroupService.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
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.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Contracts;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Entities.Entity;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
|
||||
public class ToolMoldMaintainGroupService : IToolMoldMaintainGroupService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<ToolMoldMaintainGroup> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ISqlSugarClient _db;
|
||||
public ToolMoldMaintainGroupService(ISqlSugarRepository<ToolMoldMaintainGroup> repository, IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_userManager = userManager;
|
||||
_db = repository.AsSugarClient();
|
||||
}
|
||||
|
||||
#region Get
|
||||
/// <summary>
|
||||
/// 根据项目组Id获取关联保养项信息
|
||||
/// </summary>
|
||||
/// <param name="itemGroupId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{itemGroupId}")]
|
||||
public async Task<dynamic> GetMaintianItemListByGroupId(string itemGroupId)
|
||||
{
|
||||
var list = new List<MoldMaintainItemListOutput>();
|
||||
var itemIds = await _db.Queryable<ToolMoldMaintainGroupItem>().Where(it => it.item_group_id == itemGroupId).Select(it => it.item_id).ToListAsync();
|
||||
if (itemIds?.Count > 0)
|
||||
{
|
||||
var items = await _db.Queryable<MoldMaintenance>().Where(it => itemIds.Contains(it.id)).ToListAsync();
|
||||
list = items.Adapt<List<MoldMaintainItemListOutput>>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据项目组Id获取关联模具信息
|
||||
/// </summary>
|
||||
/// <param name="itemGroupId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{itemGroupId}")]
|
||||
public async Task<dynamic> GetMoldListByGroupId(string itemGroupId)
|
||||
{
|
||||
var list = new List<RelevanceMoldListOutput>();
|
||||
var moldIds = await _db.Queryable<ToolMoldMaintainGroupRelation>().Where(it => it.item_group_id == itemGroupId).Select(it => it.mold_id).ToListAsync();
|
||||
if (moldIds?.Count > 0)
|
||||
{
|
||||
var items = await _db.Queryable<ToolMolds>().Where(it => moldIds.Contains(it.id)).ToListAsync();
|
||||
list = items.Adapt<List<RelevanceMoldListOutput>>();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Post
|
||||
/// <summary>
|
||||
/// 关联保养组与保养项
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task RelevanceMaintianGroupAndItem(MoldMaintainGroupItemInput input) =>
|
||||
await Relevance<MoldMaintainGroupItemInput, ToolMoldMaintainGroupItem>(input);
|
||||
|
||||
/// <summary>
|
||||
/// 关联项目组与模具
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task RelevanceMaintianGroupAndMold(MoldMaintainGroupItemRelationInput input) =>
|
||||
await Relevance<MoldMaintainGroupItemRelationInput, ToolMoldMaintainGroupRelation>(input);
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
private async Task Relevance<TSrc, TDest>(TSrc input) where TDest : BaseEntity<string>, new()
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException(nameof(input));
|
||||
var entity = input.Adapt<TDest>();
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
var row = await _db.Insertable(entity).ExecuteCommandAsync();
|
||||
if (row < 1) throw Oops.Oh(ErrorCode.COM1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -543,23 +543,23 @@ namespace Tnb.ProductionMgr
|
||||
if (schedQty.HasValue && schedQty.Value >= mo.plan_qty)
|
||||
{
|
||||
mo.mo_status = DictConst.AlreadyId;
|
||||
row = await db.Updateable(mo).ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (schedQty.HasValue)
|
||||
mo.scheduled_qty = schedQty.Value;
|
||||
}
|
||||
row = await db.Updateable(mo).ExecuteCommandAsync();
|
||||
}
|
||||
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == moTask.material_id);
|
||||
|
||||
var taskLog = new PrdTaskLog();
|
||||
taskLog.id = SnowflakeIdHelper.NextId();
|
||||
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id))?.mo_code;
|
||||
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == input.eqp_id))?.code;
|
||||
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == input.mold_id))?.mold_code;
|
||||
taskLog.item_code = material?.code;
|
||||
taskLog.item_standard = material?.material_standard;
|
||||
taskLog.mo_code = (await db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id))?.mo_code!;
|
||||
taskLog.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == input.eqp_id))?.code!;
|
||||
taskLog.mold_code = (await db.Queryable<Molds>().FirstAsync(it => it.id == input.mold_id))?.mold_code!;
|
||||
taskLog.item_code = material?.code!;
|
||||
taskLog.item_standard = material?.material_standard!;
|
||||
taskLog.status = DictConst.ToBeScheduledEncode;
|
||||
taskLog.operator_name = _userManager.RealName;
|
||||
taskLog.create_id = _userManager.UserId;
|
||||
@@ -571,10 +571,10 @@ namespace Tnb.ProductionMgr
|
||||
//将生产任务插入到自检报废记录表
|
||||
var sacipRecord = new PrdMoTaskDefectRecord();
|
||||
sacipRecord.id = SnowflakeIdHelper.NextId();
|
||||
sacipRecord.material_code = material?.code;
|
||||
sacipRecord.material_name = material?.name;
|
||||
sacipRecord.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == moTask.eqp_id))?.code;
|
||||
sacipRecord.mold_name = (await db.Queryable<Molds>().FirstAsync(it => it.id == moTask.mold_id))?.mold_name;
|
||||
sacipRecord.material_code = material?.code!;
|
||||
sacipRecord.material_name = material?.name!;
|
||||
sacipRecord.eqp_code = (await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == moTask.eqp_id))?.code!;
|
||||
sacipRecord.mold_name = (await db.Queryable<Molds>().FirstAsync(it => it.id == moTask.mold_id))?.mold_name!;
|
||||
sacipRecord.estimated_start_date = moTask.plan_start_date;
|
||||
sacipRecord.estimated_end_date = moTask.plan_end_date;
|
||||
sacipRecord.plan_qty = moTask.plan_qty;
|
||||
@@ -719,11 +719,9 @@ namespace Tnb.ProductionMgr
|
||||
//添加生产任务操作记录日志s
|
||||
var taskLog = new PrdTaskLog();
|
||||
taskLog.id = SnowflakeIdHelper.NextId();
|
||||
taskLog.mo_code = (await _db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id))?.mo_code;
|
||||
//taskLog.eqp_code = (await _db.Queryable<EqpEquipment>().FirstAsync(it => it.id == input.eqp_id))?.code;
|
||||
//taskLog.mold_code = (await _db.Queryable<Molds>().FirstAsync(it => it.id == input.mold_id))?.mold_code;
|
||||
taskLog.item_code = material_h?.code;
|
||||
taskLog.item_standard = material_h?.material_standard;
|
||||
taskLog.mo_code = (await _db.Queryable<PrdMo>().FirstAsync(it => it.id == input.mo_id))?.mo_code!;
|
||||
taskLog.item_code = material_h?.code!;
|
||||
taskLog.item_standard = material_h?.material_standard!;
|
||||
taskLog.status = DictConst.ToBeScheduledEncode;
|
||||
taskLog.operator_name = _userManager.RealName;
|
||||
taskLog.create_id = _userManager.UserId;
|
||||
@@ -888,21 +886,21 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
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())
|
||||
{
|
||||
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())
|
||||
{
|
||||
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())
|
||||
{
|
||||
var material = await db.Queryable<BasMaterial>().FirstAsync(it => it.id == taskItem.material_id);
|
||||
taskLog.item_code = material?.code;
|
||||
taskLog.item_standard = material?.material_standard;
|
||||
taskLog.item_code = material?.code!;
|
||||
taskLog.item_standard = material?.material_standard!;
|
||||
}
|
||||
taskLog.operator_name = _userManager.RealName;
|
||||
taskLog.status = status;
|
||||
@@ -952,7 +950,7 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
var eqpItem = await db.Queryable<EqpEquipment>().FirstAsync(it => it.id == icmoItem.eqp_id);
|
||||
icmoItem.eqp_id = eqpItem.id;
|
||||
icmoItem.eqp_type_code = db.Queryable<EqpEquipType>().First(it => it.id == eqpItem.equip_type_id)?.code;
|
||||
icmoItem.eqp_type_code = db.Queryable<EqpEquipType>().First(it => it.id == eqpItem.equip_type_id)?.code!;
|
||||
//if (input.scheduled_qty > icmoItem.plan_qty)
|
||||
//{
|
||||
// throw new AppFriendlyException("任务单数量不能大于计划数量", 500);
|
||||
|
||||
Reference in New Issue
Block a user