This commit is contained in:
gazebo
2019-10-15 15:17:43 +08:00
parent e8fe41398f
commit 5a7ac24c3c

View File

@@ -172,18 +172,20 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
StationNo: store.VendorStoreID, StationNo: store.VendorStoreID,
UserPin: userName, UserPin: userName,
OpenDistanceFreight: true, OpenDistanceFreight: true,
IsFullFree: len(storeDetail.FreightDeductionPackObj.FreightDeductionList) > 0,
StartCharge: int64(storeDetail.FreightDeductionPackObj.StartPrice), StartCharge: int64(storeDetail.FreightDeductionPackObj.StartPrice),
} }
if freightParams.IsFullFree { if len(storeDetail.FreightDeductionPackObj.FreightDeductionList) > 0 {
for _, v := range storeDetail.FreightDeductionPackObj.FreightDeductionList { for _, v := range storeDetail.FreightDeductionPackObj.FreightDeductionList {
freightParams.FreeFreightInfoList = append(freightParams.FreeFreightInfoList, &jdapi.FreeFreightInfo{ if v.DeductFreight > 0 {
FullFreeMoney: int64(v.BeginPrice), freightParams.FreeFreightInfoList = append(freightParams.FreeFreightInfoList, &jdapi.FreeFreightInfo{
FreeType: jdapi.FreightFreeTypePartBase, FullFreeMoney: int64(v.BeginPrice),
FreeMoney: int64(v.DeductFreight), FreeType: jdapi.FreightFreeTypePartBase,
}) FreeMoney: int64(v.DeductFreight),
})
}
} }
} }
freightParams.IsFullFree = len(freightParams.FreeFreightInfoList) > 0
globals.SugarLogger.Debug(utils.Format4Output(freightParams, false)) globals.SugarLogger.Debug(utils.Format4Output(freightParams, false))
if globals.EnableJdStoreWrite { if globals.EnableJdStoreWrite {
err = getAPI("").UpdateStoreFreightConfigNew(freightParams) err = getAPI("").UpdateStoreFreightConfigNew(freightParams)