|
|
@ -1229,34 +1229,38 @@ namespace QMAPP.WinForm.Forms.TianJin |
|
|
|
//物料
|
|
|
|
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; |
|
|
|
plan.QTY = defaultNum/2; |
|
|
|
if (mach.Substring(0, 3) == "770") |
|
|
|
plan.LINENO = "770B"; |
|
|
|
else |
|
|
|
plan.LINENO = "018D"; |
|
|
|
|
|
|
|
foreach (var rule in _barcodeRules) |
|
|
|
foreach (var s in "F,R".Split(',')) |
|
|
|
{ |
|
|
|
if (System.Text.RegularExpressions.Regex.IsMatch(mach+"1", rule.REGEX)) |
|
|
|
plan.PID = Guid.NewGuid().ToString(); |
|
|
|
|
|
|
|
plan.MATERIAL_CODE = mach.Substring(0, mach.Length - 1) + s + mach.Substring(mach.Length - 1,1); |
|
|
|
|
|
|
|
foreach (var rule in _barcodeRules) |
|
|
|
{ |
|
|
|
plan.MATERIAL_CODE = rule.MATERIAL_CODE; |
|
|
|
if (System.Text.RegularExpressions.Regex.IsMatch(plan.MATERIAL_CODE + "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; |
|
|
|
//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); |
|
|
|
//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; |
|
|
|
} |
|
|
|