Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -259,7 +259,7 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
|
||||
order.OrderFinishedAt = time.Now()
|
||||
dao.UpdateEntity(db, order, "OrderFinishedAt")
|
||||
} else if orderStatus.Status == model.OrderStatusCanceled {
|
||||
order2, err2 := c.LoadOrder(orderStatus.VendorOrderID, orderStatus.VendorID) // 订单被取消,则取消三方运单
|
||||
order2, _ := c.LoadOrder(orderStatus.VendorOrderID, orderStatus.VendorID) // 订单被取消,则取消三方运单
|
||||
if orderStatus.OrderType == model.OrderTypeOrder {
|
||||
waybill, _ := dao.GetWaybills(db, order2.VendorOrderID, []int64{model.VendorIDMTPS, model.VendorIDDada, model.VendorIDFengNiao, model.VendorIDUUPT, model.VendorIDSFPS})
|
||||
for _, v := range waybill {
|
||||
@@ -274,16 +274,13 @@ func (c *OrderManager) OnOrderStatusChanged(vendorOrgCode string, orderStatus *m
|
||||
dao.UpdateEntity(db, order2, "OrderFinishedAt")
|
||||
}
|
||||
|
||||
//如果取消订单则要把库存加回去
|
||||
if err2 == nil {
|
||||
// 判断是否需要打印取消订单
|
||||
storeDetail, err := c.LoadStoreDetail(order2.StoreID, order2.VendorID)
|
||||
if err == nil && storeDetail.IsPrintCancelOrder == model.YES { // 取消申请
|
||||
_, err = netprinter.PrintRefundOrCancelOrder(jxcontext.AdminCtx, model.YES, order2, order2.StoreID)
|
||||
}
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("Get store Detail Err: ", err)
|
||||
}
|
||||
// 判断是否需要打印取消订单
|
||||
storeDetail, errDetail := c.LoadStoreDetail(order2.JxStoreID, order2.VendorID)
|
||||
if errDetail == nil && storeDetail.IsPrintCancelOrder == model.YES { // 取消申请
|
||||
_, err = netprinter.PrintRefundOrCancelOrder(jxcontext.AdminCtx, model.YES, order2, order2.JxStoreID)
|
||||
}
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debug("Get store Detail Err: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6403,24 +6403,19 @@ func BatchGetMTStoreLogos(vendorOrgCode string, mtStoreIDs []string) (storeLogos
|
||||
|
||||
//批量更新美团门店logos
|
||||
func BatchUpdateMTStoreLogos(vendorOrgCode string, relInfo []MtRelInfo) (hint string) {
|
||||
param := map[string]interface{}{}
|
||||
if len(relInfo[0].PicUrl) > 0 {
|
||||
param["pic_url"] = relInfo[0].PicUrl
|
||||
}
|
||||
for _, v := range relInfo {
|
||||
if len(v.PicUrl) == 0 && len(v.Address) == 0 {
|
||||
return "暂无需要更新数据"
|
||||
}
|
||||
param := map[string]interface{}{}
|
||||
if len(v.PicUrl) > 0 {
|
||||
param["pic_url"] = v.PicUrl
|
||||
}
|
||||
if len(v.Address) > 0 {
|
||||
param["address"] = v.Address
|
||||
}
|
||||
|
||||
storeDetail, err1 := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, v.PoiCode, "")
|
||||
if err1 != nil {
|
||||
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err1)
|
||||
}
|
||||
globals.SugarLogger.Debugf("BatchUpdateMTStoreLogos param=%s", utils.Format4Output(param, false))
|
||||
if err := mtwm.GetAPI(vendorOrgCode, storeDetail.Store.ID, "").PoiSave(v.PoiCode, param); err != nil {
|
||||
apiObj := mtwm.GetAPI(vendorOrgCode, 0, v.PoiCode)
|
||||
if err := apiObj.PoiSave(v.PoiCode, param); err != nil {
|
||||
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ type JxBadComments struct {
|
||||
|
||||
Createtime string `json:"createTime" orm:"column(createtime);size(255);null;index" description:"评论的创建时间"`
|
||||
Score int `json:"score4" orm:"column(score)" description:"评论的星级"`
|
||||
Scorecontent string `json:"score4Content" orm:"column(scorecontent);size(512);null" description:"评论的内容"`
|
||||
Scorecontent string `json:"score4Content" orm:"column(scorecontent);size(1024);null" description:"评论的内容"`
|
||||
Vendertags string `json:"venderTags" orm:"column(vendertags);size(255);null" description:"评论的标签"`
|
||||
Msg string `json:"-" orm:"column(msg);type(text)" description:"未解决差评的原始信息"`
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ func (p PrinterHandler) PrintStore(ctx *jxcontext.Context, store *model.Store, s
|
||||
}
|
||||
|
||||
func (p PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printType int, store *model.Store, storeDetail *dao.StoreDetail, order *model.GoodsOrder) (printerStatus *partner.PrinterStatus, err error) {
|
||||
globals.SugarLogger.Debugf("==============storeDetail := %s", utils.Format4Output("=====================kkk", false))
|
||||
if len(order.Skus) == 0 {
|
||||
return
|
||||
}
|
||||
@@ -150,6 +151,8 @@ func (p PrinterHandler) PrintCancelOrRefundOrder(ctx *jxcontext.Context, printTy
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
globals.SugarLogger.Debugf("=======PrintCancelOrRefundOrder== : %s , %s", utils.Format4Output(content, false), store.PrinterSN)
|
||||
|
||||
return p.PrintMsg(ctx, store.PrinterSN, "", voiceType, content)
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ func (c *TaoBaoVegetableController) CancelOnSaleRefundOrder() {
|
||||
//callbackResponse := taoVegetable.OnCallbackMsg(tao_vegetable.OrderStatusOnSaleCancel, utils.Int64ToStr(afsOrder.PartCancelRequest.BizOrderId), afsOrder)
|
||||
//c.Data["json"] = callbackResponse
|
||||
order, err := partner.CurOrderManager.LoadOrder(utils.Int64ToStr(afsOrder.PartCancelRequest.BizOrderId), model.VendorIDTaoVegetable)
|
||||
if err != nil || order.Status > model.WaybillStatusCourierArrived {
|
||||
if err != nil || order.Status >= model.OrderStatusDelivering {
|
||||
c.Data["json"] = tao_vegetable.CallBackResultOnSaleCancel(fmt.Errorf("不支持售中取消"))
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user