Browse Source

注塑按箱打,死锁等异常问题,重发的处理

master
ruoxing.wang 1 month ago
parent
commit
20965236c1
  1. 546
      InjectionPC/FrmMain2408.Designer.cs
  2. 581
      InjectionPC/FrmMain2408.cs
  3. 69
      InjectionSearch/FrmBarCodeSearch2408.cs
  4. 4
      MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs
  5. 4
      MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs
  6. 3
      MESWebSite/MESWebSite.csproj
  7. 5
      MESWebSite/Manage/Index.aspx
  8. 2
      MESWebSite/Manage/YongHong/PaintS_JCJL.aspx

546
InjectionPC/FrmMain2408.Designer.cs

File diff suppressed because it is too large

581
InjectionPC/FrmMain2408.cs

@ -567,8 +567,9 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:"+ errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
@ -673,8 +674,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -889,8 +892,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -1026,8 +1031,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
}
catch (Exception ex)
@ -1271,8 +1278,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, same[j].ToString(), false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -1373,8 +1382,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, true, same[j].ToString(), false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"自动打印[{partNo[j].ToString()}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -1882,8 +1893,10 @@ namespace InjectionPC
bool saveRst = SaveInfo(md, false, "0", i == printCount, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"手工打印[{partNo}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -1964,18 +1977,14 @@ namespace InjectionPC
}
}
////if (bll.Add_Info_New(md, Program.tableName) == false)
//if (SaveBarCode(md, Program.tableName, false, "0") == false)
//{
// return;
//}
string errMsg = string.Empty;
bool saveRst = SaveInfo(md, false, "0", false, ref errMsg);
if (saveRst == false)
{
MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
return;
LogErrBLL.AddInfo($"手工打印[{partNo}],条码" + md.OneBarCode + "报错:" + errMsg, MethodBase.GetCurrentMethod());
//MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
//return;
}
#endregion
@ -2928,283 +2937,7 @@ namespace InjectionPC
fr.Show();
}
//private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
//{
// try
// {
// base.Invoke(new EventHandler(this.Scan));
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// }
//}
//private void Scan(object sender, EventArgs e)
//{
// string _code_meca = "",printBoxName="";
// try
// {
// Thread.Sleep(1500);
// char[] buffer = new char[serialPort1.BytesToRead];
// serialPort1.Read(buffer, 0, serialPort1.BytesToRead);
// for (int i = 0; i < buffer.Length; i++)
// {
// _code_meca = _code_meca + buffer[i];
// }
// GetClass();
// string aa = _code_meca;
// var result1 = System.Text.RegularExpressions.Regex.Replace(aa, @"\s*\n\s*", ",");
// result1 = System.Text.RegularExpressions.Regex.Replace(aa, @"\s*\f\s*", ",");
// result1 = System.Text.RegularExpressions.Regex.Replace(aa, @"\s*\r\s*", ",");
// result1 = result1.Remove(result1.LastIndexOf(","), 1);
// result1 = result1.Remove(result1.LastIndexOf("g"), 1);
// int idxStart = result1.LastIndexOf(" ");
// string value = result1.Substring(idxStart, result1.Length - idxStart).Trim();
// string[] b = value.Split('.');
// string c = b[0];
// string d = b[1];
// int chengzhong = Convert.ToInt32(c);
// int chengzhong1 = Convert.ToInt32(d);
// if (chengzhong1 >= 5)
// {
// chengzhong = chengzhong + 1; //重量
// }
// InjectionPlanBLL bll = new InjectionPlanBLL();
// BarCodeBLL brbll = new BarCodeBLL();
// BarCodeModel md = new BarCodeModel();
// ProductBLL productBll = new ProductBLL();
// PlasticBLL pbll = _plasticBLL;
// InjectionBoxBLL boxbll = new InjectionBoxBLL();
// InjectionBoxModel boxmd = new InjectionBoxModel();
// DataTable dt2 = null;
// string code = "", OneCode = "";
// string newcode = "", newcode1 = "", NewOneCode = "", NewOneCode1 = "";
// string IsPack = "", IsOne = "", QLevel = "", IsPaint = "", PartName = "",IsSupply="";
// string filename = "", printName = "";
// int MaxCount = 0, CurrentCount = 0;
// #region 查找当前计划
// DataTable dt = bll.SearchInfoByName(Program.station);
// if (dt != null && dt.Rows.Count > 0)
// {
// planID = dt.Rows[0]["InjectionPlanID"].ToString();
// string[] partNo = dt.Rows[0]["PartNo"].ToString().Split(',');
// string[] stockNo = new string [partNo.Length];
// //string[] stockNo = dt.Rows[0]["StockNo"].ToString().Split(',');
// string ProductNature = dt.Rows[0]["ProductNature"].ToString();
// int IsSame = 0;
// #region 判断有几个零件号
// string mould = "0";
// for (int j = 0; j < partNo.Length; j++)
// {
// #region 根据零件号查找存货代码
// DataTable sdt = productBll.SearchInfoByPartNo(partNo[j].ToString().Trim());
// if (sdt != null && sdt.Rows.Count > 0)
// {
// stockNo[j] = sdt.Rows[0]["StockNo"].ToString();
// IsSame=Convert.ToInt32(sdt.Rows[0]["IsSame"].ToString());
// }
// else
// {
// stockNo[j] = "";
// IsSame = 0;
// }
// #endregion
// DataTable dt3 = productBll.SearchInfoByPartNo(partNo[j].ToString().Trim());
// if (dt3 != null && dt3.Rows.Count > 0)
// {
// QLevel = dt3.Rows[0]["QLevel"].ToString();
// IsOne = dt3.Rows[0]["IsPrintOneTag"].ToString();
// IsPack = dt3.Rows[0]["IsPrintPackList"].ToString();
// IsPaint = dt3.Rows[0]["IsPlating"].ToString();
// PartName = dt3.Rows[0]["ProductName"].ToString();
// MaxCount = Convert.ToInt32(dt3.Rows[0]["PackCount"].ToString());
// IsSupply = dt3.Rows[0]["IsSupply"].ToString();
// }
// if (IsSame == 1)
// {
// for (int k = 0; k < 2; k++)
// {
// GetSjBarCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(),true, mould, PartName, "", ref NewOneCode, ref newcode);
// #region 插入数据tb_barCode
// md.ID = Guid.NewGuid().ToString();
// md.StationID = dt.Rows[0]["StationID"].ToString();
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.StockNo = stockNo[j].ToString().Trim();
// md.PartNo = partNo[j].ToString().Trim();
// md.PrintType = 0;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// md.Des1 = PartName;
// DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// ////if (brbll.Add_Info_New(md, Program.tableName)==false)
// //if (SaveBarCode(md, Program.tableName, true, mould) == false)
// //{
// // return;
// //}
// string errMsg = string.Empty;
// bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
// if (saveRst == false)
// {
// MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
// return;
// }
// #endregion
// #region 打印条码,判断是否打印单个条码
// DataTable dt4 = pbll.SearchInfo(partNo[j].ToString().Trim(),
// dt.Rows[0]["StationID"].ToString());
// if (dt4 != null && dt4.Rows.Count > 0)
// {
// printName = "Printer" + dt4.Rows[0]["PrinterNo"].ToString();
// }
// #region 打印单个标签
// if (IsOne == "1")
// {
// if (IsSupply == "1")
// {
// filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName(IsSupply, "Print" + Program.station + "_3922");
// string reportName = ConfigurationManager.AppSettings[printName].ToString();
// DataTable headTable = GetPrintHeadTable(partNo[j].ToString().Trim(), PartName, NewOneCode, newcode);
// ReportHelper rp = new ReportHelper(filename, headTable, null,
// (int) GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// }
// }
// #endregion
// #endregion
// }
// }
// else
// {
// GetSjBarCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(),true, mould, PartName, "", ref NewOneCode, ref newcode);
// #region 插入数据tb_barCode
// md.ID = Guid.NewGuid().ToString();
// md.StationID = dt.Rows[0]["StationID"].ToString();
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.StockNo = stockNo[j].ToString().Trim();
// md.PartNo = partNo[j].ToString().Trim();
// md.PrintType = 0;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// md.Des1 = PartName;
// DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// ////if (brbll.Add_Info_New(md, Program.tableName)==false)
// //if (SaveBarCode(md, Program.tableName, true, mould) == false)
// //{
// // return;
// //}
// string errMsg = string.Empty;
// bool saveRst = SaveInfo(md, true, mould, false, ref errMsg);
// if (saveRst == false)
// {
// MessageBox.Show("条码" + md.OneBarCode + "存储时发生错误,原因:" + errMsg);
// return;
// }
// #endregion
// #region 打印条码,判断是否打印单个条码
// DataTable dt4 = pbll.SearchInfo(partNo[j].ToString().Trim(),
// dt.Rows[0]["StationID"].ToString());
// if (dt4 != null && dt4.Rows.Count > 0)
// {
// printName = "Printer" + dt4.Rows[0]["PrinterNo"].ToString();
// }
// #region 打印单个标签
// if (IsOne == "1")
// {
// if (IsSupply == "1")
// {
// filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName(IsSupply, "Print" + Program.station + "_3993"); //new
// string reportName = ConfigurationManager.AppSettings[printName].ToString();
// DataTable headTable = GetPrintHeadTable(partNo[j].ToString().Trim(), PartName, NewOneCode, newcode);
// LogHelper.WriteLog(printName + ";" + reportName + ";" + filename);
// ReportHelper rp = new ReportHelper(filename, headTable, null,
// (int) GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// }
// }
// #endregion
// #endregion
// }
// initBarCode();
// }
// #endregion
// }
// #endregion
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// }
//}
private void timer2_Tick(object sender, EventArgs e)
{
Program.ProductDate = _barCodeBLL.GetServiceTime().ToString();
@ -3406,83 +3139,195 @@ namespace InjectionPC
Label lbPackageCode = lbPackageCodeL;
Label lbCurrentlQty = lbCurrentlQtyL;
Label lbNeedQty = lbNeedQtyL;
//BarCodeModel lastFailedModel = null;
if (mould == _leftType)
{
lbPackageCode = lbPackageCodeL;
lbCurrentlQty = lbCurrentlQtyL;
lbNeedQty = lbNeedQtyL;
//lastFailedModel = _lastFailedModelL;
}
else
{
lbPackageCode = lbPackageCodeR;
lbCurrentlQty = lbCurrentlQtyR;
lbNeedQty = lbNeedQtyR;
//lastFailedModel = _lastFailedModelR;
}
bool saveRst = false;
bool saveRst = true;
//自动模式 或者手动模式选中绑定箱码
if (isAutoPrint == true || (isAutoPrint==false && cboxHandBox.Checked ==true))
{
bcm.BoxNo = lbPackageCode.Text.Trim();
saveRst = _barCodeBLL.Add_Info_New(bcm, Program.tableName);
if (saveRst == true)
bool isSuccess = false;
DataTable dt = null;
int realCount = 0;
int sizeCount = 0;
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
{
local.BeginTrans();
_barCodeBLL.Add_Info_New(local, bcm, Program.tableName, "1");
//更新箱单数量
//查询箱单数量 是否等于标包数量 等于的话清空lb显示 小于,数量值赋值给lb显示
if (_injectionBoxBLL.UpdateBoxCount(bcm.BoxNo,1))
if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
{
DataTable dt = _injectionBoxBLL.SearchBox(bcm.BoxNo);
if (dt.Rows.Count == 0)
dt = _injectionBoxBLL.SearchBox(local, bcm.BoxNo);
if (dt.Rows.Count > 0)
{
return false;
}
string realCountStr = dt.Rows[0]["BoxCount"].ToString();
string sizeCountStr = lbNeedQty.Text.Trim();
int realCount = 0;
int sizeCount = 0;
int.TryParse(realCountStr, out realCount);
int.TryParse(sizeCountStr, out sizeCount);
// if(Program.station == "IM18")
// {
SaveLog3($"{Program.station}装箱测试:realCount=[{realCount}],sizeCount=[{sizeCount}],isAutoPrint=[{isAutoPrint}],handPrint=[{handPrint}]");
//}
if ((realCount != 0 && realCount == sizeCount) || (isAutoPrint == false && handPrint==true))
{
lbPackageCode.Text = "";
lbCurrentlQty.Text = "0";
string realCountStr = dt.Rows[0]["BoxCount"].ToString();
string sizeCountStr = lbNeedQty.Text.Trim();
int.TryParse(realCountStr, out realCount);
int.TryParse(sizeCountStr, out sizeCount);
string rst = _wmsBll.SaveInterface(dt.Rows[0]["BoxNo"].ToString(), _lastBoxNoL, _lastBoxNoR, MESClassLibrary.Enum.WmsInterfaceEnum., Program.station);
if (string.IsNullOrEmpty(rst))
if ((realCount != 0 && realCount == sizeCount) || (isAutoPrint == false && handPrint == true))
{
_lastBoxNoL = lbPackageCodeL.Text;
_lastBoxNoR = lbPackageCodeR.Text;
PrintBoxCode(dt.Rows[0], realCount, mould);
lbPackageCode.Text = "";
lbCurrentlQty.Text = "0";
_wmsBll.SaveInterface(local, bcm, "", Program.station);
isSuccess = true;
}
else
{
errorMsg = "插入接口表时异常-" +rst;
MessageBox.Show(rst);
lbCurrentlQty.Text = realCountStr;
}
}
else
{
lbCurrentlQty.Text = realCountStr;
}
}
//throw new Exception("资源被占用,死锁了测试");
local.Commit();
}
else
catch (Exception ex)
{
errorMsg = "插入表" + Program.tableName + "时发生异常";
if (local != null)
{
local.Rollback();
}
errorMsg = ex.Message;
//lastFailedModel = bcm;
if (mould == _leftType) {
_lastFailedModelL = bcm;
}
else
{
_lastFailedModelR = bcm;
}
saveRst = false;
}
finally
{
if (local != null)
{
local.EndTrans();
}
}
//保存后打印箱单
if (isSuccess)
{
_lastBoxNoL = lbPackageCodeL.Text;
_lastBoxNoR = lbPackageCodeR.Text;
//打印箱码
PrintBoxCode(dt.Rows[0], realCount, mould);
// _lastBoxNo = lbPackageCodeL.Text;
lbPackageCodeL.Text = "";
}
//saveRst = _barCodeBLL.Add_Info_New(bcm, Program.tableName);
//if (saveRst == true)
//{
// //更新箱单数量
// //查询箱单数量 是否等于标包数量 等于的话清空lb显示 小于,数量值赋值给lb显示
// if (_injectionBoxBLL.UpdateBoxCount(bcm.BoxNo, 1))
// {
// DataTable dt = _injectionBoxBLL.SearchBox(bcm.BoxNo);
// if (dt.Rows.Count == 0)
// {
// return false;
// }
// string realCountStr = dt.Rows[0]["BoxCount"].ToString();
// string sizeCountStr = lbNeedQty.Text.Trim();
// int realCount = 0;
// int sizeCount = 0;
// int.TryParse(realCountStr, out realCount);
// int.TryParse(sizeCountStr, out sizeCount);
// // if(Program.station == "IM18")
// // {
// SaveLog3($"{Program.station}装箱测试:realCount=[{realCount}],sizeCount=[{sizeCount}],isAutoPrint=[{isAutoPrint}],handPrint=[{handPrint}]");
// //}
// if ((realCount != 0 && realCount == sizeCount) || (isAutoPrint == false && handPrint == true))
// {
// lbPackageCode.Text = "";
// lbCurrentlQty.Text = "0";
// string rst = _wmsBll.SaveInterface(dt.Rows[0]["BoxNo"].ToString(), _lastBoxNoL, _lastBoxNoR, MESClassLibrary.Enum.WmsInterfaceEnum.塑件箱码报工, Program.station);
// if (string.IsNullOrEmpty(rst))
// {
// _lastBoxNoL = lbPackageCodeL.Text;
// _lastBoxNoR = lbPackageCodeR.Text;
// PrintBoxCode(dt.Rows[0], realCount, mould);
// }
// else
// {
// errorMsg = "插入接口表时异常-" + rst;
// MessageBox.Show(rst);
// }
// }
// else
// {
// lbCurrentlQty.Text = realCountStr;
// }
// }
//}
//else
//{
// errorMsg = "插入表" + Program.tableName + "时发生异常";
// saveRst = false;
//}
}
else
{
//手动打印, 关闭打印箱码, 直接存条码记录.不处理其他
saveRst = _barCodeBLL.Add_Info_New(bcm, Program.tableName);
try
{
//手动打印, 关闭打印箱码, 直接存条码记录.不处理其他
saveRst = _barCodeBLL.Add_Info_New(bcm, Program.tableName);
if (saveRst == false)
{
//lastFailedModel = bcm;
if (mould == _leftType)
{
_lastFailedModelL = bcm;
}
else
{
_lastFailedModelR = bcm;
}
}
}
catch(Exception ex)
{
errorMsg = ex.Message;
//lastFailedModel = bcm;
if (mould == _leftType)
{
_lastFailedModelL = bcm;
}
else
{
_lastFailedModelR = bcm;
}
}
}
return saveRst;
@ -3991,7 +3836,7 @@ namespace InjectionPC
timer3.Enabled = false;
//调用测试
Array a = null;
Array b = null;
Array b = new string[] { "1", "2", "3", "4", "5" };
Array c = null;
Array d = null;
status = true;
@ -4518,32 +4363,46 @@ namespace InjectionPC
LogHelper.WriteLog("SaveLog:" + ex.Message);
}
}
private BarCodeModel _lastFailedModelL = null;
private BarCodeModel _lastFailedModelR = null;
bool SaveInfo(BarCodeModel md, bool isAutoPrint, string mould, bool handPrint, ref string errMsg)
{
if (SaveBarCode(md, Program.tableName, isAutoPrint, mould, ref errMsg, handPrint) == false)
if (_lastFailedModelL != null && mould == "0")
{
int a = 0;
for (int l = 0; l < 3; l++)
{
// if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould, ref errMsg, handPrint) == true)
{
break;
}
SaveBarCode(_lastFailedModelL, Program.tableName, isAutoPrint, mould, ref errMsg, handPrint);
_lastFailedModelL = null;
}
if (_lastFailedModelR != null && !string.IsNullOrEmpty(mould) && mould != "0")
{
SaveBarCode(_lastFailedModelR, Program.tableName, isAutoPrint, mould, ref errMsg, handPrint);
_lastFailedModelR = null;
}
a += 1;
//Thread.Sleep(200);
Thread.Sleep(200);
}
bool rst = SaveBarCode(md, Program.tableName, isAutoPrint, mould, ref errMsg, handPrint);
if (a >= 2)
{
SaveLog3(Program.station + "保存3次失败,条码" + md.OneBarCode);
return false;
}
}
return true;
//if (SaveBarCode(md, Program.tableName, isAutoPrint, mould, ref errMsg, handPrint) == false)
//{
// int a = 0;
// for (int l = 0; l < 3; l++)
// {
// // if (brbll.Add_Info_New(md, Program.tableName))
// if (SaveBarCode(md, Program.tableName, true, mould, ref errMsg, handPrint) == true)
// {
// break;
// }
// a += 1;
// //Thread.Sleep(200);
// Thread.Sleep(200);
// }
// if (a >= 2)
// {
// SaveLog3(Program.station + "保存3次失败,条码" + md.OneBarCode);
// return false;
// }
//}
return rst;
}
}

69
InjectionSearch/FrmBarCodeSearch2408.cs

@ -33,10 +33,13 @@ namespace InjectionSearch
private WmsBLL _wmsBll = new WmsBLL();
private string _lastBoxNo = string.Empty;
private BarCodeBLL _barCodeBLL = new BarCodeBLL();
private BarCodeModel _lastFailedModel = null;
public FrmBarCodeSearch2408()
{
InitializeComponent();
this.Size = new Size(1280, 1024);
}
private void initProduct()
@ -636,7 +639,7 @@ namespace InjectionSearch
}
return null;
}
private BarCodeModel _lastFailedModel = null;
bool SaveBarCode(BarCodeModel bcm, string tableName, bool printBox)
{
@ -650,65 +653,7 @@ namespace InjectionSearch
if (cboxHandBox.Checked)
{
Save(bcm, tableName, printBox);
//if (cboxHandBox.Checked)
//{
// bool isSuccess = false;
// DataTable boxTable = null;
// int realCount = 0;
// int sizeCount = 0;
// LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
// try
// {
// local.BeginTrans();
// saveRst = _bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
// if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
// {
// boxTable = _injectionBoxBLL.SearchBox(bcm.BoxNo);
// if (boxTable.Rows.Count > 0)
// {
// string realCountStr = boxTable.Rows[0]["BoxCount"].ToString();
// int.TryParse(realCountStr, out realCount);
// int.TryParse(comBoxSizeL.SelectedValue?.ToString(), out sizeCount);
// if ((realCount != 0 && realCount == sizeCount) || printBox == true)
// {
// _wmsBll.SaveInterface(local, bcm, "", comboBox2.Text.Trim());
// isSuccess = true;
// }
// }
// }
// local.Commit();
// }
// catch (Exception ex)
// {
// if (local != null)
// {
// local.Rollback();
// }
// LogErrBLL.AddInfo("手动批量打印条码" + bcm.OneBarCode + "报错", MethodBase.GetCurrentMethod());
// _lastFailedModel = bcm;
// }
// finally
// {
// if (local != null)
// {
// local.EndTrans();
// }
// }
// //保存后打印箱单
// if (isSuccess)
// {
// //打印箱码
// PrintBoxCode(boxTable.Rows[0], realCount, false);
// _lastBoxNo = lbPackageCodeL.Text;
// lbPackageCodeL.Text = "";
// }
//}
}
}
else
{
try
@ -718,8 +663,6 @@ namespace InjectionSearch
{
_lastFailedModel = bcm;
}
}
catch(Exception ex)
{
@ -742,7 +685,7 @@ namespace InjectionSearch
try
{
local.BeginTrans();
saveRst = _bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
_bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
{

4
MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs

@ -114,9 +114,9 @@ namespace MESClassLibrary.BLL.BasicInfo
}
}
public bool Add_Info_New(LocalDBService local,BarCodeModel md, string tableName, string isNew = "1")
public void Add_Info_New(LocalDBService local,BarCodeModel md, string tableName, string isNew = "1")
{
return db.AddInfoNew(local, md, tableName, isNew);
db.AddInfoNew(local, md, tableName, isNew);
}
//public bool Add_Info_New(LocalDBService local, BarCodeModel md, string tableName)

4
MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs

@ -368,7 +368,7 @@ namespace MESClassLibrary.DAL.BasicInfo
return false;
}
}
public bool AddInfoNew(LocalDBService local, BarCodeModel md, string tableName,string isNew)
public void AddInfoNew(LocalDBService local, BarCodeModel md, string tableName,string isNew)
{
string sql = "";
@ -378,7 +378,7 @@ namespace MESClassLibrary.DAL.BasicInfo
$"'{md.StationID2}','{md.PlanID}','{md.ProductNature}','{md.Des1}','{md.Des2}','{md.Des3}','{md.Des4}','{md.Des5}','{md.BoxNo}','{ md.Weight}','{ md.BatchNo}','{isNew}')";
return local.Exec_NonQuery(sql);
local.Exec_NonQuery(sql);
}
public int Add_ReprintRecord(DataRow dr,string userID,string userName)

3
MESWebSite/MESWebSite.csproj

@ -105,6 +105,9 @@
<ItemGroup>
<Content Include="CSS\Basics.css" />
<Content Include="DLL\Newtonsoft.Json.dll" />
<Content Include="images\北汽模塑.jpg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="images\北汽模塑.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

5
MESWebSite/Manage/Index.aspx

@ -404,13 +404,14 @@
</div>
<div id="divcenter" data-options="region:'center',border:false" style="width: auto;">
<div id="tabmain" class="easyui-tabs" data-options="onSelect:tabSelected">
<div title="欢迎" data-options="iconCls:'icon-tip',closable:false" style="padding: 10px; background-image: url('images/北汽模塑.png'); min-height: 551px;">
<div title="欢迎" data-options="iconCls:'icon-tip',closable:false" style="padding: 10px; background-image: url('../images/北汽模塑.png');background-size:cover; min-height: 551px;">
<div id="divwelcome" style="" >
<div title="服务器信息" style="padding: 10px;">
<p style="font-size: 14px">
<asp:Literal ID="ServerInformation" runat="server" Visible="false"></asp:Literal>
</p>
</div>
</div>
</div>
</div>
</div>

2
MESWebSite/Manage/YongHong/PaintS_JCJL.aspx

@ -5,7 +5,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>喷涂检测记录</title>
<title>BI统计报表</title>
</head>
<body>
<form id="form1" runat="server">

Loading…
Cancel
Save