订单GoodsOrder添加字段InvoiceTitle,InvoiceTaxerID和InvoiceEmail表示开发票信息
GetOrders添加可选参数mustInvoice表示只查询要求开发票的订单
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
var (
|
||||
routinePool *routinepool.Pool
|
||||
skuNamePat *regexp.Regexp
|
||||
emailPat *regexp.Regexp
|
||||
|
||||
resourceTypeMap = map[int][]string{
|
||||
model.VendorIDQiNiuCloud: []string{
|
||||
@@ -67,6 +68,7 @@ func init() {
|
||||
// Go regex does not support lookarounds.
|
||||
// https://stackoverflow.com/questions/38933898/error-parsing-regexp-invalid-or-unsupported-perl-syntax
|
||||
skuNamePat = regexp.MustCompile(`([\((\[【][^\((\[【\))\]】]*[\))\]】])?(.*?)([((].*[))])?\s*约?([1-9][\d\.]*)(g|G|kg|kG|Kg|KG|l|L|ml|mL|Ml|ML|克)\s*([((].*[))])?\s*(?:\/|/|)\s*([^\s()()]{0,2})\s*([((].*[))])?$`)
|
||||
emailPat = regexp.MustCompile(`[A-Za-z0-9_\-\.]+@(?:[A-Za-z0-9_\-]+\.)+[A-Za-z]+`)
|
||||
}
|
||||
|
||||
func getJxStoreIDFromOrder(order *model.GoodsOrder) (retVal int) {
|
||||
@@ -771,3 +773,13 @@ func CalcStageValue(stageList [][]float64, totalVolume float64) (value float64)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func GetOneEmailFromStr(str string) (email string) {
|
||||
if str != "" {
|
||||
searchResult := emailPat.FindStringSubmatch(str)
|
||||
if searchResult != nil && len(searchResult) > 0 {
|
||||
email = searchResult[0]
|
||||
}
|
||||
}
|
||||
return email
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user