|
|
@@ -24,18 +24,13 @@ namespace Business.Quartz
|
|
|
SnowFlake help = new SnowFlake();
|
|
|
private IRepository<in_kd_material, long> _kd_material;
|
|
|
private IRepository<ic_item, long> _ic_item;
|
|
|
- private IRepository<ic_itemTest, long> _ic_itemTest;
|
|
|
private IRepository<ic_item_ie, long> _ic_item_ie;
|
|
|
- private IRepository<ic_item_ieTest, long> _ic_item_ieTest;
|
|
|
private IRepository<ic_item_inventory, long> _ic_item_inventory;
|
|
|
private IRepository<ic_item_pur, long> _ic_item_pur;
|
|
|
- private IRepository<ic_item_purTest, long> _ic_item_purTest;
|
|
|
private IRepository<ic_item_stock, long> _ic_item_stock;
|
|
|
private IRepository<ic_plan, long> _ic_plan;
|
|
|
- private IRepository<ic_planTest, long> _ic_planTest;
|
|
|
private IRepository<ic_check, long> _ic_check;
|
|
|
private IRepository<ic_factory_details, long> _ic_factory_details;
|
|
|
- private IRepository<ic_factory_detailsTest, long> _ic_factory_detailsTest;
|
|
|
|
|
|
|
|
|
private IRepository<in_kd_bom, long> _kd_bom;
|
|
|
@@ -46,7 +41,6 @@ namespace Business.Quartz
|
|
|
private IRepository<ic_substitute_all_dtl, long> _ic_substitute_all_dtl;
|
|
|
|
|
|
private IRepository<ext_xref, long> _ext_xref;
|
|
|
- private IRepository<ext_xrefTest, long> _ext_xrefTest;
|
|
|
|
|
|
|
|
|
private readonly BusinessDbContext _businessDbContext;
|
|
|
@@ -55,18 +49,13 @@ namespace Business.Quartz
|
|
|
public ExtJobService(
|
|
|
IRepository<in_kd_material, long> kd_material,
|
|
|
IRepository<ic_item, long> ic_item,
|
|
|
- IRepository<ic_itemTest, long> ic_itemTest,
|
|
|
IRepository<ic_item_ie, long> ic_item_ie,
|
|
|
- IRepository<ic_item_ieTest, long> ic_item_ieTest,
|
|
|
IRepository<ic_item_inventory, long> ic_item_inventory,
|
|
|
IRepository<ic_item_pur, long> ic_item_pur,
|
|
|
- IRepository<ic_item_purTest, long> ic_item_purTest,
|
|
|
IRepository<ic_item_stock, long> ic_item_stock,
|
|
|
IRepository<ic_plan, long> ic_plan,
|
|
|
- IRepository<ic_planTest, long> ic_planTest,
|
|
|
IRepository<ic_check, long> ic_check,
|
|
|
IRepository<ic_factory_details, long> ic_factory_details,
|
|
|
- IRepository<ic_factory_detailsTest, long> ic_factory_detailsTest,
|
|
|
IRepository<in_kd_bom, long> kd_bom,
|
|
|
IRepository<ic_bom, long> ic_bom,
|
|
|
IRepository<ic_bom_child, long> ic_bom_child,
|
|
|
@@ -74,25 +63,19 @@ namespace Business.Quartz
|
|
|
IRepository<ic_substitute_all, long> ic_substitute_all,
|
|
|
IRepository<ic_substitute_all_dtl, long> ic_substitute_all_dtl,
|
|
|
IRepository<ext_xref, long> ext_xref,
|
|
|
- IRepository<ext_xrefTest, long> ext_xrefTest,
|
|
|
BusinessDbContext businessDbContext,
|
|
|
BusinessExtDbContext businessExtDbContext
|
|
|
)
|
|
|
{
|
|
|
_kd_material= kd_material;
|
|
|
_ic_item= ic_item;
|
|
|
- _ic_itemTest = ic_itemTest;
|
|
|
_ic_item_ie = ic_item_ie;
|
|
|
- _ic_item_ieTest = ic_item_ieTest;
|
|
|
_ic_item_inventory = ic_item_inventory;
|
|
|
_ic_item_pur= ic_item_pur;
|
|
|
- _ic_item_purTest = ic_item_purTest;
|
|
|
_ic_item_stock = ic_item_stock;
|
|
|
_ic_plan= ic_plan;
|
|
|
- _ic_planTest = ic_planTest;
|
|
|
_ic_check = ic_check;
|
|
|
_ic_factory_details= ic_factory_details;
|
|
|
- _ic_factory_detailsTest = ic_factory_detailsTest;
|
|
|
_kd_bom = kd_bom;
|
|
|
_ic_bom= ic_bom;
|
|
|
_ic_bom_child= ic_bom_child;
|
|
|
@@ -100,7 +83,6 @@ namespace Business.Quartz
|
|
|
_ic_substitute_all= ic_substitute_all;
|
|
|
_ic_substitute_all_dtl= ic_substitute_all_dtl;
|
|
|
_ext_xref= ext_xref;
|
|
|
- _ext_xrefTest = ext_xrefTest;
|
|
|
_businessDbContext = businessDbContext;
|
|
|
_businessExtDbContext = businessExtDbContext;
|
|
|
}
|
|
|
@@ -120,24 +102,23 @@ namespace Business.Quartz
|
|
|
public async Task DoMaterial()
|
|
|
{
|
|
|
var extMaterials=_kd_material.GetListAsync();
|
|
|
- var ic_items = _ic_itemTest.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- var ic_factory_detailss = _ic_factory_detailsTest.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- var ic_item_ies = _ic_item_ieTest.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- var ic_item_purs = _ic_item_purTest.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- var ic_plans = _ic_planTest.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
-
|
|
|
-
|
|
|
- List<ic_itemTest> ic_itemListAdd = new List<ic_itemTest>();
|
|
|
- List<ic_itemTest> ic_itemListUpdate = new List<ic_itemTest>();
|
|
|
- List<ic_factory_detailsTest> ic_factory_detailsListAdd = new List<ic_factory_detailsTest>();
|
|
|
- List<ic_factory_detailsTest> ic_factory_detailsListUpdate = new List<ic_factory_detailsTest>();
|
|
|
- List<ic_item_ieTest> ic_item_ieListAdd = new List<ic_item_ieTest>();
|
|
|
- List<ic_item_ieTest> ic_item_ieListUpdate = new List<ic_item_ieTest>();
|
|
|
- List<ic_item_purTest> ic_item_purListAdd = new List<ic_item_purTest>();
|
|
|
- List<ic_item_purTest> ic_item_purListUpdate = new List<ic_item_purTest>();
|
|
|
- List<ic_planTest> ic_planListAdd = new List<ic_planTest>();
|
|
|
- List<ic_planTest> ic_planListUpdate = new List<ic_planTest>();
|
|
|
- List<ext_xrefTest> ext_xrefList = new List<ext_xrefTest>();
|
|
|
+ var ic_items = _ic_item.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
+ var ic_factory_detailss = _ic_factory_details.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
+ var ic_item_ies = _ic_item_ie.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
+ var ic_item_purs = _ic_item_pur.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
+ var ic_plans = _ic_plan.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
+
|
|
|
+ List<ic_item> ic_itemListAdd = new List<ic_item>();
|
|
|
+ List<ic_item> ic_itemListUpdate = new List<ic_item>();
|
|
|
+ List<ic_factory_details> ic_factory_detailsListAdd = new List<ic_factory_details>();
|
|
|
+ List<ic_factory_details> ic_factory_detailsListUpdate = new List<ic_factory_details>();
|
|
|
+ List<ic_item_ie> ic_item_ieListAdd = new List<ic_item_ie>();
|
|
|
+ List<ic_item_ie> ic_item_ieListUpdate = new List<ic_item_ie>();
|
|
|
+ List<ic_item_pur> ic_item_purListAdd = new List<ic_item_pur>();
|
|
|
+ List<ic_item_pur> ic_item_purListUpdate = new List<ic_item_pur>();
|
|
|
+ List<ic_plan> ic_planListAdd = new List<ic_plan>();
|
|
|
+ List<ic_plan> ic_planListUpdate = new List<ic_plan>();
|
|
|
+ List<ext_xref> ext_xrefList = new List<ext_xref>();
|
|
|
if (extMaterials != null)
|
|
|
{
|
|
|
extMaterials.Result.ForEach(ext =>
|
|
|
@@ -171,7 +152,7 @@ namespace Business.Quartz
|
|
|
ic_item.allowbatch = ext.F_SFJLPCH == "是" ? 1 : 0;
|
|
|
ic_itemListUpdate.Add(ic_item);
|
|
|
|
|
|
- ext_xrefList.Add(new ext_xrefTest
|
|
|
+ ext_xrefList.Add(new ext_xref
|
|
|
{
|
|
|
dop_table_name = "ic_item",
|
|
|
dop_id = ic_item.Id,
|
|
|
@@ -232,7 +213,7 @@ namespace Business.Quartz
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ic_itemTest item = new ic_itemTest(help.NextId());
|
|
|
+ ic_item item = new ic_item(help.NextId());
|
|
|
item.number = ext.FNumber;
|
|
|
item.name = ext.FName_2052;
|
|
|
item.model = ext.FSpecification_2052;
|
|
|
@@ -267,7 +248,7 @@ namespace Business.Quartz
|
|
|
item.enable_warning = 0;
|
|
|
ic_itemListAdd.Add(item);
|
|
|
|
|
|
- ext_xrefList.Add(new ext_xrefTest
|
|
|
+ ext_xrefList.Add(new ext_xref
|
|
|
{
|
|
|
dop_table_name = "ic_item",
|
|
|
dop_id = item.Id,
|
|
|
@@ -280,7 +261,7 @@ namespace Business.Quartz
|
|
|
other_col1_value = ext.FNumber
|
|
|
});
|
|
|
|
|
|
- ic_factory_detailsListAdd.Add(new ic_factory_detailsTest(help.NextId())
|
|
|
+ ic_factory_detailsListAdd.Add(new ic_factory_details(help.NextId())
|
|
|
{
|
|
|
icitem_id = item.Id,
|
|
|
icitem_name = ext.FName_2052,
|
|
|
@@ -305,7 +286,7 @@ namespace Business.Quartz
|
|
|
minorderqty = 0
|
|
|
});
|
|
|
|
|
|
- ic_item_ieListAdd.Add(new ic_item_ieTest(help.NextId())
|
|
|
+ ic_item_ieListAdd.Add(new ic_item_ie(help.NextId())
|
|
|
{
|
|
|
icitem_id = item.Id,
|
|
|
isbackflush = ext.FIsBatchManage == "是" ? 1 : 0,
|
|
|
@@ -316,7 +297,7 @@ namespace Business.Quartz
|
|
|
IsDeleted = false,//TODO
|
|
|
});
|
|
|
|
|
|
- ic_item_purListAdd.Add(new ic_item_purTest(help.NextId())
|
|
|
+ ic_item_purListAdd.Add(new ic_item_pur(help.NextId())
|
|
|
{
|
|
|
icitem_id = item.Id,
|
|
|
icitem_name = item.name,
|
|
|
@@ -331,7 +312,7 @@ namespace Business.Quartz
|
|
|
purchase_unit = ext.FPurchaseUnitId_Name
|
|
|
});
|
|
|
|
|
|
- ic_planListAdd.Add(new ic_planTest(help.NextId())
|
|
|
+ ic_planListAdd.Add(new ic_plan(help.NextId())
|
|
|
{
|
|
|
icitem_id = item.Id,
|
|
|
icitem_name = item.name,
|
|
|
@@ -353,347 +334,65 @@ namespace Business.Quartz
|
|
|
});
|
|
|
if (ic_itemListAdd.Count > 0)
|
|
|
{
|
|
|
- await _ic_itemTest.InsertManyAsync(ic_itemListAdd);
|
|
|
- //_businessDbContext.ic_itemTest.AddRange(ic_itemListAdd);
|
|
|
- //await _businessDbContext.ic_itemTest.BatchInsertIntoAsync(_businessDbContext.ic_itemTest);
|
|
|
+ //await _ic_item.InsertManyAsync(ic_itemListAdd);
|
|
|
+ await _businessDbContext.ic_item.BulkInsertAsync(ic_itemListAdd, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
if (ic_itemListUpdate.Count > 0)
|
|
|
{
|
|
|
- await _ic_itemTest.UpdateManyAsync(ic_itemListUpdate);
|
|
|
+ //await _ic_item.UpdateManyAsync(ic_itemListUpdate);
|
|
|
+ await _businessDbContext.ic_item.BulkUpdateAsync(ic_itemListUpdate, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
if (ic_factory_detailsListAdd.Count > 0)
|
|
|
{
|
|
|
- await _ic_factory_detailsTest.InsertManyAsync(ic_factory_detailsListAdd);
|
|
|
- //_businessDbContext.ic_factory_detailsTest.AddRange(ic_factory_detailsListAdd);
|
|
|
- //await _businessDbContext.ic_factory_detailsTest.BatchInsertIntoAsync(_businessDbContext.ic_factory_detailsTest);
|
|
|
+ //await _ic_factory_details.InsertManyAsync(ic_factory_detailsListAdd);
|
|
|
+ await _businessDbContext.ic_factory_details.BulkInsertAsync(ic_factory_detailsListAdd, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
if (ic_factory_detailsListUpdate.Count > 0)
|
|
|
{
|
|
|
- await _ic_factory_detailsTest.UpdateManyAsync(ic_factory_detailsListUpdate);
|
|
|
+ //await _ic_factory_details.UpdateManyAsync(ic_factory_detailsListUpdate);
|
|
|
+ await _businessDbContext.ic_factory_details.BulkUpdateAsync(ic_factory_detailsListUpdate, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
if (ic_item_ieListAdd.Count > 0)
|
|
|
{
|
|
|
- await _ic_item_ieTest.InsertManyAsync(ic_item_ieListAdd);
|
|
|
- //_businessDbContext.ic_item_ieTest.AddRange(ic_item_ieListAdd);
|
|
|
- //await _businessDbContext.ic_item_ieTest.BatchInsertIntoAsync(_businessDbContext.ic_item_ieTest);
|
|
|
+ //await _ic_item_ie.InsertManyAsync(ic_item_ieListAdd);
|
|
|
+ await _businessDbContext.ic_item_ie.BulkInsertAsync(ic_item_ieListAdd, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
if (ic_item_ieListUpdate.Count > 0)
|
|
|
{
|
|
|
- await _ic_item_ieTest.UpdateManyAsync(ic_item_ieListUpdate);
|
|
|
+ //await _ic_item_ie.UpdateManyAsync(ic_item_ieListUpdate);
|
|
|
+ await _businessDbContext.ic_item_ie.BulkUpdateAsync(ic_item_ieListUpdate, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
if (ic_item_purListAdd.Count > 0)
|
|
|
{
|
|
|
- await _ic_item_purTest.InsertManyAsync(ic_item_purListAdd);
|
|
|
- //_businessDbContext.ic_item_purTest.AddRange(ic_item_purListAdd);
|
|
|
- //await _businessDbContext.ic_item_purTest.BatchInsertIntoAsync(_businessDbContext.ic_item_purTest);
|
|
|
+ //await _ic_item_pur.InsertManyAsync(ic_item_purListAdd);
|
|
|
+ await _businessDbContext.ic_item_pur.BulkInsertAsync(ic_item_purListAdd, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
if (ic_item_purListUpdate.Count > 0)
|
|
|
{
|
|
|
- await _ic_item_purTest.UpdateManyAsync(ic_item_purListUpdate);
|
|
|
+ //await _ic_item_pur.UpdateManyAsync(ic_item_purListUpdate);
|
|
|
+ await _businessDbContext.ic_item_pur.BulkUpdateAsync(ic_item_purListUpdate, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
if (ic_planListAdd.Count > 0)
|
|
|
{
|
|
|
- await _ic_planTest.InsertManyAsync(ic_planListAdd);
|
|
|
- //_businessDbContext.ic_planTest.AddRange(ic_planListAdd);
|
|
|
- //await _businessDbContext.ic_planTest.BatchInsertIntoAsync(_businessDbContext.ic_planTest);
|
|
|
+ //await _ic_plan.InsertManyAsync(ic_planListAdd);
|
|
|
+ await _businessDbContext.ic_plan.BulkInsertAsync(ic_planListAdd, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
if (ic_planListUpdate.Count > 0)
|
|
|
{
|
|
|
- await _ic_planTest.UpdateManyAsync(ic_planListUpdate);
|
|
|
+ //await _ic_plan.UpdateManyAsync(ic_planListUpdate);
|
|
|
+ await _businessDbContext.ic_plan.BulkUpdateAsync(ic_planListUpdate, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
|
|
|
if (ext_xrefList.Count > 0)
|
|
|
{
|
|
|
- await _ext_xrefTest.InsertManyAsync(ext_xrefList);
|
|
|
- //_businessExtDbContext.ext_xrefTest.AddRange(ext_xrefList);
|
|
|
- //await _businessExtDbContext.ext_xrefTest.BatchInsertIntoAsync(_businessExtDbContext.ext_xrefTest);
|
|
|
+ //await _ext_xref.UpdateManyAsync(ext_xrefList);
|
|
|
+ await _businessExtDbContext.ext_xref.BulkInsertAsync(ext_xrefList, options => options.AutoMapOutputDirection = false);
|
|
|
}
|
|
|
}
|
|
|
- //var ic_items = _ic_item.GetListAsync(p=>p.factory_id==10101&&p.org_id==101&&p.tenant_id==101);
|
|
|
- //var ic_factory_detailss = _ic_factory_details.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- //var ic_item_ies = _ic_item_ie.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- //var ic_item_purs = _ic_item_pur.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
- //var ic_plans = _ic_plan.GetListAsync(p => p.factory_id == 10101 && p.org_id == 101 && p.tenant_id == 101);
|
|
|
-
|
|
|
-
|
|
|
- //List<ic_item> ic_itemListAdd = new List<ic_item>();
|
|
|
- //List<ic_item> ic_itemListUpdate = new List<ic_item>();
|
|
|
- //List<ic_factory_details> ic_factory_detailsListAdd = new List<ic_factory_details>();
|
|
|
- //List<ic_factory_details> ic_factory_detailsListUpdate = new List<ic_factory_details>();
|
|
|
- //List<ic_item_ie> ic_item_ieListAdd = new List<ic_item_ie>();
|
|
|
- //List<ic_item_ie> ic_item_ieListUpdate = new List<ic_item_ie>();
|
|
|
- //List<ic_item_pur> ic_item_purListAdd = new List<ic_item_pur>();
|
|
|
- //List<ic_item_pur> ic_item_purListUpdate = new List<ic_item_pur>();
|
|
|
- //List<ic_plan> ic_planListAdd = new List<ic_plan>();
|
|
|
- //List<ic_plan> ic_planListUpdate = new List<ic_plan>();
|
|
|
- //List<ext_xref> ext_xrefList = new List<ext_xref>();
|
|
|
- // if (extMaterials != null)
|
|
|
- //{
|
|
|
- // extMaterials.Result.ForEach(ext =>
|
|
|
- // {
|
|
|
- // if(ic_items != null && ic_items.Result.Exists(a=>a.number==ext.FNumber))
|
|
|
- // {
|
|
|
- // var ic_item = ic_items.Result.FirstOrDefault(a => a.number == ext.FNumber);
|
|
|
- // if (ic_item != null)
|
|
|
- // {
|
|
|
- // ic_item.number = ext.FNumber;
|
|
|
- // ic_item.name = ext.FName_2052;
|
|
|
- // ic_item.model = ext.FSpecification_2052;
|
|
|
- // ic_item.full_name = ext.FDescription_2052;
|
|
|
- // ic_item.fms_number = ext.FOldNumber;
|
|
|
- // //0.配置类 1. 2.委外加工 3.外购 4.虚拟件
|
|
|
- // ic_item.erp_cls = ext.FErpClsID == "配置类" ? 0 : ext.FErpClsID == "自制" ? 1 : ext.FErpClsID == "委外" ? 2 : ext.FErpClsID == "外购" ? 3 : ext.FErpClsID == "虚拟" ? 4 : ext.FErpClsID == "费用" ? 5 : ext.FErpClsID == "服务" ? 6 : -1;
|
|
|
- // ic_item.source = ext.FDataSource;
|
|
|
- // ic_item.iskeyitem = ext.FIsKitting == "是" ? 1 : 0;
|
|
|
- // ic_item.gross_weight = ext.FGROSSWEIGHT;
|
|
|
- // ic_item.net_weight = ext.FNETWEIGHT;
|
|
|
- // ic_item.maund = ext.FWEIGHTUNITID_Name;
|
|
|
- // ic_item.cubic_measure = ext.FVOLUMEUNITID_Name;
|
|
|
- // ic_item.length = ext.FLENGTH;
|
|
|
- // ic_item.width = ext.FWIDTH;
|
|
|
- // ic_item.height = ext.FHEIGHT;
|
|
|
- // ic_item.size = ext.FVOLUME;
|
|
|
- // ic_item.allowpur = ext.FIsPurchase == "是" ? 1 : 0;
|
|
|
- // ic_item.allowsale = ext.FIsSale == "是" ? 1 : 0;
|
|
|
- // ic_item.allowmanu = ext.FIsProduce == "是" ? 1 : 0;
|
|
|
- // ic_item.allowout = ext.FIsSubContract == "是" ? 1 : 0;
|
|
|
- // ic_item.allowbatch = ext.F_SFJLPCH == "是" ? 1 : 0;
|
|
|
- // ic_itemListUpdate.Add(ic_item);
|
|
|
-
|
|
|
- // ext_xrefList.Add(new ext_xref
|
|
|
- // {
|
|
|
- // dop_table_name = "ic_item",
|
|
|
- // dop_id= ic_item.Id,
|
|
|
- // dop_col1_name= "number",
|
|
|
- // dop_col1_value= ic_item.number,
|
|
|
- // other_sys_name="kd",
|
|
|
- // other_table_name= "in_kd_material",
|
|
|
- // other_id=ext.Id,
|
|
|
- // other_col1_name= "FNumber",
|
|
|
- // other_col1_value=ext.FNumber
|
|
|
- // });
|
|
|
-
|
|
|
- // var ic_factory_detail = ic_factory_detailss.Result.FirstOrDefault(a => a.icitem_id == ic_item.Id);
|
|
|
- // if (ic_factory_detail != null)
|
|
|
- // {
|
|
|
- // ic_factory_detail.product_line = ext.F_CPX_Name;
|
|
|
- // ic_factory_detail.minpackqty = ext.FIncreaseQty;
|
|
|
- // ic_factory_detailsListUpdate.Add(ic_factory_detail);
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // var ic_item_ie = ic_item_ies.Result.FirstOrDefault(a => a.icitem_id == ic_item.Id);
|
|
|
- // if (ic_item_ie != null)
|
|
|
- // {
|
|
|
- // ic_item_ie.isbackflush = ext.FIsBatchManage == "是" ? 1 : 0;
|
|
|
- // ic_item_ieListUpdate.Add(ic_item_ie);
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // var ic_item_pur = ic_item_purs.Result.FirstOrDefault(a => a.icitem_id == ic_item.Id);
|
|
|
- // if (ic_item_pur != null)
|
|
|
- // {
|
|
|
- // ic_item_pur.icitem_name = ic_item.name;
|
|
|
- // ic_item_pur.purchgroup = ext.FPurchaseGroupId_Name;
|
|
|
- // ic_item_pur.purcher = ext.FPurchaserId_Name;
|
|
|
- // ic_item_pur.purchase_unit = ext.FPurchaseUnitId_Name;
|
|
|
- // ic_item_purListUpdate.Add(ic_item_pur);
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // var ic_plan = ic_plans.Result.FirstOrDefault(a => a.icitem_id == ic_item.Id);
|
|
|
- // if (ic_plan != null)
|
|
|
- // {
|
|
|
- // ic_plan.icitem_name = ic_item.name;
|
|
|
- // ic_plan.planner_name = ext.FPurchaseGroupId_Name;
|
|
|
- // ic_plan.fix_leadtime = ext.FFixLeadTime;
|
|
|
- // ic_plan.plan_trategy = ext.FPlanningStrategy == "MRP" ? 1 : 0;
|
|
|
- // ic_plan.order_trategy = ext.FOrderPolicy == "LFL(批对批)" ? 1 : 0;
|
|
|
- // ic_plan.order_inter_val = ext.FOrderIntervalTime;
|
|
|
- // ic_plan.lead_time = ext.FVarLeadTime;
|
|
|
- // ic_plan.bat_change_economy = ext.FVarLeadTimeLotSize;
|
|
|
- // ic_plan.order_point = ext.FReOrderGood;
|
|
|
- // ic_plan.secinv = ext.FPlanSafeStockQty;
|
|
|
- // ic_planListUpdate.Add(ic_plan);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // ic_item item = new ic_item(help.NextId());
|
|
|
- // item.number = ext.FNumber;
|
|
|
- // item.name = ext.FName_2052;
|
|
|
- // item.model = ext.FSpecification_2052;
|
|
|
- // item.full_name = ext.FDescription_2052;
|
|
|
- // item.fms_number = ext.FOldNumber;
|
|
|
- // //0.配置类 1. 2.委外加工 3.外购 4.虚拟件
|
|
|
- // item.erp_cls = ext.FErpClsID == "配置类" ? 0 : ext.FErpClsID == "自制" ? 1 : ext.FErpClsID == "委外" ? 2 : ext.FErpClsID == "外购" ? 3 : ext.FErpClsID == "虚拟" ? 4 : ext.FErpClsID == "费用" ? 5: ext.FErpClsID == "服务" ? 6: - 1;
|
|
|
- // item.source = ext.FDataSource;
|
|
|
- // item.iskeyitem = ext.FIsKitting == "是" ? 1 : 0;
|
|
|
- // item.gross_weight = ext.FGROSSWEIGHT;
|
|
|
- // item.net_weight = ext.FNETWEIGHT;
|
|
|
- // item.maund = ext.FWEIGHTUNITID_Name;
|
|
|
- // item.cubic_measure = ext.FVOLUMEUNITID_Name;
|
|
|
- // item.length = ext.FLENGTH;
|
|
|
- // item.width = ext.FWIDTH;
|
|
|
- // item.height = ext.FHEIGHT;
|
|
|
- // item.size = ext.FVOLUME;
|
|
|
- // item.allowpur = ext.FIsPurchase == "是" ? 1 : 0;
|
|
|
- // item.allowsale = ext.FIsSale == "是" ? 1 : 0;
|
|
|
- // item.allowmanu = ext.FIsProduce == "是" ? 1 : 0;
|
|
|
- // item.allowout = ext.FIsSubContract == "是" ? 1 : 0;
|
|
|
- // item.allowbatch = ext.F_SFJLPCH == "是" ? 1 : 0;
|
|
|
- // item.tenant_id = 101;//TODO
|
|
|
- // item.factory_id = 10101;//TODO
|
|
|
- // item.org_id = 101;//TODO
|
|
|
- // item.IsDeleted = false;//TODO
|
|
|
- // item.is_equipment = 0;
|
|
|
- // item.item_level = 0;
|
|
|
- // item.hb_level = 0;
|
|
|
- // item.matatt = 0;
|
|
|
- // item.picktype = 0;
|
|
|
- // item.enable_warning = 0;
|
|
|
- // ic_itemListAdd.Add(item);
|
|
|
-
|
|
|
- // ext_xrefList.Add(new ext_xref
|
|
|
- // {
|
|
|
- // dop_table_name = "ic_item",
|
|
|
- // dop_id = item.Id,
|
|
|
- // dop_col1_name = "number",
|
|
|
- // dop_col1_value = item.number,
|
|
|
- // other_sys_name = "kd",
|
|
|
- // other_table_name = "in_kd_material",
|
|
|
- // other_id = ext.Id,
|
|
|
- // other_col1_name = "FNumber",
|
|
|
- // other_col1_value = ext.FNumber
|
|
|
- // });
|
|
|
-
|
|
|
- // ic_factory_detailsListAdd.Add(new ic_factory_details(help.NextId())
|
|
|
- // {
|
|
|
- // icitem_id = item.Id,
|
|
|
- // icitem_name = ext.FName_2052,
|
|
|
- // tenant_id = 101,//TODO
|
|
|
- // factory_id = 10101,////TODO
|
|
|
- // org_id = 101,//TODO
|
|
|
- // IsDeleted = false,//TODO
|
|
|
- // pick_type= 0,
|
|
|
- // stock_time= 0,
|
|
|
- // batch_manager=0,
|
|
|
- // days_per=0,
|
|
|
- // default_chkloc=0,
|
|
|
- // default_chksp=0,
|
|
|
- // default_loc=0,
|
|
|
- // default_sp=0,
|
|
|
- // product_line = ext.F_CPX_Name,
|
|
|
- // production_leadtime= 0,
|
|
|
- // stock_leadtime= 0,
|
|
|
- // transportation_leadtime=0,
|
|
|
- // order_leadtime = 0,
|
|
|
- // minpackqty = ext.FIncreaseQty,
|
|
|
- // minorderqty =0
|
|
|
- // });
|
|
|
-
|
|
|
- // ic_item_ieListAdd.Add(new ic_item_ie(help.NextId())
|
|
|
- // {
|
|
|
- // icitem_id = item.Id,
|
|
|
- // isbackflush = ext.FIsBatchManage == "是" ? 1 : 0,
|
|
|
- // put_integer=0,//TODO
|
|
|
- // tenant_id = 101,//TODO
|
|
|
- // factory_id = 10101,////TODO
|
|
|
- // org_id = 101,//TODO
|
|
|
- // IsDeleted = false,//TODO
|
|
|
- // });
|
|
|
-
|
|
|
- // ic_item_purListAdd.Add(new ic_item_pur(help.NextId())
|
|
|
- // {
|
|
|
- // icitem_id = item.Id,
|
|
|
- // icitem_name = item.name,
|
|
|
- // currency_type= ext.FCurrencyId_Name == "人民币" ? 1 : 0,//TODO
|
|
|
- // tenant_id=101,//TODO
|
|
|
- // factory_id=10101,////TODO
|
|
|
- // org_id =101,//TODO
|
|
|
- // IsDeleted =false,//TODO
|
|
|
- // supplier_id=0,
|
|
|
- // purchgroup = ext.FPurchaseGroupId_Name,
|
|
|
- // purcher = ext.FPurchaserId_Name,
|
|
|
- // purchase_unit = ext.FPurchaseUnitId_Name
|
|
|
- // });
|
|
|
-
|
|
|
- // ic_planListAdd.Add(new ic_plan(help.NextId())
|
|
|
- // {
|
|
|
- // icitem_id = item.Id,
|
|
|
- // icitem_name = item.name,
|
|
|
- // planner_name = ext.FPurchaseGroupId_Name,
|
|
|
- // fix_leadtime = ext.FFixLeadTime,
|
|
|
- // plan_trategy = ext.FPlanningStrategy == "MRP" ? 1 : 0,
|
|
|
- // order_trategy = ext.FOrderPolicy == "LFL(批对批)" ? 1 : 0,
|
|
|
- // order_inter_val = ext.FOrderIntervalTime,
|
|
|
- // lead_time = ext.FVarLeadTime,
|
|
|
- // bat_change_economy = ext.FVarLeadTimeLotSize,
|
|
|
- // order_point = ext.FReOrderGood,
|
|
|
- // secinv = ext.FPlanSafeStockQty,
|
|
|
- // tenant_id = 101,//TODO
|
|
|
- // factory_id = 10101,////TODO
|
|
|
- // org_id = 101,//TODO
|
|
|
- // IsDeleted = false,//TODO
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
- // if(ic_itemListAdd.Count>0)
|
|
|
- // {
|
|
|
- // await _ic_item.InsertManyAsync(ic_itemListAdd);
|
|
|
- // }
|
|
|
- // if (ic_itemListUpdate.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_item.UpdateManyAsync(ic_itemListUpdate);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (ic_factory_detailsListAdd.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_factory_details.InsertManyAsync(ic_factory_detailsListAdd);
|
|
|
- // }
|
|
|
- // if (ic_factory_detailsListUpdate.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_factory_details.UpdateManyAsync(ic_factory_detailsListUpdate);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (ic_item_ieListAdd.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_item_ie.InsertManyAsync(ic_item_ieListAdd);
|
|
|
- // }
|
|
|
- // if (ic_item_ieListUpdate.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_item_ie.UpdateManyAsync(ic_item_ieListUpdate);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (ic_item_purListAdd.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_item_pur.InsertManyAsync(ic_item_purListAdd);
|
|
|
- // }
|
|
|
- // if (ic_item_purListUpdate.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_item_pur.UpdateManyAsync(ic_item_purListUpdate);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (ic_planListAdd.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_plan.InsertManyAsync(ic_planListAdd);
|
|
|
- // }
|
|
|
- // if (ic_planListUpdate.Count > 0)
|
|
|
- // {
|
|
|
- // await _ic_plan.UpdateManyAsync(ic_planListUpdate);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (ext_xrefList.Count > 0)
|
|
|
- // {
|
|
|
- // await _ext_xref.UpdateManyAsync(ext_xrefList);
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 处理物料清单
|