This commit is contained in:
邹宗楠
2025-05-06 15:52:04 +08:00
parent 90111dd57e
commit 3e3f909cff
5 changed files with 55 additions and 8 deletions

View File

@@ -943,7 +943,9 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
// jxutils.StandardCoordinate2Int(deliveryAddress.Lng), jxutils.StandardCoordinate2Int(deliveryAddress.Lat),
// model.CoordinateTypeMars, outJxOrder.Weight, checkTime)
//TODO 2020-08-06 配送费固定5元
outJxOrder.FreightPrice = 500
if !IsDeliverySelf {
outJxOrder.FreightPrice = 500
}
// }
//如果是守价的订单,需要查询本期中该用户是否已经守价过,如果守价过就只算一次运费
if jxOrder.OrderType == model.OrderTypeDefendPrice {
@@ -1008,9 +1010,6 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
outJxOrder.FreightPrice = 0
}
}
if IsDeliverySelf {
outJxOrder.FreightPrice = 0
}
}
// B2B门店订单不足一千配送费一百
@@ -1027,10 +1026,6 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
}
}
if IsDeliverySelf {
outJxOrder.FreightPrice = 0
}
if err == nil {
if jxOrder.OrderType == model.OrderTypeNormal {
outJxOrder.TotalPrice = outJxOrder.OrderPrice + outJxOrder.FreightPrice
@@ -1105,6 +1100,11 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
outJxOrder = nil
deliveryAddress = nil
}
if IsDeliverySelf {
outJxOrder.FreightPrice = 0
}
return outJxOrder, deliveryAddress, err
}

View File

@@ -318,6 +318,21 @@ func AddStoreTerm(storeId int, operation string) error {
return api.TLpayAPI.TLAddTerm(param)
}
// QueryStoreTerm 查询设备终端状态
func QueryStoreTerm(storeId int) (string, error) {
storeDetail, err := dao.GetStoreDetail(dao.GetDB(), storeId, model.VendorIDJX, "")
if err != nil {
return "", err
}
param := &tonglianpayapi.AddTermQuery{
Termno: fmt.Sprintf("%d00", storeDetail.ID),
Signtype: tonglianpayapi.EncryptionRsa,
Sign: "",
}
return api.TLpayAPI.TLQueryTerm(param)
}
func checkJxAfsOrder(db *dao.DaoDB, goodsOrder *model.GoodsOrder, vendorOrderId string, skuIds map[int]int) (bool, int, error) {
if goodsOrder.Status != model.OrderStatusFinished {
return false, 0, fmt.Errorf("订单未完成支付,无法退款(刷新订单状态/联系管理员)")

View File

@@ -9,6 +9,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxstore/permission"
"git.rosy.net.cn/jx-callback/business/partner/delivery"
"git.rosy.net.cn/jx-callback/globals"
"strings"
"time"
@@ -550,6 +551,15 @@ func (c *OrderController) StaleIndexInfo() {
return retVal, "", fmt.Errorf("于该用户%s,暂无门店信息", ctx.GetUserName())
}
if params.Ctx.GetUserID() == "68F2F1F41BF211F0A561525400E86DC0" {
globals.SugarLogger.Debugf("---------timeList:= %s,%s", utils.Time2Str(timeList[0]), utils.Time2Str(timeList[1]))
globals.SugarLogger.Debugf("---------timeList:= %s,%s", utils.Time2Str(timeList[0]), utils.Time2Str(timeList[1]))
globals.SugarLogger.Debugf("---------StoreID:= %d", params.StoreID)
globals.SugarLogger.Debugf("---------brandIds:= %s", utils.Format4Output(brandIds, false))
globals.SugarLogger.Debugf("---------vendors:= %s", utils.Format4Output(vendors, false))
globals.SugarLogger.Debugf("---------dataList:= %s", utils.Format4Output(dataList, false))
}
retVal, err = orderman.FixedOrderManager.GetStoresOrderSaleInfo2(params.Ctx, timeList[0], timeList[1], params.StoreID, brandIds, vendors, dataList)
return retVal, "", err
})

View File

@@ -85,6 +85,20 @@ func (c *JxOrderController) TerminalRegister() {
})
}
// @Title 查询门店扫码枪设备状态
// @Description 查询门店扫码枪设备状态
// @Param token header string true "认证token"
// @Param storeId formData int true "京西门店ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TerminalQuery [post]
func (c *JxOrderController) TerminalQuery() {
c.callTerminalQuery(func(params *tJxorderTerminalQueryParams) (retVal interface{}, errCode string, err error) {
retVal, err = localjx.QueryStoreTerm(params.StoreId)
return retVal, errCode, err
})
}
// @Title 到店扫码支付订单退款
// @Description 到店扫码支付订单退款
// @Param token header string true "认证token"

View File

@@ -885,6 +885,14 @@ func init() {
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
web.ControllerComments{
Method: "TerminalQuery",
Router: `/TerminalQuery`,
AllowHTTPMethods: []string{"post"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
web.ControllerComments{
Method: "RefundOnlineOrder",