Пример #1
0
 public void PutIng(UpDownMessage upDownMessage)
 {
     upDownMessage.LatticeByUpDown.ForEach(o =>
     {
         //过滤
         var latticeInfo = slaveInfoService.GetLatticeInfo(o.LatticeNo);
         var waitputNum  = latticeInfo.Product.Where(p => p.Status == ProductStatus.WaitPut).Sum(t => t.WaitNum - t.PutNum);
         if (upDownMessage.Type == "1" && waitputNum > 1)//1代表光栅投递
         {
         }
         else if (waitputNum < upDownMessage.LatticeByUpDown.First().Num)
         {
             //upDownMessage.Message = $"超出可投数:{waitputNum}";
             //PutNumError(upDownMessage);
         }
         else if (latticeInfo.Status != LatticeStatus.WaitPut && slaveInfoService.SlaveInfo.LatticeStatus == LatticeStatus.WaitPut)
         {
             upDownMessage.Message = $"格口[{latticeInfo.LatticeNo}]投递出错";
             PutError(upDownMessage);
         }
         else if (latticeInfo.Status == LatticeStatus.WaitPut && slaveInfoService.SlaveInfo.LatticeStatus == LatticeStatus.WaitPut)
         {
             PutSuccess(upDownMessage);
         }
     });
 }
Пример #2
0
 public void PutSuccess(UpDownMessage upDownMessage)
 {
     upDownMessage.LatticeByUpDown.ForEach(o =>
     {
         var tempPutNum  = o.Num;
         var latticeInfo = SlaveInfoService.GetLatticeInfo(o.LatticeNo);
         latticeInfo.Product
         .FindAll(p => p.Status == ProductStatus.WaitPut)
         .ForEach(p =>
         {
             var MaxWaitPut = p.WaitNum - p.PutNum;
             if (MaxWaitPut >= tempPutNum)
             {
                 p.PutNum += tempPutNum;
             }
             else
             {
                 p.PutNum   += MaxWaitPut;
                 tempPutNum -= MaxWaitPut;
             }
         });
         //latticeInfo.Product.First(p=>p.Status==ProductStatus.WaitPut).PutNum += o.Num;
         SlaveInfoService.SetLatticeStatus(latticeInfo, LatticeStatus.None);
         SlaveInfoService.ProductTransformNone(latticeInfo);
     });
     UpdateButton(upDownMessage);
     SlaveInfoService.SaveAync();
 }
Пример #3
0
 public void RemoveBlockErrorSuccess(UpDownMessage upDownMessage)
 {
     upDownMessage.LatticeByUpDown.ForEach(o =>
     {
         var latticeInfo = SlaveInfoService.GetLatticeInfo(o.LatticeNo);
         SlaveInfoService.SetLatticeStatus(latticeInfo, LatticeStatus.None);
     });
     UpdateButton(upDownMessage);
     SoundService.PlaySoundAsny(SoundType.RemoveBlockError);
 }
Пример #4
0
 public void PutError(UpDownMessage upDownMessage)
 {
     upDownMessage.LatticeByUpDown.ForEach(o =>
     {
         var latticeInfo = SlaveInfoService.GetLatticeInfo(o.LatticeNo);
         SlaveInfoService.SetLatticeStatus(latticeInfo, LatticeStatus.PutError);
     });
     UpdateButton(upDownMessage);
     SlaveInfoService.SaveAync();
     SoundService.PlaySoundAsny(SoundType.PutError);
 }
Пример #5
0
 public void PrintAll(UpDownMessage upDownMessage)
 {
     if (SysConfig.PrintType == PrintType.一次性打印)
     {
         SlaveInfoService?.LatticeInfoList?.ForEach(o =>
         {
             var latticeInfo = SlaveInfoService.GetLatticeInfo(o.LatticeNo);
             if (!string.IsNullOrWhiteSpace(latticeInfo.OrderNo))
             {
                 latticeInfo.IsPrint = true;
                 SlaveInfoService.SaveAync();
                 new CustomPrint().PrintSetup(latticeInfo);
             }
         });
     }
 }