Browse Source

提交

master
songnan.zhang 2 years ago
parent
commit
00d996f6b1
  1. 2
      APPQ5/QMAPP.WinForm/App.config
  2. 6
      APPQ5/QMAPP.WinForm/Dictionary.xml
  3. 26
      APPQ5/QMAPP.WinForm/Forms/Injection/SlushMoldingPrintForOldNewForm.cs
  4. 108
      APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm_316.cs
  5. 4
      APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

2
APPQ5/QMAPP.WinForm/App.config

@ -211,7 +211,7 @@
<!--<endpoint address="net.tcp://localhost:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />-->
<!--<endpoint address="net.tcp://127.0.0.1:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />-->
<endpoint address="net.tcp://10.111.144.99:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />
<endpoint address="net.tcp://10.111.144.97:4444/OpcService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IOpcService" contract="ServiceOpc.IOpcService" name="NetTcpBinding_IOpcService" />
<endpoint address="http://localhost:8938/GeneralService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="CenterGeneralService.IGeneralService" name="BasicHttpBinding_IGeneralService" />
<endpoint address="http://localhost:8938/LoginService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeneralService" contract="LoginService.ILoginService" name="BasicHttpBinding_ILoginService" />

6
APPQ5/QMAPP.WinForm/Dictionary.xml

@ -141,9 +141,11 @@
<Dictionary Name="COLOR">
<items key="" value="" />
<items key="2" value="棕色" />
<items key="1" value="黑色" />
<items key="2" value="灰色" />
<items key="3" value="棕色" />
<items key="3" value="灰色" />
<items key="4" value="黑色PA" />
<items key="5" value="灰色PA" />
</Dictionary>
<Dictionary Name="PROTYPE">

26
APPQ5/QMAPP.WinForm/Forms/Injection/SlushMoldingPrintForOldNewForm.cs

@ -52,6 +52,7 @@ namespace QMAPP.WinForm.Forms.Injection
private string _cfgSlushMoldingVW3712 = null;// 预警区间
private string _cfgSlushMoldingVW371PA = null;// 称重区间
private string _cfgSlushMoldingVW371PA2 = null;// 预警区间
private string _SetFistColor = null;// 设置首选颜色
/// <summary>
/// 新建
@ -69,6 +70,7 @@ namespace QMAPP.WinForm.Forms.Injection
_cfgSlushMoldingVW3712 = GetAppConfigValue("SLUSHMOLDING2");
_cfgSlushMoldingVW371PA = GetAppConfigValue("SLUSHMOLDINGPA");
_cfgSlushMoldingVW371PA2 = GetAppConfigValue("SLUSHMOLDINGPA2");
_SetFistColor = GetAppConfigValue("SetFistColor");
btnCommSend.Enabled = true;
serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived);
@ -141,6 +143,10 @@ namespace QMAPP.WinForm.Forms.Injection
this.comColor.SelectedValue = "1";
//this.comColor.Enabled = false;
if (!string.IsNullOrEmpty(_SetFistColor))
{
this.comColor.SelectedValue = _SetFistColor;
}
ColorPrint = this.comColor.SelectedValue.ToString();
////AB腔
@ -1067,20 +1073,28 @@ namespace QMAPP.WinForm.Forms.Injection
{
if (!string.IsNullOrEmpty(ColorPrint) && ColorPrint != this.comColor.SelectedValue.ToString())
{
UpdatePasswordForm psd = new UpdatePasswordForm();
var color = this.comColor.SelectedValue.ToString();
var result = psd.ShowDialog();
if (result.ToString() != "OK")
if (this.comColor.SelectedValue.ToString() != "4")
{
if (color != ColorPrint)
UpdatePasswordForm psd = new UpdatePasswordForm();
var color = this.comColor.SelectedValue.ToString();
var result = psd.ShowDialog();
if (result.ToString() != "OK")
{
if (color != ColorPrint)
{
this.comColor.SelectedValue = ColorPrint;
}
}
else
{
this.comColor.SelectedValue = ColorPrint;
ColorPrint = this.comColor.SelectedValue.ToString();
}
}
else
{
ColorPrint = this.comColor.SelectedValue.ToString();
}
}
}

108
APPQ5/QMAPP.WinForm/Forms/Operation/OperationForm_316.cs

@ -30,6 +30,7 @@ using gregn6Lib;
using System.Data;
using QMAPP.FJC.Entity.BZD;
using QMAPP.BoraUpgrade.BLL;
using System.Text;
namespace QMAPP.WinForm.Forms.Operation
{
@ -1913,6 +1914,8 @@ namespace QMAPP.WinForm.Forms.Operation
{
try
{
WriteFile("ZSN, Print052QRCODE 开始", @"D:\MES\Log");
if (!cBoxVANstr || "IP_ASSEMBLING,GWASSEMBLE_VW371PA".Contains(_operationServiceParam.machineInfo.WORKLOC_CODE))
cBoxVAN.Visible = false;
@ -1927,20 +1930,24 @@ namespace QMAPP.WinForm.Forms.Operation
//数据填充
Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReadFetchRecordBox);
WriteFile("ZSN, Print052QRCODE reportPath:" + reportPath, @"D:\MES\Log");
Report.LoadFromFile(reportPath);
//rep.Printer.PrinterName = "默认打印机";//调取不同的打印机
Report.Print(false);
WriteFile("ZSN, Print052QRCODE 结束", @"D:\MES\Log");
}
catch (Exception)
catch (Exception ex)
{
WriteFile("ZSN, Print052QRCODE catch " + ex.Message, @"D:\MES\Log");
throw;
}
finally
{
WriteFile("ZSN, Print052QRCODE finally", @"D:\MES\Log");
Report = new GridppReport();
}
@ -1964,36 +1971,47 @@ namespace QMAPP.WinForm.Forms.Operation
private BZD getBZDCode()
{
BZD bzd = new BZD();
List<string> list = new List<string>();
List<string> paramList = new List<string>();
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 start
if (string.IsNullOrEmpty(planMATERIAL_CODE))
try
{
var MaterialCodes = "";
var dataSrouce = _agent.InvokeServiceFunction<DataTable>(B9IPCService.BZDConfigBLL_GetMaterialCode.ToString(), processMainCode);
foreach (DataRow dataRow in dataSrouce.Rows)
List<string> list = new List<string>();
List<string> paramList = new List<string>();
WriteFile("ZSN,planMATERIAL_CODE =1= " + planMATERIAL_CODE, @"D:\MES\Log");
WriteFile("ZSN,processMainCode =1= " + processMainCode, @"D:\MES\Log");
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 start
if (string.IsNullOrEmpty(planMATERIAL_CODE))
{
MaterialCodes = dataRow["MATERIAL_CODE"].ToString();
var MaterialCodes = "";
var dataSrouce = _agent.InvokeServiceFunction<DataTable>(B9IPCService.BZDConfigBLL_GetMaterialCode.ToString(), processMainCode);
foreach (DataRow dataRow in dataSrouce.Rows)
{
MaterialCodes = dataRow["MATERIAL_CODE"].ToString();
}
if (!string.IsNullOrEmpty(MaterialCodes))
planMATERIAL_CODE = MaterialCodes;
else
{
WriteFile("ZSN,缺少planMATERIAL_CODE ", @"D:\MES\Log");
throw new Exception("创建BZD码失败!缺少planMATERIAL_CODE");
}
}
if (!string.IsNullOrEmpty(MaterialCodes))
planMATERIAL_CODE = MaterialCodes;
else
throw new Exception("创建BZD码失败!缺少planMATERIAL_CODE");
}
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 end
//张松男 20210207 总成工位打印052 缺少物料号 重新查找填充 end
paramList.Add(planMATERIAL_CODE);
paramList.Add(processMainCode);
paramList.Add(planMATERIAL_CODE);
paramList.Add(processMainCode);
WriteFile("ZSN,planMATERIAL_CODE =2= " + planMATERIAL_CODE, @"D:\MES\Log");
WriteFile("ZSN,processMainCode =2= " + processMainCode, @"D:\MES\Log");
try
{
//读取BZDCONFIG配置列表
list = _agent.InvokeServiceFunction<List<string>>(
B9IPCService.BZDRecorderBLL_CreateBZDCode.ToString(), paramList);
if (list != null)
{
WriteFile("ZSN,查询到list " + processMainCode, @"D:\MES\Log");
//将返回值赋值给bzd对象
bzd.barcode = list[0];
bzd.color = list[1];
@ -2001,6 +2019,7 @@ namespace QMAPP.WinForm.Forms.Operation
bzd.count = list[3];
if (bzd.count == "0")
{
WriteFile("创建BZD码失败!缺少list[3] ", @"D:\MES\Log");
planMATERIAL_CODE = null;
processMainCode = null;
throw new Exception($"创建BZD码失败!缺少list[3];planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}");
@ -2010,6 +2029,7 @@ namespace QMAPP.WinForm.Forms.Operation
}
else
{
WriteFile("创建BZD码失败!list=null ", @"D:\MES\Log");
planMATERIAL_CODE = null;
processMainCode = null;
throw new Exception($"创建BZD码异常!list=null;planMATERIAL_CODE={planMATERIAL_CODE};processMainCode={processMainCode}");
@ -2017,6 +2037,7 @@ namespace QMAPP.WinForm.Forms.Operation
}
catch (Exception e)
{
WriteFile("创建BZD码失败!Exception: " + e.Message, @"D:\MES\Log");
planMATERIAL_CODE = null;
processMainCode = null;
MessageBox.Show(e.Message);
@ -3821,5 +3842,50 @@ namespace QMAPP.WinForm.Forms.Operation
BindPlanView();
}
/// <summary>
/// 临时日志
/// </summary>
/// <param name="strText"></param>
/// <param name="path"></param>
/// <returns></returns>
public string WriteFile(string strText, string path)
{
Encoding code = Encoding.GetEncoding("gb2312");
StreamWriter sw = null;
string filename = DateTime.Now.ToString("yyyy-MM-dd") + ".txt";
if (string.IsNullOrEmpty(path))
{
path = System.AppDomain.CurrentDomain.BaseDirectory;
}
if (Directory.Exists(path) == false)
{
Directory.CreateDirectory(path);
}
try
{
string fullpath = System.IO.Path.Combine(path, filename);
sw = new StreamWriter(fullpath, true, code);
sw.Write("[" + DateTime.Now.ToString() + "]\r\n--" + strText + "\r\n");
sw.Flush();
}
catch (Exception ex)
{
//HttpContext.Current.Response.Write(ex.Message);
//HttpContext.Current.Response.End();
}
finally
{
if (sw != null)
{
sw.Close();
}
}
return filename;
}
}
}

4
APPQ5/QMAPP.WinForm/Properties/AssemblyInfo.cs

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2022.06.16.01")]
[assembly: AssemblyFileVersion("2022.06.16.01")]
[assembly: AssemblyVersion("2022.06.23.01")]
[assembly: AssemblyFileVersion("2022.06.23.01")]

Loading…
Cancel
Save