|
|
@ -1218,11 +1218,59 @@ namespace QMAPP.WinForm.Forms.TianJin |
|
|
|
} |
|
|
|
inputstring = txtCode.Text.ToUpper(); |
|
|
|
this.lberror.Text = null; |
|
|
|
|
|
|
|
if (inputstring.Substring(0, 4) == "FYJH") |
|
|
|
{ |
|
|
|
//数量
|
|
|
|
int defaultNum = Convert.ToInt32(QMAPP.WinForm.Common.LocalSetting.Settings["ShowDataCount"]); |
|
|
|
DialogResult dr = MessageBox.Show("是否确认创建计划?", "提示"); |
|
|
|
if (dr == DialogResult.OK) |
|
|
|
{ |
|
|
|
//物料
|
|
|
|
var mach = inputstring.Substring(4, inputstring.Length - 4); |
|
|
|
var plan = new TJOrderPlan(); |
|
|
|
|
|
|
|
plan.PID = Guid.NewGuid().ToString(); |
|
|
|
plan.PLAN_DATE = DateTime.Now; |
|
|
|
plan.MATERIAL_CODE = mach; |
|
|
|
plan.QTY = defaultNum; |
|
|
|
if (mach.Substring(0, 3) == "770") |
|
|
|
plan.LINENO = "770B"; |
|
|
|
else |
|
|
|
plan.LINENO = "018D"; |
|
|
|
|
|
|
|
foreach (var rule in _barcodeRules) |
|
|
|
{ |
|
|
|
if (System.Text.RegularExpressions.Regex.IsMatch(mach+"1", rule.REGEX)) |
|
|
|
{ |
|
|
|
plan.MATERIAL_CODE = rule.MATERIAL_CODE; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var list = agent.InvokeServiceFunction<List<Materiel>>("TJDoorPlankPlanBLL_GetListMachine", plan.MATERIAL_CODE); |
|
|
|
if (list != null) |
|
|
|
plan.MATERIAL_NAME = list[0].MATERIALNAME; |
|
|
|
|
|
|
|
//QMAPP.ServicesAgent.ServiceAgent agent = ClientContext.GetServiceAgent();
|
|
|
|
var RESULT = agent.InvokeServiceFunction<DataResult<int>>("TJDoorPlankPlanBLL_Insert", plan); |
|
|
|
if (RESULT.IsSuccess == true) |
|
|
|
{ |
|
|
|
agent.InvokeServiceFunction<DataResult<int>>("TJDoorPlankPlanBLL_PutOut", plan.PID); |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#region 一号位校验是否扫描校验
|
|
|
|
|
|
|
|
//2016-01-07 增加1号位校验
|
|
|
|
if (this.dgvNF.Rows.Count == 0) //第一个码必须先扫描1号位
|
|
|
|
#region 一号位校验是否扫描校验
|
|
|
|
|
|
|
|
//2016-01-07 增加1号位校验
|
|
|
|
if (this.dgvNF.Rows.Count == 0) //第一个码必须先扫描1号位
|
|
|
|
{ |
|
|
|
string placeCode = txtCode.Text.Trim(); |
|
|
|
if (placeCode.Equals(System.Configuration.ConfigurationManager.AppSettings["PlaceFirstPositionCode"].ToString())) |
|
|
|