Commit 198adaab4e14d6f447cfc1c299c3be5cf4a45e28
Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms2 into develop
Showing
1 changed file
with
2 additions
and
2 deletions
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java
@@ -116,7 +116,6 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei | @@ -116,7 +116,6 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei | ||
116 | int i = 1; | 116 | int i = 1; |
117 | Date now = new Date(); | 117 | Date now = new Date(); |
118 | SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); | 118 | SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); |
119 | - LambdaQueryWrapper<ReceiptHeaderHistory> aa = Wrappers.lambdaQuery(); | ||
120 | LambdaQueryWrapper<ReceiptHeader> lambda = Wrappers.lambdaQuery(); | 119 | LambdaQueryWrapper<ReceiptHeader> lambda = Wrappers.lambdaQuery(); |
121 | lambda.select(ReceiptHeader::getCode).eq(ReceiptHeader::getReceiptType, receiptType) | 120 | lambda.select(ReceiptHeader::getCode).eq(ReceiptHeader::getReceiptType, receiptType) |
122 | .orderByDesc(ReceiptHeader::getId).last("Limit 1"); | 121 | .orderByDesc(ReceiptHeader::getId).last("Limit 1"); |
@@ -130,11 +129,12 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei | @@ -130,11 +129,12 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei | ||
130 | //todo:隐藏了BUG,请修正。 修改好 去掉todo | 129 | //todo:隐藏了BUG,请修正。 修改好 去掉todo |
131 | 130 | ||
132 | while (i != 0) { | 131 | while (i != 0) { |
132 | + LambdaQueryWrapper<ReceiptHeaderHistory> aa = Wrappers.lambdaQuery(); | ||
133 | if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) { | 133 | if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) { |
134 | Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); | 134 | Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); |
135 | code = receiptType + df.format(now) + String.format("%05d", Count + i++); | 135 | code = receiptType + df.format(now) + String.format("%05d", Count + i++); |
136 | } else { | 136 | } else { |
137 | - code = receiptType + df.format(now) + "0000"+i++; | 137 | + code = receiptType + df.format(now) + String.format("%05d", 0000+i++); |
138 | } | 138 | } |
139 | aa.select(ReceiptHeaderHistory::getCode).eq(ReceiptHeaderHistory::getCode, code); | 139 | aa.select(ReceiptHeaderHistory::getCode).eq(ReceiptHeaderHistory::getCode, code); |
140 | List<ReceiptHeaderHistory> list = receiptheaderhistoryMapper.selectList(aa); | 140 | List<ReceiptHeaderHistory> list = receiptheaderhistoryMapper.selectList(aa); |