This commit is contained in:
suyl
2021-06-17 18:34:13 +08:00
parent 177156dcba
commit 921a3bfffd
3 changed files with 56 additions and 7 deletions

View File

@@ -251,7 +251,8 @@ func NotifyNewOrder(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
//return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
return SendMsgToStore(storeID, WX_NEWORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
}
func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlreadyCandidate bool) (err error) {
@@ -320,7 +321,8 @@ func NotifyWaybillStatus(bill *model.Waybill, order *model.GoodsOrder, isBillAlr
"color": WX_NEW_ORDER_TEMPLATE_COLOR,
},
}
err = SendMsgToStore(jxutils.GetSaleStoreIDFromOrder(order), templateID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeDetail.ID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeDetail.ID), data)
//err = SendMsgToStore(jxutils.GetSaleStoreIDFromOrder(order), templateID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeDetail.ID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeDetail.ID), data)
err = SendMsgToStore(jxutils.GetSaleStoreIDFromOrder(order), templateID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeDetail.ID), WX_MINI_TO_ORDER_PAGE_URL, data)
netprinter.NofityOrderMsg(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromOrder(order), order.VendorOrderID, title)
}
return err
@@ -365,7 +367,8 @@ func NotifyUserApplyCancel(order *model.GoodsOrder, cancelReason string) (err er
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
err = SendMsgToStore(storeID, WX_ORDER_APPLY_CANCEL_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
//err = SendMsgToStore(storeID, WX_ORDER_APPLY_CANCEL_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
err = SendMsgToStore(storeID, WX_ORDER_APPLY_CANCEL_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
netprinter.NofityOrderMsg(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromOrder(order), order.VendorOrderID, title)
return err
}
@@ -408,7 +411,8 @@ func NotifyOrderChanged(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
err = SendMsgToStore(storeID, WX_ORDER_CHANGE_INFO_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
//err = SendMsgToStore(storeID, WX_ORDER_CHANGE_INFO_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
err = SendMsgToStore(storeID, WX_ORDER_CHANGE_INFO_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
netprinter.NofityOrderMsg(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromOrder(order), order.VendorOrderID, title)
return err
}
@@ -466,7 +470,8 @@ func NotifyOrderCanceled(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
err = SendMsgToStore(storeID, WX_ORDER_ORDER_CANCELED_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
//err = SendMsgToStore(storeID, WX_ORDER_ORDER_CANCELED_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
err = SendMsgToStore(storeID, WX_ORDER_ORDER_CANCELED_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
netprinter.NofityOrderMsg(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromOrder(order), order.VendorOrderID, title)
return err
}
@@ -720,7 +725,7 @@ func NotifyAfsOrderStatus(afsOrder *model.AfsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromAfsOrder(afsOrder)
err = SendMsgToStore(storeID, templateID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
err = SendMsgToStore(storeID, templateID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
netprinter.NofityOrderMsg(jxcontext.AdminCtx, jxutils.GetSaleStoreIDFromAfsOrder(afsOrder), afsOrder.VendorOrderID, comment)
return err
}
@@ -930,7 +935,7 @@ func NotifyAdjustOrder(order *model.GoodsOrder) (err error) {
},
}
storeID := jxutils.GetSaleStoreIDFromOrder(order)
return SendMsgToStore(storeID, WX_ADJUSTORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?jxStoreId=%v", storeID), data)
return SendMsgToStore(storeID, WX_ADJUSTORDER_TEMPLATE_ID, globals.WxBackstageHost+fmt.Sprintf("%s%d", WX_TO_ORDER_PAGE_URL, storeID), WX_MINI_TO_ORDER_PAGE_URL, data)
}
func SendUserMessage(ctx *jxcontext.Context, title, content string, userIDs []string, isAsync, isContinueWhenError bool) (hint string, err error) {

View File

@@ -0,0 +1,39 @@
package controllers
import (
"github.com/astaxie/beego/server/web"
)
type KnowController struct {
web.Controller
}
// @Title 查询知识条目
// @Description 查询知识条目
// @Param token header string true "认证token"
// @Param keyword query string false "关键字"
// @Param offset query int false "门店列表起始序号以0开始缺省为0"
// @Param pageSize query int false "门店列表页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetKnowledgeDepot [get]
func (c *KnowController) GetKnowledgeDepot() {
c.callGetKnowledgeDepot(func(params *tKnowGetKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
return retVal, "", err
})
}
// @Title 更新知识条目
// @Description 更新知识条目
// @Param token header string true "认证token"
// @Param id formData int true "id"
// @Param content formData string false "内容"
// @Param isDel formData bool true "是否是删除"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateKnowledgeDepot [post]
func (c *KnowController) UpdateKnowledgeDepot() {
c.callUpdateKnowledgeDepot(func(params *tKnowUpdateKnowledgeDepotParams) (retVal interface{}, errCode string, err error) {
return retVal, "", err
})
}

View File

@@ -146,6 +146,11 @@ func init() {
&controllers.PowerController{},
),
),
web.NSNamespace("/know",
web.NSInclude(
&controllers.KnowController{},
),
),
)
web.AddNamespace(ns)