|
|
@ -27,8 +27,8 @@ namespace WY.NewJit.MsgCheck |
|
|
|
|
|
|
|
public async Task<BillNumberRecord> GetBillNumber(int number, string productLine) |
|
|
|
{ |
|
|
|
Dictionary<string, BillNumberTypeEnum> ls = new Dictionary<string, BillNumberTypeEnum>();//待打印数据
|
|
|
|
BillNumberRecord record = new BillNumberRecord(); |
|
|
|
List<PrintData> datas = new List<PrintData>(); |
|
|
|
var bill = await _billNumberRepository.GetAsync(r => r.ProductLine == productLine); |
|
|
|
int recordNumber = bill.RecordNumber;//记录号
|
|
|
|
int roundNumber = bill.RoundNumber; |
|
|
@ -39,26 +39,41 @@ namespace WY.NewJit.MsgCheck |
|
|
|
record.InsertedRows = (1999 - recordNumber) + (number - 1) + 1; |
|
|
|
for (int i = 1; i <= record.InsertedRows; i++) |
|
|
|
{ |
|
|
|
BillNumberTypeEnum type = BillNumberTypeEnum.顺序; |
|
|
|
PrintData data = new PrintData(); |
|
|
|
BillNumberTypeEnum type = BillNumberTypeEnum.正常; |
|
|
|
if (i + recordNumber > 1999) |
|
|
|
{ |
|
|
|
if ((i + recordNumber - 1999) != number) type = BillNumberTypeEnum.断号; |
|
|
|
ls.Add((roundNumber.ToString()+(i + recordNumber - 1999).ToString()), type); |
|
|
|
data.HostSN = i + recordNumber - 1999; |
|
|
|
data.Round = roundNumber * 100000; |
|
|
|
data.HostSN2 = roundNumber * 100000 + i + recordNumber - 1999; |
|
|
|
// ls.Add((roundNumber.ToString()+(i + recordNumber - 1999).ToString()), type);
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if ((i + recordNumber) != number) type = BillNumberTypeEnum.断号; |
|
|
|
ls.Add((roundNumber.ToString()+(i + recordNumber).ToString()), type); |
|
|
|
data.HostSN = i + recordNumber; |
|
|
|
data.Round = roundNumber * 100000; |
|
|
|
data.HostSN2 = roundNumber * 100000 + i + recordNumber; |
|
|
|
// ls.Add((roundNumber.ToString()+(i + recordNumber).ToString()), type);
|
|
|
|
} |
|
|
|
data.BillNumberType = type; |
|
|
|
|
|
|
|
} |
|
|
|
recordNumber = number; |
|
|
|
record.RoundNumber= roundNumber+1; |
|
|
|
} |
|
|
|
else if (-1000 < x && x < 0) |
|
|
|
{ |
|
|
|
PrintData data = new PrintData(); |
|
|
|
record.RoundNumber = roundNumber; |
|
|
|
record.InsertedRows = 0; |
|
|
|
ls.Add((roundNumber.ToString() + (recordNumber).ToString()), BillNumberTypeEnum.补打); |
|
|
|
data.BillNumberType = BillNumberTypeEnum.迟到; |
|
|
|
data.HostSN = recordNumber; |
|
|
|
data.Round = roundNumber * 100000; |
|
|
|
data.HostSN2 = roundNumber * 100000 + recordNumber; |
|
|
|
datas.Add(data); |
|
|
|
// ls.Add((roundNumber.ToString() + (recordNumber).ToString()), BillNumberTypeEnum.迟到);
|
|
|
|
} |
|
|
|
else if (0 < x && x < 1000) |
|
|
|
{ |
|
|
@ -67,20 +82,34 @@ namespace WY.NewJit.MsgCheck |
|
|
|
|
|
|
|
for (int i = 1; i <= record.RoundNumber; i++) |
|
|
|
{ |
|
|
|
BillNumberTypeEnum type = BillNumberTypeEnum.顺序; |
|
|
|
PrintData data = new PrintData(); |
|
|
|
BillNumberTypeEnum type = BillNumberTypeEnum.正常; |
|
|
|
if ((i + recordNumber) != number) type = BillNumberTypeEnum.断号; |
|
|
|
ls.Add((roundNumber.ToString() + (i + recordNumber).ToString()), type); |
|
|
|
|
|
|
|
data.BillNumberType = type; |
|
|
|
data.HostSN = i + recordNumber; |
|
|
|
data.Round = roundNumber * 100000; |
|
|
|
data.HostSN2 = roundNumber * 100000 + i + recordNumber; |
|
|
|
datas.Add(data); |
|
|
|
|
|
|
|
// ls.Add((roundNumber.ToString() + (i + recordNumber).ToString()), type);
|
|
|
|
} |
|
|
|
recordNumber = number; |
|
|
|
|
|
|
|
} |
|
|
|
else if (x >= 1000) |
|
|
|
{ |
|
|
|
PrintData data = new PrintData(); |
|
|
|
record.RoundNumber = roundNumber - 1; |
|
|
|
record.RoundNumber = 0; |
|
|
|
ls.Add((roundNumber.ToString() + (recordNumber).ToString()), BillNumberTypeEnum.补打); |
|
|
|
data.BillNumberType = BillNumberTypeEnum.迟到; |
|
|
|
data.HostSN = recordNumber; |
|
|
|
data.Round = roundNumber * 100000; |
|
|
|
data.HostSN2 = roundNumber * 100000 + recordNumber; |
|
|
|
datas.Add(data); |
|
|
|
// ls.Add((roundNumber.ToString() + (recordNumber).ToString()), BillNumberTypeEnum.迟到);
|
|
|
|
} |
|
|
|
record.dic = ls; |
|
|
|
record.Datas = datas; |
|
|
|
return record; |
|
|
|
} |
|
|
|
|
|
|
|