入库申请同步,提报增加字段
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Tnb.BasicData
|
||||
[OverideVisualDev(ModelId)]
|
||||
public class BasMbomService : IBasMbomService, IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
public const string ModelId = "25574817510421";
|
||||
public const string ModelId = "27204627275029";
|
||||
private readonly ISqlSugarRepository<BasMbom> _repository;
|
||||
private readonly DataBaseManager _dbManager;
|
||||
private readonly IDictionaryDataService _dictionaryDataService;
|
||||
|
||||
@@ -98,6 +98,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public int icmo_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工位
|
||||
/// </summary>
|
||||
public string? station { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,5 +78,39 @@ public partial class PrdReport : BaseEntity<string>
|
||||
/// 生产任务量
|
||||
/// </summary>
|
||||
public int? icmo_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次
|
||||
/// </summary>
|
||||
public string? batch { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备id
|
||||
/// </summary>
|
||||
public string? equip_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工位id
|
||||
/// </summary>
|
||||
public string? station { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生产bom工序id
|
||||
/// </summary>
|
||||
public string? mbom_process_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 0 未入库 1 已入库
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string? material_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料单位
|
||||
/// </summary>
|
||||
public string? unit_id { get; set; }
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using Tnb.ProductionMgr.Interfaces;
|
||||
namespace Tnb.ProductionMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// mes入库申请
|
||||
/// mes生产入库申请
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
eqp_id = b.id,
|
||||
eqp_code = b.code,
|
||||
eqp_type_code = SqlFunc.Subqueryable<EqpEquipType>().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.code),
|
||||
eqp_type_code = SqlFunc.Subqueryable<EqpEquipType>().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.name),
|
||||
eqp_machine_num = b.eqp_machine_num,
|
||||
tonnage = b.tonnage,
|
||||
task_list_qty = SqlFunc.Subqueryable<PrdTask>().Where(x => x.eqp_id == b.id).Count(),
|
||||
@@ -1254,16 +1254,24 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
var row = -1;
|
||||
var report = await db.Queryable<PrdReport>().FirstAsync(it => it.mo_task_id == input.mo_task_id);
|
||||
var prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == input.mo_task_id);
|
||||
|
||||
report = input.Adapt<PrdReport>();
|
||||
report.id = SnowflakeIdHelper.NextId();
|
||||
report.reported_qty = input.reported_qty;
|
||||
report.create_id = _userManager.UserId;
|
||||
report.create_time = DateTime.Now;
|
||||
|
||||
report.batch = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
|
||||
report.equip_id = prdMoTask.eqp_id;
|
||||
report.mbom_process_id = prdMoTask.mbom_process_id;
|
||||
report.station = input.station;
|
||||
report.status = 0;
|
||||
report.material_id = prdMoTask.material_id;
|
||||
report.unit_id = prdMoTask.unit_id;
|
||||
|
||||
row = await db.Insertable(report).ExecuteCommandAsync();
|
||||
|
||||
var prdMoTask = await db.Queryable<PrdMoTask>().SingleAsync(x => x.id == input.mo_task_id);
|
||||
|
||||
if (prdMoTask.reported_work_qty == null)
|
||||
{
|
||||
await db.Updateable<PrdMoTask>()
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<ProjectReference Include="..\..\taskschedule\Tnb.TaskScheduler\Tnb.TaskScheduler.csproj" />
|
||||
<ProjectReference Include="..\..\visualdev\Tnb.VisualDev.Engine\Tnb.VisualDev.Engine.csproj" />
|
||||
<ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr.Entities\Tnb.WarehouseMgr.Entities.csproj" />
|
||||
<ProjectReference Include="..\..\WarehouseMgr\Tnb.WarehouseMgr\Tnb.WarehouseMgr.csproj" />
|
||||
<ProjectReference Include="..\Tnb.ProductionMgr.Interfaces\Tnb.ProductionMgr.Interfaces.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user