大仓输送

dep_deliver
杨威 9 months ago
parent e8d4407b80
commit 35feb46d08

@ -1,4 +1,6 @@
using FreeSql.DataAnnotations; using DevExpress.Charts.Native;
using FreeSql.DataAnnotations;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -28,5 +30,8 @@ namespace Mesnac.Action.ChemicalWeighing.FreeDb
public DateTime UpdateTime { get; set; } public DateTime UpdateTime { get; set; }
public string Remark { get; set; } = "";
} }
} }

@ -247,7 +247,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
private void Sss(Db2101LinEntity entity,int no) private void Sss(Db2101LinEntity entity,int no)
{ {
var a = entity; var a = entity;
if (a.Start) //开始中
if (a.Start=true && a.End==false)
{ {
SuSong data = new SuSong(); SuSong data = new SuSong();
data.Start = 1; data.Start = 1;
@ -259,24 +260,26 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
data.Model = a.model; data.Model = a.model;
data.Destination = a.Get(); data.Destination = a.Get();
data.Number = a.number; data.Number = a.number;
data.Remark = "开始";
FreeDb.FreeSqlUnit.Instance.Insert(data).ExecuteAffrows(); FreeDb.FreeSqlUnit.Instance.Insert(data).ExecuteAffrows();
if (no == 1) //if (no == 1)
{ //{
Db2101HelperWriter.WriterLinAStart(false); // Db2101HelperWriter.WriterLinAStart(false);
} //}
if (no == 2) //if (no == 2)
{ //{
Db2101HelperWriter.WriterLinBStart(false); // Db2101HelperWriter.WriterLinBStart(false);
} //}
if (no == 3) //if (no == 3)
{ //{
Db2101HelperWriter.WriterLinCStart(false); // Db2101HelperWriter.WriterLinCStart(false);
} //}
} }
//结束
if (a.End) if (a.End==true && a.Start==false)
{ {
SuSong su=FreeDb.FreeSqlUnit.Instance. SuSong su=FreeDb.FreeSqlUnit.Instance.
Queryable<SuSong>().Where(s => s.No == no) Queryable<SuSong>().Where(s => s.No == no)
@ -288,21 +291,31 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
FreeDb.FreeSqlUnit.Instance.Update<SuSong>() FreeDb.FreeSqlUnit.Instance.Update<SuSong>()
.Set(x=>x.UpdateTime,DateTime.Now) .Set(x=>x.UpdateTime,DateTime.Now)
.Set(x=>x.EndInfo==1) .Set(x=>x.EndInfo==1)
.Set(x=>x.Start,0)
.Set(x=>x.Number==entity.number) .Set(x=>x.Number==entity.number)
.Set(x=>x.Destination,a.Get())
.Set(x=>x.Remark=="结束")
.Where(x=>x.Id==su.Id).ExecuteUpdated(); .Where(x=>x.Id==su.Id).ExecuteUpdated();
} }
if (no == 1)
{ }
Db2101HelperWriter.WriterLinAEnd(false);
} if(a.Start==true && a.End == false)
if (no == 2) {
{ SuSong su = FreeDb.FreeSqlUnit.Instance.
Db2101HelperWriter.WriterLinBEnd(false); Queryable<SuSong>().Where(s => s.No == no)
} .Where(x => x.Start == 1)
if (no == 3) .Where(s => s.EndInfo == 0).OrderByDescending(s => s.CreateTime).First();
if (su != null)
{ {
Db2101HelperWriter.WriterLinCEnd(false); FreeDb.FreeSqlUnit.Instance.Update<SuSong>()
.Set(x=>x.UpdateTime,DateTime.Now)
.Set(x=>x.Destination, a.Get())
.Set(x=>x.Number==entity.number)
.Set(x => x.Remark == "运行中")
.Where(x=>x.Id==su.Id).ExecuteUpdated();
} }
} }
@ -1120,15 +1133,45 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver
var ab = db2101.LinA; var ab = db2101.LinA;
LabelE.linAName.Text = destinations[Get(ab.destination)]; LabelE.linAName.Text = destinations[Get(ab.destination)];
LabelE.linANum.Text = ab.number.ToString(); LabelE.linANum.Text = ab.number.ToString();
LabelE.AStatus.Text = GetStatus(ab);
ab = db2101.LinB; ab = db2101.LinB;
LabelE.linBName.Text = destinations[Get(ab.destination)]; LabelE.linBName.Text = destinations[Get(ab.destination)];
LabelE.linBNum.Text = ab.number.ToString(); LabelE.linBNum.Text = ab.number.ToString();
LabelE.BStatus.Text = GetStatus(ab);
ab = db2101.LinC; ab = db2101.LinC;
LabelE.linCName.Text = destinations[Get(ab.destination)]; LabelE.linCName.Text = destinations[Get(ab.destination)];
LabelE.linCNum.Text = ab.number.ToString(); LabelE.linCNum.Text = ab.number.ToString();
LabelE.CStatus.Text = GetStatus(ab);
}
public string GetStatus(Db2101LinEntity entity)
{
string str = "";
if(entity.Start==true && entity.End == false)
{
str = "开始";
}
if (entity.Start == false && entity.End == true)
{
str = "结束";
}
if (entity.Start == true && entity.End == false)
{
str = "运行中";
}
if (entity.Start == false && entity.End == false)
{
str = "空闲";
}
return str;
} }
string[] destinations = new string[] { string[] destinations = new string[] {

@ -106,14 +106,16 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliver.Entity
public MCLabel linBNum { get; set; } public MCLabel linBNum { get; set; }
public MCLabel linCName { get; set; } public MCLabel linCName { get; set; }
public MCLabel linCNum { get; set; } public MCLabel linCNum { get; set; }
public MCLabel AStatus { get; set; }
public MCLabel BStatus { get; set; }
public MCLabel CStatus { get; set; }
} }
internal class LjSwitchEntity internal class LjSwitchEntity

@ -142,9 +142,9 @@ namespace Mesnac.Action.ChemicalWeighing.Su
dr[3] = x.Destination; dr[3] = x.Destination;
if (x.Destination > 0) if (x.Destination >= 0)
{ {
string info = destinations[x.Destination - 1]; string info = destinations[x.Destination];
dr[3] = info; dr[3] = info;
} }
@ -153,12 +153,8 @@ namespace Mesnac.Action.ChemicalWeighing.Su
dr[4] = x.Number; dr[4] = x.Number;
dr[5] = Convert.ToDateTime(x.CreateTime).ToString("yyyy-MM-dd hh:mm:ss"); dr[5] = Convert.ToDateTime(x.CreateTime).ToString("yyyy-MM-dd hh:mm:ss");
string state = "结束";
if (x.EndInfo == 0) dr[6] = x.Remark;
{
state = "运行中";
}
dr[6] = state;
dt.Rows.Add(dr); dt.Rows.Add(dr);
} }

@ -1608,6 +1608,48 @@
<Property name="Size">11, 12</Property> <Property name="Size">11, 12</Property>
</Object> </Object>
<Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack3" children="Controls"> <Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack3" children="Controls">
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="CStatus" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">166, 110</Property>
<Property name="Name">CStatus</Property>
<Property name="Size">11, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel346" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">状态</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">164, 90</Property>
<Property name="Name">MCLabel346</Property>
<Property name="Size">29, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linCNum" children="Controls"> <Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linCNum" children="Controls">
<Property name="Format" /> <Property name="Format" />
<Property name="TextName" /> <Property name="TextName" />
@ -1949,6 +1991,48 @@
<Property name="Size">203, 134</Property> <Property name="Size">203, 134</Property>
</Object> </Object>
<Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack2" children="Controls"> <Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack2" children="Controls">
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="BStatus" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">164, 115</Property>
<Property name="Name">BStatus</Property>
<Property name="Size">11, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel344" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">状态</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">162, 96</Property>
<Property name="Name">MCLabel344</Property>
<Property name="Size">29, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linBNum" children="Controls"> <Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linBNum" children="Controls">
<Property name="Format" /> <Property name="Format" />
<Property name="TextName" /> <Property name="TextName" />
@ -2287,9 +2371,51 @@
</Object> </Object>
<Property name="Location">357, 419</Property> <Property name="Location">357, 419</Property>
<Property name="Name">MCPanelBlack2</Property> <Property name="Name">MCPanelBlack2</Property>
<Property name="Size">203, 140</Property> <Property name="Size">212, 140</Property>
</Object> </Object>
<Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack1" children="Controls"> <Object type="Mesnac.Controls.Default.MCPanelBlack, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCPanelBlack1" children="Controls">
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="AStatus" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">0</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">151, 110</Property>
<Property name="Name">AStatus</Property>
<Property name="Size">11, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCLabel342" children="Controls">
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="MCKey" />
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">None</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="Text">状态</Property>
<Property name="BackColor">Transparent</Property>
<Property name="ForeColor">ButtonHighlight</Property>
<Property name="Location">149, 91</Property>
<Property name="Name">MCLabel342</Property>
<Property name="Size">29, 12</Property>
</Object>
<Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linANum" children="Controls"> <Object type="Mesnac.Controls.Default.MCLabel, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="linANum" children="Controls">
<Property name="Format" /> <Property name="Format" />
<Property name="TextName" /> <Property name="TextName" />

Loading…
Cancel
Save