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("订单未完成支付,无法退款(刷新订单状态/联系管理员)")