瀏覽代碼

库存检查处理

tangdi 2 年之前
父節點
當前提交
29a91d262d
共有 1 個文件被更改,包括 8 次插入24 次删除
  1. 8 24
      MicroServices/Business/Business.Application/SystemJobManagement/SystemJobAppService.cs

+ 8 - 24
MicroServices/Business/Business.Application/SystemJobManagement/SystemJobAppService.cs

@@ -703,7 +703,7 @@ namespace Business.SystemJobManagement
                             erpclsText = "外购";
                             erpclsText = "外购";
                         }
                         }
                     }
                     }
-                    var upditemStock = icitemStokc.Find(x => x.icitem_number == ic_item.number);
+                    var addStock = icitemStokc.Find(x => x.icitem_number == custList[i].ItemNum);
                     if (ic_item == null)
                     if (ic_item == null)
                     {
                     {
                         ItemsAdd.Add(new ic_item(itemId)
                         ItemsAdd.Add(new ic_item(itemId)
@@ -758,23 +758,7 @@ namespace Business.SystemJobManagement
                             Warehousing_date = 1,
                             Warehousing_date = 1,
                             Shipping_date = 3,
                             Shipping_date = 3,
                             PurLT = custList[i].PurLT
                             PurLT = custList[i].PurLT
-                        });;
-                        /*ic_item_stock addStock = new ic_item_stock();
-                        addStock.GenerateNewId(help.NextId());
-                        addStock.icitem_id = itemId;
-                        addStock.icitem_number = custList[i].ItemNum; //物料编码
-                        addStock.icitem_name = custList[i].Descr; //物料名称
-                        addStock.sqty = 0;
-                        addStock.quantity_in_transit = 0;
-                        addStock.fversion = "";
-                        addStock.factory_id = long.Parse(custList[i].Domain);
-                        addStock.company_id = 1000;
-                        addStock.tenant_id = 1000;
-                        addStock.create_time = DateTime.Now;
-                        addStock.update_time = DateTime.Now;
-                        addStock.create_by_name = "admin";
-                        addStock.update_by_name = "admin";
-                        stockAdd.Add(addStock);*/
+                        });
                     }
                     }
                     else
                     else
                     {
                     {
@@ -789,16 +773,16 @@ namespace Business.SystemJobManagement
                         ic_item.PurLT = custList[i].PurLT;
                         ic_item.PurLT = custList[i].PurLT;
                         ItemsUpd.Add(ic_item);
                         ItemsUpd.Add(ic_item);
                     }
                     }
-                    if (upditemStock == null)
+                    if (addStock == null)
                     {
                     {
-                        ic_item_stock addStock = new ic_item_stock();
+                        addStock = new ic_item_stock();
                         addStock.GenerateNewId(help.NextId());
                         addStock.GenerateNewId(help.NextId());
-                        addStock.icitem_id = ic_item.Id;
-                        addStock.icitem_number = ic_item.number; //物料编码
-                        addStock.icitem_name = ic_item.name; //物料名称
+                        addStock.icitem_id = ic_item == null ? itemId : ic_item.Id;
+                        addStock.icitem_number = custList[i].ItemNum; //物料编码
+                        addStock.icitem_name = custList[i].Descr; //物料名称
                         addStock.sqty = 0;
                         addStock.sqty = 0;
                         addStock.quantity_in_transit = 0;
                         addStock.quantity_in_transit = 0;
-                        addStock.fversion = ic_item.fversion;
+                        addStock.fversion = "";
                         addStock.factory_id = long.Parse(custList[i].Domain);
                         addStock.factory_id = long.Parse(custList[i].Domain);
                         addStock.company_id = 1000;
                         addStock.company_id = 1000;
                         addStock.tenant_id = 1000;
                         addStock.tenant_id = 1000;