From dd0f967858ec2fc3a361e1a1fd25cdce76cdd6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 11:52:56 +0800 Subject: [PATCH 01/13] 1 --- business/jxcallback/orderman/orderman_ext.go | 1 + business/partner/delivery/mtps/waybill.go | 1 - business/partner/purchase/mtwm/order.go | 1 + controllers/jd_callback.go | 1 - controllers/taobao_vegetable.go | 23 -------------------- 5 files changed, 2 insertions(+), 25 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 858a62124..c293d5d53 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1344,6 +1344,7 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in VendorOrgCode string VendorStoreID string } + globals.SugarLogger.Debugf("dateVendorList============== :%s", utils.Format4Output(dateVendorList, false)) if len(dateVendorList) > 0 { var missingOrderList []*tOrderVendorPair var updateOrderStatusList []*model.GoodsOrder diff --git a/business/partner/delivery/mtps/waybill.go b/business/partner/delivery/mtps/waybill.go index 1fefc3b46..bbb53774c 100644 --- a/business/partner/delivery/mtps/waybill.go +++ b/business/partner/delivery/mtps/waybill.go @@ -104,7 +104,6 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m } } - globals.SugarLogger.Debugf("===========msg := %s", utils.Format4Output(msg, false)) store, _ := dao.GetStoreDetail(dao.GetDB(), goodsOrder.JxStoreID, goodsOrder.VendorID, goodsOrder.VendorOrgCode) switch msg.Status { case mtpsapi.OrderStatusWaitingForSchedule: diff --git a/business/partner/purchase/mtwm/order.go b/business/partner/purchase/mtwm/order.go index 860fc48cb..8e9013375 100644 --- a/business/partner/purchase/mtwm/order.go +++ b/business/partner/purchase/mtwm/order.go @@ -661,6 +661,7 @@ func (c *PurchaseHandler) ListOrders(ctx *jxcontext.Context, vendorOrgCode strin } else { tmpOrderIDs, err = getAPI(vendorOrgCode, 0, vendorStoreID).GetOrderIdByDaySeq(vendorStoreID, queryDate, seqStart, seqEnd) } + globals.SugarLogger.Debugf("============tmpOrderIDs := %s", utils.Format4Output(tmpOrderIDs, false)) if len(tmpOrderIDs) > 0 { for _, v := range tmpOrderIDs { orderIDs = append(orderIDs, utils.Int64ToStr(v)) diff --git a/controllers/jd_callback.go b/controllers/jd_callback.go index 165b6817f..616babe6d 100644 --- a/controllers/jd_callback.go +++ b/controllers/jd_callback.go @@ -110,7 +110,6 @@ func (c *DjswController) OrderCommentPush() { func (c *DjswController) Token() { urlValues, err := utils.HTTPBody2Values(c.Ctx.Input.RequestBody, false) - globals.SugarLogger.Info(utils.Format4Output(utils.URLValues2Map(urlValues), false)) globals.SugarLogger.Info(utils.Format4Output(utils.Format4Output(err, false), false)) jd.OnTokenChange(urlValues) c.Data["json"] = c.transferResponse("Token", nil) diff --git a/controllers/taobao_vegetable.go b/controllers/taobao_vegetable.go index 048f73b8b..68fc1aa71 100644 --- a/controllers/taobao_vegetable.go +++ b/controllers/taobao_vegetable.go @@ -9,7 +9,6 @@ import ( "git.rosy.net.cn/jx-callback/business/jxstore/common" "git.rosy.net.cn/jx-callback/business/model" taoVegetable "git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable" - "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" "io/ioutil" @@ -39,7 +38,6 @@ func (c *TaoBaoVegetableController) GetCode() { } tokenInfo, err := api.TaoVegetableApi.GetStoreToken(codeData, "") if err != nil { - globals.SugarLogger.Debugf("获取门店token错误:%s", err.Error()) c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() return @@ -76,8 +74,6 @@ func (c *TaoBaoVegetableController) OrderStatus() { // 获取url参数 values, err := url.ParseQuery(urlParam) - globals.SugarLogger.Debugf("ReaderOrderInfo := %s", utils.Format4Output(urlParam, false)) - globals.SugarLogger.Debugf("ReaderOrderInfo err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -86,8 +82,6 @@ func (c *TaoBaoVegetableController) OrderStatus() { // 获取body参数 order, body, err := api.TaoVegetableApi.ReaderOrderInfo(c.Ctx.Request) - globals.SugarLogger.Debugf("order_status ReaderOrderInfo:= %s", utils.Format4Output(order, false)) - globals.SugarLogger.Debugf("order_status ReaderOrderInfo:= %s", utils.Format4Output(order, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -121,8 +115,6 @@ func (c *TaoBaoVegetableController) ApplyCancelOrder() { // 获取url参数 values, err := url.ParseQuery(urlParam) - globals.SugarLogger.Debugf("ApplyCancelOrder := %s", utils.Format4Output(urlParam, false)) - globals.SugarLogger.Debugf("ApplyCancelOrder err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -130,8 +122,6 @@ func (c *TaoBaoVegetableController) ApplyCancelOrder() { } afsOrder, body, err := api.TaoVegetableApi.UserApplyRefund(c.Ctx.Request) - globals.SugarLogger.Debugf("ApplyCancelOrder := %s", utils.Format4Output(afsOrder, false)) - globals.SugarLogger.Debugf("ApplyCancelOrder err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -153,7 +143,6 @@ func (c *TaoBaoVegetableController) ApplyCancelOrder() { } default: callbackResponse := taoVegetable.OnCallbackMsg(tao_vegetable.OrderStatusApplyAfs, afsOrder.OutOrderId, afsOrder) - globals.SugarLogger.Debugf("callbackResponse response : %s", utils.Format4Output(callbackResponse, false)) c.Data["json"] = callbackResponse c.ServeJSON() return @@ -166,8 +155,6 @@ func (c *TaoBaoVegetableController) UserCancelRefund() { // 获取url参数 values, err := url.ParseQuery(urlParam) - globals.SugarLogger.Debugf("UserCancelRefund := %s", utils.Format4Output(urlParam, false)) - globals.SugarLogger.Debugf("UserCancelRefund err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -175,8 +162,6 @@ func (c *TaoBaoVegetableController) UserCancelRefund() { } afsOrder, body, err := api.TaoVegetableApi.UserCancelRefundApply(c.Ctx.Request) - globals.SugarLogger.Debugf("UserCancelRefund := %s", utils.Format4Output(afsOrder, false)) - globals.SugarLogger.Debugf("UserCancelRefund err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -211,8 +196,6 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() { // 获取url参数 values, err := url.ParseQuery(urlParam) - globals.SugarLogger.Debugf("CancelOnSaleRefundOrder := %s", utils.Format4Output(urlParam, false)) - globals.SugarLogger.Debugf("CancelOnSaleRefundOrder err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -220,8 +203,6 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() { } afsOrder, body, err := api.TaoVegetableApi.OnSaleRefundOrder(c.Ctx.Request) - globals.SugarLogger.Debugf("CancelOnSaleRefundOrder := %s", utils.Format4Output(afsOrder, false)) - globals.SugarLogger.Debugf("CancelOnSaleRefundOrder err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -255,8 +236,6 @@ func (c *TaoBaoVegetableController) RefundOrderSuccess() { // 获取url参数 values, err := url.ParseQuery(urlParam) - globals.SugarLogger.Debugf("RefundOrderSuccess := %s", utils.Format4Output(urlParam, false)) - globals.SugarLogger.Debugf("RefundOrderSuccess err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() @@ -264,8 +243,6 @@ func (c *TaoBaoVegetableController) RefundOrderSuccess() { } refundSuccess, body, err := api.TaoVegetableApi.RefundOrderFinish(c.Ctx.Request) - globals.SugarLogger.Debugf("RefundOrderSuccess := %s", utils.Format4Output(refundSuccess, false)) - globals.SugarLogger.Debugf("RefundOrderSuccess err := %s", utils.Format4Output(err, false)) if err != nil { c.Data["json"] = tao_vegetable.CallBackResultInfo(err) c.ServeJSON() From de9a57540aff654b897ac0f3af33818b19d42910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 14:44:45 +0800 Subject: [PATCH 02/13] 1 --- business/jxcallback/orderman/orderman_ext.go | 1 - business/model/dao/act.go | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index c293d5d53..858a62124 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -1344,7 +1344,6 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in VendorOrgCode string VendorStoreID string } - globals.SugarLogger.Debugf("dateVendorList============== :%s", utils.Format4Output(dateVendorList, false)) if len(dateVendorList) > 0 { var missingOrderList []*tOrderVendorPair var updateOrderStatusList []*model.GoodsOrder diff --git a/business/model/dao/act.go b/business/model/dao/act.go index d09080bd9..62607c175 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -705,7 +705,8 @@ func GetActEbaiVendorSkus(db *DaoDB, storeIDs, skuIDs []int) (actEbaiVendorSku [ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beginAt, endAt time.Time, actType, offset, pageSize int) (page *model.PagedInfo, err error) { var ( - acts []*model.ActMtwmVendor + acts []*model.ActMtwmVendor + pageInfo *model.PagedInfo ) sql := ` SELECT SQL_CALC_FOUND_ROWS b.name store_name ,a.* @@ -750,11 +751,11 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg } }() if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil { - page.TotalCount = GetLastTotalRowCount2(db, txDB) - page.Data = acts + pageInfo.TotalCount = GetLastTotalRowCount2(db, txDB) + pageInfo.Data = acts } Commit(db, txDB) - return page, err + return pageInfo, err } // GetDontHaveSku 获取不存在此商品活动的门店 From 8338413166fe2276794a20c7a0478cfd4e58bd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 15:01:03 +0800 Subject: [PATCH 03/13] 1 --- business/model/dao/act.go | 1 + business/partner/purchase/mtwm/order.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index 62607c175..4c5d5842a 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -712,6 +712,7 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg SELECT SQL_CALC_FOUND_ROWS b.name store_name ,a.* FROM act_mtwm_vendor a LEFT JOIN store b ON a.store_id = b.id + WHERE 1 = 1 ` sqlParams := []interface{}{} if len(storeIDs) > 0 { diff --git a/business/partner/purchase/mtwm/order.go b/business/partner/purchase/mtwm/order.go index 8e9013375..860fc48cb 100644 --- a/business/partner/purchase/mtwm/order.go +++ b/business/partner/purchase/mtwm/order.go @@ -661,7 +661,6 @@ func (c *PurchaseHandler) ListOrders(ctx *jxcontext.Context, vendorOrgCode strin } else { tmpOrderIDs, err = getAPI(vendorOrgCode, 0, vendorStoreID).GetOrderIdByDaySeq(vendorStoreID, queryDate, seqStart, seqEnd) } - globals.SugarLogger.Debugf("============tmpOrderIDs := %s", utils.Format4Output(tmpOrderIDs, false)) if len(tmpOrderIDs) > 0 { for _, v := range tmpOrderIDs { orderIDs = append(orderIDs, utils.Int64ToStr(v)) From e4bd1658cc985d19267ffeea69cf6fc4e0a14e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 15:14:49 +0800 Subject: [PATCH 04/13] 1 --- business/model/dao/act.go | 5 +++-- controllers/act.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index 4c5d5842a..cf71bcc2b 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -751,8 +751,9 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg panic(r) } }() - if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil { - pageInfo.TotalCount = GetLastTotalRowCount2(db, txDB) + if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil && len(acts) != 0 { + aa := GetLastTotalRowCount2(db, txDB) + pageInfo.TotalCount = aa pageInfo.Data = acts } Commit(db, txDB) diff --git a/controllers/act.go b/controllers/act.go index ad3f93222..fda9eec9e 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -449,7 +449,7 @@ func (c *ActController) GetVendorPopActDetail() { // @Title 查询美团平台活动 // @Description 查询美团平台活动 -// @Param token header string true "认证token" +// @Param token header string true "认证token" // @Param storeIDs query string false "门店IDs" // @Param skuIDs query string false "skuIDs" // @Param keyword query string false "关键字" From e509133d5e896485c121582fe1a0abf3d6bd992a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 16:11:51 +0800 Subject: [PATCH 05/13] 1 --- business/model/dao/act.go | 3 +++ business/partner/purchase/tao_vegetable/store_sku2.go | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index cf71bcc2b..1ab611ebd 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -751,6 +751,9 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg panic(r) } }() + + globals.SugarLogger.Debugf("sql := %s", sql) + globals.SugarLogger.Debugf("sql := %s", utils.Format4Output(sqlParams, false)) if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil && len(acts) != 0 { aa := GetLastTotalRowCount2(db, txDB) pageInfo.TotalCount = aa diff --git a/business/partner/purchase/tao_vegetable/store_sku2.go b/business/partner/purchase/tao_vegetable/store_sku2.go index 74802d9af..b7c03e0f4 100644 --- a/business/partner/purchase/tao_vegetable/store_sku2.go +++ b/business/partner/purchase/tao_vegetable/store_sku2.go @@ -674,7 +674,6 @@ func updateStoreSkusStockByCreate(ctx *jxcontext.Context, api *tao_vegetable.API globals.SugarLogger.Debugf("Updat stock err := %s", err.Error()) //failedList = append(failedList, putils.GetErrMsg2FailedSingleList(v, err, storeID, model.VendorChineseNames[model.VendorIDTaoVegetable], "更新库存错误")...) } - globals.SugarLogger.Debugf("UpdateStoreSkusStock=====err := %v", failedList) return failedList } From 09b2e45f7dcd7c0873d9eccdf26cbd286539fe1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 16:16:44 +0800 Subject: [PATCH 06/13] 1 --- business/model/dao/act.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index 1ab611ebd..0329eba5c 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -728,11 +728,11 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg sqlParams = append(sqlParams, keyword, keyword, "%"+keyword+"%", "%"+keyword+"%") } if !utils.IsTimeZero(beginAt) { - sql += " AND a.begin_at <= ?" + sql += " AND a.begin_at >= ?" sqlParams = append(sqlParams, beginAt) } if !utils.IsTimeZero(endAt) { - sql += " AND a.end_at >= ?" + sql += " AND a.end_at <= ?" sqlParams = append(sqlParams, endAt) } if actType != 0 { @@ -752,11 +752,8 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg } }() - globals.SugarLogger.Debugf("sql := %s", sql) - globals.SugarLogger.Debugf("sql := %s", utils.Format4Output(sqlParams, false)) if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil && len(acts) != 0 { - aa := GetLastTotalRowCount2(db, txDB) - pageInfo.TotalCount = aa + pageInfo.TotalCount = GetLastTotalRowCount2(db, txDB) pageInfo.Data = acts } Commit(db, txDB) From dbb20a524d6150c65af9b59cc379b1f3d5c94f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 16:23:09 +0800 Subject: [PATCH 07/13] 1 --- business/model/dao/act.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index 0329eba5c..f4b3d5ef0 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -753,7 +753,10 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg }() if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil && len(acts) != 0 { - pageInfo.TotalCount = GetLastTotalRowCount2(db, txDB) + globals.SugarLogger.Debugf("len := %d", len(acts)) + aa := GetLastTotalRowCount2(db, txDB) + globals.SugarLogger.Debugf("aa := %d", aa) + pageInfo.TotalCount = aa pageInfo.Data = acts } Commit(db, txDB) From 01df953b938948e2a73a1c0cc0d4a72329a9b5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 17 Jul 2023 16:31:21 +0800 Subject: [PATCH 08/13] 1 --- business/model/dao/act.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/business/model/dao/act.go b/business/model/dao/act.go index f4b3d5ef0..c84e2a076 100644 --- a/business/model/dao/act.go +++ b/business/model/dao/act.go @@ -705,9 +705,10 @@ func GetActEbaiVendorSkus(db *DaoDB, storeIDs, skuIDs []int) (actEbaiVendorSku [ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beginAt, endAt time.Time, actType, offset, pageSize int) (page *model.PagedInfo, err error) { var ( - acts []*model.ActMtwmVendor - pageInfo *model.PagedInfo + acts []*model.ActMtwmVendor ) + pageInfo := &model.PagedInfo{} + sql := ` SELECT SQL_CALC_FOUND_ROWS b.name store_name ,a.* FROM act_mtwm_vendor a @@ -753,10 +754,7 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg }() if err = GetRowsTx(txDB, &acts, sql, sqlParams...); err == nil && len(acts) != 0 { - globals.SugarLogger.Debugf("len := %d", len(acts)) - aa := GetLastTotalRowCount2(db, txDB) - globals.SugarLogger.Debugf("aa := %d", aa) - pageInfo.TotalCount = aa + pageInfo.TotalCount = GetLastTotalRowCount2(db, txDB) pageInfo.Data = acts } Commit(db, txDB) From fb63c0d831fb43c78cdc56db17e4358358372d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 18 Jul 2023 10:13:42 +0800 Subject: [PATCH 09/13] 1 --- business/jxcallback/orderman/order_comment.go | 4 ++++ business/partner/purchase/mtwm/order_comment.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/business/jxcallback/orderman/order_comment.go b/business/jxcallback/orderman/order_comment.go index 3b578fa3c..958f98591 100644 --- a/business/jxcallback/orderman/order_comment.go +++ b/business/jxcallback/orderman/order_comment.go @@ -80,6 +80,7 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( if err == nil || dao.IsNoRowsError(err) { isNewComment := false if dao.IsNoRowsError(err) { + globals.SugarLogger.Debugf("========dao.IsNoRowsError= :%s", utils.Format4Output(orderComment, false)) err = nil isNewComment = true if orderComment.IsReplied == 0 && time.Now().Sub(orderComment.CommentCreatedAt) < time.Duration(orderComment.ModifyDuration)*time.Hour { @@ -157,6 +158,9 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) ( } } } + globals.SugarLogger.Debugf("========comment2= :%s", utils.Format4Output(comment2, false)) + globals.SugarLogger.Debugf("========isNewComment= :%s", utils.Format4Output(isNewComment, false)) + if err == nil { if isNewComment { err = dao.CreateEntity(db, comment2) diff --git a/business/partner/purchase/mtwm/order_comment.go b/business/partner/purchase/mtwm/order_comment.go index d585b479a..4824df771 100644 --- a/business/partner/purchase/mtwm/order_comment.go +++ b/business/partner/purchase/mtwm/order_comment.go @@ -29,6 +29,7 @@ func (c *PurchaseHandler) StartRefreshComment() { } func (c *PurchaseHandler) refreshCommentOnce() { + globals.SugarLogger.Debugf("%s", utils.Format4Output(time.Now(), false)) c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now()) utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() { c.refreshCommentOnce() @@ -55,6 +56,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) storeID := batchItemList[0].(int) storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDMTWM, "") commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied) + globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(commentList, false)) var orderCommentList []*model.OrderComment if err = err2; err != nil { return nil, err From 24e62bb62924bfaf751f4d301a1a0706f6d24a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 18 Jul 2023 10:14:22 +0800 Subject: [PATCH 10/13] 1 --- business/partner/purchase/mtwm/order_comment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/partner/purchase/mtwm/order_comment.go b/business/partner/purchase/mtwm/order_comment.go index 4824df771..7b737204d 100644 --- a/business/partner/purchase/mtwm/order_comment.go +++ b/business/partner/purchase/mtwm/order_comment.go @@ -29,7 +29,7 @@ func (c *PurchaseHandler) StartRefreshComment() { } func (c *PurchaseHandler) refreshCommentOnce() { - globals.SugarLogger.Debugf("%s", utils.Format4Output(time.Now(), false)) + globals.SugarLogger.Debugf("refreshCommentOnce = %s", utils.Format4Output(time.Now(), false)) c.RefreshComment(time.Now().Add(-RefreshCommentTime), time.Now()) utils.AfterFuncWithRecover(RefreshCommentTimeInterval, func() { c.refreshCommentOnce() From 1d99bf00b4ecaf2913cf79e5cdf88eb7cf31050c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 18 Jul 2023 10:23:55 +0800 Subject: [PATCH 11/13] 1 --- business/partner/purchase/mtwm/order_comment.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/mtwm/order_comment.go b/business/partner/purchase/mtwm/order_comment.go index 7b737204d..1dd2107f7 100644 --- a/business/partner/purchase/mtwm/order_comment.go +++ b/business/partner/purchase/mtwm/order_comment.go @@ -58,8 +58,8 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied) globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(commentList, false)) var orderCommentList []*model.OrderComment - if err = err2; err != nil { - return nil, err + if err2 != nil || len(commentList) == model.NO { + return nil, err2 } for _, mtwmComment := range commentList { createdTime, err := utils.TryStr2Time(mtwmComment.CommentTime) @@ -95,6 +95,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) if err = err2; err != nil { return err } + globals.SugarLogger.Debugf("resultList := %s", utils.Format4Output(resultList, false)) var orderCommentList []*model.OrderComment for _, result := range resultList { orderComment := result.(*model.OrderComment) From 4815f3909db17a0bbad31149cee34fb4165decd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 18 Jul 2023 10:28:48 +0800 Subject: [PATCH 12/13] 1 --- business/partner/purchase/mtwm/order_comment.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/partner/purchase/mtwm/order_comment.go b/business/partner/purchase/mtwm/order_comment.go index 1dd2107f7..1d77c9429 100644 --- a/business/partner/purchase/mtwm/order_comment.go +++ b/business/partner/purchase/mtwm/order_comment.go @@ -57,6 +57,7 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDMTWM, "") commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied) globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(commentList, false)) + globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(err2, false)) var orderCommentList []*model.OrderComment if err2 != nil || len(commentList) == model.NO { return nil, err2 From d32e9dd2dbde0c087b4c897ba6cb544b0785b34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 18 Jul 2023 10:33:18 +0800 Subject: [PATCH 13/13] 1 --- business/partner/purchase/mtwm/order_comment.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/business/partner/purchase/mtwm/order_comment.go b/business/partner/purchase/mtwm/order_comment.go index 1d77c9429..984f9b1e2 100644 --- a/business/partner/purchase/mtwm/order_comment.go +++ b/business/partner/purchase/mtwm/order_comment.go @@ -55,12 +55,10 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { storeID := batchItemList[0].(int) storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDMTWM, "") - commentList, err2 := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied) - globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(commentList, false)) - globals.SugarLogger.Debugf("========commentList= :%s", utils.Format4Output(err2, false)) + commentList, _ := getAPI(storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID).CommentQuery(storeDetail.VendorStoreID, startDateStr, endDateStr, 0, 0, mtwmapi.CommentReplyStatusNotReplied) var orderCommentList []*model.OrderComment - if err2 != nil || len(commentList) == model.NO { - return nil, err2 + if len(commentList) == model.NO || commentList == nil { + return nil, nil } for _, mtwmComment := range commentList { createdTime, err := utils.TryStr2Time(mtwmComment.CommentTime) @@ -93,10 +91,11 @@ func (c *PurchaseHandler) RefreshComment(fromTime, toTime time.Time) (err error) }, storeIDs) task.Run() resultList, err2 := task.GetResult(0) + globals.SugarLogger.Debugf("resultList := %s", utils.Format4Output(resultList, false)) + globals.SugarLogger.Debugf("err2 := %s", utils.Format4Output(err2, false)) if err = err2; err != nil { return err } - globals.SugarLogger.Debugf("resultList := %s", utils.Format4Output(resultList, false)) var orderCommentList []*model.OrderComment for _, result := range resultList { orderComment := result.(*model.OrderComment)