Commit 66b210f2 LN

孝感料仓增加条码处理

1 个父辈 bab040c2
......@@ -45,6 +45,8 @@
<!--解码方式,0=halcon 解码,1=西安料仓 使用zxing解码,2=成都料仓-->
<add key="DeCodeType" value="2"/>
<add key ="DefaultPWD" value ="123456"/>
<!--料仓名称,XG=孝感料仓-->
<add key ="StoreName" value ="XG"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -86,3 +86,10 @@ PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32#FA=7x32,,,,,,,
DeCodeType=解码类型,0=halcon,1=zxing解码 西安料仓解析方式。2=成都料仓 PN;RI;
孝感料仓增加条码处理:
ACSingleStore.exe.config文件增加配置:
<!--料仓名称,XG=孝感料仓-->
<add key ="StoreName" value ="XG"/>
\ No newline at end of file
......@@ -90,5 +90,6 @@ namespace OnlineStore.Common
/// </summary>
public static string DeCodeType = "DeCodeType";
public static string DefaultPWD = "DefaultPWD";
public static string StoreName = "StoreName";
}
}
......@@ -1557,6 +1557,7 @@ namespace OnlineStore.DeviceLibrary
message = message + code + spiltStr;
}
}
string StoreName = ConfigAppSettings.GetValue(Setting_Init.StoreName);
//成都料仓条码处理
if ((!hasSpecialCode) && CodeManager.DeCodeType.Equals(2) && codeList.Count > 0)
{
......@@ -1565,6 +1566,13 @@ namespace OnlineStore.DeviceLibrary
{
message = "=1+0x0-" + GetSize() + "x" + GetHeight() + "=" + code;
}
}else if ((!hasSpecialCode) && StoreName.Equals("XG"))
{
string code = CodeManager.ProcessXiaoGanCode(codeList);
if (!String.IsNullOrEmpty(code))
{
message = "=1+0x0-" + GetSize() + "x" + GetHeight() + "=" + code;
}
}
//if (!outMsg.Equals(""))
//{
......
......@@ -342,7 +342,45 @@ namespace OnlineStore.DeviceLibrary
return result;
}
public static string ProcessXiaoGanCode(List<string> codeList)
{
string codeStr = "";
foreach (string key in codeList)
{
if (key.Trim().Equals(""))
{
continue;
}
codeStr = key.Trim() + ";";
}
if (codeStr.EndsWith(";"))
{
codeStr = codeStr.Substring(0, codeStr.Length - 1);
}
if (codeStr != null && codeStr.Contains(";"))
{
string[] codeArr = codeStr.Split(';');
string pn = "";
string qty = "";
foreach (string temp in codeList)
{
if (temp.StartsWith("DM"))
{
pn = temp;
}
if (temp.StartsWith("SL"))
{
qty = temp;
}
}
if (pn.Length != 0 && qty.Length != 0)
{
return pn + "@" + codeStr + "@" + qty;
}
}
return codeStr;
}
private static string GetCodeByStart(List<string> codeList, string start)
{
List<string> pCode = (from m in codeList where m.StartsWith(start) select m).ToList<string>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!