This commit is contained in:
邹宗楠
2022-12-06 17:35:38 +08:00
parent a1847b2aae
commit f2e7ff0757
5 changed files with 32 additions and 3 deletions

View File

@@ -6102,3 +6102,7 @@ func BatchCreateFreeShipTemplate(relInfo map[string][]tiktok_store.RelInfo, ship
}
return "", nil
}
func GetVendorStoreBind(vendorStoreId string, vendorId int) (string, error) {
return dao.GetCodeAndIDByMeiTuan(vendorStoreId, vendorId)
}

View File

@@ -6642,7 +6642,7 @@ func SyncTiktokMainIdToLocal(ctx *jxcontext.Context, param *tiktok_store.MainSku
func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmapi.SpuData) error {
var params []*mtwmapi.SpuData
for k, v := range preData {
if storeID, err := dao.GetCodeAndIDByMeiTuan(k); err != nil {
if storeID, err := dao.GetCodeAndIDByMeiTuan(k, model.VendorIDMTWM); err != nil {
return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err))
} else {
for _, i := range v {

View File

@@ -1632,7 +1632,7 @@ func InsertIntoFreightTemplate(storeID int, vendorStoreID string, templateID, wa
}
//只获取美团平台的京西storeID
func GetCodeAndIDByMeiTuan(vendorStoreID string) (storeID int, err error) {
err = GetRow(GetDB(), &storeID, "SELECT s.store_id FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, model.VendorIDMTWM)
func GetCodeAndIDByMeiTuan(vendorStoreID string, vendorId int) (storeID int, err error) {
err = GetRow(GetDB(), &storeID, "SELECT s.store_id FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, vendorId)
return storeID, err
}

View File

@@ -1543,3 +1543,18 @@ func (c *StoreController) CreateFreeShipTemplates() {
return retVal, "", err
})
}
// @Title 打印机获取授权账号再京西菜市的绑定关系
// @Description 打印机获取授权账号再京西菜市的绑定关系
// @Param token header string true "认证token"
// @Param vendorStoreId formData string true "平台账号id"
// @Param vendorId formData int true "平台id"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /PrintCheckAccountAuthorization [post]
func (c *StoreController) PrintCheckAccountAuthorization() {
c.callPrintCheckAccountAuthorization(func(params *tStorePrintCheckAccountAuthorizationParams) (interface{}, string, error) {
retVal, err := cms.GetVendorStoreBind(params.VendorStoreId, params.VendorId)
return retVal, "", err
})
}

View File

@@ -2981,6 +2981,16 @@ func init() {
Filters: nil,
Params: nil})
// 打印机管理系统绑定打印机授权时,检查账号是否已经授权过
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
web.ControllerComments{
Method: "PrintCheckAccountAuthorization",
Router: `/PrintCheckAccountAuthorization`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"],
web.ControllerComments{
Method: "BackUpStoreSkuBind",