Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -555,6 +555,7 @@ func CheckAndReply(req *JXMsg, elmAppID string) (err error) {
|
||||
temp.MsgContent = AutoReplyByAppID[mt.AppID]
|
||||
}
|
||||
}
|
||||
temp.MsgType = mtwmapi.MsgTypeText
|
||||
temp.MsgSource = mtwmapi.MsgSourceStore
|
||||
temp.Cts = int(time.Now().Unix())
|
||||
temp.MsgID = RandTimeNumber()
|
||||
@@ -742,7 +743,7 @@ func GetDefaultTemplate(appID, vendorStoreID string, vendorID int) (string, erro
|
||||
if err != nil && err != orm.ErrNoRows {
|
||||
return "", err
|
||||
}
|
||||
if err == orm.ErrNoRows || (len(store.Tel1) == 0 && len(store.Tel2) == 0) {
|
||||
if err == orm.ErrNoRows || store.Tel1 == "" {
|
||||
t = BasePhoneNum
|
||||
}
|
||||
if len(store.Tel1) > 0 {
|
||||
|
||||
@@ -85,9 +85,11 @@ func isCreateOrUpdate(syncStatus int8) bool {
|
||||
|
||||
func createOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*model.ActStoreSku2) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
actData := storeSku2ActData(act, actStoreSku, isCreateOrUpdate)
|
||||
globals.SugarLogger.Debugf("test0129 actData=%s", utils.Format4Output(actData, false))
|
||||
if len(actData) > 0 {
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
actResult, faileInfoList, err2 := api.MtwmAPI.RetailDiscountBatchSave2(vendorStoreID, jxActType2Mtwm(act.Type), actData)
|
||||
//actResult, faileInfoList, err2 := getAPI(act.VendorOrgCode, 0, vendorStoreID).RetailDiscountBatchSave2(vendorStoreID, jxActType2Mtwm(act.Type), actData)
|
||||
err = err2
|
||||
// 忽略错误,都放在failedList里
|
||||
// if err != nil {
|
||||
@@ -161,9 +163,12 @@ func getActStoreSkuFromTaskResult(taskReslt []interface{}) (list []*model.ActSto
|
||||
|
||||
func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (createdList []*model.ActStoreSku2, err error) {
|
||||
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
||||
globals.SugarLogger.Debugf("createSkuAct test0129 actStoreSkuListList=%s", utils.Format4Output(actStoreSkuListList, false))
|
||||
task := tasksch.NewParallelTask("mtwm createSkuAct", nil, ctx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
list := batchItemList[0].([]*model.ActStoreSku2)
|
||||
globals.SugarLogger.Debugf("createSkuAct test0129 list=%s", utils.Format4Output(list, false))
|
||||
|
||||
failedList, err2 := createOneShopAct(act, list[0].VendorStoreID, list)
|
||||
if err = err2; err2 == nil {
|
||||
if len(failedList) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user