// 存储编号的集合
List purchaseNoList =new ArrayList<>();
// 获取年月日
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) +1;
int date = calendar.get(Calendar.DAY_OF_MONTH);
// 月份格式化(01-12)
String formattedMonth = String.format("%02d", month);
// 日期格式化(01-31)
String formattedDay = String.format("%02d", date);
String time = year +"-" + formattedMonth +"-" + formattedDay +"-";
//获取数据库的最大编号
String maxRefundNo =materialPurchaseMapperEx.selectMaxPurchaseNo(time);
int number =0;
if (StringUtils.isNotBlank(maxRefundNo)) {
number = Integer.parseInt(maxRefundNo);
}
for (Integer i =0; i < noNum; i++) {
number++;
//编号格式(%04d:四位 0001)