- 拉取平台信息时,存储平台门店名

This commit is contained in:
gazebo
2019-09-03 08:55:28 +08:00
parent 4e617f4ef5
commit 0f69e9b51e
2 changed files with 12 additions and 9 deletions

View File

@@ -1436,6 +1436,7 @@ func GetStoresVendorSnapshot(ctx *jxcontext.Context, parentTask tasksch.ITask, v
CloseTime2: store.CloseTime2,
DeliveryType: store.DeliveryType,
StoreName: store.Name,
}}
}
}
@@ -1481,8 +1482,8 @@ func updateVendorStoreStatusBySnapshot(db *dao.DaoDB, curSnapshotList []*model.V
(v.Status != snapshot.Status || v.DeliveryType != snapshot.DeliveryType) {
v.Status = snapshot.Status
v.DeliveryType = snapshot.DeliveryType
v.LastOperator = model.AdminName
if _, err = dao.UpdateEntity(db, v, model.FieldLastOperator, model.FieldUpdatedAt, model.FieldStatus, "DeliveryType"); err != nil {
v.StoreName = snapshot.StoreName
if _, err = dao.UpdateEntity(db, v, model.FieldStatus, "DeliveryType", "StoreName"); err != nil {
return err
}
}

View File

@@ -356,7 +356,8 @@ type StoreMap struct {
StoreID int `orm:"column(store_id)" json:"storeID"`
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
Status int `json:"status"` // 取值同Store.Status
Status int `json:"status"` // 取值同Store.Status
StoreName string `orm:"size(255)" json:"storeName"` // 平台门店的名字
PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格
PricePercentagePack string `orm:"size(32)" json:"pricePercentagePack"` //
@@ -404,12 +405,13 @@ type VendorStoreSnapshot struct {
VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"`
SnapshotAt time.Time `orm:"type(datetime)" json:"snapshotAt"` // 这个不同于CreatedAtSnapshotAt是逻辑上的时间CreatedAt是实际存储的时间
Status int `json:"status"` // 取值同Store.Status
OpenTime1 int16 `json:"openTime1"` // 930就表示9点半用两个的原因是为了支持中午休息1与2的时间段不能交叉为0表示没有
CloseTime1 int16 `json:"closeTime1"` // 格式同上
OpenTime2 int16 `json:"openTime2"` // 格式同上
CloseTime2 int16 `json:"closeTime2"` // 格式同上
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
Status int `json:"status"` // 取值同Store.Status
OpenTime1 int16 `json:"openTime1"` // 930就表示9点半用两个的原因是为了支持中午休息1与2的时间段不能交叉为0表示没有
CloseTime1 int16 `json:"closeTime1"` // 格式同上
OpenTime2 int16 `json:"openTime2"` // 格式同上
CloseTime2 int16 `json:"closeTime2"` // 格式同上
DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型
StoreName string `orm:"size(255)" json:"storeName"` // 平台门店的名字
}
func (*VendorStoreSnapshot) TableUnique() [][]string {