补漏订单修改
This commit is contained in:
@@ -1095,7 +1095,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
|
|||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
if model.IsOrderFinalStatus(order.Status) {
|
if model.IsOrderFinalStatus(order.Status) {
|
||||||
goodsOrder.Status = order.Status
|
goodsOrder.Status = order.Status
|
||||||
goodsOrder.OrderFinishedAt = order.StatusTime
|
goodsOrder.OrderFinishedAt = order.OrderFinishedAt
|
||||||
_, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt")
|
_, err = dao.UpdateEntity(db, goodsOrder, "Status", "OrderFinishedAt")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,6 +231,19 @@ var (
|
|||||||
"18048531223": "18048531223", //石老板
|
"18048531223": "18048531223", //石老板
|
||||||
"18982250714": "18982250714", //赵敏夫
|
"18982250714": "18982250714", //赵敏夫
|
||||||
}
|
}
|
||||||
|
|
||||||
|
marketManPhoneRoleMap = map[string]string{
|
||||||
|
"marketManPhone": "市场负责人电话",
|
||||||
|
}
|
||||||
|
|
||||||
|
marketManPhoneRoleMoblieMap = map[string]string{
|
||||||
|
"13684045763": "13684045763",
|
||||||
|
"18160030913": "18160030913",
|
||||||
|
"18048531223": "18048531223",
|
||||||
|
"18328080405": "18328080405",
|
||||||
|
"17380734342": "17380734342",
|
||||||
|
"15208271238": "15208271238",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func getStoresSql(ctx *jxcontext.Context, keyword string, params map[string]interface{}, orderTimeFrom, orderTimeTo time.Time) (sql string, sqlParams []interface{}, sqlFrom string, sqlFromParams []interface{}, err error) {
|
func getStoresSql(ctx *jxcontext.Context, keyword string, params map[string]interface{}, orderTimeFrom, orderTimeTo time.Time) (sql string, sqlParams []interface{}, sqlFrom string, sqlFromParams []interface{}, err error) {
|
||||||
@@ -881,6 +894,13 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if marketManPhoneRoleMap[k] != "" {
|
||||||
|
if authInfo, err := ctx.GetV2AuthInfo(); err == nil {
|
||||||
|
if marketManPhoneRoleMoblieMap[authInfo.Mobile] == "" {
|
||||||
|
return 0, errors.New(fmt.Sprintf("当前用户 [%v] 无权限修改 [%v] 字段!", authInfo.Name, roleMap[k]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// districtCode := 0
|
// districtCode := 0
|
||||||
|
|||||||
@@ -233,6 +233,12 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
|
|
||||||
VendorOrgCode: utils.Interface2String(result["source"]),
|
VendorOrgCode: utils.Interface2String(result["source"]),
|
||||||
}
|
}
|
||||||
|
finishTime := getTimeFromInterface(orderMap["finished_time"])
|
||||||
|
if finishTime == utils.ZeroTimeValue {
|
||||||
|
order.OrderFinishedAt = utils.DefaultTimeValue
|
||||||
|
} else {
|
||||||
|
order.OrderFinishedAt = finishTime
|
||||||
|
}
|
||||||
if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
||||||
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 饿百要求在5分钟内拣货,不然订单会被取消
|
order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 饿百要求在5分钟内拣货,不然订单会被取消
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
`
|
`
|
||||||
if err = dao.GetRows(db, &stores, sql, model.VendorIDEBAI, utils.DefaultTimeValue, storeID); err == nil {
|
if err = dao.GetRows(db, &stores, sql, model.VendorIDEBAI, utils.DefaultTimeValue, storeID); err == nil {
|
||||||
for _, store := range stores {
|
for _, store := range stores {
|
||||||
globals.SugarLogger.Debugf("testUpdateStoreStatus1 storeID", storeID, utils.Format4Output(store, false))
|
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
shopID := 0
|
shopID := 0
|
||||||
if store.SyncStatus&model.SyncFlagDeletedMask == 0 {
|
if store.SyncStatus&model.SyncFlagDeletedMask == 0 {
|
||||||
@@ -182,7 +181,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {
|
||||||
mergeStatus := jxutils.MergeStoreStatus(store.Status, store.EbaiStoreStatus)
|
mergeStatus := jxutils.MergeStoreStatus(store.Status, store.EbaiStoreStatus)
|
||||||
globals.SugarLogger.Debugf("testUpdateStoreStatus storeID:%d, mergeStatus:%s, store.Status:%s, store.EbaiStoreStatus:%s", storeID, mergeStatus, store.Status, store.EbaiStoreStatus)
|
|
||||||
if err = p.UpdateStoreStatus(jxcontext.AdminCtx, store.VendorOrgCode, storeID, store.VendorStoreID, mergeStatus); err != nil {
|
if err = p.UpdateStoreStatus(jxcontext.AdminCtx, store.VendorOrgCode, storeID, store.VendorStoreID, mergeStatus); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,9 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
|
|
||||||
VendorOrgCode: utils.Interface2String(result[keyVendorOrgCode]),
|
VendorOrgCode: utils.Interface2String(result[keyVendorOrgCode]),
|
||||||
}
|
}
|
||||||
|
if result["order_completed_time"] != nil {
|
||||||
|
order.OrderFinishedAt = getTimeFromTimestamp(utils.MustInterface2Int64(result["order_completed_time"]))
|
||||||
|
}
|
||||||
pickType := int(utils.Interface2Int64WithDefault(result["pick_type"], 0))
|
pickType := int(utils.Interface2Int64WithDefault(result["pick_type"], 0))
|
||||||
if pickType == mtwmapi.OrderPickTypeSelf {
|
if pickType == mtwmapi.OrderPickTypeSelf {
|
||||||
order.DeliveryType = model.OrderDeliveryTypeSelfTake
|
order.DeliveryType = model.OrderDeliveryTypeSelfTake
|
||||||
|
|||||||
Reference in New Issue
Block a user