|
|
@@ -130,8 +130,11 @@ namespace Business.ResourceExamineManagement
|
|
|
/// <summary>
|
|
|
/// 销售工单
|
|
|
/// </summary>
|
|
|
- private readonly IMongoDB<crm_seorder> _crm_seorder;
|
|
|
-
|
|
|
+ private readonly IRepository<crm_seorder> _crm_seorder;
|
|
|
+ /// <summary>
|
|
|
+ /// 销售工单
|
|
|
+ /// </summary>
|
|
|
+ private readonly IRepository<crm_seorderentry> _crm_seorderentry;
|
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -156,8 +159,9 @@ namespace Business.ResourceExamineManagement
|
|
|
IMongoDB<mes_mooccupy> mes_mooccupy,
|
|
|
IBasicRepository<ic_item, long> mysql_ic_item,
|
|
|
IBasicRepository<ic_bom, long> mysql_ic_bom,
|
|
|
- IBasicRepository<ic_bom_child, long> mysql_ic_bom_child
|
|
|
-
|
|
|
+ IBasicRepository<ic_bom_child, long> mysql_ic_bom_child,
|
|
|
+ IRepository<crm_seorder, long> mysql_crm_seorder,
|
|
|
+ IRepository<crm_seorderentry, long> mysql_crm_seorderentry
|
|
|
)
|
|
|
{
|
|
|
_mes_technique = mes_technique;
|
|
|
@@ -405,6 +409,8 @@ namespace Business.ResourceExamineManagement
|
|
|
var morderList = await _mes_morder.GetManyByCondition(filter);
|
|
|
|
|
|
//TODO:获取销售订单信息
|
|
|
+ //var seorder = await _crm_seorder.FindAsync(x => x.Id == OrderId);
|
|
|
+ var seorderentry = await _crm_seorderentry.FindAsync(x => x.seorder_id == OrderId);
|
|
|
|
|
|
//工单已被占用后要与占用表关联查询...减去占用量后 剩下生产数量可供下个销售工单使用。
|
|
|
Expression<Func<mes_mooccupy, bool>> mooccupyfilter = x => x.moo_state == 1 && x.IsDeleted == false;
|
|
|
@@ -461,12 +467,12 @@ namespace Business.ResourceExamineManagement
|
|
|
mes_mooccupy mes_Mooccupy = new mes_mooccupy();
|
|
|
mes_Mooccupy.GenerateNewId();
|
|
|
mes_Mooccupy.moo_id_type = "分配";
|
|
|
- mes_Mooccupy.moo_id_billid = 0;//销售订单ID
|
|
|
- mes_Mooccupy.fbill_no = "0";//销售订单号
|
|
|
- mes_Mooccupy.fentry_id = 0;//销售订单行
|
|
|
+ mes_Mooccupy.moo_id_billid = seorderentry.seorder_id;//销售订单ID
|
|
|
+ mes_Mooccupy.fbill_no = seorderentry.bill_no;//销售订单号
|
|
|
+ mes_Mooccupy.fentry_id = seorderentry.entry_seq.Value;//销售订单行
|
|
|
mes_Mooccupy.fitem_name = string.Empty;//物料名称
|
|
|
mes_Mooccupy.fitem_number = bomNumber;
|
|
|
- mes_Mooccupy.fmodel = string.Empty;//规格型号
|
|
|
+ mes_Mooccupy.fmodel = seorderentry.specification;//规格型号
|
|
|
mes_Mooccupy.moo_moid = item.Id;
|
|
|
mes_Mooccupy.moo_mo = item.morder_no;
|
|
|
//占用量=生产计划数量-入库数量-已被占用数量
|