From 77e7b21917302f9a2ed77c6f355fe96c9a4dd5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 23 May 2023 09:34:23 +0800 Subject: [PATCH] 1 --- business/jxcallback/orderman/orderman_ext.go | 10 +++ business/jxstore/misc/misc.go | 1 + business/model/store.go | 89 +++++++++----------- main.go | 5 +- 4 files changed, 52 insertions(+), 53 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 410968963..b2167f1e9 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -502,6 +502,15 @@ func (c *OrderManager) ExportOrders(ctx *jxcontext.Context, fromDateStr, toDateS v.CourierVendorName = model.VendorChineseNames[v.WaybillVendorID] v.Status2 = model.OrderStatusName[v.Status] v.SkuInfo = skuStr + // 统计订单的违约金 + var damages = &struct { + Damages int64 `json:"damages"` + }{} + sqlDamages := ` SELECT SUM(w.desired_fee) damages FROM waybill w WHERE w.vendor_order_id = ? AND w.status = ? ` + paramDamages := []interface{}{v.VendorOrderID, model.OrderStatusCanceled} + if err := dao.GetRow(dao.GetDB(), damages, sqlDamages, paramDamages); err == nil { + v.LiquidatedDamages = damages.Damages + } orders2 = append(orders2, v) } else { order.SkuInfo += ";" + skuStr @@ -542,6 +551,7 @@ func (c *OrderManager) ExportOrders(ctx *jxcontext.Context, fromDateStr, toDateS "courierMobile", "courierMobile", "desiredFee", + "liquidated_damages", "waybillCreatedAt", "waybillFinishedAt", "status2", diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index ff244ed19..a850c0968 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -210,6 +210,7 @@ func Init() { // (自动发单拣货,设置骑手) ScheduleTimerFuncByInterval(func() { + auto_delivery.Init() // 初始化骑手列表 auto_delivery.AutoSettingFakeDelivery() }, 10*time.Second, 3*time.Minute) diff --git a/business/model/store.go b/business/model/store.go index 2693232e1..ea501f06a 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -473,55 +473,46 @@ func (*StoreSub) TableUnique() [][]string { type StoreMap struct { ModelIDCULD - StoreID int `orm:"column(store_id)" json:"storeID"` - VendorID int `orm:"column(vendor_id)" json:"vendorID"` - VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空 - - VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` - Status int `json:"status"` // 取值同Store.Status - IsOnline int `json:"isOnline"` //上下线状态, -1是下线,1是上线 - StoreName string `orm:"size(255)" json:"storeName"` // 平台门店的名字,由平台到京西 - VendorStoreName string `orm:"size(255)" json:"vendorStoreName"` //平台门店名,由京西到平台 - VendorPayPercentage int `json:"vendorPayPercentage"` //平台结算比例 - - PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格 - PricePercentagePack string `orm:"size(32)" json:"pricePercentagePack"` // - FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` // - - AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货 - DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型 - DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //在vendorID=14,存储满 x 包邮金额 - DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //在vendorID=14,存储打包费 - DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争 - CreateDeliveryType int `orm:"default(0)" json:"createDeliveryType"` //默认0系统发单,1为门店发单 - IsService int `orm:"default(0)" json:"isService"` // 默认0非服务商,1服务商 - - SyncStatus int8 `orm:"default(2)" json:"syncStatus"` - IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步 - SyncRule int8 `orm:"default(0)" json:"syncRule"` //目前用于京东商城晚上的同步规则,0表示关闭,1表示小同步,2表示大同步 - FakeOpenStart int16 `orm:"default(0)" json:"fakeOpenStart"` // 假开店开始 - FakeOpenStop int16 `orm:"default(0)" json:"fakeOpenStop"` // 假开店结束 - JdStoreLevel string `orm:"size(32)" json:"jdStoreLevel"` //京东门店等级 - JdsStreetCode int `orm:"default(0)" json:"jdsStreetCode"` //京东商城直辖市街道code - JdsStreetName string `orm:"size(32)" json:"jdsStreetName"` //京东商城直辖市街道 - - IsOrder int `orm:"default(0)" json:"isOrder"` //是否是下预订单门店 - IsSysCat int `orm:"default(0)" json:"isSysCat"` //是否使用京西分类 - IsSupplyGoods int `orm:"default(0)" json:"isSupplyGoods"` // 是否是货源门店 - - YbAppID string `orm:"column(yb_app_id);size(255)" json:"ybAppID"` - YbAppKey string `orm:"size(255)" json:"ybAppKey"` - YbStorePrefix string `orm:"size(255)" json:"ybStorePrefix"` //在vendorID=14,存储抖店门店起送金额 单位分 - - MtwmToken string `orm:"size(512)" json:"mtwmToken"` //美团外卖商超token,有效期30天,每20天刷一次 - MtwmRefreshToken string `orm:"size(255)" json:"mtwmRefreshToken"` //美团外卖商超refreshToken - EbaiSupplierID string `orm:"column(ebai_supplier_id)" json:"ebaiSupplierID"` //饿百供应商ID - - BussinessStatus int `orm:"-" json:"bussinessStatus"` - - VendorAccount string `orm:"size(255)" json:"vendorAccount"` //商户在平台上的账号(授权用 - VendorPasswaord string `orm:"size(255)" json:"vendorPasswaord"` //商户在平台上的密码( aes cbc base64后的 - AuditStatus int `json:"auditStatus"` //审核状态(授权状态 + StoreID int `orm:"column(store_id)" json:"storeID"` + VendorID int `orm:"column(vendor_id)" json:"vendorID"` + VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空 + VendorStoreID string `orm:"column(vendor_store_id);size(48)" json:"vendorStoreID"` + Status int `json:"status"` // 取值同Store.Status + IsOnline int `json:"isOnline"` //上下线状态, -1是下线,1是上线 + StoreName string `orm:"size(255)" json:"storeName"` // 平台门店的名字,由平台到京西 + VendorStoreName string `orm:"size(255)" json:"vendorStoreName"` //平台门店名,由京西到平台 + VendorPayPercentage int `json:"vendorPayPercentage"` //平台结算比例 + PricePercentage int16 `orm:"default(100)" json:"pricePercentage"` // todo 厂商价格相对于本地价格的百分比,这个字段的修改会比较特殊,因为可能需要刷新厂商价格 + PricePercentagePack string `orm:"size(32)" json:"pricePercentagePack"` // + FreightDeductionPack string `orm:"size(32)" json:"freightDeductionPack"` // + AutoPickup int8 `orm:"default(1)" json:"autoPickup"` // 是否自动拣货 + DeliveryType int8 `orm:"default(0)" json:"deliveryType"` // 配送类型 + DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //在vendorID=14,存储满 x 包邮金额 + DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //在vendorID=14,存储打包费 + DeliveryCompetition int8 `orm:"default(1)" json:"deliveryCompetition"` // 是否支持配送竞争 + CreateDeliveryType int `orm:"default(0)" json:"createDeliveryType"` //默认0系统发单,1为门店发单 + IsService int `orm:"default(0)" json:"isService"` // 默认0非服务商,1服务商 + SyncStatus int8 `orm:"default(2)" json:"syncStatus"` + IsSync int8 `orm:"default(1)" json:"isSync"` // 是否同步 + SyncRule int8 `orm:"default(0)" json:"syncRule"` //目前用于京东商城晚上的同步规则,0表示关闭,1表示小同步,2表示大同步 + FakeOpenStart int16 `orm:"default(0)" json:"fakeOpenStart"` // 假开店开始 + FakeOpenStop int16 `orm:"default(0)" json:"fakeOpenStop"` // 假开店结束 + JdStoreLevel string `orm:"size(32)" json:"jdStoreLevel"` //京东门店等级 + JdsStreetCode int `orm:"default(0)" json:"jdsStreetCode"` //京东商城直辖市街道code + JdsStreetName string `orm:"size(32)" json:"jdsStreetName"` //京东商城直辖市街道 + IsOrder int `orm:"default(0)" json:"isOrder"` //是否是下预订单门店 + IsSysCat int `orm:"default(0)" json:"isSysCat"` //是否使用京西分类 + IsSupplyGoods int `orm:"default(0)" json:"isSupplyGoods"` // 是否是货源门店 + YbAppID string `orm:"column(yb_app_id);size(255)" json:"ybAppID"` + YbAppKey string `orm:"size(255)" json:"ybAppKey"` + YbStorePrefix string `orm:"size(255)" json:"ybStorePrefix"` //在vendorID=14,存储抖店门店起送金额 单位分 + MtwmToken string `orm:"size(512)" json:"mtwmToken"` //美团外卖商超token,有效期30天,每20天刷一次 + MtwmRefreshToken string `orm:"size(255)" json:"mtwmRefreshToken"` //美团外卖商超refreshToken + EbaiSupplierID string `orm:"column(ebai_supplier_id)" json:"ebaiSupplierID"` //饿百供应商ID + BussinessStatus int `orm:"-" json:"bussinessStatus"` + VendorAccount string `orm:"size(255)" json:"vendorAccount"` //商户在平台上的账号(授权用 + VendorPasswaord string `orm:"size(255)" json:"vendorPasswaord"` //商户在平台上的密码( aes cbc base64后的 + AuditStatus int `json:"auditStatus"` //审核状态(授权状态 } func (*StoreMap) TableUnique() [][]string { diff --git a/main.go b/main.go index 30f9eaeef..8bbdc397b 100644 --- a/main.go +++ b/main.go @@ -11,8 +11,6 @@ import ( "git.rosy.net.cn/jx-callback/business/partner/purchase/im" "git.rosy.net.cn/jx-callback/business/enterprise" - "git.rosy.net.cn/jx-callback/business/jxcallback/auto_delivery" - "git.rosy.net.cn/jx-callback/business/partner/purchase/jdshop" "git.rosy.net.cn/jx-callback/business/partner/purchase/yb" @@ -93,8 +91,7 @@ func Init() { jdshop.CurPurchaseHandler.StartRefreshComment() } misc.Init() - enterprise.Init() // 初始化enterprise key - auto_delivery.Init() // 初始化骑手列表 + enterprise.Init() // 初始化enterprise key im.Init() //初始化ws连接