Commit 5b76b879 authored by 李佳's avatar 李佳

半自动出票

parent 8618d159
......@@ -250,7 +250,6 @@
this.chkAllowPaperout.TabIndex = 77;
this.chkAllowPaperout.Text = "是否允许出实体票";
this.chkAllowPaperout.UseVisualStyleBackColor = true;
this.chkAllowPaperout.Visible = false;
this.chkAllowPaperout.CheckedChanged += new System.EventHandler(this.chkAllowPaperout_CheckedChanged);
//
// btnCancel
......
......@@ -716,7 +716,7 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacLotPlayMode
}
else
{
regex = new Regex(@"过关方式\s{1,}单场固定\s{1,}");
regex = new Regex(@"单场固定");
match = regex.Match(input);
if (match.Success)
{
......
......@@ -12,6 +12,7 @@ using ChuPiao.Common.Models;
using ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacLotPlayMode;
using ChuPiao.Common.Communication.GtdJson.Packs;
using ChuPiao.Common.Communication.GtdJson;
using ChuPiao.Common.Communication.GtdJson.Items;
namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
{
......@@ -568,9 +569,22 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
SaveLastFile(oneTicketData);
try
{
if (MachineInfo.M_AllowPaperout)
{
this.PrinterClient.AddBytes(oneTicketData);
}
}
catch (Exception exception)
{
Log.Info(string.Concat("打印错误:", exception.ToString()));
}
//解析票
CaptureDataInfo captureDataInfo = new CaptureDataInfo(oneTicketData);
string input = captureDataInfo.CaptureDataString;
int tmpEnd = input.IndexOf("-------------------");
if (tmpEnd < 0)
continue;
......@@ -658,6 +672,107 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
//{
//}
else if (strPlayCodetype.Contains("时段报表二")) //时段报表
{
ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport.MacReportService service = new ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport.MacReportService();
DecodeMachineReport decodeMachineReport = new DecodeMachineReport();
decodeMachineReport.InputData = captureDataInfo;
service.DecodeMachineReportReport(null, decodeMachineReport);
if (decodeMachineReport.DecodeSuccess)
{
A10005UploadMachineSale pack = new A10005UploadMachineSale();
pack.AgentId = MachineInfo.M_Number;
pack.Salt = LotMachine.MachineInfo.M_Salt;
pack.SaleMoney = decodeMachineReport.MachineReportEntity.R_SaleMoney;
pack.EncashMoney = decodeMachineReport.MachineReportEntity.R_EncashMoney;
pack.ReturnMoney = decodeMachineReport.MachineReportEntity.R_ReturnMoney;
pack.QueryTime = decodeMachineReport.MachineReportEntity.R_QueryTime.ToString("yyyyMMddHHmmss");
pack.From = decodeMachineReport.MachineReportEntity.R_StartTime.ToString("yyyyMMdd");
pack.To = decodeMachineReport.MachineReportEntity.R_EndTime.ToString("yyyyMMdd");
if (pack.From != pack.To)
{
continue;
}
pack.Type = 1;
pack.TypeName = pack.From;
pack.Prntext = decodeMachineReport.MachineReportEntity.R_PrnText;
A10005UploadMachineSaleRet packRet = PackManager.Instance.Send(pack) as A10005UploadMachineSaleRet;
if (packRet.Code <= 0)
{
LotMachine.Log.Warn("上传天报表失败," + packRet.Message);
}
else
{
LotMachine.Log.Info("上传天报表成功!" + packRet.AgentId);
}
}
else
{
LotMachine.Log.Warn(string.Concat("解析天报表失败。错误信息:", decodeMachineReport.ErrorMessage));
}
}
else if (strPlayCodetype.Contains("缴款报表")) //缴款报表
{
//缴款
ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport.MacReportService service = new ChuPiao.AutoPrint.Machine.TjJingCaiV1.MacReport.MacReportService();
DecodeMachinePayMoneyReport decodePrintData = new DecodeMachinePayMoneyReport();
decodePrintData.InputData = captureDataInfo;
service.DecodeMachinePayMoneyReport(null, decodePrintData);
if (decodePrintData.DecodeSuccess)
{
A10006UploadMachineBalance pack = new A10006UploadMachineBalance();
pack.AgentId = MachineInfo.M_Number;
pack.Salt = LotMachine.MachineInfo.M_Salt;
pack.Balance = decodePrintData.MachinePayMoneyReportEntity.R_Balance;
pack.QueryTime = decodePrintData.MachinePayMoneyReportEntity.R_QueryTime.ToString("yyyyMMddHHmmss");
pack.From = decodePrintData.MachinePayMoneyReportEntity.R_QueryTime.ToString("yyyyMMdd");
pack.To = decodePrintData.MachinePayMoneyReportEntity.R_QueryTime.ToString("yyyyMMdd");
pack.Type = 1;
pack.TypeName = pack.From; //暂时只打天报表,以后有周月报表再说
pack.Prntext = decodePrintData.MachinePayMoneyReportEntity.R_PrnText;
A10006UploadMachineBalanceRet packRet = PackManager.Instance.Send(pack) as A10006UploadMachineBalanceRet;
if (packRet.Code <= 0)
{
LotMachine.Log.Warn("上传缴款报表中的余额失败," + packRet.Code.ToString() + " " + packRet.Message);
}
else
{
LotMachine.Log.Info("上传缴款报表中的余额成功!" + packRet.AgentId);
}
A10007UploadMachinePay pack1 = new A10007UploadMachinePay();
pack1.AgentId = MachineInfo.M_Number;
pack1.Salt = LotMachine.MachineInfo.M_Salt;
pack1.QueryTime = decodePrintData.MachinePayMoneyReportEntity.R_QueryTime;
foreach (PayMoneyDataItem item in decodePrintData.MachinePayMoneyReportEntity.R_DataList)
{
pack1.PaymentList.Add(new UploadMachinePayItem(item.PayType, item.PayMoney, item.PayTime));
}
A10007UploadMachinePayRet packRet1 = PackManager.Instance.Send(pack1) as A10007UploadMachinePayRet;
if (packRet1.Code <= 0)
{
LotMachine.Log.Warn("上传缴款报表中的缴款记录失败," + packRet1.Code.ToString() + " " + packRet1.Message);
}
else
{
LotMachine.Log.Info("上传缴款报表中的缴款记录成功!" + packRet.AgentId);
}
}
else
{
LotMachine.Log.Warn(string.Concat("解析缴款报表失败。错误信息:", decodePrintData.ErrorMessage));
}
}
//竞彩上传电子票
if (ticketEntity.LotId == (int)Lottype.Jz || ticketEntity.LotId == (int)Lottype.Jl)
......@@ -694,11 +809,13 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
pack.Ticket = ticketEntity;
int retry = 0;
int retCode = 0;
while (retry < 3)
{
A10002NotifyTicketRet packRet = PackManager.Instance.Send(pack) as A10002NotifyTicketRet;
if (packRet.Code > 0)
{
retCode = packRet.Code;
break;
}
......@@ -712,11 +829,17 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
Thread.Sleep(retry * 1000);
}
//删除last目录下最后一个文件
LotMachine.VirtualPrinter.DeleteLastFile();
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));
if (retCode == 300)
{
//删除last目录下最后一个文件
LotMachine.VirtualPrinter.DeleteLastFile();
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)
{
LotMachine.Log.Info("回写了一张错票!");
}
}
catch (Exception exception)
{
......@@ -756,11 +879,13 @@ namespace ChuPiao.AutoPrint.Machine.TjJingCaiV1
}
catch (Exception ex)
{
Log.Warn(string.Concat("彩票机 ", this.MachineInfo.M_Number, " 接收数据异常:", ex.ToString()));
if (ex.Message.Contains("口被关闭"))
{
Log.Warn("操作提示:软件已经抓取不到票数据,将导致错票(彩票机出了但没有票),请停止出票,重启软件!");
}
Log.Warn(string.Concat("彩票机 ", this.MachineInfo.M_Number, " 打印机接收数据异常,请停止出票,重启软件,否则会白出!!!"));
//Log.Warn(string.Concat("彩票机 ", this.MachineInfo.M_Number, " 接收数据异常:", ex.ToString()));
//if (ex.Message.Contains("口被关闭"))
//{
// Log.Warn("操作提示:软件已经抓取不到票数据,将导致错票(彩票机出了但没有票),请停止出票,重启软件!");
//}
}
//finally
//{
......
......@@ -54,8 +54,8 @@ namespace ChuPiao.AutoPrint.Services
_machine.M_InputDeviceType = 100;
_machine.M_KeyboardType = 1002;
_machine.M_Type = 1001;
//_machine.M_AllowPaperout = _entity.M_AllowPaperout;
_machine.M_AllowPaperout = false;
_machine.M_AllowPaperout = _entity.M_AllowPaperout;
// _machine.M_AllowPaperout = false;
_machine.M_HasJc = _entity.M_HasJc;
_machine.M_IsSimulate = _entity.M_IsSimulate;
_machine.M_IsAutoClearTotal = _entity.M_IsAutoClearTotal;
......
No preview for this file type
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