解决冲突
This commit is contained in:
@@ -736,6 +736,7 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
|
|||||||
// if order.VendorID == model.VendorIDJX {
|
// if order.VendorID == model.VendorIDJX {
|
||||||
// excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS)
|
// excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if savedOrderInfo != nil {
|
if savedOrderInfo != nil {
|
||||||
//TODO 2020-07-21 发单时间要在门店的营业时间内
|
//TODO 2020-07-21 发单时间要在门店的营业时间内
|
||||||
if savedOrderInfo.storeDetail != nil {
|
if savedOrderInfo.storeDetail != nil {
|
||||||
|
|||||||
@@ -1367,9 +1367,18 @@ func GetOrderStoreSkusCount(db *DaoDB, storeID, skuID int, fromTime, toTime time
|
|||||||
}
|
}
|
||||||
return count, err
|
return count, err
|
||||||
}
|
}
|
||||||
func GetSupplySupportStoreSkus(db *DaoDB, fromDate, toDate time.Time, fromStoreID, storeID int, percentage float64) (orderSkus []*model.OrderSku, err error) {
|
|
||||||
|
type GetSupplySupportStoreSkusResult struct {
|
||||||
|
SkuID int `orm:"column(sku_id)" json:"skuID"`
|
||||||
|
Count int `json:"count"`
|
||||||
|
SalePrice int `json:"salePrice"`
|
||||||
|
Stock int `json:"stock"`
|
||||||
|
model.SkuName
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetSupplySupportStoreSkus(db *DaoDB, fromDate, toDate time.Time, fromStoreID, storeID int, percentage float64) (getSupplySupportStoreSkusResult []*GetSupplySupportStoreSkusResult, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT c.sku_id,CEIL(c.count) count,CEIL(c.count) * d.jx_price sale_price
|
SELECT c.sku_id,CEIL(c.count) count,CEIL(c.count) * d.jx_price sale_price, d.stock, f.*
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT a.sku_id,SUM(a.count * ? ) count FROM order_sku a
|
SELECT a.sku_id,SUM(a.count * ? ) count FROM order_sku a
|
||||||
@@ -1381,6 +1390,8 @@ func GetSupplySupportStoreSkus(db *DaoDB, fromDate, toDate time.Time, fromStoreI
|
|||||||
GROUP BY 1
|
GROUP BY 1
|
||||||
)c
|
)c
|
||||||
JOIN store_sku_bind d ON d.store_id = ? AND d.sku_id = c.sku_id AND d.deleted_at = ?
|
JOIN store_sku_bind d ON d.store_id = ? AND d.sku_id = c.sku_id AND d.deleted_at = ?
|
||||||
|
JOIN sku e ON e.id = d.sku_id
|
||||||
|
JOIN sku_name f ON f.id = e.name_id
|
||||||
ORDER BY c.count desc
|
ORDER BY c.count desc
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{
|
sqlParams := []interface{}{
|
||||||
@@ -1391,10 +1402,10 @@ func GetSupplySupportStoreSkus(db *DaoDB, fromDate, toDate time.Time, fromStoreI
|
|||||||
fromStoreID,
|
fromStoreID,
|
||||||
storeID, utils.DefaultTimeValue,
|
storeID, utils.DefaultTimeValue,
|
||||||
}
|
}
|
||||||
if err = GetRows(db, &orderSkus, sql, sqlParams); err == nil {
|
if err = GetRows(db, &getSupplySupportStoreSkusResult, sql, sqlParams); err == nil {
|
||||||
return orderSkus, err
|
return getSupplySupportStoreSkusResult, err
|
||||||
}
|
}
|
||||||
return orderSkus, err
|
return getSupplySupportStoreSkusResult, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPriceDefendOrder(db *DaoDB, storeIDs, skuIDs, issues []int, defendPrice, isBuyNowPrice, isSuccess int) (priceDefendOrders []*model.PriceDefendOrder, err error) {
|
func GetPriceDefendOrder(db *DaoDB, storeIDs, skuIDs, issues []int, defendPrice, isBuyNowPrice, isSuccess int) (priceDefendOrders []*model.PriceDefendOrder, err error) {
|
||||||
|
|||||||
@@ -1857,7 +1857,7 @@ func buildJxOrderInfo(order *model.GoodsOrder, orderSkus []*model.OrderSku) (jxO
|
|||||||
return jxOrder
|
return jxOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetSupplySupportStoreSkus(ctx *jxcontext.Context, fromDate, toDate string, fromStoreID, storeID int, percentage string) (orderSkus []*model.OrderSku, err error) {
|
func GetSupplySupportStoreSkus(ctx *jxcontext.Context, fromDate, toDate string, fromStoreID, storeID int, percentage string) (orderSkus []*dao.GetSupplySupportStoreSkusResult, err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user