This commit is contained in:
邹宗楠
2023-05-23 09:34:23 +08:00
parent c011092a2b
commit 77e7b21917
4 changed files with 52 additions and 53 deletions

View File

@@ -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",

View File

@@ -210,6 +210,7 @@ func Init() {
// (自动发单拣货,设置骑手)
ScheduleTimerFuncByInterval(func() {
auto_delivery.Init() // 初始化骑手列表
auto_delivery.AutoSettingFakeDelivery()
}, 10*time.Second, 3*time.Minute)

View File

@@ -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 {

View File

@@ -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连接