修改拉卡拉卡分账

This commit is contained in:
邹宗楠
2025-08-05 16:21:26 +08:00
parent cb974f7618
commit 33c5eed1fc
7 changed files with 199 additions and 108 deletions

View File

@@ -22,7 +22,8 @@ import (
)
func pay4OrderByLaKaLa(ctx *jxcontext.Context, order *model.GoodsOrder, payType int, vendorPayType, subAppID, code, source string) (orderPay *model.OrderPay, err error) {
merchantObj, err := dao.GetStoreInfoByMerchantID(dao.GetDB(), "", order.JxStoreID, "", "")
var db = dao.GetDB()
merchantObj, err := dao.GetStoreInfoByMerchantID(db, "", order.JxStoreID, "", "")
if err != nil {
return nil, err
}
@@ -101,9 +102,31 @@ func pay4OrderByLaKaLa(ctx *jxcontext.Context, order *model.GoodsOrder, payType
fields, _ := json.Marshal(result.AccRespFields)
orderPay.CodeURL = utils.LimitUTF8StringLen(string(fields), 3200)
}
separate := &model.LakalaSeparateAmt{
MerchantNo: merchantObj.MerchantNo2,
VendorOrderID: order.VendorOrderID,
StoreId: order.JxStoreID,
CmdType: lakala.SeparateType_SEPATRATE,
Status: "1",
LogNo: result.LogNo,
LogDate: time.Now(),
OutSeparateNo: "",
SeparateNo: "",
CalType: "",
FinishDate: "",
TotalAmt: "",
ActualSeparateAmt: "",
TotalFeeAmt: "",
FinalStatus: "",
DetailData: "",
Remark: "聚合主扫订单",
}
dao.WrapAddIDCULEntity(separate, ctx.GetUserName())
dao.CreateEntity(db, separate)
}
order.VendorOrderID2 = result.LogNo
dao.UpdateEntity(dao.GetDB(), order, "VendorOrderID2")
dao.UpdateEntity(db, order, "VendorOrderID2")
return orderPay, err
}