|
|
@ -10,17 +10,23 @@ using QMAPP.Entity; |
|
|
|
|
|
|
|
namespace QMAPP.WinForm.Forms.Operation |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public partial class SignInfoForm : Form |
|
|
|
{ |
|
|
|
//获取服务代理
|
|
|
|
QMAPP.ServicesAgent.ServiceAgent _agent = ClientContext.GetServiceAgent(); |
|
|
|
|
|
|
|
List<BZDConfig> _bzdConfig = null; |
|
|
|
List<Config> _bzdConfig = null; |
|
|
|
private SignInfo signInfo = new SignInfo(); |
|
|
|
|
|
|
|
Product _CurrentProduct = null; |
|
|
|
private OperationForm _parentForm; |
|
|
|
private OperationForm_316 operationForm_316; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="parentForm"></param>
|
|
|
|
public SignInfoForm(OperationForm parentForm) |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
@ -29,11 +35,6 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
|
_parentForm = parentForm; |
|
|
|
} |
|
|
|
|
|
|
|
public SignInfoForm(OperationForm_316 operationForm_316) |
|
|
|
{ |
|
|
|
this.operationForm_316 = operationForm_316; |
|
|
|
} |
|
|
|
|
|
|
|
#region 打印按钮
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -46,92 +47,27 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(cbMaterial.Text)) |
|
|
|
{ |
|
|
|
infolabel.Text = "请选择总成零件号!"; |
|
|
|
cbMaterial.Focus(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (string.IsNullOrWhiteSpace(cbMaterial.Text)) |
|
|
|
{ |
|
|
|
infolabel.Text = "请选择标记类型!"; |
|
|
|
cbMaterial.Focus(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(txtMainCode.Text)) |
|
|
|
{ |
|
|
|
infolabel.Text = "请扫描或填写装配码!"; |
|
|
|
signInfo.ProductCode = txtMainCode.Text; |
|
|
|
signInfo.WorkLoc = _parentForm._SignMachineInfo.MACHINECODDE; |
|
|
|
signInfo.Type = cbMaterial.Text; |
|
|
|
|
|
|
|
txtMainCode.Focus(); |
|
|
|
return; |
|
|
|
} |
|
|
|
//*****************************
|
|
|
|
var _Product = _agent.InvokeServiceFunction<BZDRecorder2>(B9IPCService.BZDRecorderBLL_GetRecord.ToString(), new BZDRecorder2() { PRODUCTCODE = txtMainCode.Text }); |
|
|
|
var result = _agent.InvokeServiceFunction<DataResult<int>>(B9IPCService.SignInfoBLL_Insert.ToString(), signInfo); |
|
|
|
|
|
|
|
if (_Product == null) |
|
|
|
if (result.Result > 0) |
|
|
|
{ |
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加T_AW_PRODUCT
|
|
|
|
var ProductList = SelectProduct(txtMainCode.Text); |
|
|
|
var PID = Guid.NewGuid().ToString(); |
|
|
|
var ProductNew = new Product() |
|
|
|
{ |
|
|
|
PRODUCTCODE = txtMainCode.Text, |
|
|
|
PID = PID, |
|
|
|
//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; |
|
|
|
} |
|
|
|
|
|
|
|
_parentForm.Print052QRCODE(false,txtMainCode.Text); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageBox.Show("条码规则不符合!"); |
|
|
|
} |
|
|
|
|
|
|
|
infolabel.Text = "保存成功!"; |
|
|
|
txtMainCode.Text = ""; |
|
|
|
return; |
|
|
|
} |
|
|
|
else |
|
|
|
MessageBox.Show("条码已存在!"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception exception) |
|
|
|
{ |
|
|
@ -164,12 +100,9 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
|
/// <param name="e"></param>
|
|
|
|
private void PrintForm_Load(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
_bzdConfig = |
|
|
|
_agent.InvokeServiceFunction<List<BZDConfig>>(B9IPCService.BZDConfigBLL_GetAllList.ToString(),""); |
|
|
|
foreach (var t in _bzdConfig) |
|
|
|
{ |
|
|
|
t.MATERIALCODDE = t.MATERIALCODDE + "|" + t.ColorDetail; |
|
|
|
} |
|
|
|
_bzdConfig.Add(new Config { PID = "配胶", MATERIALCODDE = "配胶" }); |
|
|
|
_bzdConfig.Add(new Config { PID = "清胶", MATERIALCODDE = "清胶" }); |
|
|
|
_bzdConfig.Add(new Config { PID = "表皮新料", MATERIALCODDE = "表皮新料" }); |
|
|
|
LoadAssyMaterial(); |
|
|
|
} |
|
|
|
|
|
|
@ -188,7 +121,19 @@ namespace QMAPP.WinForm.Forms.Operation |
|
|
|
this.cbMaterial.DisplayMember = "MATERIALCODDE"; |
|
|
|
this.cbMaterial.ValueMember = "PID"; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public class Config{ |
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public string PID { get; set; } |
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
public string MATERIALCODDE { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|