合并修改
This commit is contained in:
@@ -106,7 +106,7 @@ var (
|
|||||||
Name: "石峰固定",
|
Name: "石峰固定",
|
||||||
},
|
},
|
||||||
AuthBindInfo: &AuthBindEx{},
|
AuthBindInfo: &AuthBindEx{},
|
||||||
LoginTime: utils.ZeroTimeValue,
|
LoginTime: utils.DefaultTimeValue,
|
||||||
ExpiresAt: 0,
|
ExpiresAt: 0,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ type StoreSkuExt struct {
|
|||||||
BindCreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
BindCreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
||||||
BindUpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
|
BindUpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
|
||||||
BindLastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
BindLastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
||||||
BindDeletedAt time.Time `orm:"type(datetime);default('1970-01-01 00:00:00')" json:"deletedAt"`
|
BindDeletedAt time.Time `orm:"type(datetime)" json:"deletedAt"`
|
||||||
SubStoreID int `orm:"column(sub_store_id)" json:"subStoreID"`
|
SubStoreID int `orm:"column(sub_store_id)" json:"subStoreID"`
|
||||||
BindPrice int `json:"price"` // 单位为分,不用int64的原因是这里不需要累加
|
BindPrice int `json:"price"` // 单位为分,不用int64的原因是这里不需要累加
|
||||||
UnitPrice int `json:"unitPrice"` // 这个是一斤的门店商品价,放在这里的原因是避免额外增加一张store sku_name表,逻辑上要保证同一SKU NAME中的所有SKU这个字段的数据一致
|
UnitPrice int `json:"unitPrice"` // 这个是一斤的门店商品价,放在这里的原因是避免额外增加一张store sku_name表,逻辑上要保证同一SKU NAME中的所有SKU这个字段的数据一致
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
|||||||
FROM store t1
|
FROM store t1
|
||||||
JOIN place t2 ON t2.code = t1.city_code AND t2.name = ?
|
JOIN place t2 ON t2.code = t1.city_code AND t2.name = ?
|
||||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = ? AND t10.status <> ?) > 0
|
||||||
`,
|
`,
|
||||||
`
|
`
|
||||||
SELECT t1.*, t5.vendor_store_id
|
SELECT t1.*, t5.vendor_store_id
|
||||||
@@ -123,13 +123,13 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
|||||||
JOIN place t2 ON t2.code = t1.city_code
|
JOIN place t2 ON t2.code = t1.city_code
|
||||||
JOIN place t3 ON t3.code = t2.parent_code AND t3.name = ?
|
JOIN place t3 ON t3.code = t2.parent_code AND t3.name = ?
|
||||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = ? AND t10.status <> ?) > 0
|
||||||
`,
|
`,
|
||||||
`
|
`
|
||||||
SELECT t1.*, t5.vendor_store_id
|
SELECT t1.*, t5.vendor_store_id
|
||||||
FROM store t1
|
FROM store t1
|
||||||
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
LEFT JOIN store_map t5 ON t1.id = t5.store_id AND t5.vendor_id = ? AND t5.deleted_at = ?
|
||||||
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = '1970-01-01 00:00:00' AND t10.status <> ?) > 0
|
WHERE t1.status = ? AND (SELECT COUNT(*) FROM store_map t10 WHERE t10.store_id = t1.id AND t10.deleted_at = ? AND t10.status <> ?) > 0
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
sqlParamsList := [][]interface{}{
|
sqlParamsList := [][]interface{}{
|
||||||
@@ -138,6 +138,7 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
|||||||
model.VendorIDWSC,
|
model.VendorIDWSC,
|
||||||
utils.DefaultTimeValue,
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusOpened,
|
model.StoreStatusOpened,
|
||||||
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusDisabled,
|
model.StoreStatusDisabled,
|
||||||
},
|
},
|
||||||
[]interface{}{
|
[]interface{}{
|
||||||
@@ -145,12 +146,14 @@ func GetPossibleStoresByPlaceName(db *DaoDB, cityName, provinceName string) (sto
|
|||||||
model.VendorIDWSC,
|
model.VendorIDWSC,
|
||||||
utils.DefaultTimeValue,
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusOpened,
|
model.StoreStatusOpened,
|
||||||
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusDisabled,
|
model.StoreStatusDisabled,
|
||||||
},
|
},
|
||||||
[]interface{}{
|
[]interface{}{
|
||||||
model.VendorIDWSC,
|
model.VendorIDWSC,
|
||||||
utils.DefaultTimeValue,
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusOpened,
|
model.StoreStatusOpened,
|
||||||
|
utils.DefaultTimeValue,
|
||||||
model.StoreStatusDisabled,
|
model.StoreStatusDisabled,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ type StoreSkuSyncInfo struct {
|
|||||||
StoreSkuStatus int
|
StoreSkuStatus int
|
||||||
StoreSkuSyncStatus int8
|
StoreSkuSyncStatus int8
|
||||||
VendorSkuID string `orm:"column(vendor_sku_id)"`
|
VendorSkuID string `orm:"column(vendor_sku_id)"`
|
||||||
BindDeletedAt time.Time `orm:"type(datetime);default('1970-01-01 00:00:00')" json:"bindDeletedAt"`
|
BindDeletedAt time.Time `orm:"type(datetime)" json:"bindDeletedAt"`
|
||||||
|
|
||||||
model.Sku
|
model.Sku
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ type ModelIDCULD struct {
|
|||||||
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
||||||
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
|
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
|
||||||
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
||||||
DeletedAt time.Time `orm:"type(datetime);default('1970-01-01 00:00:00')" json:"deletedAt"`
|
DeletedAt time.Time `orm:"type(datetime);null" json:"deletedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同步标识掩码
|
// 同步标识掩码
|
||||||
|
|||||||
@@ -16,16 +16,24 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
AfsVendorStatus2StatusMap = map[int]int{
|
// AfsVendorStatus2StatusMap = map[int]int{
|
||||||
mtwmapi.ResTypePending: model.AfsOrderStatusWait4Approve,
|
// mtwmapi.ResTypePending: model.AfsOrderStatusWait4Approve,
|
||||||
mtwmapi.ResTypeMerchantRefused: model.AfsOrderStatusFailed,
|
// mtwmapi.ResTypeMerchantRefused: model.AfsOrderStatusFailed,
|
||||||
mtwmapi.ResTypeMerchantAgreed: model.AfsOrderStatusFinished,
|
// mtwmapi.ResTypeMerchantAgreed: model.AfsOrderStatusFinished,
|
||||||
mtwmapi.ResTypeCSRefused: model.AfsOrderStatusFailed,
|
// mtwmapi.ResTypeCSRefused: model.AfsOrderStatusFailed,
|
||||||
mtwmapi.ResTypeCSAgreed: model.AfsOrderStatusFinished,
|
// mtwmapi.ResTypeCSAgreed: model.AfsOrderStatusFinished,
|
||||||
mtwmapi.ResTypeTimeoutAutoAgreed: model.AfsOrderStatusFinished,
|
// mtwmapi.ResTypeTimeoutAutoAgreed: model.AfsOrderStatusFinished,
|
||||||
mtwmapi.ResTypeAutoAgreed: model.AfsOrderStatusFinished,
|
// mtwmapi.ResTypeAutoAgreed: model.AfsOrderStatusFinished,
|
||||||
mtwmapi.ResTypeUserCancelApply: model.AfsOrderStatusFailed,
|
// mtwmapi.ResTypeUserCancelApply: model.AfsOrderStatusFailed,
|
||||||
mtwmapi.ResTypeUserCancelComplain: model.AfsOrderStatusFailed,
|
// mtwmapi.ResTypeUserCancelComplain: model.AfsOrderStatusFailed,
|
||||||
|
// }
|
||||||
|
AfsVendorStatus2StatusMap = map[string]int{
|
||||||
|
mtwmapi.NotifyTypeApply: model.AfsOrderStatusWait4Approve,
|
||||||
|
mtwmapi.NotifyTypePartyApply: model.AfsOrderStatusWait4Approve,
|
||||||
|
mtwmapi.NotifyTypeSuccess: model.AfsOrderStatusFinished,
|
||||||
|
mtwmapi.NotifyTypeReject: model.AfsOrderStatusFailed,
|
||||||
|
mtwmapi.NotifyTypeCancelRefund: model.AfsOrderStatusFailed,
|
||||||
|
mtwmapi.NotifyTypeCancelRefundComplaint: model.AfsOrderStatusFailed,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -138,8 +146,8 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *mtwmapi.CallbackMsg) (order
|
|||||||
OrderType: model.OrderTypeAfsOrder,
|
OrderType: model.OrderTypeAfsOrder,
|
||||||
RefVendorOrderID: utils.Int64ToStr(refundData.OrderID),
|
RefVendorOrderID: utils.Int64ToStr(refundData.OrderID),
|
||||||
RefVendorID: model.VendorIDMTWM,
|
RefVendorID: model.VendorIDMTWM,
|
||||||
VendorStatus: utils.Int2Str(refundData.ResType),
|
VendorStatus: fmt.Sprintf("%s:%d", refundData.NotifyType, refundData.ResType),
|
||||||
Status: c.GetAfsStatusFromVendorStatus(refundData.ResType),
|
Status: c.GetAfsStatusFromVendorStatus(refundData.ResType, refundData.NotifyType),
|
||||||
StatusTime: utils.Timestamp2Time(refundData.Timestamp),
|
StatusTime: utils.Timestamp2Time(refundData.Timestamp),
|
||||||
Remark: refundData.Reason,
|
Remark: refundData.Reason,
|
||||||
}
|
}
|
||||||
@@ -149,8 +157,12 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *mtwmapi.CallbackMsg) (order
|
|||||||
return orderStatus
|
return orderStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(vendorStatus int) int {
|
func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(resType int, notifyType string) int {
|
||||||
return AfsVendorStatus2StatusMap[vendorStatus]
|
status := AfsVendorStatus2StatusMap[notifyType]
|
||||||
|
if status == model.AfsOrderStatusWait4Approve && resType != mtwmapi.ResTypePending {
|
||||||
|
status = model.AfsOrderStatusNew
|
||||||
|
}
|
||||||
|
return status
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核售后单申请
|
// 审核售后单申请
|
||||||
|
|||||||
Reference in New Issue
Block a user