tx
This commit is contained in:
@@ -95,6 +95,7 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
"deliveryStatusName": model.DeliveryStatusName,
|
||||
"cashbackName": model.CashbackName,
|
||||
"consumeName": model.ConsumeName,
|
||||
"txWaybillNames": model.TxWaybillNames,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/txcloudapi"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
@@ -1163,8 +1165,35 @@ func GetDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID string) (queryDyn
|
||||
return api.JdEclpAPI.QueryDynamicTraceInfo(vendorWaybillID)
|
||||
}
|
||||
|
||||
func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType string) (a string, err error) {
|
||||
return a, err
|
||||
func GetAllDeliveryDetail(ctx *jxcontext.Context, vendorWaybillID, comType string) (result interface{}, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
jobOrder := &model.JobOrder{
|
||||
VendorWaybillID: vendorWaybillID,
|
||||
}
|
||||
err = dao.GetEntity(db, jobOrder, "VendorWaybillID")
|
||||
if jobOrder == nil {
|
||||
return result, fmt.Errorf("运单号有误,无法查询!")
|
||||
}
|
||||
if jobOrder.WaybillStatus == model.OrderStatusFinished {
|
||||
return jobOrder.WaybillInfo, err
|
||||
}
|
||||
if jobOrder.WaybillQueryTime != utils.ZeroTimeValue {
|
||||
if time.Now().Sub(jobOrder.WaybillQueryTime) <= time.Hour*12 {
|
||||
return jobOrder.WaybillInfo, err
|
||||
}
|
||||
}
|
||||
getWaybillDetailInfoResult, err := api.TxAPI.GetWaybillDetailInfo(vendorWaybillID, comType)
|
||||
jobOrder.WaybillQueryTime = time.Now()
|
||||
if waybillInfo, err := json.Marshal(getWaybillDetailInfoResult); err == nil {
|
||||
jobOrder.WaybillInfo = string(waybillInfo)
|
||||
}
|
||||
if getWaybillDetailInfoResult.State == utils.Int2Str(txcloudapi.StatusFinished) {
|
||||
jobOrder.WaybillStatus = model.OrderStatusFinished
|
||||
}
|
||||
dao.UpdateEntity(db, jobOrder, "WaybillQueryTime", "WaybillInfo", "WaybillStatus")
|
||||
return result, err
|
||||
}
|
||||
|
||||
func CheckJdDeliveryWeight(ctx *jxcontext.Context) (err error) {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/txcloudapi"
|
||||
)
|
||||
|
||||
const (
|
||||
JobStatusDoing = 0 //正在进行中
|
||||
@@ -70,6 +74,17 @@ var (
|
||||
ConsumeTypeMember: "充会员",
|
||||
ConsumeTypeDelivery: "发快递",
|
||||
}
|
||||
|
||||
TxWaybillNames = map[int]string{
|
||||
txcloudapi.StatusErr: "单号或代码错误",
|
||||
txcloudapi.StatusNull: "暂无轨迹",
|
||||
txcloudapi.StatusAccept: "快递收件",
|
||||
txcloudapi.StatusDelivering: "在途中",
|
||||
txcloudapi.StatusFinished: "已签收",
|
||||
txcloudapi.StatusProblem: "问题件 (派件不成功或要求择日派送)",
|
||||
txcloudapi.StatusException: "疑难件(收件人拒绝签收,地址有误或不能送达派送区域,收费等原因无法正常派送)",
|
||||
txcloudapi.StatusFailed: "退件签收",
|
||||
}
|
||||
)
|
||||
|
||||
type Job struct {
|
||||
@@ -179,19 +194,21 @@ type JobOrder struct {
|
||||
Comment string `json:"comment"` //审核理由
|
||||
UserActualPrice int `json:"userActualPrice"` //用户订单实际支付(用户自填)
|
||||
|
||||
DropShippingCount int `json:"dropShippingCount"` //一件代发购买商品数量
|
||||
DropShippingDeliveryID int `orm:"column(drop_shipping_delivery_id)" json:"dropShippingDeliveryID"`
|
||||
DropShippingName string `json:"dropShippingName"`
|
||||
DropShippingMobile string `json:"dropShippingMobile"`
|
||||
DropShippingAddress string `json:"dropShippingAddress"`
|
||||
DropShippingDetailAddress string `json:"dropShippingDetailAddress"`
|
||||
DropShippingLng float64 `json:"dropShippingLng"`
|
||||
DropShippingLat float64 `json:"dropShippingLat"`
|
||||
DropShippingAutoAddress string `json:"dropShippingAutoAddress"`
|
||||
DropShippingCityCode int `json:"dropShippingCityCode"`
|
||||
DropShippingDistrictCode int `json:"dropShippingDistrictCode"`
|
||||
VendorWaybillID string `json:"vendorWaybillID"` //运单号
|
||||
WaybillInfo string `orm:"type(text)" json:"waybillInfo"` //物流信息
|
||||
DropShippingCount int `json:"dropShippingCount"` //一件代发购买商品数量
|
||||
DropShippingDeliveryID int `orm:"column(drop_shipping_delivery_id)" json:"dropShippingDeliveryID"`
|
||||
DropShippingName string `json:"dropShippingName"`
|
||||
DropShippingMobile string `json:"dropShippingMobile"`
|
||||
DropShippingAddress string `json:"dropShippingAddress"`
|
||||
DropShippingDetailAddress string `json:"dropShippingDetailAddress"`
|
||||
DropShippingLng float64 `json:"dropShippingLng"`
|
||||
DropShippingLat float64 `json:"dropShippingLat"`
|
||||
DropShippingAutoAddress string `json:"dropShippingAutoAddress"`
|
||||
DropShippingCityCode int `json:"dropShippingCityCode"`
|
||||
DropShippingDistrictCode int `json:"dropShippingDistrictCode"`
|
||||
VendorWaybillID string `json:"vendorWaybillID"` //运单号
|
||||
WaybillInfo string `orm:"type(text)" json:"waybillInfo"` //物流信息
|
||||
WaybillQueryTime time.Time `json:"waybillQueryTime"` //上次查询时间
|
||||
WaybillStatus int `json:"waybillStatus"` //运单状态(一件代发)
|
||||
}
|
||||
|
||||
func (v *JobOrder) TableIndex() [][]string {
|
||||
|
||||
@@ -289,4 +289,7 @@ pushMasterSecret= "dGZcR0XGGg7H5Pd7FR3n47"
|
||||
|
||||
ejyPlatName = "1Zbve"
|
||||
ejyBeforeKey = "htvse3XEDhBnCTNo"
|
||||
ejyAfterKey = "QM5RnGl6kNh3ENLT"
|
||||
ejyAfterKey = "QM5RnGl6kNh3ENLT"
|
||||
|
||||
txCloudSecretID = "AKIDFNmm1U7vhITlVItry0ng5Q268lGjDZyQUR6"
|
||||
txCloudSecretKey = "25p3aynr97hOMJEfpvr0LoXD0gI62l7wcHA7nsM6"
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/txcloudapi"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/ejyapi"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtmemberapi"
|
||||
@@ -79,6 +81,7 @@ var (
|
||||
WeixinPageAPI *weixinapi.API // 用户微信扫码登录
|
||||
|
||||
AliPayAPI *alipayapi.API
|
||||
TxAPI *txcloudapi.API
|
||||
|
||||
AutonaviAPI *autonavi.API
|
||||
BaiDuNaviAPI *baidunavi.API
|
||||
@@ -241,7 +244,7 @@ func Init() {
|
||||
ShowAPI = showapi.New(beego.AppConfig.DefaultInt("showAppID", 0), beego.AppConfig.DefaultString("showAppSecret", ""))
|
||||
Cacher = redis.New(beego.AppConfig.DefaultString("redisHost", "localhost"), beego.AppConfig.DefaultInt("redisPort", 0), beego.AppConfig.DefaultString("redisPassword", ""))
|
||||
AliUpcAPI = aliupcapi.New(beego.AppConfig.String("aliUpcAppCode"))
|
||||
|
||||
TxAPI = txcloudapi.New(beego.AppConfig.String("txCloudSecretID"), beego.AppConfig.String("txCloudSecretKey"))
|
||||
DingDingAPI = dingdingapi.NewWithAgentID(beego.AppConfig.DefaultInt64("dingdingAgentID", 0), beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingAppKey", ""), beego.AppConfig.DefaultString("dingdingSecret", ""))
|
||||
DingDingQRCodeAPI = dingdingapi.New(beego.AppConfig.DefaultString("dingdingCorpID", ""), beego.AppConfig.DefaultString("dingdingQRCodeAppKey", ""), beego.AppConfig.DefaultString("dingdingQRCodeSecret", ""))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user