占位符0001
// 生成批次号 nowTime := time.Now().Format("20060102")
func generateBatchNumber(num *int) string {
if *num == 10000 {
*num = 1
}
timeNum := time.Now().Format("20060102")
snum := fmt.Sprintf("%04d", *num)
if len(snum) > 4 {
snum = snum[1:len(snum)]
}
*num++
return timeNum + snum
}