1
This commit is contained in:
@@ -208,6 +208,14 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
|
||||
order.TotalShopMoney = order.TotalShopMoney + jxutils.StandardPrice2Int(utils.Str2Float64(rd.RefundPartialEstimateCharge.SettleAmount))
|
||||
}
|
||||
}
|
||||
|
||||
orderSkuShopPriceList := make(map[int]int64, 0)
|
||||
orderSkuEarningPriceList := make(map[int]int64, 0)
|
||||
for _, os := range order.Skus {
|
||||
orderSkuShopPriceList[os.SkuID] = os.ShopPrice
|
||||
orderSkuEarningPriceList[os.SkuID] = os.EarningPrice
|
||||
}
|
||||
|
||||
switch order.EarningType {
|
||||
case model.EarningTypePoints: // 扣点
|
||||
//更新订单new_earning_price
|
||||
@@ -221,15 +229,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
|
||||
order.NewEarningPrice = order.TotalShopMoney*int64(100-order.OrderPayPercentage/2)/int64(100) - waybill.DesiredFee
|
||||
}
|
||||
}
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
|
||||
case model.EarningTypeQuote: // 报价
|
||||
orderSkuShopPriceList := make(map[int]int64, 0)
|
||||
orderSkuEarningPriceList := make(map[int]int64, 0)
|
||||
for _, os := range order.Skus {
|
||||
orderSkuShopPriceList[os.SkuID] = os.ShopPrice
|
||||
orderSkuEarningPriceList[os.SkuID] = os.EarningPrice
|
||||
}
|
||||
|
||||
for _, rd := range refundDetail {
|
||||
for _, rdw := range rd.WmAppRetailForOrderPartRefundList {
|
||||
switch rd.RefundType {
|
||||
@@ -250,7 +250,7 @@ func (c *PurchaseHandler) onAfsOrderMsg(msg *mtwmapi.CallbackMsg) (retVal *mtwma
|
||||
order.NewEarningPrice = order.EarningPrice
|
||||
}
|
||||
}
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice")
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "ShopPrice", "EarningPrice", "NewEarningPrice")
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("美团平台售后获取退款金额信息错误: = %v", err)
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团平台售后获取退款金额信息错误", fmt.Sprintf("orderid := %d,%s,%v", model.VendorIDMTWM, order.VendorOrderID, err))
|
||||
|
||||
7
controllers/lakala.go
Normal file
7
controllers/lakala.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package controllers
|
||||
|
||||
import "github.com/astaxie/beego/server/web"
|
||||
|
||||
type LaKaLaController struct {
|
||||
web.Controller
|
||||
}
|
||||
44
controllers/lakala_callback.go
Normal file
44
controllers/lakala_callback.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
type LaKaLaCallbackController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// SeparateMsg 开通分账业务回调
|
||||
func (c *LaKaLaCallbackController) SeparateMsg() {
|
||||
body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||
if err != nil {
|
||||
c.Data["json"] = tao_vegetable.CallBackResultInfo(err)
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
separate := &SeparateCallback{}
|
||||
if err = json.Unmarshal(body, &separate); err != nil {
|
||||
c.Data["json"] = tao_vegetable.CallBackResultInfo(err)
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
// todo
|
||||
}
|
||||
|
||||
type SeparateCallback struct {
|
||||
ApplyId int64 `json:"applyId"`
|
||||
MerCupNo string `json:"merCupNo"`
|
||||
RetUrl string `json:"retUrl"`
|
||||
EntrustFileName string `json:"entrustFileName"`
|
||||
AuditStatus string `json:"auditStatus"`
|
||||
MerInnerNo string `json:"merInnerNo"`
|
||||
Remark string `json:"remark"`
|
||||
AuditStatusText string `json:"auditStatusText"`
|
||||
UploadAttachType string `json:"uploadAttachType"`
|
||||
EntrustFilePath string `json:"entrustFilePath"`
|
||||
}
|
||||
@@ -4682,6 +4682,16 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
// lakala图片上传
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:LaKaLaController"],
|
||||
web.ControllerComments{
|
||||
Method: "UploadImg",
|
||||
Router: `/UploadImg`,
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
//web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:FnController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:FnController"],
|
||||
// web.ControllerComments{
|
||||
// Method: "FnStore",
|
||||
|
||||
@@ -160,6 +160,11 @@ func init() {
|
||||
&controllers.SessionController{},
|
||||
),
|
||||
),
|
||||
web.NSNamespace("/lakala",
|
||||
web.NSInclude(
|
||||
&controllers.LaKaLaController{},
|
||||
),
|
||||
),
|
||||
web.NSNamespace("/version",
|
||||
web.NSInclude(
|
||||
&controllers.VersionController{},
|
||||
@@ -201,6 +206,8 @@ func init() {
|
||||
web.AutoRouter(&controllers.KuaiShouController{}) // 快手支付回调
|
||||
web.AutoRouter(&controllers.TaoBaoVegetableController{}) // 淘菜菜回调
|
||||
//web.AutoRouter(&controllers.IMController{}) //im
|
||||
web.AutoRouter(&controllers.LaKaLaCallbackController{}) // 拉卡拉回调
|
||||
|
||||
// 如下都是用于检测存活的空接口
|
||||
web.Any("/", func(ctx *beecontext.Context) {
|
||||
ctx.WriteString("pong\n")
|
||||
|
||||
Reference in New Issue
Block a user