This commit is contained in:
邹宗楠
2026-07-06 10:56:17 +08:00
parent 5bbc71a47f
commit 7e0cd4a82c
20 changed files with 57544 additions and 57232 deletions

View File

@@ -2,8 +2,11 @@ package controllers
import (
"encoding/json"
"fmt"
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
@@ -156,7 +159,6 @@ func (c *MtwmController) Invoice() {
data := &mtwmapi.InvoiceCallback{}
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
// 消息通知
if err := mtwm.InvoiceCallback(data); err != nil {
globals.SugarLogger.Errorf("mtwm Invoice err := %v", err)
@@ -217,3 +219,75 @@ func pushMTWMOrder2GY(value url.Values, msgType string, serverType string) *mtwm
return &result
}
// ImgCheckOutCallback 针对返图订单,当实拍审核失败时,通过该消息通知三方重新修改实拍
// http://callback.jxc4.com//mtwm/imgCheckOutCallback
func (c *MtwmController) ImgCheckOutCallback() {
data, err := ioutil.ReadAll(c.Ctx.Request.Body)
if err != nil {
c.Data["json"] = map[string]interface{}{"result_code": -1}
c.ServeJSON()
return
}
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团返图审核通知", fmt.Sprintf("美团返图审核:%s", string(data)))
globals.SugarLogger.Debugf("-----data := %s", string(data))
callback := &CheckBackParam{}
if err = json.Unmarshal(data, callback); err != nil {
globals.SugarLogger.Debugf("-----data := %s", string(data))
c.Data["json"] = map[string]interface{}{"result_code": -1}
c.ServeJSON()
return
}
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(callback, false))
c.Data["json"] = map[string]interface{}{"result_code": 1}
c.ServeJSON()
}
type CheckBackParam struct {
OrderViewId string `json:"order_view_id"` // 订单号,商家可根据订单号查询订单当前的详细信息。
AuditStatus int `json:"audit_status"` // 审核状态2:审核失败 3:审核通过
RiskInfoList []struct {
RiskInfo int `json:"risk_info"` // 1.含违规信息 2.重复上传 3.图片模糊
RiskDesc string `json:"risk_desc"` // 含违规信息
Url string `json:"url"` // 审核失败的图片url注意为美团侧转换后的url
} `json:"risk_info_list"`
}
// OrderImgStatusCallback 针对强制返图订单,当订单返图就绪满足发配条件时,通过该消息通知三方是否可发配
// http://callback.jxc4.com//mtwm/orderImgStatusCallback
func (c *MtwmController) OrderImgStatusCallback() {
data, err := ioutil.ReadAll(c.Ctx.Request.Body)
if err != nil {
c.Data["json"] = map[string]interface{}{"result_code": -1}
c.ServeJSON()
return
}
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "美团返图发货通知", fmt.Sprintf("美团发货审核:%s", string(data)))
globals.SugarLogger.Debugf("-----data := %s", string(data))
callback := &CanSendDelivery{}
if err = json.Unmarshal(data, callback); err != nil {
globals.SugarLogger.Debugf("-----data := %s", string(data))
c.Data["json"] = map[string]interface{}{"result_code": -1}
c.ServeJSON()
return
}
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(callback, false))
c.Data["json"] = map[string]interface{}{"result_code": 1}
c.ServeJSON()
}
type CanSendDelivery struct {
OrderViewId string `json:"order_view_id"` // 订单号,商家可根据订单号查询订单当前的详细信息。
SendTime string `json:"send_time"` // 消息发送时间,秒级时间戳
EnableDispatch bool `json:"enable_dispatch"` // true-可发配 false-不可发配
DispatchConditionDetail []struct {
ConditionType int `json:"condition_type"` // 发配条件限制类型 1-强制返图
EnableDispatch bool `json:"enable_dispatch"` // 某个发配条件限制类型是否已经满足
} // 发货条件明细
}