Merge remote-tracking branch 'origin/mark' into su

This commit is contained in:
苏尹岚
2019-11-14 11:45:32 +08:00
11 changed files with 322 additions and 49 deletions

View File

@@ -307,6 +307,14 @@ const (
AfsTypeFullRefund = 2 // 全额退款
)
const (
DefaultEarningPricePercentage = 70 // 门店缺省结算百分比
MinVendorPricePercentage = 10
DefVendorPricePercentage = 100 // 平台缺省调价比例
MaxVendorPricePercentage = 400
)
func IsPurchaseVendorExist(vendorID int) bool {
_, ok := VendorNames[vendorID]
return ok && vendorID >= VendorIDPurchaseBegin && vendorID <= VendorIDPurchaseEnd
@@ -358,7 +366,3 @@ func WaybillVendorID2Mask(vendorID int) (mask int8) {
func IsAfsOrderFinalStatus(status int) bool {
return status >= AfsOrderStatusFinished && status <= AfsOrderStatusFailed
}
const (
DefaultEarningPricePercentage = 70 // 门店缺省结算百分比
)

View File

@@ -100,7 +100,7 @@ func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (sto
storeDetail.FreightDeductionPackObj = FreightDeductionPack2Obj(storeDetail.FreightDeductionPackStr)
if storeDetail.VendorStoreID == "" {
storeDetail.VendorStatus = storeDetail.Status
storeDetail.PricePercentage = 100
storeDetail.PricePercentage = model.DefVendorPricePercentage
storeDetail.AutoPickup = 1
storeDetail.DeliveryType = model.StoreDeliveryTypeByStore
storeDetail.DeliveryCompetition = 1
@@ -295,15 +295,31 @@ func GetRebindPrinterStoreList(db *DaoDB) (storeList []*model.Store, err error)
return storeList, err
}
// 容错用
type tPricePercentageItemFloat struct {
BeginPrice float64 `json:"beginPrice"` // 起始价格区间(包括)
PricePercentage float64 `json:"pricePercentage"` // 调价比例
PriceAdd float64 `json:"priceAdd"` // 调价额定值
}
func PricePercentagePack2Obj(packStr string) (obj model.PricePercentagePack) {
if packStr != "" {
if err := utils.UnmarshalUseNumber([]byte(packStr), &obj); err == nil {
for _, v := range obj {
if v.PricePercentage >= 500 || v.PricePercentage <= 80 {
return nil
var floatObj []*tPricePercentageItemFloat
if err := utils.UnmarshalUseNumber([]byte(packStr), &floatObj); err == nil {
if len(floatObj) > 0 {
obj = make(model.PricePercentagePack, len(floatObj))
for k, v := range floatObj {
if v.PricePercentage >= 500 || v.PricePercentage <= 80 {
return nil
}
obj[k] = &model.PricePercentageItem{
BeginPrice: int(v.BeginPrice),
PricePercentage: int(v.PricePercentage),
PriceAdd: int(v.PriceAdd),
}
}
sort.Sort(obj)
}
sort.Sort(obj)
}
}
return obj

View File

@@ -108,7 +108,7 @@ type StoreSkuBind struct {
JdPrice int `json:"jdPrice"`
EbaiPrice int `json:"ebaiPrice"`
MtwmPrice int `json:"mtwmPrice"`
// JxPrice int `json:"jxPrice"`
JxPrice int `json:"jxPrice"`
// WscPrice int `json:"wscPrice"`
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`