|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
|
using Mesnac.Action.Feeding.BasicInfo;
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.Feeding.FinishBatch
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 称量数据存盘辅助类
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class PptWeighDataHelper
|
|
|
|
|
{
|
|
|
|
|
#region 字段与构造方法
|
|
|
|
|
private SaveDataPerLotHandler saveDataPerLot = null;
|
|
|
|
|
private LotBarcode lotBarcode = null;
|
|
|
|
|
private LotWeight lotWeight = null;
|
|
|
|
|
private RecipeData.PptPlanInfo planInfo = null;
|
|
|
|
|
private List<RecipeData.RecipeWeightInfo> allWeightInfo = null;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存本车称重信息是否存在超差记录 0:无 1:有
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static int LotErrorSgn = 0; //初始为0
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造方法
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="_saveDataPerLot">Plc每车存盘数据对象</param>
|
|
|
|
|
/// <param name="_lotBarcode">车报表数据</param>
|
|
|
|
|
/// <param name="_lotWeight">车称重数据</param>
|
|
|
|
|
/// <param name="_planInfo">计划执行数据</param>
|
|
|
|
|
/// <param name="_allWeightInfo">所有称量数据</param>
|
|
|
|
|
public PptWeighDataHelper(SaveDataPerLotHandler _saveDataPerLot, LotBarcode _lotBarcode, LotWeight _lotWeight, RecipeData.PptPlanInfo _planInfo, List<RecipeData.RecipeWeightInfo> _allWeightInfo)
|
|
|
|
|
{
|
|
|
|
|
this.saveDataPerLot = _saveDataPerLot;
|
|
|
|
|
this.lotBarcode = _lotBarcode;
|
|
|
|
|
this.lotWeight = _lotWeight;
|
|
|
|
|
this.planInfo = _planInfo;
|
|
|
|
|
this.allWeightInfo = _allWeightInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region SavePptWeighData - 保存当前车称量存盘信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 保存当前车称量存盘信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dbHelper">数据访问对象</param>
|
|
|
|
|
/// <returns>存盘成功返回true,存盘失败返回false</returns>
|
|
|
|
|
public bool SavePptWeighData(Mesnac.Basic.DataSourceFactory.MCDbType dbType, DbHelper dbHelper)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
FeedingAction action = new FeedingAction();
|
|
|
|
|
//移除卸料
|
|
|
|
|
for (int i = 0; i < allWeightInfo.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (allWeightInfo[i].ActCode - 1 == 2)
|
|
|
|
|
{
|
|
|
|
|
allWeightInfo.RemoveAt(i);
|
|
|
|
|
i--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#region 基本信息
|
|
|
|
|
List<PlcRecipeReader> readerLst = PlcSchemaHandler.Instance.GetPlcRecipeReader("PptWeighData");
|
|
|
|
|
#endregion
|
|
|
|
|
foreach (PlcRecipeReader reader in readerLst)
|
|
|
|
|
{
|
|
|
|
|
int[] buff;
|
|
|
|
|
|
|
|
|
|
#region 称量配方
|
|
|
|
|
List<RecipeData.RecipeWeightInfo> recipeweight = new List<RecipeData.RecipeWeightInfo>();
|
|
|
|
|
for (int i = 0; i < allWeightInfo.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
if (allWeightInfo[i].WeightType == reader.ThisType)
|
|
|
|
|
{
|
|
|
|
|
recipeweight.Add(allWeightInfo[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (recipeweight.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
if (!PlcData.Instance.PlcLastValueRead(reader.PlcFiledName, out buff))
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("读取PLC的称量数据【{0}】失败!", reader.PlcFiledName));
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//int shifting = 0;
|
|
|
|
|
double smallValue = 0.0; //保存前几次小料重量
|
|
|
|
|
for (int i = 0; i < recipeweight.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
RecipeData.RecipeWeightInfo weight = recipeweight[i];
|
|
|
|
|
|
|
|
|
|
#region 基本信息
|
|
|
|
|
dbHelper.CommandType = CommandType.Text;
|
|
|
|
|
StringBuilder sqlstr_field = new StringBuilder();
|
|
|
|
|
StringBuilder sqlstr_value = new StringBuilder();
|
|
|
|
|
string fieldName = string.Empty;
|
|
|
|
|
string valueName = string.Empty;
|
|
|
|
|
if (Mesnac.Basic.DataSourceFactory.MCDbType.Server == dbType)
|
|
|
|
|
sqlstr_field.Append("INSERT INTO Ppt_Weigh(");
|
|
|
|
|
if (Mesnac.Basic.DataSourceFactory.MCDbType.Local == dbType)
|
|
|
|
|
sqlstr_field.Append("INSERT INTO PptWeigh(");
|
|
|
|
|
sqlstr_value.Append(" ) VALUES (");
|
|
|
|
|
#region 数据整理
|
|
|
|
|
#region WeightID
|
|
|
|
|
fieldName = "Weight_id";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.WeightID.ToString().Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
#region MaterCode
|
|
|
|
|
fieldName = "Mater_code";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.MaterialCode.Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
#region MaterName
|
|
|
|
|
fieldName = "Mater_name";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.MaterialName.Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
#region EquipCode
|
|
|
|
|
fieldName = "Equip_code";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, action.CurrEquipCode.Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
#region SetWeight
|
|
|
|
|
fieldName = "Set_weight";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.SetWeight);
|
|
|
|
|
#endregion
|
|
|
|
|
#region ErrorAllow
|
|
|
|
|
fieldName = "Error_allow";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.ErrorAllow);
|
|
|
|
|
#endregion
|
|
|
|
|
#region WeighTime
|
|
|
|
|
fieldName = "Weigh_time";
|
|
|
|
|
//valueName = "getdate()";
|
|
|
|
|
valueName = "convert(varchar(19),getdate(),120)";
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
#endregion
|
|
|
|
|
#region WeighType
|
|
|
|
|
fieldName = "weigh_type";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.WeightType);
|
|
|
|
|
#endregion
|
|
|
|
|
#region Weigh_State
|
|
|
|
|
fieldName = "weigh_state";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
switch (weight.WeightType)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
dbHelper.AddParameter(valueName, saveDataPerLot.CBStatus);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
dbHelper.AddParameter(valueName, saveDataPerLot.OilStatus);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
dbHelper.AddParameter(valueName, saveDataPerLot.RubStatus);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
dbHelper.AddParameter(valueName, saveDataPerLot.FLStatus);
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
dbHelper.AddParameter(valueName, 0);
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
dbHelper.AddParameter(valueName, saveDataPerLot.Oil2Status);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
dbHelper.AddParameter(valueName, 0);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#region PlanID
|
|
|
|
|
fieldName = "plan_id";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, planInfo.PlanID.Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
#region PlanDate
|
|
|
|
|
fieldName = "plan_date";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, String.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(planInfo.PlanDate)));
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 从配置信息获取 Real_Weight、Error_out、Warning_sgn超差标志
|
|
|
|
|
|
|
|
|
|
//1、获取称重值
|
|
|
|
|
double theValue = 0.0; //要获取的称重值
|
|
|
|
|
switch (reader.ThisType)
|
|
|
|
|
{
|
|
|
|
|
case 0: //炭黑
|
|
|
|
|
case 1: //油1
|
|
|
|
|
case 5: //油2
|
|
|
|
|
if (reader.ItemList.Count != 2)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("PlcSchema.xml文件中【{0}】配置错误,应该配置“JarSerial”和“Real_weight”", reader.PlcFiledName));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int loopCount = buff.Length / reader.ItemList.Count; //循环计算次数(总字节长度/存盘数据项)
|
|
|
|
|
for (int k = 0; k < loopCount; k++)
|
|
|
|
|
{
|
|
|
|
|
int jarSerial = buff[k * 2]; //取出罐号
|
|
|
|
|
if (weight.JarNum == jarSerial)
|
|
|
|
|
{
|
|
|
|
|
theValue += buff[k * 2 + 1]; //累加称量值
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
theValue = theValue / reader.ItemList[1].Multiply; //除法运算
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2: //胶料
|
|
|
|
|
if (reader.ItemList.Count != 1)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("PlcSchema.xml文件中【{0}】配置错误,应该配置“Real_weight”", reader.PlcFiledName));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
theValue = buff[i]; //按顺序取胶料重量
|
|
|
|
|
theValue = theValue / reader.ItemList[0].Multiply; //除法运算
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4: //小料
|
|
|
|
|
if (reader.ItemList.Count != 1)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("PlcSchema.xml文件中【{0}】配置错误,应该配置“Real_weight”", reader.PlcFiledName));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (i < recipeweight.Count - 1)
|
|
|
|
|
{
|
|
|
|
|
theValue = weight.SetWeight;
|
|
|
|
|
smallValue += weight.SetWeight; //累加前几次的小料重量
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
theValue = buff[0]; //小料重量值存在1个字中,前面每次称量取设定值,最后一次用取出的重量减去前几次的设定重量
|
|
|
|
|
theValue = theValue / reader.ItemList[0].Multiply; //除法运算
|
|
|
|
|
theValue = theValue - smallValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3: //粉料
|
|
|
|
|
if (reader.ItemList.Count != 2)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("PlcSchema.xml文件中【{0}】配置错误,应该配置“JarSerial”和“Real_weight”", reader.PlcFiledName));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int loopCount = buff.Length / reader.ItemList.Count; //循环计算次数(总字节长度/存盘数据项)
|
|
|
|
|
for (int k = 0; k < loopCount; k++)
|
|
|
|
|
{
|
|
|
|
|
int jarSerial = buff[k * 2]; //取出罐号
|
|
|
|
|
if (weight.JarNum == jarSerial)
|
|
|
|
|
{
|
|
|
|
|
theValue += buff[k * 2 + 1]; //累加称量值2
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
theValue = theValue / reader.ItemList[1].Multiply; //除法运算
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ICSharpCode.Core.LoggingService.Warn(String.Format("PlcSchema.xml配置文件-存盘配置-称量配置无效称量类型【type = {0}】", reader.ThisType));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//累计每车设定重量和实际重量
|
|
|
|
|
if (dbType == Basic.DataSourceFactory.MCDbType.Local) //防止重复累加
|
|
|
|
|
{
|
|
|
|
|
this.lotWeight.SetWeight += weight.SetWeight; //累计到每车的设定重量
|
|
|
|
|
this.lotWeight.RealWeight += theValue; //累加到每车实际重量
|
|
|
|
|
}
|
|
|
|
|
//2、获取误差值
|
|
|
|
|
double theErrorOut = Math.Abs(theValue - weight.SetWeight);
|
|
|
|
|
int Warning_sgn = 0; //超差标志,1:超差;0:正常
|
|
|
|
|
if (theErrorOut > weight.ErrorAllow)
|
|
|
|
|
{
|
|
|
|
|
Warning_sgn = 1;
|
|
|
|
|
PptWeighDataHelper.LotErrorSgn = 1; //设置超差报警信息,提供给PptLot使用
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Warning_sgn = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Real_Weight 实际称量值
|
|
|
|
|
fieldName = "Real_Weight";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
if (theValue == 0)
|
|
|
|
|
{
|
|
|
|
|
//如果实际称量值为0,则进行修正,把实际值修正为设定值,清除超差信息,同时在Unit_name字段中添加标志M
|
|
|
|
|
dbHelper.AddParameter(valueName, weight.SetWeight);
|
|
|
|
|
PptWeighDataHelper.LotErrorSgn = 0;
|
|
|
|
|
Warning_sgn = 0;
|
|
|
|
|
theErrorOut = 0;
|
|
|
|
|
|
|
|
|
|
fieldName = "Unit_name";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, "M");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dbHelper.AddParameter(valueName, theValue);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Error_out 实际误差值
|
|
|
|
|
fieldName = "Error_out";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, theErrorOut);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Warning_sgn 超差标志
|
|
|
|
|
fieldName = "Warning_sgn";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName).Append(",");
|
|
|
|
|
sqlstr_value.Append(valueName).Append(",");
|
|
|
|
|
dbHelper.AddParameter(valueName, Warning_sgn);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 老版本代码
|
|
|
|
|
|
|
|
|
|
//foreach (PlcRecipeReaderItem item in reader.ItemList)
|
|
|
|
|
//{
|
|
|
|
|
// fieldName = item.DataFieldName;
|
|
|
|
|
|
|
|
|
|
// if (!fieldName.Equals("Real_weight", StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
// {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// int[] data = new int[item.ValueLen];
|
|
|
|
|
// for (int idx = 0; idx < data.Length; idx++)
|
|
|
|
|
// {
|
|
|
|
|
// data[idx] = buff[idx + shifting];
|
|
|
|
|
// }
|
|
|
|
|
// shifting += item.ValueLen;
|
|
|
|
|
// item.SetValue = data;
|
|
|
|
|
|
|
|
|
|
// valueName = "@" + fieldName;
|
|
|
|
|
// sqlstr_field.Append(fieldName).AppendLine(",");
|
|
|
|
|
// sqlstr_value.Append(valueName).AppendLine(",");
|
|
|
|
|
// if (fieldName.Equals("Real_weight", StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
// {
|
|
|
|
|
// lotWeight.RealWeight += (double)item.GetValue();
|
|
|
|
|
// }
|
|
|
|
|
// dbHelper.AddParameter(valueName, item.GetValue());
|
|
|
|
|
//}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 执行存储
|
|
|
|
|
#region Barcode
|
|
|
|
|
fieldName = "Barcode";
|
|
|
|
|
valueName = "@" + fieldName;
|
|
|
|
|
sqlstr_field.Append(fieldName);
|
|
|
|
|
sqlstr_value.Append(valueName);
|
|
|
|
|
dbHelper.AddParameter(valueName, lotBarcode.Barcode.Trim());
|
|
|
|
|
#endregion
|
|
|
|
|
sqlstr_value.AppendLine(")"); //结束SQL语句
|
|
|
|
|
dbHelper.CommandText = sqlstr_field.ToString() + sqlstr_value.ToString();
|
|
|
|
|
dbHelper.ExecuteNonQuery();
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//dbHelper.CommandText = "UPDATE PptWeigh SET Error_out=Set_weight-Real_weight WHERE Barcode='" + lotBarcode.Barcode + "'";
|
|
|
|
|
//dbHelper.ExecuteNonQuery();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Error("存盘业务-保存当前车称量存盘信息失败:" + ex.Message);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 更新本地库称量数据的上传标志
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 更新本地库称量数据的上传标志
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="localHelper">本地库数据连接对象</param>
|
|
|
|
|
public void UpdateIsUpFlag(DbHelper localHelper)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string strSql = "update PptWeigh set IsUpFlag = 1 where Barcode = @Barcode";
|
|
|
|
|
localHelper.ClearParameter();
|
|
|
|
|
localHelper.CommandText = strSql;
|
|
|
|
|
localHelper.AddParameter("@Barcode", this.lotBarcode.Barcode.Trim());
|
|
|
|
|
localHelper.ExecuteNonQuery();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ICSharpCode.Core.LoggingService.Error(String.Format("更新本地库称量数据[{0}]上传标志失败:{1}", this.lotBarcode.Barcode, ex.Message));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|