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) {
|
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 {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
t.Log(utils.Format4Output(skuList, false))
|
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 {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ type StoreDetail struct {
|
|||||||
|
|
||||||
VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||||
|
|
||||||
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
|
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
|
||||||
VendorStoreName string `json:"vendorStoreName"`
|
VendorStoreName string `json:"vendorStoreName"`
|
||||||
VendorStatus int `json:"vendor_status"` // 取值同Store.Status
|
VendorStatus int `json:"vendor_status"` // 取值同Store.Status
|
||||||
DeliveryFee int `json:"deliveryFee"`
|
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"`
|
||||||
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"`
|
||||||
|
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
||||||
|
|
||||||
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
|
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
|
||||||
PricePercentagePackStr string `orm:"size(4096)" json:"-"` //
|
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) {
|
func getStoreDetail(db *DaoDB, storeID, vendorID int, vendorStoreID string) (storeDetail *StoreDetail, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT t1.*,
|
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,
|
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,
|
t3.value price_percentage_pack_str,
|
||||||
t4.value freight_deduction_pack_str,
|
t4.value freight_deduction_pack_str,
|
||||||
|
|||||||
@@ -407,10 +407,11 @@ type StoreMap struct {
|
|||||||
|
|
||||||
FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` //
|
FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` //
|
||||||
|
|
||||||
AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货
|
AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货
|
||||||
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
|
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
|
||||||
DeliveryFee int `json:"deliveryFee"`
|
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"`
|
||||||
DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争
|
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"`
|
||||||
|
DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争
|
||||||
|
|
||||||
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
SyncStatus int8 `orm:"default(2)" json:"syncStatus"`
|
||||||
IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步
|
IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步
|
||||||
|
|||||||
@@ -466,6 +466,12 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
|||||||
} else {
|
} else {
|
||||||
outJxOrder.FreightPrice = 0
|
outJxOrder.FreightPrice = 0
|
||||||
}
|
}
|
||||||
|
if outJxOrder.OrderPrice >= int64(storeDetail.DeliveryFeeDeductionSill) {
|
||||||
|
outJxOrder.FreightPrice -= int64(storeDetail.DeliveryFeeDeductionFee)
|
||||||
|
if outJxOrder.FreightPrice < 0 {
|
||||||
|
outJxOrder.FreightPrice = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
outJxOrder.TotalPrice = outJxOrder.OrderPrice + outJxOrder.FreightPrice
|
outJxOrder.TotalPrice = outJxOrder.OrderPrice + outJxOrder.FreightPrice
|
||||||
outJxOrder.ActualPayPrice = outJxOrder.TotalPrice
|
outJxOrder.ActualPayPrice = outJxOrder.TotalPrice
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ filelinenum = true
|
|||||||
|
|
||||||
routinePoolSize = 1000
|
routinePoolSize = 1000
|
||||||
|
|
||||||
dadaAppKey = "dada147f7a190ce7b3c"
|
dadaAppKey = "dada154e2a41fd6cef3"
|
||||||
dadaAppSecret = "2c717ad914767d6e2beb3f743db9e477"
|
dadaAppSecret = "7f97d8f258b70b450f04e7ab274ed8f8"
|
||||||
|
|
||||||
mtwmAppID = "589"
|
mtwmAppID = "589"
|
||||||
mtwmSecret = "a81eb3df418d83d6a1a4b7c572156d2f"
|
mtwmSecret = "a81eb3df418d83d6a1a4b7c572156d2f"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ type StoreController struct {
|
|||||||
|
|
||||||
// @Title 得到京西门店信息
|
// @Title 得到京西门店信息
|
||||||
// @Description 得到京西门店信息,如下条件之间是与的关系
|
// @Description 得到京西门店信息,如下条件之间是与的关系
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string false "认证token"
|
||||||
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
|
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
|
||||||
// @Param storeID query int false "门店ID"
|
// @Param storeID query int false "门店ID"
|
||||||
// @Param startStoreID query int false "起始门店ID"
|
// @Param startStoreID query int false "起始门店ID"
|
||||||
@@ -137,7 +137,7 @@ func (c *StoreController) CreateStore() {
|
|||||||
|
|
||||||
// @Title 得到门店映射信息
|
// @Title 得到门店映射信息
|
||||||
// @Description 得到门店映射信息
|
// @Description 得到门店映射信息
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string false "认证token"
|
||||||
// @Param storeID query int true "门店ID"
|
// @Param storeID query int true "门店ID"
|
||||||
// @Param vendorID query int false "厂商ID(缺省为全部)"
|
// @Param vendorID query int false "厂商ID(缺省为全部)"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
|||||||
@@ -36,16 +36,18 @@ func (c *DadaDeliveryController) Msg() {
|
|||||||
func (c *DadaDeliveryController) Notify() {
|
func (c *DadaDeliveryController) Notify() {
|
||||||
if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
obj, notifyResponse := api.DadaAPI.GetNotifyMsg(c.Ctx.Input.RequestBody)
|
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)
|
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)
|
globals.SugarLogger.Debugf("dada notify, obj:%s, err:%v", utils.Format4Output(obj, false), err)
|
||||||
}
|
}
|
||||||
if notifyResponse == nil {
|
if notifyResponse == nil {
|
||||||
notifyResponse = dadaapi.SuccessNotifyResponse
|
notifyResponse = dadaapi.SuccessNotifyResponse
|
||||||
} else {
|
|
||||||
c.Data["json"] = notifyResponse
|
|
||||||
c.ServeJSON()
|
|
||||||
}
|
}
|
||||||
|
c.Data["json"] = notifyResponse
|
||||||
|
c.ServeJSON()
|
||||||
} else {
|
} else {
|
||||||
c.Abort("404")
|
c.Abort("404")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
if false { //IsProductEnv() {
|
if false { //!IsProductEnv() {
|
||||||
OutputDebugMsgLevel = 1
|
OutputDebugMsgLevel = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user