|
@@ -109,7 +109,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
set { _connected = value; }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public DelegateCommand QRCommand { get; set; }
|
|
|
public DelegateCommand HouseCommand { get; set; }
|
|
@@ -232,13 +232,13 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
_logger = logger;
|
|
|
_warningUpdateService = warningUpdateService;
|
|
|
_dialogService = dialogService;
|
|
|
- this.tcpService = tcpService;
|
|
|
+ this.tcpService = tcpService;
|
|
|
_container = container;
|
|
|
InforNew = new ObservableCollection<InformationNew>();
|
|
|
HouseCommand = new DelegateCommand(UploadHouse);
|
|
|
OutWorkCommand = new DelegateCommand(UploadOutWork);
|
|
|
OrderCommand = new DelegateCommand(OrderEnter);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
Products = _container.Resolve<MulProductModel>();
|
|
|
if (Products == null)
|
|
@@ -638,7 +638,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
string sp = mes.Split(":")[1];//产品码
|
|
|
string result = mes.Split(":")[2];
|
|
|
string opname = Operator15;
|
|
|
- if (sp!="")
|
|
|
+ if (sp != "")
|
|
|
{
|
|
|
TestRes(sp, result, opname);
|
|
|
WriteCSV_Test(opname, sp, result);
|
|
@@ -664,7 +664,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
q[i] = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var list = repository.GetFirstDefault<Quality>(c => c.QuPCode == Order);//查一个值
|
|
|
if (list != null)
|
|
|
{
|
|
@@ -709,7 +709,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
Id = Guid.NewGuid(),
|
|
|
DateQuality = DateTime.Today,
|
|
|
QuPCode = Order,
|
|
|
- ProTName =GVariable.ProductTypeName,
|
|
|
+ ProTName = GVariable.ProductTypeName,
|
|
|
Q1 = q[0],
|
|
|
Q2 = q[1],
|
|
|
Q3 = q[2],
|
|
@@ -1170,14 +1170,86 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
string sp = mes.Split(":")[1];
|
|
|
string cl = mes.Split(":")[2];
|
|
|
string wu = ResWord(mes.Split(":")[3]);
|
|
|
- var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
|
|
|
- if (res != null)
|
|
|
+
|
|
|
+ Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
+ {
|
|
|
+ var productNew = new InformationNew
|
|
|
+ {
|
|
|
+ OperatorCode = Operator19,
|
|
|
+ ItemCode = wu,
|
|
|
+ SpendTime = 0,
|
|
|
+ CreateTime = DateTime.Today,
|
|
|
+ ProType = proName,
|
|
|
+ ProNo = "",
|
|
|
+ ProCode = sp,
|
|
|
+ OrderNo = "",
|
|
|
+ TestResult = "维修",
|
|
|
+ WorkDev = "1号维修机"
|
|
|
+ };
|
|
|
+ var product = new Information()
|
|
|
+ {
|
|
|
+ CreateTime = productNew.CreateTime,
|
|
|
+ Id = Guid.NewGuid(),
|
|
|
+ OperatorCode = productNew.OperatorCode,
|
|
|
+ ItemCode = productNew.ItemCode,
|
|
|
+ SpendTime = productNew.SpendTime,
|
|
|
+ ProType = productNew.ProType,
|
|
|
+ ProNo = productNew.ProNo,
|
|
|
+ ProCode = productNew.ProCode,
|
|
|
+ OrderNo = productNew.OrderNo,
|
|
|
+ TestResult = productNew.TestResult,
|
|
|
+ WorkDev = productNew.WorkDev
|
|
|
+ };
|
|
|
+
|
|
|
+ InforNew.Add(productNew);
|
|
|
+ _repository.Add(product);
|
|
|
+ }));
|
|
|
+ WriteCSV_Repair(Operator19, cl, sp, wu);
|
|
|
+ client.Send("Rep:维修信息上传成功");
|
|
|
+ WriteLog("维修1#维修信息上传成功");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
+ if (list != null)
|
|
|
+ {
|
|
|
+ list.ErrS++;
|
|
|
+ _repository.Update(list);
|
|
|
+ }
|
|
|
+ var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
+ if (allnumbers != null)
|
|
|
+ {
|
|
|
+ allnumbers.ErrA++;
|
|
|
+ _repository.Update(allnumbers);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
+ WriteLog("FIX1:" + ex.Message, LogType.Error);
|
|
|
+ _logger.Error("FIX1:" + ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (client.IP == "192.168.10.20")//维修2
|
|
|
+ {
|
|
|
+ if (mes.Split(":")[0] == "Login")
|
|
|
+ {
|
|
|
+ string accountID = mes.Split(":")[1];
|
|
|
+ Operator20 = accountID;
|
|
|
+ client.Send($"LoginSuc:登录成功");
|
|
|
+ WriteLog("20#登录成功");
|
|
|
+ operName[19] = Operator20;
|
|
|
+ }
|
|
|
+ if (mes.Split(":")[0] == "Fix")
|
|
|
+ {
|
|
|
+ string sp = mes.Split(":")[1];
|
|
|
+ string cl = mes.Split(":")[2];
|
|
|
+ string wu = ResWord(mes.Split(":")[3]);
|
|
|
+
|
|
|
+ Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
{
|
|
|
var productNew = new InformationNew
|
|
|
{
|
|
|
- OperatorCode = Operator19,
|
|
|
+ OperatorCode = Operator20,
|
|
|
ItemCode = wu,
|
|
|
SpendTime = 0,
|
|
|
CreateTime = DateTime.Today,
|
|
@@ -1186,7 +1258,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
ProCode = sp,
|
|
|
OrderNo = "",
|
|
|
TestResult = "维修",
|
|
|
- WorkDev = "1号维修机"
|
|
|
+ WorkDev = "2号维修机"
|
|
|
};
|
|
|
var product = new Information()
|
|
|
{
|
|
@@ -1200,112 +1272,34 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
ProCode = productNew.ProCode,
|
|
|
OrderNo = productNew.OrderNo,
|
|
|
TestResult = productNew.TestResult,
|
|
|
- WorkDev = productNew.WorkDev
|
|
|
+ WorkDev = productNew.WorkDev,
|
|
|
};
|
|
|
|
|
|
InforNew.Add(productNew);
|
|
|
_repository.Add(product);
|
|
|
}));
|
|
|
- WriteCSV_Repair(Operator19,cl, sp, wu);
|
|
|
- client.Send("Rep:维修信息上传成功");
|
|
|
- WriteLog("维修1#维修信息上传成功");
|
|
|
- try
|
|
|
+ WriteCSV_Repair(Operator20, cl, sp, wu);
|
|
|
+ client.Send("Rep:维修信息上传成功");
|
|
|
+ WriteLog("维修2#维修信息上传成功");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
+ if (list != null)
|
|
|
{
|
|
|
- var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
- if (list != null)
|
|
|
- {
|
|
|
- list.ErrS++;
|
|
|
- _repository.Update(list);
|
|
|
- }
|
|
|
- var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
- if (allnumbers != null)
|
|
|
- {
|
|
|
- allnumbers.ErrA++;
|
|
|
- _repository.Update(allnumbers);
|
|
|
- }
|
|
|
+ list.ErrS++;
|
|
|
+ _repository.Update(list);
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
+ if (allnumbers != null)
|
|
|
{
|
|
|
- WriteLog("FIX1:" + ex.Message, LogType.Error);
|
|
|
- _logger.Error("FIX1:" + ex);
|
|
|
+ allnumbers.ErrA++;
|
|
|
+ _repository.Update(allnumbers);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- if (client.IP == "192.168.10.20")//维修2
|
|
|
- {
|
|
|
- if (mes.Split(":")[0] == "Login")
|
|
|
- {
|
|
|
- string accountID = mes.Split(":")[1];
|
|
|
- Operator20 = accountID;
|
|
|
- client.Send($"LoginSuc:登录成功");
|
|
|
- WriteLog("20#登录成功");
|
|
|
- operName[19] = Operator20;
|
|
|
- }
|
|
|
- if (mes.Split(":")[0] == "Fix")
|
|
|
- {
|
|
|
- string sp = mes.Split(":")[1];
|
|
|
- string cl = mes.Split(":")[2];
|
|
|
- string wu = ResWord(mes.Split(":")[3]);
|
|
|
- var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
|
|
|
- if (res != null)
|
|
|
+ catch (Exception ex)
|
|
|
{
|
|
|
- Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
- {
|
|
|
- var productNew = new InformationNew
|
|
|
- {
|
|
|
- OperatorCode = Operator20,
|
|
|
- ItemCode = wu,
|
|
|
- SpendTime = 0,
|
|
|
- CreateTime = DateTime.Today,
|
|
|
- ProType = proName,
|
|
|
- ProNo = "",
|
|
|
- ProCode = sp,
|
|
|
- OrderNo = "",
|
|
|
- TestResult = "维修",
|
|
|
- WorkDev = "2号维修机"
|
|
|
- };
|
|
|
- var product = new Information()
|
|
|
- {
|
|
|
- CreateTime = productNew.CreateTime,
|
|
|
- Id = Guid.NewGuid(),
|
|
|
- OperatorCode = productNew.OperatorCode,
|
|
|
- ItemCode = productNew.ItemCode,
|
|
|
- SpendTime = productNew.SpendTime,
|
|
|
- ProType = productNew.ProType,
|
|
|
- ProNo = productNew.ProNo,
|
|
|
- ProCode = productNew.ProCode,
|
|
|
- OrderNo = productNew.OrderNo,
|
|
|
- TestResult = productNew.TestResult,
|
|
|
- WorkDev = productNew.WorkDev,
|
|
|
- };
|
|
|
-
|
|
|
- InforNew.Add(productNew);
|
|
|
- _repository.Add(product);
|
|
|
- }));
|
|
|
- WriteCSV_Repair(Operator20, cl, sp, wu);
|
|
|
- client.Send("Rep:维修信息上传成功");
|
|
|
- WriteLog("维修2#维修信息上传成功");
|
|
|
- try
|
|
|
- {
|
|
|
- var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
- if (list != null)
|
|
|
- {
|
|
|
- list.ErrS++;
|
|
|
- _repository.Update(list);
|
|
|
- }
|
|
|
- var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
- if (allnumbers != null)
|
|
|
- {
|
|
|
- allnumbers.ErrA++;
|
|
|
- _repository.Update(allnumbers);
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- WriteLog("FIX2:" + ex.Message, LogType.Error);
|
|
|
- _logger.Error("FIX2:" + ex);
|
|
|
- }
|
|
|
+ WriteLog("FIX2:" + ex.Message, LogType.Error);
|
|
|
+ _logger.Error("FIX2:" + ex);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1321,77 +1315,75 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
}
|
|
|
if (mes.Split(":")[0] == "Fix")
|
|
|
{
|
|
|
- string sp = mes.Split(":")[1];
|
|
|
+ string sp = mes.Split(":")[1];
|
|
|
string cl = mes.Split(":")[2];
|
|
|
string wu = ResWord(mes.Split(":")[3]);
|
|
|
- var res = repository.GetFirstDefault<Information>(c => c.ProCode == sp);
|
|
|
- if (res != null)
|
|
|
+
|
|
|
+ Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
{
|
|
|
- Application.Current.Dispatcher.Invoke(new Action(() =>
|
|
|
+ var productNew = new InformationNew
|
|
|
{
|
|
|
- var productNew = new InformationNew
|
|
|
- {
|
|
|
- OperatorCode = Operator21,
|
|
|
- ItemCode = wu,
|
|
|
- SpendTime = 0,
|
|
|
- CreateTime = DateTime.Today,
|
|
|
- ProType = proName,
|
|
|
- ProNo = "",
|
|
|
- ProCode = sp,
|
|
|
- OrderNo = "",
|
|
|
- TestResult = "维修",
|
|
|
- WorkDev = "3号维修机"
|
|
|
- };
|
|
|
- var product = new Information()
|
|
|
- {
|
|
|
- CreateTime = productNew.CreateTime,
|
|
|
- Id = Guid.NewGuid(),
|
|
|
- OperatorCode = productNew.OperatorCode,
|
|
|
- ItemCode = productNew.ItemCode,
|
|
|
- SpendTime = productNew.SpendTime,
|
|
|
- ProType = productNew.ProType,
|
|
|
- ProNo = productNew.ProNo,
|
|
|
- ProCode = productNew.ProCode,
|
|
|
- OrderNo = productNew.OrderNo,
|
|
|
- TestResult = productNew.TestResult,
|
|
|
- WorkDev = productNew.WorkDev,
|
|
|
- };
|
|
|
+ OperatorCode = Operator21,
|
|
|
+ ItemCode = wu,
|
|
|
+ SpendTime = 0,
|
|
|
+ CreateTime = DateTime.Today,
|
|
|
+ ProType = proName,
|
|
|
+ ProNo = "",
|
|
|
+ ProCode = sp,
|
|
|
+ OrderNo = "",
|
|
|
+ TestResult = "维修",
|
|
|
+ WorkDev = "3号维修机"
|
|
|
+ };
|
|
|
+ var product = new Information()
|
|
|
+ {
|
|
|
+ CreateTime = productNew.CreateTime,
|
|
|
+ Id = Guid.NewGuid(),
|
|
|
+ OperatorCode = productNew.OperatorCode,
|
|
|
+ ItemCode = productNew.ItemCode,
|
|
|
+ SpendTime = productNew.SpendTime,
|
|
|
+ ProType = productNew.ProType,
|
|
|
+ ProNo = productNew.ProNo,
|
|
|
+ ProCode = productNew.ProCode,
|
|
|
+ OrderNo = productNew.OrderNo,
|
|
|
+ TestResult = productNew.TestResult,
|
|
|
+ WorkDev = productNew.WorkDev,
|
|
|
+ };
|
|
|
|
|
|
- InforNew.Add(productNew);
|
|
|
- _repository.Add(product);
|
|
|
- }));
|
|
|
- WriteCSV_Repair(Operator21, cl, sp, wu);
|
|
|
- client.Send("Rep:维修信息上传成功");
|
|
|
- WriteLog("维修3#维修信息上传成功");
|
|
|
- try
|
|
|
+ InforNew.Add(productNew);
|
|
|
+ _repository.Add(product);
|
|
|
+ }));
|
|
|
+ WriteCSV_Repair(Operator21, cl, sp, wu);
|
|
|
+ client.Send("Rep:维修信息上传成功");
|
|
|
+ WriteLog("维修3#维修信息上传成功");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
+ if (list != null)
|
|
|
{
|
|
|
- var list = _repository.GetFirstDefault<ProStatus>(c => c.OrdNoS == Order);//查一个值
|
|
|
- if (list != null)
|
|
|
- {
|
|
|
- list.ErrS++;
|
|
|
- _repository.Update(list);
|
|
|
- }
|
|
|
- var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
- if (allnumbers != null)
|
|
|
- {
|
|
|
- allnumbers.ErrA++;
|
|
|
- _repository.Update(allnumbers);
|
|
|
- }
|
|
|
+ list.ErrS++;
|
|
|
+ _repository.Update(list);
|
|
|
}
|
|
|
- catch (Exception ex)
|
|
|
+ var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
+ if (allnumbers != null)
|
|
|
{
|
|
|
- WriteLog("FIX3:" + ex.Message, LogType.Error);
|
|
|
- _logger.Error("FIX3:" + ex);
|
|
|
+ allnumbers.ErrA++;
|
|
|
+ _repository.Update(allnumbers);
|
|
|
}
|
|
|
}
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ WriteLog("FIX3:" + ex.Message, LogType.Error);
|
|
|
+ _logger.Error("FIX3:" + ex);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
#endregion
|
|
|
OperatorName(operName);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- WriteLog($"TCPReceived:{ex.Message}",LogType.Error);
|
|
|
+ WriteLog($"TCPReceived:{ex.Message}", LogType.Error);
|
|
|
_logger.Error("TCPReceived:" + ex);
|
|
|
}
|
|
|
return EasyTask.CompletedTask;
|
|
@@ -1462,7 +1454,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
myBackUpThread.Start();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
public void Bind(string procode)
|
|
|
{
|
|
@@ -1720,7 +1712,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Order=Order.ToUpper();
|
|
|
+ Order = Order.ToUpper();
|
|
|
|
|
|
Quest(Order);
|
|
|
|
|
@@ -1748,9 +1740,9 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
ErrS = 0
|
|
|
};
|
|
|
_repository.Add(outp);
|
|
|
-
|
|
|
+
|
|
|
//Task.Factory.StartNew(PrintCode, TaskCreationOptions.LongRunning);//打印产品码
|
|
|
-
|
|
|
+
|
|
|
var allnumbers = _repository.GetFirstDefault<AllNumber>(c => c.DateA == DateTime.Today);
|
|
|
if (allnumbers != null)
|
|
|
{
|
|
@@ -1934,7 +1926,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
ProCode = "",
|
|
|
OrderNo = Order,
|
|
|
TestResult = "",
|
|
|
- WorkDev="1号机台"
|
|
|
+ WorkDev = "1号机台"
|
|
|
};
|
|
|
var product = new Information()
|
|
|
{
|
|
@@ -1948,7 +1940,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
ProCode = productNew.ProCode,
|
|
|
OrderNo = productNew.OrderNo,
|
|
|
TestResult = productNew.TestResult,
|
|
|
- WorkDev=productNew.WorkDev
|
|
|
+ WorkDev = productNew.WorkDev
|
|
|
};
|
|
|
|
|
|
WriteCSV_Pro(Operator1, "1号机台", pno, proName, Order, Material1);
|
|
@@ -2066,7 +2058,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
TestResult = productNew.TestResult,
|
|
|
WorkDev = productNew.WorkDev,
|
|
|
};
|
|
|
- WriteCSV_Pro(Operator3, "3号机台",pno, proName, Order, Material3);
|
|
|
+ WriteCSV_Pro(Operator3, "3号机台", pno, proName, Order, Material3);
|
|
|
_repository.Add(product);
|
|
|
InforNew.Add(productNew);
|
|
|
OperatorName(operName);
|
|
@@ -2941,7 +2933,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
return time;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public void Change()
|
|
|
{
|
|
|
int type = tcpNet.ReadInt(1000);
|
|
@@ -3108,7 +3100,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
|
|
|
#region WriteCSV
|
|
|
//生产信息
|
|
|
- public void WriteCSV_Pro(string idPeople, string devNum,string proNo, string proType, string order, string Wu)
|
|
|
+ public void WriteCSV_Pro(string idPeople, string devNum, string proNo, string proType, string order, string Wu)
|
|
|
{
|
|
|
string s1, s2, s3, s4,
|
|
|
s11, s12, s13, s14, s15, s16, s17,
|
|
@@ -3209,7 +3201,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
|
|
|
}
|
|
|
|
|
|
//维修信息
|
|
|
- public void WriteCSV_Repair(string idPeople,string client, string proCode, string wu)
|
|
|
+ public void WriteCSV_Repair(string idPeople, string client, string proCode, string wu)
|
|
|
{
|
|
|
string s1, s2, s3, s4,
|
|
|
s11, s12, s13, s14, s15,
|