1
This commit is contained in:
@@ -383,7 +383,7 @@ func GetUserStoresResultMap(userID string) (resultMap map[int]int, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsRoled(ctx *jxcontext.Context) bool {
|
func IsRoled(ctx *jxcontext.Context) bool {
|
||||||
if ctx.GetUserName() != "jxadmin" {
|
if ctx.GetUserName() != "jxadmin" && ctx.GetUserName() != "shifengfix" {
|
||||||
userRole, _ := dao.GetUserRole(dao.GetDB(), []string{ctx.GetUserID()}, nil)
|
userRole, _ := dao.GetUserRole(dao.GetDB(), []string{ctx.GetUserID()}, nil)
|
||||||
for _, v := range userRole {
|
for _, v := range userRole {
|
||||||
if v.RoleID == model.YES {
|
if v.RoleID == model.YES {
|
||||||
|
|||||||
@@ -149,22 +149,23 @@ type GoodsOrder struct {
|
|||||||
OrderFinishedAt time.Time `orm:"type(datetime)" json:"orderFinishedAt"`
|
OrderFinishedAt time.Time `orm:"type(datetime)" json:"orderFinishedAt"`
|
||||||
StatusTime time.Time `orm:"type(datetime)" json:"statusTime"` // last status time
|
StatusTime time.Time `orm:"type(datetime)" json:"statusTime"` // last status time
|
||||||
PickDeadline time.Time `orm:"type(datetime);null" json:"pickDeadline"`
|
PickDeadline time.Time `orm:"type(datetime);null" json:"pickDeadline"`
|
||||||
DeliveryFeeFrom *time.Time `orm:"type(datetime);null" json:"deliveryFeeFrom,omitempty"` // 三方配置费计算的开始基准时间
|
DeliveryFeeFrom *time.Time `orm:"type(datetime);null" json:"deliveryFeeFrom,omitempty"` // 三方配置费计算的开始基准时间
|
||||||
Flag int `json:"flag"` // 非运单调整相关的其它状态
|
Flag int `json:"flag"` // 非运单调整相关的其它状态
|
||||||
InvoiceTitle string `orm:"size(64)" json:"invoiceTitle"` // 发票抬头
|
InvoiceTitle string `orm:"size(64)" json:"invoiceTitle"` // 发票抬头
|
||||||
InvoiceTaxerID string `orm:"size(32);column(invoice_taxer_id)" json:"invoiceTaxerID"` // 发票纳税人识别码
|
InvoiceTaxerID string `orm:"size(32);column(invoice_taxer_id)" json:"invoiceTaxerID"` // 发票纳税人识别码
|
||||||
InvoiceEmail string `orm:"size(64)" json:"invoiceEmail"` // 发票邮箱
|
InvoiceEmail string `orm:"size(64)" json:"invoiceEmail"` // 发票邮箱
|
||||||
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
VendorOrgCode string `orm:"size(64)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||||
FromStoreID int `orm:"column(from_store_id)" json:"fromStoreID"` // 物料配送门店
|
FromStoreID int `orm:"column(from_store_id)" json:"fromStoreID"` // 物料配送门店
|
||||||
EclpOutID string `orm:"column(eclp_out_id)" json:"eclpOutID"` // 物料配送的出库单号
|
EclpOutID string `orm:"column(eclp_out_id)" json:"eclpOutID"` // 物料配送的出库单号
|
||||||
AddressID int64 `orm:"column(address_id)" json:"addressID"` // 配送地址ID
|
AddressID int64 `orm:"column(address_id)" json:"addressID"` // 配送地址ID
|
||||||
EarningType int `json:"earningType"` // 订单结算方式,2为扣点,1为报价
|
EarningType int `json:"earningType"` // 订单结算方式,2为扣点,1为报价
|
||||||
OrderType int `json:"orderType"` // 订单类型,0为普通订单,1为物料订单,2为进货订单
|
OrderType int `json:"orderType"` // 订单类型,0为普通订单,1为物料订单,2为进货订单
|
||||||
OrderPayPercentage int `json:"orderPayPercentage"` // 调价包?
|
OrderPayPercentage int `json:"orderPayPercentage"` // 调价包?
|
||||||
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` // 优惠券IDs(京西商城)
|
CouponIDs string `orm:"column(coupon_ids)" json:"couponIDs"` // 优惠券IDs(京西商城)
|
||||||
NotifyType int `json:"notifyType"` // 0表示没有通知,1表示发的短信,2表示发的语音
|
NotifyType int `json:"notifyType"` // 0表示没有通知,1表示发的短信,2表示发的语音
|
||||||
PhoneAscription string `orm:"column(phone_ascription)" json:"phoneAscription"` // 电话号码归属地,{代表抖音号码归宿地[yes-四川成都]}
|
PhoneAscription string `orm:"column(phone_ascription)" json:"phoneAscription"` // 电话号码归属地,{代表抖音号码归宿地[yes-四川成都]}
|
||||||
PackagePrice int `orm:"size(8);column(package_price);default(0)" json:"packagePrice"` // 门店包装袋金额
|
PackagePrice int `orm:"size(8);column(package_price);default(0)" json:"packagePrice"` // 门店包装袋金额
|
||||||
|
ForceRequirePicture int `orm:"size(4);column(force_require_picture);default(0)" json:"forceRequirePicture"` // 是否强制返图1需要0不需要
|
||||||
// 以下只是用于传递数据
|
// 以下只是用于传递数据
|
||||||
OriginalData string `orm:"-" json:"-"`
|
OriginalData string `orm:"-" json:"-"`
|
||||||
Skus []*OrderSku `orm:"-" json:"-"`
|
Skus []*OrderSku `orm:"-" json:"-"`
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ var (
|
|||||||
102114997: true,
|
102114997: true,
|
||||||
102641826: true,
|
102641826: true,
|
||||||
102651220: true,
|
102651220: true,
|
||||||
|
156976863: true,
|
||||||
// 果园啊
|
// 果园啊
|
||||||
6572945: true,
|
6572945: true,
|
||||||
6772759: true,
|
6772759: true,
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ type IPurchasePlatformStoreSkuHandler interface {
|
|||||||
// UploadInvoice 发票回复
|
// UploadInvoice 发票回复
|
||||||
UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error)
|
UploadInvoice(param *model.InvoiceMsg, base64 string) ([]string, []string, error)
|
||||||
// UploadPickingImg 上传订单拣货图片
|
// UploadPickingImg 上传订单拣货图片
|
||||||
UploadPickingImg(order *model.GoodsOrder, imgList []string) error
|
UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type ISingleStoreStoreSkuHandler interface {
|
type ISingleStoreStoreSkuHandler interface {
|
||||||
|
|||||||
@@ -1095,6 +1095,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -361,6 +361,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg) ([]string, []st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -736,6 +736,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,6 +350,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg) ([]string, []st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,6 +188,13 @@ func (p *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
|
|||||||
if openUID > 0 {
|
if openUID > 0 {
|
||||||
order.VendorUserID = utils.Int64ToStr(openUID)
|
order.VendorUserID = utils.Int64ToStr(openUID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当此数值为1时需要强制返图
|
||||||
|
if utils.MustInterface2Int64(result["force_require_picture"]) == 1 {
|
||||||
|
order.ForceRequirePicture = 1
|
||||||
|
} else {
|
||||||
|
order.ForceRequirePicture = 0
|
||||||
|
}
|
||||||
// 不设置最晚拣货时间,以缺省值为准
|
// 不设置最晚拣货时间,以缺省值为准
|
||||||
// if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
// if utils.IsTimeZero(order.PickDeadline) && !utils.IsTimeZero(order.StatusTime) {
|
||||||
// order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 美团外卖要求在5分钟内拣货,不然订单会被取消
|
// order.PickDeadline = order.StatusTime.Add(pickupOrderDelay) // 美团外卖要求在5分钟内拣货,不然订单会被取消
|
||||||
@@ -1077,6 +1084,11 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), order.VendorStoreID).UploadMediaToOrder(order.VendorOrderID, imgList)
|
return getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), order.VendorStoreID).UploadMediaToOrder(order.VendorOrderID, imgList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetVendorDetail(order *model.GoodsOrder) (map[string]interface{}, error) {
|
||||||
|
result, err := getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), order.VendorStoreID).OrderGetOrderDetail(utils.Str2Int64(order.VendorOrderID), true)
|
||||||
|
return result, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -1005,6 +1005,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1123,6 +1123,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,6 +324,6 @@ func (c *PurchaseHandler) ApplyCompensationOrder(order *model.GoodsOrder) (strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,6 @@ func (c *PurchaseHandler) UploadInvoice(param *model.InvoiceMsg, base64 string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadPickingImg 上传拣货图片
|
// UploadPickingImg 上传拣货图片
|
||||||
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList []string) error {
|
func (c *PurchaseHandler) UploadPickingImg(order *model.GoodsOrder, imgList interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner"
|
"git.rosy.net.cn/jx-callback/business/partner"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -595,17 +597,24 @@ func (c *JxOrderController) CreateBrandOrder() {
|
|||||||
// @Description 上传订单拣货图片
|
// @Description 上传订单拣货图片
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param orderId formData string true "订单ID"
|
// @Param orderId formData string true "订单ID"
|
||||||
// @Param vendorID formData int false "平台ID"
|
// @Param vendorID formData int true "平台ID"
|
||||||
// @Param imgs formData string true "图片url,图片大小限制为10M,长宽比例需要限制为4:3[1,3,2]"
|
// @Param mediaList formData string true "返图参数"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /UploadOrderPicking [post]
|
// @router /UploadOrderPicking [post]
|
||||||
func (c *JxOrderController) UploadOrderPicking() {
|
func (c *JxOrderController) UploadOrderPicking() {
|
||||||
c.callUploadOrderPicking(func(params *tJxorderUploadOrderPickingParams) (retVal interface{}, errCode string, err error) {
|
c.callUploadOrderPicking(func(params *tJxorderUploadOrderPickingParams) (retVal interface{}, errCode string, err error) {
|
||||||
var imgList []string
|
var mediaList = make([]*mtwmapi.UploadMedia, 0, 0)
|
||||||
if err = jxutils.Strings2Objs(params.Imgs, &imgList); err != nil {
|
|
||||||
return retVal, "", err
|
if err = json.Unmarshal([]byte(params.MediaList), &mediaList); err != nil {
|
||||||
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var imgList []string
|
||||||
|
for _, v := range mediaList {
|
||||||
|
imgList = append(imgList, v.Url)
|
||||||
|
}
|
||||||
|
|
||||||
localOrder, err := partner.CurOrderManager.LoadOrder(params.OrderId, params.VendorID)
|
localOrder, err := partner.CurOrderManager.LoadOrder(params.OrderId, params.VendorID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
@@ -614,12 +623,12 @@ func (c *JxOrderController) UploadOrderPicking() {
|
|||||||
if handler == nil {
|
if handler == nil {
|
||||||
return retVal, "", fmt.Errorf("不存在的厂商ID:%d", params.VendorID)
|
return retVal, "", fmt.Errorf("不存在的厂商ID:%d", params.VendorID)
|
||||||
}
|
}
|
||||||
err = handler.UploadPickingImg(localOrder, imgList)
|
err = handler.UploadPickingImg(localOrder, mediaList)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
originalOrder := &model.GoodsOrderImg{
|
originalOrder := &model.GoodsOrderImg{
|
||||||
VendorOrderID: localOrder.VendorOrderID,
|
VendorOrderID: localOrder.VendorOrderID,
|
||||||
VendorID: localOrder.VendorID,
|
VendorID: localOrder.VendorID,
|
||||||
OriginalData: params.Imgs,
|
OriginalData: string(utils.MustMarshal(imgList)),
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
}
|
}
|
||||||
dao.CreateEntity(dao.GetDB(), originalOrder)
|
dao.CreateEntity(dao.GetDB(), originalOrder)
|
||||||
@@ -633,3 +642,22 @@ func (c *JxOrderController) UploadOrderPicking() {
|
|||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 获取订单返图详情
|
||||||
|
// @Description 获取订单返图详情
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param orderId formData string true "订单ID"
|
||||||
|
// @Param vendorID formData int false "平台ID"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /GetOrderRequirePicture [get]
|
||||||
|
func (c *JxOrderController) GetOrderRequirePicture() {
|
||||||
|
c.callGetOrderRequirePicture(func(params *tJxorderGetOrderRequirePictureParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
localOrder, err := partner.CurOrderManager.LoadOrder(params.OrderId, params.VendorID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, "", err
|
||||||
|
}
|
||||||
|
retVal, err = mtwm.GetVendorDetail(localOrder)
|
||||||
|
return retVal, errCode, err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ package controllers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"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"
|
||||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||||
@@ -156,7 +159,6 @@ func (c *MtwmController) Invoice() {
|
|||||||
|
|
||||||
data := &mtwmapi.InvoiceCallback{}
|
data := &mtwmapi.InvoiceCallback{}
|
||||||
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
|
utils.Map2StructByJson(utils.URLValues2Map(msg.FormData), data, false)
|
||||||
|
|
||||||
// 消息通知
|
// 消息通知
|
||||||
if err := mtwm.InvoiceCallback(data); err != nil {
|
if err := mtwm.InvoiceCallback(data); err != nil {
|
||||||
globals.SugarLogger.Errorf("mtwm Invoice err := %v", err)
|
globals.SugarLogger.Errorf("mtwm Invoice err := %v", err)
|
||||||
@@ -217,3 +219,75 @@ func pushMTWMOrder2GY(value url.Values, msgType string, serverType string) *mtwm
|
|||||||
|
|
||||||
return &result
|
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"` // 某个发配条件限制类型是否已经满足
|
||||||
|
} // 发货条件明细
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -936,6 +936,15 @@ func init() {
|
|||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: 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: "GetOrderRequirePicture",
|
||||||
|
Router: `/GetOrderRequirePicture`,
|
||||||
|
AllowHTTPMethods: []string{"get"},
|
||||||
|
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.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JxOrderController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
|
|||||||
114507
swagger/param_parser.go.txt
114507
swagger/param_parser.go.txt
File diff suppressed because it is too large
Load Diff
@@ -5776,6 +5776,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/jxorder/GetOrderRequirePicture": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"jxorder"
|
||||||
|
],
|
||||||
|
"description": "获取订单返图详情",
|
||||||
|
"operationId": "JxOrderController.获取订单返图详情",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "header",
|
||||||
|
"name": "token",
|
||||||
|
"description": "认证token",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "formData",
|
||||||
|
"name": "orderId",
|
||||||
|
"description": "订单ID",
|
||||||
|
"required": true,
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"in": "formData",
|
||||||
|
"name": "vendorID",
|
||||||
|
"description": "平台ID",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "{object} controllers.CallResult"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/jxorder/GetSupplySupportStoreSkus": {
|
"/jxorder/GetSupplySupportStoreSkus": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
@@ -6462,13 +6499,14 @@
|
|||||||
"in": "formData",
|
"in": "formData",
|
||||||
"name": "vendorID",
|
"name": "vendorID",
|
||||||
"description": "平台ID",
|
"description": "平台ID",
|
||||||
|
"required": true,
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64"
|
"format": "int64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"in": "formData",
|
"in": "formData",
|
||||||
"name": "imgs",
|
"name": "mediaList",
|
||||||
"description": "图片url,图片大小限制为10M,长宽比例需要限制为4:3[1,3,2]",
|
"description": "返图参数",
|
||||||
"required": true,
|
"required": true,
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3912,6 +3912,31 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{object} controllers.CallResult'
|
description: '{object} controllers.CallResult'
|
||||||
|
/jxorder/GetOrderRequirePicture:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- jxorder
|
||||||
|
description: 获取订单返图详情
|
||||||
|
operationId: JxOrderController.获取订单返图详情
|
||||||
|
parameters:
|
||||||
|
- in: header
|
||||||
|
name: token
|
||||||
|
description: 认证token
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- in: formData
|
||||||
|
name: orderId
|
||||||
|
description: 订单ID
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- in: formData
|
||||||
|
name: vendorID
|
||||||
|
description: 平台ID
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: '{object} controllers.CallResult'
|
||||||
/jxorder/GetSupplySupportStoreSkus:
|
/jxorder/GetSupplySupportStoreSkus:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@@ -4380,11 +4405,12 @@ paths:
|
|||||||
- in: formData
|
- in: formData
|
||||||
name: vendorID
|
name: vendorID
|
||||||
description: 平台ID
|
description: 平台ID
|
||||||
|
required: true
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
- in: formData
|
- in: formData
|
||||||
name: imgs
|
name: mediaList
|
||||||
description: 图片url,图片大小限制为10M,长宽比例需要限制为4:3[1,3,2]
|
description: 返图参数
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
|
|||||||
Reference in New Issue
Block a user