|
|
@ -336,20 +336,10 @@ namespace WY.NewJit.PrintTable |
|
|
|
{ |
|
|
|
List<WaitPrint> billLst = new List<WaitPrint>(); |
|
|
|
ListResultDto<WaitPrint> ret = new ListResultDto<WaitPrint>(billLst); |
|
|
|
|
|
|
|
int printBillCnt = 0; |
|
|
|
if (input.PrintCount == 0) input.PrintCount = 10;//调试用的
|
|
|
|
if (input.PrintType == WY.NewJit.Extends.PaiGe.PrintTypeEnum.正常打印) |
|
|
|
{ |
|
|
|
if ((input.BeginHostSN % 10000) > 1999) |
|
|
|
{ |
|
|
|
throw new Exception("起始大众顺序号不能大于1999!"); |
|
|
|
} |
|
|
|
if (input.BeginHostSN > input.EndHostSN) |
|
|
|
{ |
|
|
|
throw new Exception("起始大众顺序号不能大于止大众顺序号!"); |
|
|
|
} |
|
|
|
|
|
|
|
printBillCnt = input.EndHostSN - input.BeginHostSN + 1; |
|
|
|
|
|
|
|
int minHostSN2 = await _waitPrintRepository.Where(itm => |
|
|
|
itm.BusinessType == BusinessTypeEnum.MenBan |
|
|
@ -370,8 +360,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
&& itm.PrintType == PrintTypeEnum.OrderPrint //顺序打印
|
|
|
|
&& itm.HostSN2 >= minHostSN2) |
|
|
|
.OrderBy(itm => itm.HostSN2) |
|
|
|
.Take(printBillCnt).ToListAsync(); |
|
|
|
|
|
|
|
.Take(input.PrintCount).ToListAsync(); |
|
|
|
bool hasData = billLst.Any(); |
|
|
|
if (hasData == false) |
|
|
|
{ |
|
|
@ -401,7 +390,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
/// <returns></returns>
|
|
|
|
private List<MenBanPackingList> DoMBPrint(MenBanPrintInputDto input, int pageIdx, ref double maxBillNum, double maxSN, DateTime printTime, List<WaitPrint> billLst, string rightOrLeft) |
|
|
|
{ |
|
|
|
const int _colNumberPerPage = 12; |
|
|
|
const int _colNumberPerPage = 10; |
|
|
|
List<MenBanPackingList> retLst = new List<MenBanPackingList>(); |
|
|
|
|
|
|
|
//取当前页内容
|
|
|
@ -566,7 +555,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
//装箱单号规则 1开头,11位,自增顺序号
|
|
|
|
if (newSNStr.Length < 11) |
|
|
|
{ |
|
|
|
return "F" + newSNStr.PadLeft(10, '0'); |
|
|
|
return "W" + newSNStr.PadLeft(10, '0'); |
|
|
|
} |
|
|
|
return newSNStr; |
|
|
|
} |
|
|
@ -610,7 +599,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
targetMain.BillNum = sourceObj.BillNum; //单据编号
|
|
|
|
targetMain.State = 0; |
|
|
|
targetMain.BillType = 206; //单据类型
|
|
|
|
targetMain.SubBillType = 21004; //单据子类型
|
|
|
|
targetMain.SubBillType = 21033; //红旗单据子类型
|
|
|
|
targetMain.BillTime = sourceObj.PrintDate; //单据时间
|
|
|
|
targetMain.OperName = sourceObj.CreatorId.ToString(); //操作员
|
|
|
|
targetMain.DetailQty = 0; //明细数量
|
|
|
@ -663,8 +652,8 @@ namespace WY.NewJit.PrintTable |
|
|
|
targetDetail.BillNum = sourceObj.BillNum; //单据编号 通过该字段和主表弱连接
|
|
|
|
targetDetail.VinCode = sourceRec.VIN; //VIN码
|
|
|
|
targetDetail.PartCode = sourceRec.BelowSAPMaterialNum; //物料号
|
|
|
|
targetDetail.LineNum = (idx2 + 12); //行号
|
|
|
|
targetDetail.SeqNum = (idx2 + 12).ToString(); //顺序号sourceRec.HostSN.ToString()
|
|
|
|
targetDetail.LineNum = (idx2 + 10); //行号
|
|
|
|
targetDetail.SeqNum = (idx2 + 10).ToString(); //顺序号sourceRec.HostSN.ToString()
|
|
|
|
//targetDetail.BarCode = sourceRec.TopBoxPositionNum; //箱码
|
|
|
|
targetDetail.ProjectId = ""; //车型
|
|
|
|
targetDetail.State = "0"; //状态
|
|
|
@ -915,7 +904,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
sw.Stop(); |
|
|
|
_logger.LogWarning($"SaveMenBanReport读取数据 - {sw.ElapsedMilliseconds}毫秒"); |
|
|
|
sw.Start(); |
|
|
|
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数
|
|
|
|
int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
|
|
|
|
|
|
|
|
double maxBillNum = 0; |
|
|
|
|
|
|
@ -982,7 +971,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|
int pageCnt = (int)Math.Ceiling(billLst.Count / 12.0); //每页打印12列,取打印页数
|
|
|
|
int pageCnt = (int)Math.Ceiling(billLst.Count / 10.0); //每页打印10列,取打印页数
|
|
|
|
|
|
|
|
double maxBillNum = 0; |
|
|
|
|
|
|
@ -1067,7 +1056,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
foreach (var masterObj in targetLst) |
|
|
|
{ |
|
|
|
int trueCnt = masterObj.Details.Count; |
|
|
|
int planCnt = 12; |
|
|
|
int planCnt = 10; |
|
|
|
if (trueCnt > planCnt) |
|
|
|
{ |
|
|
|
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}"); |
|
|
@ -1182,7 +1171,7 @@ namespace WY.NewJit.PrintTable |
|
|
|
foreach (var masterObj in targetLst) |
|
|
|
{ |
|
|
|
int trueCnt = masterObj.Details.Count; |
|
|
|
int planCnt = 12; |
|
|
|
int planCnt = 10; |
|
|
|
if (trueCnt > planCnt) |
|
|
|
{ |
|
|
|
throw new Exception($"实际打印行数{trueCnt}超过每页总行数{planCnt}, 底盘起{masterObj.BeginVin}底盘止{masterObj.EndVin}"); |
|
|
|