This commit is contained in:
苏尹岚
2020-08-11 09:27:00 +08:00
25 changed files with 348 additions and 117 deletions

View File

@@ -672,6 +672,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
'","eclpID":"', t2.eclp_id,
'","weight":', t2.weight, ',"categoryID":', t2.category_id, ',"nameID":', t2.name_id,
', "seq":', t2.seq,
', "minOrderCount":', t2.min_order_count,
"}")), "]") skus_str,
CONCAT("[", GROUP_CONCAT(DISTINCT t3.place_code), "]") places_str
` + sql + `

View File

@@ -2,6 +2,7 @@ package cms
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
@@ -3399,13 +3400,16 @@ func UpdateStorePricePack(ctx *jxcontext.Context, storeID, vendorID int, pricePa
}()
//证明是门店自己的调价包
if strings.Contains(pricePack, utils.Int2Str(storeID)) {
obj := dao.PricePercentagePack2Obj(value)
realValue, _ := json.Marshal(obj)
// _, err = UpdateConfig(ctx, pricePack, model.ConfigTypePricePack, string(realValue))
configList, err := dao.QueryConfigs(db, pricePack, model.ConfigTypePricePack, "")
if err != nil {
dao.Rollback(db)
return err
}
if _, err = dao.UpdateEntityLogically(db, configList[0], map[string]interface{}{
"Value": value,
"Value": string(realValue),
}, ctx.GetUserName(), nil); err != nil {
dao.Rollback(db)
return err

View File

@@ -4079,7 +4079,7 @@ func BackUpStoreSkuBind(ctx *jxcontext.Context, isAsync, isContinueWhenError boo
snapshotAt = utils.Time2Date(time.Now())
)
storeSkuBindHis := &model.StoreSkuBindHistory{
SnapshotAt: snapshotAt.AddDate(0, 0, -2),
SnapshotAt: snapshotAt.AddDate(0, 0, -5),
}
dao.DeleteEntity(db, storeSkuBindHis, "SnapshotAt")
storeList, err := dao.GetStoreList(db, nil, nil, nil, nil, "")
@@ -4397,7 +4397,6 @@ func SyncMatterC4ToGy(ctx *jxcontext.Context, isContinueWhenError, isAsync bool)
updateMatters = append(updateMatters, skusMap[c4.EclpID])
}
}
fmt.Println("updateMatters", utils.Format4Output(updateMatters, false))
case 1:
if len(deleteMatters) > 0 {
for _, v := range deleteMatters {

View File

@@ -1297,6 +1297,9 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
ShopInfo, _ := api.MtpsAPI.ShopQuery(strconv.Itoa(storeId))
if ShopInfo != nil {
ShopName = ShopInfo.ShopName
if ShopName == "" {
ShopName = StoreLists[0].Name[:len(StoreLists[0].Name)-3]
}
StoreInfoList, _ = api.MtpsAPI.GetStoreStatus(ShopName)
if StoreInfoList != nil && StoreInfoList.DataList != nil {
goto ifExist
@@ -1354,15 +1357,15 @@ func SetMTPSStatus(ctx *jxcontext.Context, storeId, courierStatus int) {
{
if StoreInfoList.DataList[0].OuterPoiID != "" {
//若存在且名字不为空,就是找到了
if StoreInfoList.DataList[0].OpenType != courierStatus {
sl := make(map[string]interface{})
sl["vendorStoreID"] = StoreInfoList.DataList[0].OuterPoiID
sl["status"] = StoreInfoList.DataList[0].OpenType
sl["vendorStatus"] = StoreInfoList.DataList[0].OpenType
globals.SugarLogger.Debugf("被修改配送状态的VendorStoreID是:%s,名称是:%s,美团状态是:%s,本地状态是:%s",
StoreInfoList.DataList[0].OuterPoiID, StoreInfoList.DataList[0].PoiName, strconv.Itoa(StoreInfoList.DataList[0].OpenType), strconv.Itoa(StoreLists[0].Status))
UpdateStoreCourierMap(ctx, nil, storeId, model.VendorIDMTPS, sl, ctx.GetUserName())
}
// if StoreInfoList.DataList[0].OpenType != courierStatus ||{
sl := make(map[string]interface{})
sl["vendorStoreID"] = StoreInfoList.DataList[0].OuterPoiID
sl["status"] = StoreInfoList.DataList[0].OpenType
sl["vendorStatus"] = StoreInfoList.DataList[0].OpenType
globals.SugarLogger.Debugf("被修改配送状态的VendorStoreID是:%s,名称是:%s,美团状态是:%s,本地状态是:%s",
StoreInfoList.DataList[0].OuterPoiID, StoreInfoList.DataList[0].PoiName, strconv.Itoa(StoreInfoList.DataList[0].OpenType), strconv.Itoa(StoreLists[0].Status))
UpdateStoreCourierMap(ctx, nil, storeId, model.VendorIDMTPS, sl, ctx.GetUserName())
// }
}
}
} else {