Commit a8383be3 LN

模板界面bug修改

1 个父辈 600ca576
...@@ -4,7 +4,7 @@ using Newtonsoft.Json; ...@@ -4,7 +4,7 @@ using Newtonsoft.Json;
using RestSharp; using RestSharp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView; using static System.Windows.Forms.VisualStyles.VisualStyleElement.ListView;
using Http = Model.Http; using Http = Model.Http;
...@@ -85,6 +85,23 @@ namespace BLL ...@@ -85,6 +85,23 @@ namespace BLL
} }
return ""; return "";
} }
private int getIntReelInfo(Dictionary<string, string> reelData, string key)
{
try
{
string data = getReelInfo(reelData, key).Trim();
if (data != "")
{
return Convert.ToInt32(data);
}
}
catch (Exception e)
{
LogNet.log.Error(e.ToString());
}
return 0;
}
private string RI = "RI"; private string RI = "RI";
private string PN = "PN"; private string PN = "PN";
...@@ -136,8 +153,8 @@ namespace BLL ...@@ -136,8 +153,8 @@ namespace BLL
paramsMap.Add("partBarcode", getReelInfo(reelData, PN)); paramsMap.Add("partBarcode", getReelInfo(reelData, PN));
paramsMap.Add("quantity", getReelInfo(reelData, QTY)); paramsMap.Add("quantity", getReelInfo(reelData, QTY));
paramsMap.Add("packageType", "paper"); //默认是paper, paramsMap.Add("packageType", "paper"); //默认是paper,
paramsMap.Add("partsoutWarning", getReelInfo(reelData, QTY)); paramsMap.Add("partsoutWarning", getIntReelInfo(reelData, QTY));
paramsMap.Add("splicingWarning", getReelInfo(reelData, QTY)); paramsMap.Add("splicingWarning", getIntReelInfo(reelData, QTY));
paramsMap.Add("partNumber", getReelInfo(reelData, PN)); paramsMap.Add("partNumber", getReelInfo(reelData, PN));
paramsMap.Add("vendorName", getReelInfo(reelData, SP)); paramsMap.Add("vendorName", getReelInfo(reelData, SP));
paramsMap.Add("lotName", getReelInfo(reelData, BATCH)); paramsMap.Add("lotName", getReelInfo(reelData, BATCH));
...@@ -149,10 +166,10 @@ namespace BLL ...@@ -149,10 +166,10 @@ namespace BLL
paramsMap.Add("note3", ""); paramsMap.Add("note3", "");
paramsMap.Add("note4", ""); paramsMap.Add("note4", "");
paramsMap.Add("useSplicing", true); paramsMap.Add("useSplicing", true);
paramsMap.Add("useTrayPackage", true); paramsMap.Add("useTrayPackage", false);
paramsMap.Add("trayStackCount", 1); paramsMap.Add("trayStackCount", 0);
paramsMap.Add("trayPickupPositionX", 1); paramsMap.Add("trayPickupPositionX", 0);
paramsMap.Add("trayPickupPositionY", 1); paramsMap.Add("trayPickupPositionY", 0);
paramsMap.Add("traySizeX", 0); paramsMap.Add("traySizeX", 0);
paramsMap.Add("traySizeY", 0); paramsMap.Add("traySizeY", 0);
List<Dictionary<string, object>> paramList=new List<Dictionary<string, object>>(); List<Dictionary<string, object>> paramList=new List<Dictionary<string, object>>();
......
...@@ -31,6 +31,7 @@ namespace SmartScan.SetControl.WPF ...@@ -31,6 +31,7 @@ namespace SmartScan.SetControl.WPF
{ {
private readonly int codeID; private readonly int codeID;
private readonly string codeText; private readonly string codeText;
private readonly string orgCode = "";
private readonly string codeType; private readonly string codeType;
private readonly Dictionary<Button, ExtractSettingsPanel> matchButton = new Dictionary<Button, ExtractSettingsPanel>(); private readonly Dictionary<Button, ExtractSettingsPanel> matchButton = new Dictionary<Button, ExtractSettingsPanel>();
private readonly Dictionary<Button, UserControl1> userControls = new Dictionary<Button, UserControl1>(); private readonly Dictionary<Button, UserControl1> userControls = new Dictionary<Button, UserControl1>();
...@@ -39,10 +40,10 @@ namespace SmartScan.SetControl.WPF ...@@ -39,10 +40,10 @@ namespace SmartScan.SetControl.WPF
private MaterialCodeMatch matchShared = new MaterialCodeMatch(); private MaterialCodeMatch matchShared = new MaterialCodeMatch();
private Button currentSelectedButton = null; // 跟踪当前选中的按钮 private Button currentSelectedButton = null; // 跟踪当前选中的按钮
public WPF_CodeExtract(string codeText, int codeID, string codeType, List<MaterialCodeMatch> match, string[] strings) public WPF_CodeExtract(string orgCode,string codeText, int codeID, string codeType, List<MaterialCodeMatch> match, string[] strings)
{ {
InitializeComponent(); InitializeComponent();
this.orgCode = orgCode;
codeText = codeText.Replace("\r", ""); codeText = codeText.Replace("\r", "");
this.codeText = codeText.Replace("\n", ""); this.codeText = codeText.Replace("\n", "");
this.codeID = codeID; this.codeID = codeID;
...@@ -642,12 +643,12 @@ namespace SmartScan.SetControl.WPF ...@@ -642,12 +643,12 @@ namespace SmartScan.SetControl.WPF
{ {
try try
{ {
string result = text; string result = orgCode;
// 条码分割 // 条码分割
if (userControl.ChkSplitBarcode.IsChecked == true && userControl.CboSplitChar.SelectedItem != null) if (userControl.ChkSplitBarcode.IsChecked == true && userControl.CboSplitChar.SelectedItem != null)
{ {
string splitChar = userControl.CboSplitChar.SelectedItem.ToString(); string splitChar = MaterialAsciiCode.GetAsciiCode(userControl.CboSplitChar.SelectedItem.ToString());
string[] parts = result.Split(splitChar.ToCharArray()); string[] parts = result.Split(splitChar.ToCharArray());
int splitIndex = int.Parse(userControl.TxtSplitIndex.Text) - 1; // UI显示从1开始,数组从0开始 int splitIndex = int.Parse(userControl.TxtSplitIndex.Text) - 1; // UI显示从1开始,数组从0开始
......
...@@ -529,7 +529,8 @@ namespace SmartScan.SetControl.WPF ...@@ -529,7 +529,8 @@ namespace SmartScan.SetControl.WPF
{ {
codestring = code.Text.Replace(" ", ""); codestring = code.Text.Replace(" ", "");
} }
WPF_CodeExtract wPF_CodeExtract = new WPF_CodeExtract(codestring, code.ID, code.CodeType, match, strings);
WPF_CodeExtract wPF_CodeExtract = new WPF_CodeExtract(code.Text,codestring, code.ID, code.CodeType, match, strings);
bool dr= (bool)wPF_CodeExtract.ShowDialog(); bool dr= (bool)wPF_CodeExtract.ShowDialog();
//FrmCodeExtract frm = new(codestring, code.ID, code.CodeType, match, strings); //FrmCodeExtract frm = new(codestring, code.ID, code.CodeType, match, strings);
//DialogResult dr = frm.ShowDialog(); //DialogResult dr = frm.ShowDialog();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!