1
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
/// <summary>
|
||||
/// 组装、包装,生产任务修改输入参数
|
||||
/// </summary>
|
||||
public class PackPrdTaskUpInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产任务id
|
||||
/// </summary>
|
||||
public string mo_task_id { get; set; }
|
||||
/// <summary>
|
||||
/// 产线Id
|
||||
/// </summary>
|
||||
public string workline_id { get; set; }
|
||||
/// <summary>
|
||||
/// 生产bomid
|
||||
/// </summary>
|
||||
public string bom_id { get; set; }
|
||||
/// <summary>
|
||||
/// Desc:预计开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? estimated_start_date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Desc:预计结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? estimated_end_date { get; set; }
|
||||
/// <summary>
|
||||
/// 已排产数量
|
||||
/// </summary>
|
||||
public int scheduled_qty { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
{
|
||||
/// <summary>
|
||||
/// 组装、包装待下发列表输入参数
|
||||
/// </summary>
|
||||
public class PackScheldToBeIssueListInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 生产任务单号
|
||||
/// </summary>
|
||||
public string mo_task_code { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,10 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
/// </summary>
|
||||
public string material_code { get; set; }
|
||||
/// <summary>
|
||||
/// 产线id
|
||||
/// </summary>
|
||||
public string workline_id { get; set; }
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string material_name { get; set; }
|
||||
@@ -52,6 +56,22 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage
|
||||
/// 工序任务量
|
||||
/// </summary>
|
||||
public int? process_task_qty { get; set; }
|
||||
/// <summary>
|
||||
/// bom_id
|
||||
/// </summary>
|
||||
public string bom_id { get; set; }
|
||||
/// <summary>
|
||||
/// bom版本
|
||||
/// </summary>
|
||||
public string bom_version { get; set; }
|
||||
/// <summary>
|
||||
/// 预计开始时间
|
||||
/// </summary>
|
||||
public DateTime? estimated_start_date { get; set; }
|
||||
/// <summary>
|
||||
/// 预计结束时间
|
||||
/// </summary>
|
||||
public DateTime? estimated_end_date { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,26 +241,7 @@ namespace Tnb.ProductionMgr.Entities
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
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; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///生产任务信息
|
||||
///</summary>
|
||||
public partial class PrdMoTask
|
||||
{
|
||||
/// <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; }
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.ProductionMgr.Entities
|
||||
{
|
||||
///<summary>
|
||||
///生产任务信息
|
||||
///</summary>
|
||||
[SugarTable("prd_mo_task_copy1")]
|
||||
public partial class PrdMoTaskCopy1
|
||||
{
|
||||
public PrdMoTaskCopy1(){
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Desc:计划开始时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? plan_start_date {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:计划结束时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? plan_end_date {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际开工日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? act_start_date {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:实际完工日期
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? act_end_date {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;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改人
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? modify_id {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:修改时间
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public DateTime? modify_time {get;set;}
|
||||
|
||||
/// <summary>
|
||||
/// Desc:扩展字段
|
||||
/// Default:
|
||||
/// Nullable:True
|
||||
/// </summary>
|
||||
public string? extras {get;set;}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -76,11 +76,8 @@ namespace Tnb.ProductionMgr
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region Get
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据产品ID获取模具列表
|
||||
/// </summary>
|
||||
@@ -98,8 +95,6 @@ namespace Tnb.ProductionMgr
|
||||
/// <br/> }
|
||||
/// <br/>]
|
||||
/// </remarks>
|
||||
|
||||
|
||||
[HttpGet("{materialId}")]
|
||||
public async Task<dynamic> GetMoldListByItemId(string materialId)
|
||||
{
|
||||
@@ -415,24 +410,31 @@ namespace Tnb.ProductionMgr
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<dynamic> GetPackScheldToBeIssueList()
|
||||
public async Task<dynamic> GetPackScheldToBeIssueList([FromQuery] PackScheldToBeIssueListInput input)
|
||||
{
|
||||
var dic = await _dictionaryDataService.GetDicByTypeId(DictConst.PrdTaskStatusTypeId);
|
||||
var result = await _db.Queryable<PrdMoTask>().Where(it => it.schedule_type == 2)
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c) => a.workline_id == c.Id)
|
||||
.LeftJoin<PrdMo>((a, b, c, d) => a.mo_id == d.id)
|
||||
.Select((a, b, c, d) => new PackSechelToBeIssueListOutput
|
||||
.LeftJoin<BasMbom>((a, b, c, d, e) => a.bom_id == e.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(input.mo_task_code), (a, b, c, d, e) => a.mo_task_code.Contains(input.mo_task_code))
|
||||
.Select((a, b, c, d, e) => new PackSechelToBeIssueListOutput
|
||||
{
|
||||
mo_task_id = a.id,
|
||||
mo_task_code = a.mo_task_code,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
workline_id = a.workline_id,
|
||||
workline_code = c.EnCode,
|
||||
workline_name = c.FullName,
|
||||
mo_task_status = a.mo_task_status,
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
plan_qty = d.plan_qty
|
||||
plan_qty = d.plan_qty,
|
||||
estimated_start_date = a.estimated_start_date,
|
||||
estimated_end_date = a.estimated_end_date,
|
||||
bom_id = e.id,
|
||||
bom_version = e.version
|
||||
})
|
||||
.Mapper(it => it.mo_task_status = dic.ContainsKey(it.mo_task_status) ? dic[it.mo_task_status].ToString()! : "")
|
||||
.ToListAsync();
|
||||
@@ -705,11 +707,11 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
var pos = taskCode.IndexOf("-", StringComparison.Ordinal);
|
||||
if (pos > -1)
|
||||
var pos = taskCode?.IndexOf("-", StringComparison.Ordinal);
|
||||
if (pos.HasValue && pos.Value > -1)
|
||||
{
|
||||
var num = taskCode.AsSpan().Slice(pos + 1).ToString().ParseToInt();
|
||||
var code = taskCode.AsSpan().Slice(0, pos).ToString();
|
||||
var num = taskCode.AsSpan().Slice(pos.Value + 1).ToString().ParseToInt();
|
||||
var code = taskCode.AsSpan().Slice(0, pos.Value).ToString();
|
||||
var n = (num + 1).ToString().PadLeft(2, '0');
|
||||
moTask.mo_task_code = $"{code}-{n}";
|
||||
}
|
||||
@@ -1083,6 +1085,26 @@ namespace Tnb.ProductionMgr
|
||||
});
|
||||
return result.IsSuccess;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改组装、包装,生产任务信息
|
||||
/// </summary>
|
||||
/// <param name="updateToObj"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> UpdatePackMoTask(PackPrdTaskUpInput input)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException("input");
|
||||
var row = await _db.Updateable<PrdMoTask>().SetColumns(it => new PrdMoTask
|
||||
{
|
||||
workline_id = input.workline_id,
|
||||
bom_id = input.bom_id,
|
||||
estimated_start_date = input.estimated_start_date,
|
||||
estimated_end_date = input.estimated_end_date,
|
||||
scheduled_qty = input.scheduled_qty,
|
||||
})
|
||||
.Where(it => it.id == input.mo_task_id).ExecuteCommandAsync();
|
||||
return row > 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user