|
|
@@ -173,39 +173,39 @@ namespace Business.SyncDataManagement
|
|
|
public async void SyncBaseDataToMongoDB()
|
|
|
{
|
|
|
//同步物料Bom数据
|
|
|
- var icBoms = _mysql_ic_bom.GetListAsync().Result;
|
|
|
- if (icBoms.Count > 0)
|
|
|
- {
|
|
|
- //先清空表数据
|
|
|
- await _ic_bom.Delete(p => p.mysql_id != -1);
|
|
|
- var moIcBoms = ObjectMapper.Map<List<ic_bom>, List<mo_ic_bom>>(icBoms);
|
|
|
- moIcBoms.ForEach(s => s.id = help.NextId());
|
|
|
- //插入数据
|
|
|
- await _ic_bom.InsertMany(moIcBoms);
|
|
|
- }
|
|
|
+ //var icBoms = _mysql_ic_bom.GetListAsync().Result;
|
|
|
+ //if (icBoms.Count > 0)
|
|
|
+ //{
|
|
|
+ // //先清空表数据
|
|
|
+ // await _ic_bom.Delete(p => p.mysql_id != -1);
|
|
|
+ // var moIcBoms = ObjectMapper.Map<List<ic_bom>, List<mo_ic_bom>>(icBoms);
|
|
|
+ // moIcBoms.ForEach(s => s.id = help.NextId());
|
|
|
+ // //插入数据
|
|
|
+ // await _ic_bom.InsertMany(moIcBoms);
|
|
|
+ //}
|
|
|
|
|
|
- //同步物料BOM明细数据
|
|
|
- var icbom_childs = _mysql_ic_bom_child.GetListAsync().Result;
|
|
|
- if (icbom_childs.Count > 0)
|
|
|
- {
|
|
|
- //先清空表数据
|
|
|
- await _ic_bom_child.Delete(p => p.mysql_id != -1);
|
|
|
- var moIcbom_childs = ObjectMapper.Map<List<ic_bom_child>, List<mo_ic_bom_child>>(icbom_childs);
|
|
|
- moIcbom_childs.ForEach(s => s.id = help.NextId());
|
|
|
- //插入数据
|
|
|
- await _ic_bom_child.InsertMany(moIcbom_childs);
|
|
|
- }
|
|
|
+ ////同步物料BOM明细数据
|
|
|
+ //var icbom_childs = _mysql_ic_bom_child.GetListAsync().Result;
|
|
|
+ //if (icbom_childs.Count > 0)
|
|
|
+ //{
|
|
|
+ // //先清空表数据
|
|
|
+ // await _ic_bom_child.Delete(p => p.mysql_id != -1);
|
|
|
+ // var moIcbom_childs = ObjectMapper.Map<List<ic_bom_child>, List<mo_ic_bom_child>>(icbom_childs);
|
|
|
+ // moIcbom_childs.ForEach(s => s.id = help.NextId());
|
|
|
+ // //插入数据
|
|
|
+ // await _ic_bom_child.InsertMany(moIcbom_childs);
|
|
|
+ //}
|
|
|
|
|
|
- //工厂物料明细表
|
|
|
- var ic_factory_details = _mysql_ic_factory_details.GetListAsync().Result;
|
|
|
- if (ic_factory_details.Count > 0)
|
|
|
- {
|
|
|
- //先清空表数据
|
|
|
- await _ic_factory_details.Delete(p => p.mysql_id != -1);
|
|
|
- var moIc_factory_details = ObjectMapper.Map<List<ic_factory_details>, List<mo_ic_factory_details>>(ic_factory_details);
|
|
|
- moIc_factory_details.ForEach(s => s.id = help.NextId());
|
|
|
- await _ic_factory_details.InsertMany(moIc_factory_details);
|
|
|
- }
|
|
|
+ ////工厂物料明细表
|
|
|
+ //var ic_factory_details = _mysql_ic_factory_details.GetListAsync().Result;
|
|
|
+ //if (ic_factory_details.Count > 0)
|
|
|
+ //{
|
|
|
+ // //先清空表数据
|
|
|
+ // await _ic_factory_details.Delete(p => p.mysql_id != -1);
|
|
|
+ // var moIc_factory_details = ObjectMapper.Map<List<ic_factory_details>, List<mo_ic_factory_details>>(ic_factory_details);
|
|
|
+ // moIc_factory_details.ForEach(s => s.id = help.NextId());
|
|
|
+ // await _ic_factory_details.InsertMany(moIc_factory_details);
|
|
|
+ //}
|
|
|
|
|
|
//同步物料数据
|
|
|
var icItems = _mysql_ic_item.GetListAsync().Result;
|