删除一些model和dao文件
This commit is contained in:
@@ -49,20 +49,6 @@ func init() {
|
||||
orderNoBeginTimestamp = utils.Str2Time("2010-01-01 00:00:00").Unix()
|
||||
}
|
||||
|
||||
func GetSaleStoreIDFromAfsOrder(order *model.AfsOrder) (retVal int) {
|
||||
if order.JxStoreID > 0 {
|
||||
return order.JxStoreID
|
||||
}
|
||||
return order.StoreID
|
||||
}
|
||||
|
||||
func GetSkuIDFromOrderSkuFinancial(sku *model.OrderSkuFinancial) (skuID int) {
|
||||
if sku.JxSkuID > 0 {
|
||||
return sku.JxSkuID
|
||||
}
|
||||
return sku.SkuID
|
||||
}
|
||||
|
||||
func SplitUniversalOrderID(universalOrderID string) (orderID string, vendorID int) {
|
||||
index := strings.Index(universalOrderID, "|")
|
||||
if index != -1 {
|
||||
@@ -545,19 +531,6 @@ func Strings2Objs(strAndObjAddPairs ...interface{}) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func RefreshAfsOrderSkuRelated(afsOrder *model.AfsOrder) *model.AfsOrder {
|
||||
afsOrder.SkuUserMoney = 0
|
||||
afsOrder.PmSkuSubsidyMoney = 0
|
||||
for _, orderSku := range afsOrder.Skus {
|
||||
if orderSku.SkuID > math.MaxInt32 {
|
||||
orderSku.SkuID = orderSku.JxSkuID
|
||||
}
|
||||
afsOrder.SkuUserMoney += orderSku.UserMoney
|
||||
afsOrder.PmSkuSubsidyMoney += orderSku.PmSkuSubsidyMoney
|
||||
}
|
||||
return afsOrder
|
||||
}
|
||||
|
||||
func TaskResult2Hint(resultList []interface{}) (hint string) {
|
||||
strList := make([]string, len(resultList))
|
||||
for k, v := range resultList {
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package jxutils
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
|
||||
type ActStoreSkuMap struct {
|
||||
actStoreSkuMap map[int64]map[int]*model.ActStoreSku2
|
||||
}
|
||||
|
||||
// isActPrice为true表示是活动,false表示是结算
|
||||
func NewActStoreSkuMap(actStoreSkuList []*model.ActStoreSku2, isActPrice bool) (actMap *ActStoreSkuMap) {
|
||||
actMap = &ActStoreSkuMap{}
|
||||
actStoreSkuMap := make(map[int64]map[int]*model.ActStoreSku2)
|
||||
for _, v := range actStoreSkuList {
|
||||
index := Combine2Int(v.StoreID, v.SkuID)
|
||||
if actStoreSkuMap[index] == nil {
|
||||
actStoreSkuMap[index] = make(map[int]*model.ActStoreSku2)
|
||||
}
|
||||
if (isActPrice && v.ActualActPrice > 0 && (actStoreSkuMap[index][v.VendorID] == nil || actStoreSkuMap[index][v.VendorID].ActualActPrice > v.ActualActPrice)) ||
|
||||
(!isActPrice && v.EarningPrice > 0 && (actStoreSkuMap[index][v.VendorID] == nil || actStoreSkuMap[index][v.VendorID].EarningPrice > v.EarningPrice)) {
|
||||
actStoreSkuMap[index][v.VendorID] = v
|
||||
}
|
||||
}
|
||||
actMap.actStoreSkuMap = actStoreSkuMap
|
||||
return actMap
|
||||
}
|
||||
|
||||
func (a *ActStoreSkuMap) GetActStoreSku(storeID, skuID, vendorID int) (storeSku *model.ActStoreSku2) {
|
||||
index := Combine2Int(storeID, skuID)
|
||||
if a.actStoreSkuMap[index] != nil {
|
||||
if vendorID < 0 {
|
||||
for k := range a.actStoreSkuMap[index] {
|
||||
vendorID = k
|
||||
break
|
||||
}
|
||||
}
|
||||
storeSku = a.actStoreSkuMap[index][vendorID]
|
||||
}
|
||||
return storeSku
|
||||
}
|
||||
Reference in New Issue
Block a user