acceptjob

This commit is contained in:
苏尹岚
2020-10-16 10:38:01 +08:00
parent 25461b7f8f
commit 47c2cd12fe
5 changed files with 63 additions and 9 deletions

View File

@@ -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