Ver código fonte

Merge branch 'dev' of http://123.60.180.165:4647/ZZYDOP/DOPCore into dev

heteng 2 anos atrás
pai
commit
4dcdd1af3c

+ 18 - 18
MicroServices/Business/Business.Application/DOP/SyncDOPAppService.cs

@@ -241,7 +241,7 @@ namespace Business.DOP
                 //工厂库存
                 var itemSap = ItemInvList.Find(b => b.MATNR == a.ItemNumber);
                 if(itemSap!=null)
-                    a.FactoryInv = itemSap.LABST.ToDecimal();
+                    a.FactoryInv =itemSap.LABST.ToDecimal();
                 //国科库存
                 var platformInventoryGK=  platformInvList.Find(b => b.SpecificationModel == a.Model && b.Code== "HW0002");
                 if (platformInventoryGK != null)
@@ -255,7 +255,7 @@ namespace Business.DOP
                 a.TotalInv = a.FactoryInv + a.GKInv + a.HWInv;
 
                 //T1月需求
-                var t1 = domesticTerminalFcstList.Find(a => a.TypeEnum == 2);
+                var t1 = domesticTerminalFcstList.Find(b => b.TypeEnum == 2);
                 if (t1 != null)
                 {
                     a.T1MonthlyDemand = t1.Qty;
@@ -299,12 +299,12 @@ namespace Business.DOP
                 //总终端需求
                 a.TotalTerminalDemand = a.T1MonthlyDemand + a.ReplenishmentPoint + a.GKEstimatedDemand + a.HWEstimatedDemand + a.T2TotalDemand;
                 //工厂平台覆盖月
-                a.FactoryCoveragePlatformMonth = a.FactoryInv / a.T1MonthlyDemand;
+                a.FactoryCoveragePlatformMonth = Math.Round(a.FactoryInv / a.T1MonthlyDemand,2);
                 //国科库存最高最低覆盖月
-                var prodTypeGK=platformFcstCollectList?.Find(a => a.Model == a.Model && a.Platform == "国科");
+                var prodTypeGK=platformFcstCollectList?.Find(b => b.Model == a.Model && b.Platform == "国科");
                 if(prodTypeGK!=null)
                 {
-                    var prodTypeSettingGK = platStockMonitorSettingList?.Find(a => a.ProdType == prodTypeGK.ProdType && a.Platform == "国科");
+                    var prodTypeSettingGK = platStockMonitorSettingList?.Find(b => b.ProdType == prodTypeGK.ProdType && b.Platform == "国科");
                     if(prodTypeSettingGK!=null)
                     {
                         a.GKCoverageMaxMonth = prodTypeSettingGK.MaxTimes;
@@ -317,30 +317,30 @@ namespace Business.DOP
                 }
 
                 //国科库存覆盖月
-                a.GKCoverageMonth = a.GKInv / a.GKEstimatedDemand;
+                a.GKCoverageMonth = Math.Round(a.GKInv / a.GKEstimatedDemand, 2);
 
 
                 //海王库存最高最低覆盖月
-                var prodTypeHW = platformFcstCollectList?.Find(a => a.Model == a.Model && a.Platform == "海王");
+                var prodTypeHW = platformFcstCollectList?.Find(b => b.Model == a.Model && b.Platform == "海王");
                 if (prodTypeHW != null)
                 {
-                    var prodTypeSettingHW = platStockMonitorSettingList?.Find(a => a.ProdType == prodTypeHW.ProdType && a.Platform == "海王");
+                    var prodTypeSettingHW = platStockMonitorSettingList?.Find(b => b.ProdType == prodTypeHW.ProdType && b.Platform == "海王");
                     if(prodTypeSettingHW != null)
                     {
-                        a.GKCoverageMaxMonth = prodTypeSettingHW.MaxTimes;
-                        a.GKCoverageMinMonth = prodTypeSettingHW.MinTimes;
+                        a.HWCoverageMaxMonth = prodTypeSettingHW.MaxTimes;
+                        a.HWCoverageMinMonth = prodTypeSettingHW.MinTimes;
                     }else
                     {
-                        a.GKCoverageMaxMonth = 0;
-                        a.GKCoverageMinMonth = 0;
+                        a.HWCoverageMaxMonth = 0;
+                        a.HWCoverageMinMonth = 0;
                     }
                 }
 
 
                 //海王库存覆盖月
-                a.HWCoverageMonth = a.HWInv / a.HWEstimatedDemand;
+                a.HWCoverageMonth = Math.Round(a.HWInv / a.HWEstimatedDemand, 2);
                 //全域覆盖
-                a.TotalCoverageMonth = a.TotalInv / a.TotalTerminalDemand;
+                a.TotalCoverageMonth = Math.Round(a.TotalInv / a.TotalTerminalDemand, 2);
 
                 //T1库存监控
                 if (a.FactoryInv < a.ReplenishmentPoint)
@@ -357,22 +357,22 @@ namespace Business.DOP
                 a.HWMonitoringResult = a.HWCoverageMonth > a.HWCoverageMaxMonth ? "库存高于最高库存水位警戒" : a.HWCoverageMonth < a.HWCoverageMinMonth ? "库存低于最低库存水位,紧急补货" : "正常周转";
 
                 //推荐决策
-                if (a.TotalCoverageMonth < 3)
+                if (a.TotalCoverageMonth <= 3)
                 {
                     a.RecommendDecision = "紧急补货";
                 }
                 else 
-                if (a.TotalCoverageMonth < 6)
+                if (a.TotalCoverageMonth <=6)
                 {
                     a.RecommendDecision = "需要补货";
                 }
                 else 
-                if (a.TotalCoverageMonth < 9)
+                if (a.TotalCoverageMonth <=9)
                 {
                     a.RecommendDecision = "正常库存";
                 }
                 else 
-                if (a.TotalCoverageMonth < 24)
+                if (a.TotalCoverageMonth <= 24)
                 {
                     a.RecommendDecision = "关注库存";
                 }