1
This commit is contained in:
@@ -1493,13 +1493,11 @@ func (c *OrderManager) AmendMissingOrders(ctx *jxcontext.Context, vendorIDs []in
|
||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(pair.VendorID); handler != nil && err3 == nil && store != nil {
|
||||
order, err2 := handler.GetOrder(pair.VendorOrgCode, pair.VendorOrderID, pair.VendorStoreID)
|
||||
if err = err2; err == nil {
|
||||
if store != nil && err3 == nil {
|
||||
isDuplicated, err2 := c.SaveOrder(order, false, dao.GetDB())
|
||||
if err2 == nil && !isDuplicated {
|
||||
retVal = []int{1}
|
||||
if order.Status == model.OrderStatusNew {
|
||||
err = handler.AcceptOrRefuseOrder(order, true, ctx.GetUserName())
|
||||
}
|
||||
isDuplicated, err2 := c.SaveOrder(order, false, dao.GetDB())
|
||||
if err2 == nil && !isDuplicated {
|
||||
retVal = []int{1}
|
||||
if order.Status == model.OrderStatusNew {
|
||||
err = handler.AcceptOrRefuseOrder(order, true, ctx.GetUserName())
|
||||
}
|
||||
}
|
||||
} else if pair.VendorID == model.VendorIDMTWM {
|
||||
|
||||
@@ -283,7 +283,7 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct bool, keyword string, categoryID, status, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo2, err error) {
|
||||
func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct bool, keyword string, categoryID, status, offset, pageSize int, stock, locationCode bool) (skuNamesInfo *dao.StoreSkuNamesInfo2, err error) {
|
||||
var (
|
||||
sqlParams []interface{}
|
||||
db = dao.GetDB()
|
||||
@@ -375,10 +375,18 @@ func GetStoresSkusForStore(ctx *jxcontext.Context, storeID int, isFocus, isAct b
|
||||
sql += " AND c.sku_id IS NULL AND (a.status = ? AND b.status = ?)"
|
||||
sqlParams = append(sqlParams, model.SkuStatusNormal, model.SkuStatusNormal)
|
||||
}
|
||||
if stock {
|
||||
sql += " AND c.stock = 0"
|
||||
}
|
||||
if locationCode {
|
||||
sql += " AND c.location_code = ''"
|
||||
}
|
||||
|
||||
if keyword != "" {
|
||||
sql += " AND a.name LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+keyword+"%")
|
||||
}
|
||||
|
||||
sql += `
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
@@ -1156,8 +1164,6 @@ func GetStoresSkusNew(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []str
|
||||
if isHighPrice || priceType != 0 {
|
||||
sql += " , t4.unit_price DESC LIMIT 99"
|
||||
}
|
||||
globals.SugarLogger.Debugf("-----sql := %s", sql)
|
||||
globals.SugarLogger.Debugf("-----sqlParams := %s", utils.Format4Output(sqlParams, false))
|
||||
var tmpList []*tGetStoresSkusInfo
|
||||
if err = dao.GetRowsTx(txDB, &tmpList, sql, sqlParams...); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
|
||||
@@ -50,7 +50,6 @@ func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int
|
||||
}()
|
||||
for i := 0; i < 2; i++ {
|
||||
localCats, err2 := dao.GetSkusCategories(db, vendorID, storeID, skuIDs, i+1)
|
||||
globals.SugarLogger.Debugf("----------localCats:= %s", utils.Format4Output(localCats, false))
|
||||
if err = err2; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ func (p *PurchaseHandler) ReadStore(ctx *jxcontext.Context, vendorOrgCode, vendo
|
||||
Type: tencent_map.CoordinateChangeTypeBaidu,
|
||||
})
|
||||
if err2 != nil {
|
||||
globals.SugarLogger.Debugf("CoordinateConvert err : %v", err)
|
||||
globals.SugarLogger.Debugf("CoordinateConvert err : %v", err2)
|
||||
}
|
||||
if len(lngAndLat) != 0 {
|
||||
lng = utils.Str2Float64(lngAndLat[0].Lng)
|
||||
|
||||
@@ -1012,6 +1012,8 @@ func (c *StoreSkuController) GetVendorStoreSkus() {
|
||||
// @Param token header string false "认证token"
|
||||
// @Param storeID query int true "门店ID"
|
||||
// @Param isFocus query bool true "是否已关注(认领)"
|
||||
// @Param stock query bool false "库存是否为0"
|
||||
// @Param locationCode query bool false "商品位置是否为空"
|
||||
// @Param keyword query string false "查询关键字(可以为空,为空表示不限制)"
|
||||
// @Param categoryID query int false "商品所属类别ID"
|
||||
// @Param status query int false "查询起始状态(0:不可售,1:可售,-1 全部)"
|
||||
@@ -1023,7 +1025,7 @@ func (c *StoreSkuController) GetVendorStoreSkus() {
|
||||
// @router /GetStoresSkusForStore [get]
|
||||
func (c *StoreSkuController) GetStoresSkusForStore() {
|
||||
c.callGetStoresSkusForStore(func(params *tStoreSkuGetStoresSkusForStoreParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetStoresSkusForStore(params.Ctx, params.StoreID, params.IsFocus, params.IsAct, params.Keyword, params.CategoryID, params.Status, params.Offset, params.PageSize)
|
||||
retVal, err = cms.GetStoresSkusForStore(params.Ctx, params.StoreID, params.IsFocus, params.IsAct, params.Keyword, params.CategoryID, params.Status, params.Offset, params.PageSize, params.Stock, params.LocationCode)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user