diff --git a/business/jxutils/weixinmsg/weixinmsg.go b/business/jxutils/weixinmsg/weixinmsg.go index 0d97ed626..43d139aa4 100644 --- a/business/jxutils/weixinmsg/weixinmsg.go +++ b/business/jxutils/weixinmsg/weixinmsg.go @@ -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) { diff --git a/controllers/knowledge_controller.go b/controllers/knowledge_controller.go new file mode 100644 index 000000000..91a0dc88b --- /dev/null +++ b/controllers/knowledge_controller.go @@ -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 + }) +} diff --git a/routers/router.go b/routers/router.go index dc6ecbe45..c07d26795 100644 --- a/routers/router.go +++ b/routers/router.go @@ -146,6 +146,11 @@ func init() { &controllers.PowerController{}, ), ), + web.NSNamespace("/know", + web.NSInclude( + &controllers.KnowController{}, + ), + ), ) web.AddNamespace(ns)