liulb@mesnac.com 1 year ago
parent 4187eaa1ca
commit 82e6cfd870

@ -95,11 +95,8 @@ namespace Aucma.Core.OldBoxFoam.Business
{ {
SpaceDetailModel model = new SpaceDetailModel(); SpaceDetailModel model = new SpaceDetailModel();
model.ObjId = i + 1; model.ObjId = i + 1;
//if (BoxTypeList.Count > 0) model.FixtureBoxType = BoxTypeList[i].ToString(); if (StoreTypeList.Count > 0) model.StoreType = StoreTypeList[i].ToString();
//if (HolderStatusList.Count > 0) model.Status = HolderStatusList[i]; if (StoreAmountList.Count > 0) model.StoreAmount =Convert.ToInt32(StoreAmountList[i]);
//if (HolderOutPutList.Count > 0) model.Yield = HolderOutPutList[i];
//if (SolidifyTimeList.Count > 0) model.PlanCuringTime = SolidifyTimeList[i];
spaceDetailModel.Add(model); spaceDetailModel.Add(model);
} }
Thread.Sleep(10000); Thread.Sleep(10000);

@ -16,5 +16,7 @@ namespace Aucma.Core.OldBoxFoam.Models
/// 箱型 /// 箱型
/// </summary> /// </summary>
public string StoreType { get; set; } public string StoreType { get; set; }
public int StoreAmount { get; set; }
} }
} }

@ -12,6 +12,7 @@ using Aucma.Core.Tasks;
using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.ComponentModel;
using log4net; using log4net;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using NPOI.SS.Formula.Functions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@ -79,12 +80,6 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
_totle = $"总产量:{num}"; _totle = $"总产量:{num}";
foreach (var item in prderList) foreach (var item in prderList)
{ {
//OldBoxFoamDataModel model = new OldBoxFoamDataModel();
//model.ObjId = item.ObjId;
//model.Fixtureboxtype = item.FixtureBoxType;
//model.Fixturestatus = item.Status;
//model.Production = item.Yield;
//model.CuringTimeSettingValue = item.PlanCuringTime.ToString();
if (item.Status == 1)//生产 if (item.Status == 1)//生产
{ {
_statusColor.Add("green"); _statusColor.Add("green");
@ -96,9 +91,9 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
_fixtureName.Add(item.FixtureBoxType); _fixtureName.Add(item.FixtureBoxType);
_production.Add(item.Yield); _production.Add(item.Yield);
//_beat.Add(item.BoxBeat); //_beat.Add(item.BoxBeat);
i = +item.Yield; _totle = _totle + item.Yield;
} }
_totle = $"总产量:{i}";
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -106,6 +101,9 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
} }
finally finally
{ {
var prderList = Collection.listFixtureStatus;
int num = prderList.Sum(d => d.Yield);
_totle = $"总产量:{num}";
if (GetStoreTimer != null) if (GetStoreTimer != null)
{ {
GetStoreTimer.Change(20000, Timeout.Infinite); GetStoreTimer.Change(20000, Timeout.Infinite);
@ -341,9 +339,10 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
private async void ExecHourData(string productLineCode) private async void ExecHourData(string productLineCode)
{ {
var boxList = Collection.listFixtureStatus; var boxList = Collection.listFixtureStatus;
foreach (var item in boxList) if (boxList == null) return;
for (int j = 0; j < boxList.Count; j++)
{ {
OldBoxFoamType space = await _oldBoxFoamTypeServices.FirstAsync(d => d.Boxtype == item.FixtureBoxType); OldBoxFoamType space = await _oldBoxFoamTypeServices.FirstAsync(d => d.Boxtype == boxList[j].FixtureBoxType);
//根据夹具找货道,根据货道找物料 //根据夹具找货道,根据货道找物料
if (space != null) if (space != null)
{ {
@ -353,27 +352,27 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
plan.CompleteAmount = plan.CompleteAmount + 1; plan.CompleteAmount = plan.CompleteAmount + 1;
await _boxFoamPlanServices.UpdateAsync(plan); await _boxFoamPlanServices.UpdateAsync(plan);
//更新小时数据 //更新小时数据
BoxFoamData bfd = await _oldBoxFoamDataServices.FirstAsync(d => d.Fixtureboxtype == item.FixtureBoxType && d.MainId == item.ObjId); BoxFoamData bfd = await _oldBoxFoamDataServices.FirstAsync(d => d.Fixtureboxtype == boxList[j].FixtureBoxType && d.MainId == boxList[j].ObjId);
if (bfd != null) if (bfd != null)
{ {
UpdateBoxData(item, bfd); UpdateBoxData(boxList[j], bfd);
} }
else else
{ {
SaveBoxData(productLineCode, item); SaveBoxData(productLineCode, boxList[j]);
} }
} }
else else
{ {
//更新小时数据 //更新小时数据
BoxFoamData bfd = await _oldBoxFoamDataServices.FirstAsync(d => d.Fixtureboxtype == item.FixtureBoxType && d.MainId == item.ObjId); BoxFoamData bfd = await _oldBoxFoamDataServices.FirstAsync(d => d.Fixtureboxtype == boxList[j].FixtureBoxType && d.MainId == boxList[j].ObjId);
if (bfd != null) if (bfd != null)
{ {
UpdateBoxData(item, bfd); UpdateBoxData(boxList[j], bfd);
} }
else else
{ {
SaveBoxData(productLineCode, item); SaveBoxData(productLineCode, boxList[j]);
} }
} }
} }

Loading…
Cancel
Save