diff --git a/111.xlsx b/111.xlsx deleted file mode 100644 index f5d88d461..000000000 Binary files a/111.xlsx and /dev/null differ diff --git a/LinuxFoundationXLFS141x-V000100_DTH.mp4 b/LinuxFoundationXLFS141x-V000100_DTH.mp4 deleted file mode 100644 index 364c064e4..000000000 Binary files a/LinuxFoundationXLFS141x-V000100_DTH.mp4 and /dev/null differ diff --git a/business/model/dao/dao_order_test.go b/business/model/dao/dao_order_test.go index a30eed64a..539001f27 100644 --- a/business/model/dao/dao_order_test.go +++ b/business/model/dao/dao_order_test.go @@ -26,13 +26,13 @@ func TestGetAfsOrderSkuInfo(t *testing.T) { } func TestGetStoreOrderSkuList(t *testing.T) { - skuList, err := GetStoreOrderSkuList(GetDB(), []int{100118}, time.Now().Add(-30*time.Hour), time.Now(), nil) + skuList, err := GetStoreOrderSkuList(GetDB(), []int{100118}, time.Now().Add(-30*time.Hour), time.Now(), nil, false) if err != nil { t.Fatal(err) } t.Log(utils.Format4Output(skuList, false)) - afsSkuList, err := GetStoreOrderSkuList(GetDB(), []int{100118}, time.Now().Add(-30*time.Hour), time.Now(), nil) + afsSkuList, err := GetStoreOrderSkuList(GetDB(), []int{100118}, time.Now().Add(-30*time.Hour), time.Now(), nil, false) if err != nil { t.Fatal(err) } diff --git a/business/model/dao/store.go b/business/model/dao/store.go index b9db74271..6135869c3 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -16,11 +16,12 @@ type StoreDetail struct { VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空 - VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` - VendorStoreName string `json:"vendorStoreName"` - VendorStatus int `json:"vendor_status"` // 取值同Store.Status - DeliveryFee int `json:"deliveryFee"` - SyncStatus int8 `orm:"default(2)" json:"syncStatus"` + VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` + VendorStoreName string `json:"vendorStoreName"` + VendorStatus int `json:"vendor_status"` // 取值同Store.Status + DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` + DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` + SyncStatus int8 `orm:"default(2)" json:"syncStatus"` PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格 PricePercentagePackStr string `orm:"size(4096)" json:"-"` // @@ -86,7 +87,7 @@ func (s *StoreDetail) GetPricePerentage(price int) (pricePercentage int) { func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (storeDetail *StoreDetail, err error) { sql := ` SELECT t1.*, - t2.vendor_store_id, t2.status vendor_status, t2.delivery_fee, t2.sync_status, t2.vendor_org_code, + t2.vendor_store_id, t2.status vendor_status, t2.delivery_fee_deduction_sill, t2.delivery_fee_deduction_fee, t2.sync_status, t2.vendor_org_code, t2.price_percentage, t2.auto_pickup, t2.delivery_type, t2.delivery_competition, t2.is_sync, t2.vendor_store_name, t3.value price_percentage_pack_str, t4.value freight_deduction_pack_str, diff --git a/business/model/store.go b/business/model/store.go index b0c82a868..799714676 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -407,10 +407,11 @@ type StoreMap struct { FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` // - AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货 - DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型 - DeliveryFee int `json:"deliveryFee"` - DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争 + AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货 + DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型 + DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` + DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` + DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争 SyncStatus int8 `orm:"default(2)" json:"syncStatus"` IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步 diff --git a/business/partner/purchase/jx/localjx/order.go b/business/partner/purchase/jx/localjx/order.go index 37bd1867e..f35c8d385 100644 --- a/business/partner/purchase/jx/localjx/order.go +++ b/business/partner/purchase/jx/localjx/order.go @@ -466,6 +466,12 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64 } else { outJxOrder.FreightPrice = 0 } + if outJxOrder.OrderPrice >= int64(storeDetail.DeliveryFeeDeductionSill) { + outJxOrder.FreightPrice -= int64(storeDetail.DeliveryFeeDeductionFee) + if outJxOrder.FreightPrice < 0 { + outJxOrder.FreightPrice = 0 + } + } if err == nil { outJxOrder.TotalPrice = outJxOrder.OrderPrice + outJxOrder.FreightPrice outJxOrder.ActualPayPrice = outJxOrder.TotalPrice diff --git a/conf/app.conf b/conf/app.conf index 25696cfc0..c99207850 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -9,8 +9,8 @@ filelinenum = true routinePoolSize = 1000 -dadaAppKey = "dada147f7a190ce7b3c" -dadaAppSecret = "2c717ad914767d6e2beb3f743db9e477" +dadaAppKey = "dada154e2a41fd6cef3" +dadaAppSecret = "7f97d8f258b70b450f04e7ab274ed8f8" mtwmAppID = "589" mtwmSecret = "a81eb3df418d83d6a1a4b7c572156d2f" diff --git a/controllers/cms_store.go b/controllers/cms_store.go index e30712941..2dfab7cc0 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -16,7 +16,7 @@ type StoreController struct { // @Title 得到京西门店信息 // @Description 得到京西门店信息,如下条件之间是与的关系 -// @Param token header string true "认证token" +// @Param token header string false "认证token" // @Param keyword query string false "查询关键字(可以为空,为空表示不限制)" // @Param storeID query int false "门店ID" // @Param startStoreID query int false "起始门店ID" @@ -137,7 +137,7 @@ func (c *StoreController) CreateStore() { // @Title 得到门店映射信息 // @Description 得到门店映射信息 -// @Param token header string true "认证token" +// @Param token header string false "认证token" // @Param storeID query int true "门店ID" // @Param vendorID query int false "厂商ID(缺省为全部)" // @Success 200 {object} controllers.CallResult diff --git a/controllers/dada_order.go b/controllers/dada_order.go index 290e91d62..8635d3fac 100644 --- a/controllers/dada_order.go +++ b/controllers/dada_order.go @@ -36,16 +36,18 @@ func (c *DadaDeliveryController) Msg() { func (c *DadaDeliveryController) Notify() { if c.Ctx.Input.Method() == http.MethodPost { obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody) - if notifyResponse == nil { + if notifyResponse == nil && obj.MessageObj != nil { err := api.DadaAPI.ConfirmRidderCancel(obj.MessageObj.OrderID, obj.MessageObj.DadaOrderID, true) + if err != nil { + notifyResponse = dadaapi.FailedNotifyResponse + } globals.SugarLogger.Debugf("dada notify, obj:%s, err:%v", utils.Format4Output(obj, false), err) } if notifyResponse == nil { notifyResponse = dadaapi.SuccessNotifyResponse - } else { - c.Data["json"] = notifyResponse - c.ServeJSON() } + c.Data["json"] = notifyResponse + c.ServeJSON() } else { c.Abort("404") } diff --git a/globals/globals.go b/globals/globals.go index 0520eb188..85cc2ea0a 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -71,7 +71,7 @@ func init() { } func Init() { - if false { //IsProductEnv() { + if false { //!IsProductEnv() { OutputDebugMsgLevel = 1 }