Merge remote-tracking branch 'origin/mark' into su
This commit is contained in:
Binary file not shown.
@@ -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)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ type StoreDetail struct {
|
||||
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"`
|
||||
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"`
|
||||
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"`
|
||||
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
||||
|
||||
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
|
||||
@@ -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,
|
||||
|
||||
@@ -409,7 +409,8 @@ type StoreMap struct {
|
||||
|
||||
AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货
|
||||
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
|
||||
DeliveryFee int `json:"deliveryFee"`
|
||||
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"`
|
||||
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"`
|
||||
DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争
|
||||
|
||||
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,8 +9,8 @@ filelinenum = true
|
||||
|
||||
routinePoolSize = 1000
|
||||
|
||||
dadaAppKey = "dada147f7a190ce7b3c"
|
||||
dadaAppSecret = "2c717ad914767d6e2beb3f743db9e477"
|
||||
dadaAppKey = "dada154e2a41fd6cef3"
|
||||
dadaAppSecret = "7f97d8f258b70b450f04e7ab274ed8f8"
|
||||
|
||||
mtwmAppID = "589"
|
||||
mtwmSecret = "a81eb3df418d83d6a1a4b7c572156d2f"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
} else {
|
||||
c.Abort("404")
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func init() {
|
||||
}
|
||||
|
||||
func Init() {
|
||||
if false { //IsProductEnv() {
|
||||
if false { //!IsProductEnv() {
|
||||
OutputDebugMsgLevel = 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user