|
|
@@ -67,22 +67,27 @@ namespace Business.ResourceExamineManagement
|
|
|
/// 物料详情
|
|
|
/// </summary>
|
|
|
private readonly IMongoDB<ic_item> _ic_item;
|
|
|
- //private IRepository<ic_item, long> _mysql_ic_item;
|
|
|
+ private IBasicRepository<ic_item, long> _mysql_ic_item;
|
|
|
/// <summary>
|
|
|
/// 物料BOM
|
|
|
/// </summary>
|
|
|
private readonly IMongoDB<ic_bom> _ic_bom;
|
|
|
- //private IRepository<ic_bom, long> _mysql_ic_bom;
|
|
|
+ private IBasicRepository<ic_bom, long> _mysql_ic_bom;
|
|
|
/// <summary>
|
|
|
/// 物料BOM明细
|
|
|
/// </summary>
|
|
|
private readonly IMongoDB<ic_bom_child> _ic_bom_child;
|
|
|
- //private IRepository<ic_bom_child, long> _mysql_ic_bom_child;
|
|
|
+ private IBasicRepository<ic_bom_child, long> _mysql_ic_bom_child;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 物料库存表
|
|
|
+ /// </summary>
|
|
|
+ private readonly IMongoDB<ic_item_stock> _ic_item_stock;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 生产工单主表
|
|
|
/// </summary>
|
|
|
private readonly IMongoDB<mes_morder> _mes_morder;
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -95,10 +100,11 @@ namespace Business.ResourceExamineManagement
|
|
|
IMongoDB<ic_item> ic_item,
|
|
|
IMongoDB<ic_bom> ic_bom,
|
|
|
IMongoDB<ic_bom_child> ic_bom_child,
|
|
|
- IMongoDB<mes_morder> mes_morder
|
|
|
- //IRepository<ic_item, long> mysql_ic_item,
|
|
|
- //IRepository<ic_bom, long> mysql_ic_bom,
|
|
|
- //IRepository<ic_bom_child, long> mysql_ic_bom_child,
|
|
|
+ IMongoDB<ic_item_stock> ic_item_stock,
|
|
|
+ IMongoDB<mes_morder> mes_morder,
|
|
|
+ IBasicRepository<ic_item, long> mysql_ic_item,
|
|
|
+ IBasicRepository<ic_bom, long> mysql_ic_bom,
|
|
|
+ IBasicRepository<ic_bom_child, long> mysql_ic_bom_child
|
|
|
|
|
|
)
|
|
|
{
|
|
|
@@ -106,10 +112,11 @@ namespace Business.ResourceExamineManagement
|
|
|
_ic_item = ic_item;
|
|
|
_ic_bom = ic_bom;
|
|
|
_ic_bom_child = ic_bom_child;
|
|
|
+ _ic_item_stock = ic_item_stock;
|
|
|
_mes_morder = mes_morder;
|
|
|
- //_mysql_ic_item = mysql_ic_item;
|
|
|
- //_mysql_ic_bom = mysql_ic_bom;
|
|
|
- //_mysql_ic_bom_child = mysql_ic_bom_child;
|
|
|
+ _mysql_ic_item = mysql_ic_item;
|
|
|
+ _mysql_ic_bom = mysql_ic_bom;
|
|
|
+ _mysql_ic_bom_child = mysql_ic_bom_child;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -216,6 +223,10 @@ namespace Business.ResourceExamineManagement
|
|
|
dto.qty = 1;
|
|
|
dto.num = "1";
|
|
|
dto.isbom = 1;
|
|
|
+ dto.is_replace = 0;
|
|
|
+ dto.haveicsubs = 0;
|
|
|
+ dto.substitute_code = "";
|
|
|
+ dto.icitem_ids = "";
|
|
|
GetBomList(bomlist, bomchildlist, icitemlist, dto, returnlist);
|
|
|
}
|
|
|
|
|
|
@@ -243,6 +254,7 @@ namespace Business.ResourceExamineManagement
|
|
|
dto.unit = bom.unit;
|
|
|
dto.erp_cls = item.erp_cls;
|
|
|
dto.erp_cls_name = item.erp_cls_name;
|
|
|
+
|
|
|
|
|
|
//var bdto = ObjectMapper.Map<ic_bom,BomChildExamineDto>(bom);
|
|
|
returnlist.Add(dto);
|
|
|
@@ -267,6 +279,10 @@ namespace Business.ResourceExamineManagement
|
|
|
cdto.backflush = c.backflush;
|
|
|
cdto.num = childNum;
|
|
|
cdto.isbom = 1;
|
|
|
+ cdto.is_replace = c.is_replace;
|
|
|
+ cdto.haveicsubs = c.haveicsubs;
|
|
|
+ cdto.substitute_code = c.substitute_code;
|
|
|
+ cdto.icitem_ids = c.icitem_ids;
|
|
|
GetBomList(bomlist, bomchildlist, icitemlist, cdto, returnlist);
|
|
|
}
|
|
|
}
|
|
|
@@ -290,6 +306,10 @@ namespace Business.ResourceExamineManagement
|
|
|
childDto.backflush = c.backflush;
|
|
|
childDto.qty = c.qty.Value;
|
|
|
childDto.isbom = 0;
|
|
|
+ childDto.is_replace = c.is_replace;
|
|
|
+ childDto.haveicsubs = c.haveicsubs;
|
|
|
+ childDto.substitute_code = c.substitute_code;
|
|
|
+ childDto.icitem_ids = c.icitem_ids;
|
|
|
returnlist.Add(childDto);
|
|
|
}
|
|
|
}
|
|
|
@@ -298,18 +318,18 @@ namespace Business.ResourceExamineManagement
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public void BomSubstitute(List<BomChildExamineDto> returnlist)
|
|
|
+ /// <summary>
|
|
|
+ /// 计算库存量
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="returnlist"></param>
|
|
|
+ public void BomStock(List<BomChildExamineDto> returnlist)
|
|
|
{
|
|
|
returnlist = returnlist.OrderBy(s => s.num).ToList();
|
|
|
|
|
|
List<long> idlist = new List<long>();
|
|
|
foreach (var item in returnlist)
|
|
|
{
|
|
|
- if (item.num != "1")
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|