Merge branch 'mark' of e.coding.net:rosydev/jx-callback into mark
This commit is contained in:
@@ -249,14 +249,14 @@ func GetComplaintReasons() (complaintReasonList []*dadaapi.ComplaintReason) {
|
|||||||
return complaintReasonList
|
return complaintReasonList
|
||||||
}
|
}
|
||||||
|
|
||||||
func ComplaintRider(ctx *jxcontext.Context, orderID string, vendorID, complaintID int) (err error) {
|
func ComplaintRider(ctx *jxcontext.Context, vendorOrderID string, vendorID, waybillVendorID, complaintID int) (err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
p := partner.GetDeliveryPlatformFromVendorID(vendorID).Handler
|
p := partner.GetDeliveryPlatformFromVendorID(vendorID).Handler
|
||||||
wayBillList, err := dao.GetWayBillByOrderID(db, model.OrderStatusFinished, vendorID, orderID)
|
wayBillList, err := dao.GetWayBillByOrderID(db, model.OrderStatusFinished, vendorID, waybillVendorID, vendorOrderID)
|
||||||
if err == nil && len(wayBillList) > 0 {
|
if err == nil && len(wayBillList) > 0 {
|
||||||
err = p.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
|
err = p.ComplaintRider(wayBillList[0], complaintID, complaintReasonsMap[complaintID])
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("未查询到到相关订单,订单状态要求必须是完成!订单号:[%v] ,厂商:[%v]", orderID, vendorID)
|
return fmt.Errorf("未查询到到相关订单,订单状态要求必须是完成!订单号:[%v] ,厂商:[%v]", vendorOrderID, waybillVendorID)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2548,13 +2548,13 @@ func StoreStatus2Chinese(status int) (str string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs, vendorIDs []int, fromScore, toScore, sort, directSort, secKillSort int, snapDate string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
func GetStorePriceScore(ctx *jxcontext.Context, storeIDs, vendorIDs []int, fromScore, toScore, sort int, snapDate string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||||
var snapDateParam time.Time
|
var snapDateParam time.Time
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if snapDate != "" {
|
if snapDate != "" {
|
||||||
snapDateParam = utils.Str2Time(snapDate)
|
snapDateParam = utils.Str2Time(snapDate)
|
||||||
}
|
}
|
||||||
storePriceScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, vendorIDs, fromScore, toScore, sort, directSort, secKillSort, snapDateParam, offset, pageSize)
|
storePriceScore, totalCount, err := dao.GetStorePriceScore(db, storeIDs, vendorIDs, fromScore, toScore, sort, snapDateParam, offset, pageSize)
|
||||||
pagedInfo = &model.PagedInfo{
|
pagedInfo = &model.PagedInfo{
|
||||||
Data: storePriceScore,
|
Data: storePriceScore,
|
||||||
TotalCount: totalCount,
|
TotalCount: totalCount,
|
||||||
@@ -2589,6 +2589,7 @@ func CreateStorePriceScore(ctx *jxcontext.Context) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Commit(db)
|
dao.Commit(db)
|
||||||
|
globals.SugarLogger.Debugf("CreateStorePriceScore")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
@@ -76,6 +78,7 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int) (err e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Commit(db)
|
dao.Commit(db)
|
||||||
|
globals.SugarLogger.Debugf("CreatePriceRefer")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1028,14 +1028,18 @@ func LoadPendingOrders(db *DaoDB, orderCreatedAfter time.Time, beforStatus int)
|
|||||||
return orderList, err
|
return orderList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetWayBillByOrderID(db *DaoDB, orderStatus, waybillVendorID int, vendorOrderID string) (wayBillList []*model.Waybill, err error) {
|
func GetWayBillByOrderID(db *DaoDB, orderStatus, vendorID, waybillVendorID int, vendorOrderID string) (wayBillList []*model.Waybill, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT b.*
|
SELECT b.*
|
||||||
FROM goods_order a
|
FROM goods_order a
|
||||||
LEFT JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id
|
JOIN waybill b ON IF(a.waybill_vendor_id = -1,a.vendor_order_id,a.vendor_waybill_id) = b.vendor_waybill_id AND b.vendor_id = a.vendor_id
|
||||||
WHERE a.vendor_order_id = ?
|
WHERE a.vendor_order_id = ?
|
||||||
|
AND a.vendor_id = ?
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{vendorOrderID}
|
sqlParams := []interface{}{
|
||||||
|
vendorOrderID,
|
||||||
|
vendorID,
|
||||||
|
}
|
||||||
if orderStatus > 0 {
|
if orderStatus > 0 {
|
||||||
sql += ` AND a.status = ?`
|
sql += ` AND a.status = ?`
|
||||||
sqlParams = append(sqlParams, orderStatus)
|
sqlParams = append(sqlParams, orderStatus)
|
||||||
|
|||||||
@@ -489,9 +489,9 @@ func GetStoreMapsListWithoutDisabled(db *DaoDB, vendorIDs []int, status int) (st
|
|||||||
return storeMapList, err
|
return storeMapList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStorePriceScore(db *DaoDB, storeIDs, vendorIDs []int, fromScore, toScore, sort, directSort, secKillSort int, snapDate time.Time, offset, pageSize int) (StorePriceScore []*StorePriceScore, totalCount int, err error) {
|
func GetStorePriceScore(db *DaoDB, storeIDs, vendorIDs []int, fromScore, toScore, sort int, snapDate time.Time, offset, pageSize int) (StorePriceScore []*StorePriceScore, totalCount int, err error) {
|
||||||
sql := `
|
sql := `
|
||||||
SELECT SQL_CALC_FOUND_ROWS a.store_id,score store_score,e.name city_name,b.name store_name
|
SELECT SQL_CALC_FOUND_ROWS a.store_id, score store_score, e.name city_name, b.name store_name, t1.direct_down_count, t1.sec_kill_count
|
||||||
FROM store_price_score_snapshot a
|
FROM store_price_score_snapshot a
|
||||||
JOIN store b ON b.id = a.store_id
|
JOIN store b ON b.id = a.store_id
|
||||||
JOIN place e ON e.code = b.city_code
|
JOIN place e ON e.code = b.city_code
|
||||||
@@ -533,19 +533,17 @@ func GetStorePriceScore(db *DaoDB, storeIDs, vendorIDs []int, fromScore, toScore
|
|||||||
sql += " AND a.snapshot_at = ?"
|
sql += " AND a.snapshot_at = ?"
|
||||||
sqlParams = append(sqlParams, snapDate)
|
sqlParams = append(sqlParams, snapDate)
|
||||||
}
|
}
|
||||||
if sort == 0 {
|
if sort == 1 {
|
||||||
sql += " ORDER BY a.score"
|
sql += " ORDER BY a.score"
|
||||||
} else if sort == 1 {
|
} else if sort == -1 {
|
||||||
sql += " ORDER BY a.score DESC"
|
sql += " ORDER BY a.score DESC"
|
||||||
}
|
} else if sort == 2 {
|
||||||
if directSort == 0 {
|
|
||||||
sql += " ORDER BY t1.direct_down_count"
|
sql += " ORDER BY t1.direct_down_count"
|
||||||
} else if directSort == 1 {
|
} else if sort == -2 {
|
||||||
sql += " ORDER BY t1.direct_down_count DESC"
|
sql += " ORDER BY t1.direct_down_count DESC"
|
||||||
}
|
} else if sort == 3 {
|
||||||
if secKillSort == 0 {
|
|
||||||
sql += " ORDER BY t1.sec_kill_count"
|
sql += " ORDER BY t1.sec_kill_count"
|
||||||
} else if secKillSort == 1 {
|
} else if sort == -3 {
|
||||||
sql += " ORDER BY t1.sec_kill_count DESC"
|
sql += " ORDER BY t1.sec_kill_count DESC"
|
||||||
}
|
}
|
||||||
sql += " LIMIT ? OFFSET ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
|
|||||||
@@ -593,9 +593,7 @@ func (c *StoreController) GetVendorStoreInfo() {
|
|||||||
// @Param snapDate formData string true "时间,默认前一天(格式2006-01-02"
|
// @Param snapDate formData string true "时间,默认前一天(格式2006-01-02"
|
||||||
// @Param fromScore formData int false "分数范围开始 默认0"
|
// @Param fromScore formData int false "分数范围开始 默认0"
|
||||||
// @Param toScore formData int false "分数范围结束 默认100"
|
// @Param toScore formData int false "分数范围结束 默认100"
|
||||||
// @Param sort formData int false "分数排序,默认降序,0为降序,1为升序,-1为忽略"
|
// @Param sort formData int false "分数排序,-1降序,-升序 ,直降排序,-2降序,2升序,秒杀排序,-3降序,3升序"
|
||||||
// @Param directSort formData int false "直降排序,默认降序,0为降序,1为升序,-1为忽略"
|
|
||||||
// @Param secKillSort formData int false "秒杀排序,默认降序,0为降序,1为升序,-1为忽略"
|
|
||||||
// @Param offset formData int false "门店列表起始序号(以0开始,缺省为0)"
|
// @Param offset formData int false "门店列表起始序号(以0开始,缺省为0)"
|
||||||
// @Param pageSize formData int false "门店列表页大小(缺省为50,-1表示全部)"
|
// @Param pageSize formData int false "门店列表页大小(缺省为50,-1表示全部)"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
@@ -605,7 +603,7 @@ func (c *StoreController) GetStorePriceScore() {
|
|||||||
var storeIDList, vendorIDList []int
|
var storeIDList, vendorIDList []int
|
||||||
c.callGetStorePriceScore(func(params *tStoreGetStorePriceScoreParams) (retVal interface{}, errCode string, err error) {
|
c.callGetStorePriceScore(func(params *tStoreGetStorePriceScoreParams) (retVal interface{}, errCode string, err error) {
|
||||||
if jxutils.Strings2Objs(params.StoreIDs, &storeIDList, params.VendorIDs, &vendorIDList); err == nil {
|
if jxutils.Strings2Objs(params.StoreIDs, &storeIDList, params.VendorIDs, &vendorIDList); err == nil {
|
||||||
retVal, err = cms.GetStorePriceScore(params.Ctx, storeIDList, vendorIDList, params.FromScore, params.ToScore, params.Sort, params.DirectSort, params.SecKillSort, params.SnapDate, params.Offset, params.PageSize)
|
retVal, err = cms.GetStorePriceScore(params.Ctx, storeIDList, vendorIDList, params.FromScore, params.ToScore, params.Sort, params.SnapDate, params.Offset, params.PageSize)
|
||||||
}
|
}
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -896,15 +896,16 @@ func (c *OrderController) GetComplaintReasons() {
|
|||||||
// @Title 投诉骑手(三方运送)
|
// @Title 投诉骑手(三方运送)
|
||||||
// @Description 投诉骑手(三方运送)
|
// @Description 投诉骑手(三方运送)
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param orderID formData string true "订单号"
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
// @Param vendorID formData int true "平台厂商ID"
|
// @Param vendorID formData int true "订单所属厂商ID"
|
||||||
|
// @Param waybillVendorID formData int true "运单所属厂商ID"
|
||||||
// @Param complaintID formData int true "投诉原因ID"
|
// @Param complaintID formData int true "投诉原因ID"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /ComplaintRider [post]
|
// @router /ComplaintRider [post]
|
||||||
func (c *OrderController) ComplaintRider() {
|
func (c *OrderController) ComplaintRider() {
|
||||||
c.callComplaintRider(func(params *tOrderComplaintRiderParams) (retVal interface{}, errCode string, err error) {
|
c.callComplaintRider(func(params *tOrderComplaintRiderParams) (retVal interface{}, errCode string, err error) {
|
||||||
err = orderman.ComplaintRider(params.Ctx, params.OrderID, params.VendorID, params.ComplaintID)
|
err = orderman.ComplaintRider(params.Ctx, params.VendorOrderID, params.VendorID, params.WaybillVendorID, params.ComplaintID)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user