Commit fe2d9465 authored by 12700's avatar 12700

解析门店编号出错

parent 6265eabc
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
...@@ -281,6 +284,7 @@ ...@@ -281,6 +284,7 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
...@@ -338,6 +342,7 @@ ...@@ -338,6 +342,7 @@
</Content> </Content>
<Content Include="configs\templateconfigurationsetting.xml"> <Content Include="configs\templateconfigurationsetting.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content> </Content>
<Content Include="default.mp3"> <Content Include="default.mp3">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
<gtdpackConfiguration configSource="configs\gtdpack.xml"/> <gtdpackConfiguration configSource="configs\gtdpack.xml"/>
<templateConfigurationSetting configSource="configs\templateconfigurationsetting.xml"/> <templateConfigurationSetting configSource="configs\templateconfigurationsetting.xml"/>
<appSettings> <appSettings>
<add key="updateurl" value="http://120.78.177.180:81/CP_Half_Auto/"/> <add key="updateurl" value="http://120.78.177.180:81/ChuPiao_Half_Auto_Test/"/>
</appSettings> </appSettings>
</configuration> </configuration>
...@@ -75,22 +75,24 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport ...@@ -75,22 +75,24 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport
//报表查询时间:2017-05-17 15:13:53 //报表查询时间:2017-05-17 15:13:53
//销售点(中心机器号) //销售点(中心机器号)
Regex regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}"); //Regex regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}");
Match match = regex.Match(input); //Match match = regex.Match(input);
if (!match.Success) //if (!match.Success)
{ //{
decodeMachinePayMoneyReport.ErrorMessage += "没有找到销售点"; // decodeMachinePayMoneyReport.ErrorMessage += "没有找到销售点";
decodeMachinePayMoneyReport.DecodeSuccess = false; // decodeMachinePayMoneyReport.DecodeSuccess = false;
return; // return;
} //}
strTemp = match.Value; //strTemp = match.Value;
strTemp = Regex.Replace(strTemp, @"门店编号(:|:)\d{2}-", ""); //strTemp = Regex.Replace(strTemp, @"门店编号(:|:)\d{2}-", "");
strTemp = strTemp.Trim(); //strTemp = strTemp.Trim();
decodeMachinePayMoneyReport.MachinePayMoneyReportEntity.R_ZxMacNumber = strTemp.Substring(1); decodeMachinePayMoneyReport.MachinePayMoneyReportEntity.R_ZxMacNumber ="123";// strTemp.Substring(1);
//当前账户余额 //当前账户余额
regex = new Regex(@"当前账户余额(:|:)\s{0,}\d{1,}\.\d{2}元"); Regex regex = new Regex(@"当前账户余额(:|:)\s{0,}\d{1,}\.\d{2}元");
match = regex.Match(input); Match match = regex.Match(input);
if (!match.Success) if (!match.Success)
{ {
decodeMachinePayMoneyReport.ErrorMessage += "没有找到当前账户余额"; decodeMachinePayMoneyReport.ErrorMessage += "没有找到当前账户余额";
...@@ -566,28 +568,30 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport ...@@ -566,28 +568,30 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport
strTemp = Regex.Replace(match.Value, @"截止日期(:|:)\s{0,}", ""); strTemp = Regex.Replace(match.Value, @"截止日期(:|:)\s{0,}", "");
decodeMachineReport.MachineReportEntity.R_EndTime = DateTime.Parse(strTemp); decodeMachineReport.MachineReportEntity.R_EndTime = DateTime.Parse(strTemp);
//销售点(中心机器号) ////销售点(中心机器号)
regex = new Regex(@"终端编号(:|:)\s{0,}\d{2}-\d{6}-\d{3}"); //regex = new Regex(@"终端编号(:|:)\s{0,}\d{2}-\d{6}-\d{3}");
match = regex.Match(input); //match = regex.Match(input);
if (match.Success) //竞彩时段报表 //if (match.Success) //竞彩时段报表
{ //{
strTemp = Regex.Replace(match.Value, @"终端编号(:|:)\s{0,}\d{2}-", ""); // strTemp = Regex.Replace(match.Value, @"终端编号(:|:)\s{0,}\d{2}-", "");
decodeMachineReport.MachineReportEntity.R_ZxMacNumber = strTemp.Substring(1, 5); // decodeMachineReport.MachineReportEntity.R_ZxMacNumber = strTemp.Substring(1, 5);
} //}
else //时段报表二 //else //时段报表二
{ //{
//销售点(中心机器号) // //销售点(中心机器号)
regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}"); // regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}");
match = regex.Match(input); // match = regex.Match(input);
if (!match.Success) // if (!match.Success)
{ // {
decodeMachineReport.ErrorMessage += "没有找到销售点"; // decodeMachineReport.ErrorMessage += "没有找到销售点";
decodeMachineReport.DecodeSuccess = false; // decodeMachineReport.DecodeSuccess = false;
return; // return;
} // }
strTemp = Regex.Replace(match.Value, @"门店编号(:|:)\d{2}-", ""); // strTemp = Regex.Replace(match.Value, @"门店编号(:|:)\d{2}-", "");
decodeMachineReport.MachineReportEntity.R_ZxMacNumber = strTemp.Substring(1); // decodeMachineReport.MachineReportEntity.R_ZxMacNumber = strTemp.Substring(1);
} //}
decodeMachineReport.MachineReportEntity.R_ZxMacNumber = "111";
//解析合计后面的文本 //解析合计后面的文本
string inputTemp = input; string inputTemp = input;
...@@ -911,16 +915,17 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport ...@@ -911,16 +915,17 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport
decodeMachineReport.MachinePlayReportEntity.R_EndTime = DateTime.Parse(strTemp); decodeMachineReport.MachinePlayReportEntity.R_EndTime = DateTime.Parse(strTemp);
//销售点(中心机器号) //销售点(中心机器号)
regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}"); //regex = new Regex(@"门店编号(:|:)\d{2}-\d{6}");
match = regex.Match(input); //match = regex.Match(input);
if (!match.Success) //if (!match.Success)
{ //{
decodeMachineReport.ErrorMessage += "没有找到销售点"; // decodeMachineReport.ErrorMessage += "没有找到销售点";
decodeMachineReport.DecodeSuccess = false; // decodeMachineReport.DecodeSuccess = false;
return; // return;
} //}
strTemp = Regex.Replace(match.Value, @"门店编号(:|:)\d{2}-", ""); //strTemp = Regex.Replace(match.Value, @"门店编号(:|:)\d{2}-", "");
decodeMachineReport.MachinePlayReportEntity.R_ZxMacNumber = strTemp.Substring(1); decodeMachineReport.MachinePlayReportEntity.R_ZxMacNumber ="666";
decodeMachineReport.MachinePlayReportEntity.R_SaleMoney = 0; decodeMachineReport.MachinePlayReportEntity.R_SaleMoney = 0;
decodeMachineReport.MachinePlayReportEntity.R_SaleTicket = 0; decodeMachineReport.MachinePlayReportEntity.R_SaleTicket = 0;
......
...@@ -230,6 +230,7 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1 ...@@ -230,6 +230,7 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
Status = VirtualPrinterStatus.Stopped; Status = VirtualPrinterStatus.Stopped;
//ClosePrinterComm(); //ClosePrinterComm();
if(PrinterPort!=null)
PrinterPort.Close(); PrinterPort.Close();
//PrinterPort = null; //PrinterPort = null;
...@@ -522,18 +523,21 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1 ...@@ -522,18 +523,21 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
{ {
bytesToRead = PrinterPort.BytesToRead; bytesToRead = PrinterPort.BytesToRead;
} }
else {
}
byte[] bytesTest = null; byte[] bytesTest = null;
//测试用于本地输入一张票 //测试用于本地输入一张票
if (GConfig.IsTest) { //if (GConfig.IsTest) {
if (!isTestFlag) { // if (!isTestFlag) {
isTestFlag = true; // isTestFlag = true;
testString = File.ReadAllText("d:\\1.txt"); // testString = File.ReadAllText("d:\\1.txt");
HD.Test_LogPrint(testString); // HD.Test_LogPrint(testString);
bytesTest = HexString.StringToByte(testString); // bytesTest = HexString.StringToByte(testString);
bytesToRead = bytesTest.Length; // bytesToRead = bytesTest.Length;
} // }
} //}
if (bytesToRead > 0) if (bytesToRead > 0)
...@@ -870,12 +874,15 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1 ...@@ -870,12 +874,15 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
int retry = 0; int retry = 0;
int retCode = 0; int retCode = 0;
string msg = "";
while (retry < 3) while (retry < 3)
{ {
A10002NotifyTicketRet packRet = PackManager.Instance.Send(pack) as A10002NotifyTicketRet; A10002NotifyTicketRet packRet = PackManager.Instance.Send(pack) as A10002NotifyTicketRet;
if (packRet.Code > 0) if (packRet.Code > 0)
{ {
retCode = packRet.Code; retCode = packRet.Code;
msg = packRet.Message;
break; break;
} }
...@@ -896,9 +903,12 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1 ...@@ -896,9 +903,12 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
LotMachine.Log.Info(string.Concat("票号通知成功:", ticketEntity.L_TicketSn, " 彩种:", ticketEntity.L_LotName, ticketEntity.LotId, "玩法:", ticketEntity.L_PlayName, ticketEntity.L_PlayId, "倍数:", ticketEntity.L_Mutiple, "金额:", ticketEntity.L_Money)); LotMachine.Log.Info(string.Concat("票号通知成功:", ticketEntity.L_TicketSn, " 彩种:", ticketEntity.L_LotName, ticketEntity.LotId, "玩法:", ticketEntity.L_PlayName, ticketEntity.L_PlayId, "倍数:", ticketEntity.L_Mutiple, "金额:", ticketEntity.L_Money));
} }
else if (retCode == 304) //else if (retCode == 304)
{ //{
LotMachine.Log.Info("回写了一张错票!"); // LotMachine.Log.Info("回写了一张错票!" + msg);
//}
else {
LotMachine.Log.Info("服务端返回CODE="+ retCode +"MSG="+ msg);
} }
} }
catch (Exception exception) catch (Exception exception)
......
...@@ -11,7 +11,7 @@ namespace ChuPiao.Common.HD ...@@ -11,7 +11,7 @@ namespace ChuPiao.Common.HD
{ {
#if !DEUBG #if !DEUBG
public const string VersionName = "230410.0"; public const string VersionName = "230715.0";
public const string VersionText = "Half Auto正式版"; public const string VersionText = "Half Auto正式版";
...@@ -19,6 +19,10 @@ namespace ChuPiao.Common.HD ...@@ -19,6 +19,10 @@ namespace ChuPiao.Common.HD
public const bool IsTest = false; public const bool IsTest = false;
#else #else
public const string VersionName = "1.0.1"; public const string VersionName = "1.0.1";
...@@ -28,11 +32,18 @@ namespace ChuPiao.Common.HD ...@@ -28,11 +32,18 @@ namespace ChuPiao.Common.HD
public const bool IsTest = true; public const bool IsTest = true;
#endif #endif
public static string MainTitle public static string MainTitle
{ {
get get
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment