acceptjob
This commit is contained in:
@@ -186,6 +186,21 @@ func GenOrderNo() (orderNo int64) {
|
||||
return orderNo
|
||||
}
|
||||
|
||||
func GenJobOrderNo() (orderNo int64) {
|
||||
const prefix = 88
|
||||
const randPartNum = 1000
|
||||
orderNo = time.Now().Unix() - orderNoBeginTimestamp
|
||||
orderNo = orderNo * randPartNum
|
||||
md5Bytes := md5.Sum([]byte(utils.GetUUID()))
|
||||
randPart := 0
|
||||
for k, v := range md5Bytes {
|
||||
randPart += int(v) << ((k % 3) * 8)
|
||||
}
|
||||
orderNo += int64(randPart % randPartNum)
|
||||
orderNo += int64(math.Pow10(int(math.Log10(float64(orderNo)))+1)) * prefix
|
||||
return orderNo
|
||||
}
|
||||
|
||||
func GenBillID() (billID int64) {
|
||||
const prefix = 66
|
||||
const randPartNum = 100
|
||||
|
||||
Reference in New Issue
Block a user