恢复京东商品库
This commit is contained in:
@@ -2196,3 +2196,21 @@ func writeToExcel(excelTitle []string, dataList interface{}, ctx *jxcontext.Cont
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func RefreshJdDepot(ctx *jxcontext.Context) (err error) {
|
||||
var thingMaps []model.ThingMap
|
||||
sql := `
|
||||
SELECT * FROM thing_map WHERE thing_type = ? AND vendor_id = ? AND vendor_org = ? AND deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{model.ThingTypeSku, model.VendorIDJD, "320406", utils.DefaultTimeValue}
|
||||
err = dao.GetRows(dao.GetDB(), &thingMaps, sql, sqlParams)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(thingMaps) > 0 {
|
||||
for _, v := range thingMaps {
|
||||
_, err = api.JdAPI.RefreshJdDepot(int(v.ThingID))
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -466,3 +466,16 @@ func (c *SkuController) CreateUpcSkuByExcel() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 恢复被删除的京东商品库
|
||||
// @Description
|
||||
// @Param token header string true "认证token"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshJdDepot [post]
|
||||
func (c *SkuController) RefreshJdDepot() {
|
||||
c.callRefreshJdDepot(func(params *tSkuRefreshJdDepotParams) (retVal interface{}, errCode string, err error) {
|
||||
err = cms.RefreshJdDepot(params.Ctx)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user