解决冲突

This commit is contained in:
苏尹岚
2020-08-18 10:47:02 +08:00
3 changed files with 18 additions and 6 deletions

View File

@@ -736,6 +736,7 @@ func (s *DefScheduler) createWaybillOn3rdProviders(savedOrderInfo *WatchOrderInf
// if order.VendorID == model.VendorIDJX {
// excludeVendorIDs = append(excludeVendorIDs, model.VendorIDMTPS)
// }
if savedOrderInfo != nil {
//TODO 2020-07-21 发单时间要在门店的营业时间内
if savedOrderInfo.storeDetail != nil {

View File

@@ -1367,9 +1367,18 @@ func GetOrderStoreSkusCount(db *DaoDB, storeID, skuID int, fromTime, toTime time
}
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 := `
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
(
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
)c
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
`
sqlParams := []interface{}{
@@ -1391,10 +1402,10 @@ func GetSupplySupportStoreSkus(db *DaoDB, fromDate, toDate time.Time, fromStoreI
fromStoreID,
storeID, utils.DefaultTimeValue,
}
if err = GetRows(db, &orderSkus, sql, sqlParams); err == nil {
return orderSkus, err
if err = GetRows(db, &getSupplySupportStoreSkusResult, sql, sqlParams); err == nil {
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) {

View File

@@ -1857,7 +1857,7 @@ func buildJxOrderInfo(order *model.GoodsOrder, orderSkus []*model.OrderSku) (jxO
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 (
db = dao.GetDB()
)