|
|
@@ -23,6 +23,8 @@ using Volo.Abp.ObjectMapping;
|
|
|
using Volo.Abp.Application.Services;
|
|
|
using ZstdSharp.Unsafe;
|
|
|
using System.Transactions;
|
|
|
+using NUglify.JavaScript.Syntax;
|
|
|
+using System.Linq.Expressions;
|
|
|
|
|
|
namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
@@ -67,22 +69,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 +102,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 +114,46 @@ 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>
|
|
|
+ /// mongoDB示例方法,后期删除
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task test()
|
|
|
+ {
|
|
|
+ //多条插入
|
|
|
+ List<mes_technique> infos = new List<mes_technique>();
|
|
|
+ mes_technique info;
|
|
|
+ for (int i = 0; i < 3; i++)
|
|
|
+ {
|
|
|
+ info = new mes_technique();
|
|
|
+ info.GenerateNewId();
|
|
|
+ info.tech_name = "多条" + i;
|
|
|
+ info.level = i;
|
|
|
+ infos.Add(info);
|
|
|
+ }
|
|
|
+ await _mes_technique.InsertMany(infos);
|
|
|
+
|
|
|
+ var info2 = _mes_technique.GetAll().Result;
|
|
|
+ var a = new PschedDto();
|
|
|
+ a.count = info2.Count;
|
|
|
+
|
|
|
+ //获取数据
|
|
|
+ var info1 = await _mes_technique.GetOneByID((long)1732029975067480064);
|
|
|
+
|
|
|
+ //更新数据
|
|
|
+ info1.tech_name = "更新***";
|
|
|
+ var rlt = await _mes_technique.UpdateOne(info1, info1.Id);
|
|
|
+
|
|
|
+ //根据条件查询数据
|
|
|
+ Expression<Func<mes_technique, bool>> filter = x => x.Id == (long)1732376973889097728 && x.tech_name == "多条0";
|
|
|
+ var info3 = await _mes_technique.GetManyByCondition(filter);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -120,30 +164,6 @@ namespace Business.ResourceExamineManagement
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
public async Task<PschedDto> ReceiveResult(SeorderentryDto input)
|
|
|
{
|
|
|
- ////多条插入
|
|
|
- //List<mes_technique> infos = new List<mes_technique>();
|
|
|
- //mes_technique info;
|
|
|
- //for (int i = 0; i < 3; i++)
|
|
|
- //{
|
|
|
- // info = new mes_technique();
|
|
|
- // info.GenerateNewId();
|
|
|
- // info.tech_name = "多条" + i;
|
|
|
- // info.level = i;
|
|
|
- // infos.Add(info);
|
|
|
- //}
|
|
|
- //await _mes_technique.InsertMany(infos);
|
|
|
-
|
|
|
- //var info2 = _mes_technique.GetAll().Result;
|
|
|
- //var a = new PschedDto();
|
|
|
- //a.count = info2.Count;
|
|
|
- //return a;
|
|
|
-
|
|
|
- ////获取数据
|
|
|
- //var info1 = await _mes_technique.GetOneByID((long)1732029975067480064);
|
|
|
-
|
|
|
- ////更新数据
|
|
|
- //info1.tech_name = "更新***";
|
|
|
- //var rlt =await _mes_technique.UpdateOne(info1, info1.Id);
|
|
|
return null;
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
@@ -219,6 +239,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);
|
|
|
}
|
|
|
|
|
|
@@ -246,6 +270,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);
|
|
|
@@ -270,6 +295,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);
|
|
|
}
|
|
|
}
|
|
|
@@ -293,6 +322,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);
|
|
|
}
|
|
|
}
|
|
|
@@ -300,5 +333,20 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /// <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)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|