|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
using Mesnac.Compressor.Entity;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
using Models;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using SlnMesnac.Common;
|
|
|
|
|
using SlnMesnac.Config;
|
|
|
|
|
@ -203,7 +204,7 @@ namespace ConsoleApp
|
|
|
|
|
{
|
|
|
|
|
n = "转子压装位置1压力值",
|
|
|
|
|
t = 0,
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7708").ToString()),
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7708").ToString()) == 1? 0 : 1,
|
|
|
|
|
v = Plc.readFloatByAddress("D7705").ToString(),
|
|
|
|
|
min = Plc.readFloatByAddress("D7706").ToString(),
|
|
|
|
|
max = Plc.readFloatByAddress("D7707").ToString(),
|
|
|
|
|
@ -212,7 +213,7 @@ namespace ConsoleApp
|
|
|
|
|
{
|
|
|
|
|
n = "转子压装位置2压力值",
|
|
|
|
|
t = 0,
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7712").ToString()),
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7712").ToString()) == 1 ? 0 : 1,
|
|
|
|
|
v = Plc.readFloatByAddress("D7709").ToString(),
|
|
|
|
|
min = Plc.readFloatByAddress("D7710").ToString(),
|
|
|
|
|
max = Plc.readFloatByAddress("D7711").ToString(),
|
|
|
|
|
@ -221,7 +222,7 @@ namespace ConsoleApp
|
|
|
|
|
{
|
|
|
|
|
n = "转子压装位置3压力值",
|
|
|
|
|
t = 0,
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7716").ToString()),
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7716").ToString()) == 1 ? 0 : 1,
|
|
|
|
|
v = Plc.readFloatByAddress("D7713").ToString(),
|
|
|
|
|
min = Plc.readFloatByAddress("D7714").ToString(),
|
|
|
|
|
max = Plc.readFloatByAddress("D7715").ToString(),
|
|
|
|
|
@ -230,7 +231,7 @@ namespace ConsoleApp
|
|
|
|
|
{
|
|
|
|
|
n = "转子压装位置4位移值",
|
|
|
|
|
t = 0,
|
|
|
|
|
ng = 1,
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7720").ToString()) == 1 ? 0 : 1,
|
|
|
|
|
v = Plc.readFloatByAddress("D7717").ToString(),
|
|
|
|
|
min = Plc.readFloatByAddress("D7718").ToString(),
|
|
|
|
|
max = Plc.readFloatByAddress("D7719").ToString(),
|
|
|
|
|
@ -239,7 +240,7 @@ namespace ConsoleApp
|
|
|
|
|
{
|
|
|
|
|
n = "转子压装位置4压力值",
|
|
|
|
|
t = 0,
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7724").ToString()),
|
|
|
|
|
ng = int.Parse(Plc.readFloatByAddress("D7724").ToString()) == 1 ? 0 : 1,
|
|
|
|
|
v = Plc.readFloatByAddress("D7721").ToString(),
|
|
|
|
|
min = Plc.readFloatByAddress("D7722").ToString(),
|
|
|
|
|
max = Plc.readFloatByAddress("D7723").ToString(),
|
|
|
|
|
@ -276,7 +277,7 @@ namespace ConsoleApp
|
|
|
|
|
Productid = "",
|
|
|
|
|
Partid = "",
|
|
|
|
|
Modelid = "",
|
|
|
|
|
Ng = Plc.readFloatByAddress("D7708").ToString() == "1" ? 0 : 1,
|
|
|
|
|
Ng = Plc.readFloatByAddress("D7725").ToString() == "1" ? 0 : 1,
|
|
|
|
|
Proc = 0,
|
|
|
|
|
Sublinenum = 0,
|
|
|
|
|
Sublinesnnum = 0,
|
|
|
|
|
@ -300,6 +301,7 @@ namespace ConsoleApp
|
|
|
|
|
Datastationparam datastationparam1 = new Datastationparam()
|
|
|
|
|
{
|
|
|
|
|
Dsid = datastationid.Id,
|
|
|
|
|
Productid = StationCode,
|
|
|
|
|
Stationid = StationCode,
|
|
|
|
|
N = data1.n,
|
|
|
|
|
T = false,
|
|
|
|
|
@ -313,6 +315,7 @@ namespace ConsoleApp
|
|
|
|
|
Datastationparam datastationparam2 = new Datastationparam()
|
|
|
|
|
{
|
|
|
|
|
Dsid = datastationid.Id,
|
|
|
|
|
Productid = StationCode,
|
|
|
|
|
Stationid = StationCode,
|
|
|
|
|
N = data2.n,
|
|
|
|
|
T = false,
|
|
|
|
|
@ -326,6 +329,7 @@ namespace ConsoleApp
|
|
|
|
|
Datastationparam datastationparam3 = new Datastationparam()
|
|
|
|
|
{
|
|
|
|
|
Dsid = datastationid.Id,
|
|
|
|
|
Productid = StationCode,
|
|
|
|
|
Stationid = StationCode,
|
|
|
|
|
N = data3.n,
|
|
|
|
|
T = false,
|
|
|
|
|
@ -339,6 +343,7 @@ namespace ConsoleApp
|
|
|
|
|
Datastationparam datastationparam4 = new Datastationparam()
|
|
|
|
|
{
|
|
|
|
|
Dsid = datastationid.Id,
|
|
|
|
|
Productid = StationCode,
|
|
|
|
|
Stationid = StationCode,
|
|
|
|
|
N = data4.n,
|
|
|
|
|
T = false,
|
|
|
|
|
@ -352,6 +357,7 @@ namespace ConsoleApp
|
|
|
|
|
Datastationparam datastationparam5 = new Datastationparam()
|
|
|
|
|
{
|
|
|
|
|
Dsid = datastationid.Id,
|
|
|
|
|
Productid = StationCode,
|
|
|
|
|
Stationid = StationCode,
|
|
|
|
|
N = data5.n,
|
|
|
|
|
T = false,
|
|
|
|
|
@ -406,17 +412,21 @@ namespace ConsoleApp
|
|
|
|
|
_logger.Info("前盖码:" + QGBarCode);
|
|
|
|
|
#region 根据前盖码查询Productid
|
|
|
|
|
//根据前盖码查询Productid
|
|
|
|
|
var Dipsn = SqlSugarClient.Queryable<Dipsn>().First(it => it.Sn == QGBarCode);
|
|
|
|
|
var Dipsn = SqlSugarClient.Queryable<Dataproduce>().First(it => it.Mainsn == QGBarCode);
|
|
|
|
|
if (Dipsn != null)
|
|
|
|
|
{
|
|
|
|
|
Dipsn dipsn = new Dipsn()
|
|
|
|
|
{
|
|
|
|
|
Type = Dipsn.Type,
|
|
|
|
|
Stime = DateTime.Now,
|
|
|
|
|
Sn = ZZBarCode,
|
|
|
|
|
Productid = Dipsn.Productid,
|
|
|
|
|
};
|
|
|
|
|
int id = SqlSugarClient.Insertable(dipsn).ExecuteReturnIdentity();
|
|
|
|
|
Dipsn.Snlist = QGBarCode+","+ZZBarCode;
|
|
|
|
|
Dipsn.Operseq = Dipsn.Operseq+","+StationCode;
|
|
|
|
|
int updateflag = SqlSugarClient.Updateable(Dipsn).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
//Dipsn dipsn = new Dipsn()
|
|
|
|
|
//{
|
|
|
|
|
// Type = Dipsn.Type,
|
|
|
|
|
// Stime = DateTime.Now,
|
|
|
|
|
// Sn = ZZBarCode,
|
|
|
|
|
// Productid = Dipsn.Productid,
|
|
|
|
|
//};
|
|
|
|
|
//int id = SqlSugarClient.Insertable(dipsn).ExecuteReturnIdentity();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region 查询datastation表,更新Productid
|
|
|
|
|
|