|
@ -10,17 +10,23 @@ using QMAPP.Entity; |
|
|
|
|
|
|
|
|
namespace QMAPP.WinForm.Forms.Operation |
|
|
namespace QMAPP.WinForm.Forms.Operation |
|
|
{ |
|
|
{ |
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
public partial class SignInfoForm : Form |
|
|
public partial class SignInfoForm : Form |
|
|
{ |
|
|
{ |
|
|
//获取服务代理
|
|
|
//获取服务代理
|
|
|
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); |
|
|
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); |
|
|
|
|
|
|
|
|
List<BZDConfig> _bzdConfig = null; |
|
|
List<Config> _bzdConfig = null; |
|
|
|
|
|
private SignInfo signInfo = new SignInfo(); |
|
|
|
|
|
|
|
|
Product _CurrentProduct = null; |
|
|
Product _CurrentProduct = null; |
|
|
private OperationForm _parentForm; |
|
|
private OperationForm _parentForm; |
|
|
private OperationForm_316 operationForm_316; |
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parentForm"></param>
|
|
|
public SignInfoForm(OperationForm parentForm) |
|
|
public SignInfoForm(OperationForm parentForm) |
|
|
{ |
|
|
{ |
|
|
InitializeComponent(); |
|
|
InitializeComponent(); |
|
@ -29,11 +35,6 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
_parentForm = parentForm; |
|
|
_parentForm = parentForm; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public SignInfoForm(OperationForm_316 operationForm_316) |
|
|
|
|
|
{ |
|
|
|
|
|
this.operationForm_316 = operationForm_316; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region 打印按钮
|
|
|
#region 打印按钮
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
@ -48,91 +49,26 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(cbMaterial.Text)) |
|
|
if (string.IsNullOrWhiteSpace(cbMaterial.Text)) |
|
|
{ |
|
|
{ |
|
|
infolabel.Text = "请选择总成零件号!"; |
|
|
infolabel.Text = "请选择标记类型!"; |
|
|
cbMaterial.Focus(); |
|
|
cbMaterial.Focus(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(txtMainCode.Text)) |
|
|
signInfo.ProductCode = txtMainCode.Text; |
|
|
{ |
|
|
signInfo.WorkLoc = _parentForm._SignMachineInfo.MACHINECODDE; |
|
|
infolabel.Text = "请扫描或填写装配码!"; |
|
|
signInfo.Type = cbMaterial.Text; |
|
|
|
|
|
|
|
|
txtMainCode.Focus(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
//*****************************
|
|
|
|
|
|
var _Product = _agent.InvokeServiceFunction<BZDRecorder2>(B9IPCService.BZDRecorderBLL_GetRecord.ToString(), new BZDRecorder2() { PRODUCTCODE = txtMainCode.Text }); |
|
|
|
|
|
|
|
|
|
|
|
if (_Product == null) |
|
|
|
|
|
{ |
|
|
|
|
|
string BZDRule = ""; |
|
|
|
|
|
DataTable dataTable = _agent.InvokeServiceFunction<DataTable>(B9IPCService.BZDConfigBLL_GetAppConfigValue.ToString(), "BZDRule"); |
|
|
|
|
|
if (dataTable.Rows.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
BZDRule = dataTable.Rows[0]["Value"].ToString(); |
|
|
|
|
|
} |
|
|
|
|
|
if (string.IsNullOrEmpty(BZDRule)) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show("未配置总成规则!"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
string MATERIAL_CODE = cbMaterial.Text.Split('|')[0]; |
|
|
|
|
|
|
|
|
|
|
|
if (System.Text.RegularExpressions.Regex.IsMatch(txtMainCode.Text, BZDRule)) |
|
|
|
|
|
{ |
|
|
|
|
|
//添加补打记录
|
|
|
|
|
|
_agent.InvokeServiceFunction<int>(B9IPCService.BarCodeReplacementBLL_Insert.ToString(), new BarCodeReplacement() { ProductCode = txtMainCode.Text, Type = "BZD条码补打" }); |
|
|
|
|
|
|
|
|
|
|
|
_parentForm.planMATERIAL_CODE = MATERIAL_CODE; |
|
|
|
|
|
_parentForm.processMainCode = txtMainCode.Text; |
|
|
|
|
|
//_parentForm.cBoxVAN = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = _agent.InvokeServiceFunction<DataResult<int>>(B9IPCService.SignInfoBLL_Insert.ToString(), signInfo); |
|
|
|
|
|
|
|
|
//添加T_AW_PRODUCT
|
|
|
if (result.Result > 0) |
|
|
var ProductList = SelectProduct(txtMainCode.Text); |
|
|
|
|
|
var PID = Guid.NewGuid().ToString(); |
|
|
|
|
|
var ProductNew = new Product() |
|
|
|
|
|
{ |
|
|
{ |
|
|
PRODUCTCODE = txtMainCode.Text, |
|
|
infolabel.Text = "保存成功!"; |
|
|
PID = PID, |
|
|
txtMainCode.Text = ""; |
|
|
//MACHINECODDE = _operationServiceParam.machineInfo.MACHINECODDE,
|
|
|
|
|
|
//MACHINENAME = _operationServiceParam.machineInfo.MACHINENAME,
|
|
|
|
|
|
PRODUCTSOURCE = "0", |
|
|
|
|
|
MATERIAL_CODE = MATERIAL_CODE, |
|
|
|
|
|
STATUS = "0", |
|
|
|
|
|
OUTFLAG = "0", |
|
|
|
|
|
USINGSTATE = "0", |
|
|
|
|
|
CAPACITY = 1, |
|
|
|
|
|
USINGCOUNT = 0, |
|
|
|
|
|
//WORKCELL_CODE = ProductList.WORKCELL_CODE,
|
|
|
|
|
|
//WORKLOC_CODE = ProductList.WORKLOC_CODE,
|
|
|
|
|
|
//WORKCENTER_CODE = ProductList.WORKCENTER_CODE,
|
|
|
|
|
|
WORKCENTER_CODE = "ASSLINE", |
|
|
|
|
|
MATERIAL_TYPE = "IP_FINASSY" |
|
|
|
|
|
}; |
|
|
|
|
|
//_agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.ProductBLL_Insert.ToString(), ProductNew);
|
|
|
|
|
|
DataResult<int> result;//判断是否成功
|
|
|
|
|
|
//result = _agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.ProductBLL_Insert.ToString(), ProductNew);
|
|
|
|
|
|
result = _agent.InvokeServiceFunction<DataResult<int>>(B9BasicService.ProductBLL_InsertForBundle.ToString(), ProductNew); |
|
|
|
|
|
if (!result.IsSuccess) |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show(result.Msg); |
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_parentForm.Print052QRCODE(false,txtMainCode.Text); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
MessageBox.Show("条码规则不符合!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
MessageBox.Show("条码已存在!"); |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception exception) |
|
|
catch (Exception exception) |
|
|
{ |
|
|
{ |
|
|
MessageBox.Show("打印失败!"); |
|
|
MessageBox.Show("打印失败!"); |
|
@ -164,12 +100,9 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
/// <param name="e"></param>
|
|
|
/// <param name="e"></param>
|
|
|
private void PrintForm_Load(object sender, EventArgs e) |
|
|
private void PrintForm_Load(object sender, EventArgs e) |
|
|
{ |
|
|
{ |
|
|
_bzdConfig = |
|
|
_bzdConfig.Add(new Config { PID = "配胶", MATERIALCODDE = "配胶" }); |
|
|
_agent.InvokeServiceFunction<List<BZDConfig>>(B9IPCService.BZDConfigBLL_GetAllList.ToString(),""); |
|
|
_bzdConfig.Add(new Config { PID = "清胶", MATERIALCODDE = "清胶" }); |
|
|
foreach (var t in _bzdConfig) |
|
|
_bzdConfig.Add(new Config { PID = "表皮新料", MATERIALCODDE = "表皮新料" }); |
|
|
{ |
|
|
|
|
|
t.MATERIALCODDE = t.MATERIALCODDE + "|" + t.ColorDetail; |
|
|
|
|
|
} |
|
|
|
|
|
LoadAssyMaterial(); |
|
|
LoadAssyMaterial(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -188,7 +121,19 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
this.cbMaterial.DisplayMember = "MATERIALCODDE"; |
|
|
this.cbMaterial.DisplayMember = "MATERIALCODDE"; |
|
|
this.cbMaterial.ValueMember = "PID"; |
|
|
this.cbMaterial.ValueMember = "PID"; |
|
|
} |
|
|
} |
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Config{ |
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string PID { get; set; } |
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
///
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string MATERIALCODDE { get; set; } |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
#endregion
|
|
|