1
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/excel"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/weixinmsg"
|
||||
tao "git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
|
||||
"git.rosy.net.cn/jx-callback/globals/api2"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
@@ -2676,3 +2677,55 @@ func UpdateTiktokShopTotalMoney() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateTaoSettleInfo 定时任务更新淘鲜达结算信息
|
||||
func UpdateTaoSettleInfo() {
|
||||
db := dao.GetDB()
|
||||
|
||||
storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDTaoVegetable}, nil, nil, 0, 0, "", "", "")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
timeStart := time.Now().Add(-72 * time.Hour)
|
||||
startTime := time.Date(timeStart.Year(), timeStart.Month(), timeStart.Day(), 0, 0, 0, 0, timeStart.Location())
|
||||
timeEnd := time.Now()
|
||||
endTiem := time.Date(timeEnd.Year(), timeEnd.Month(), timeEnd.Day()-1, 23, 59, 59, 0, timeStart.Location())
|
||||
for _, v := range storeMaps {
|
||||
settleInfo, err := tao.GetOrderTotalShopMoney(v.VendorOrgCode, v.VendorStoreID, startTime, endTiem)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Errorf("获取淘鲜达结算信息异常 := %v", err)
|
||||
continue
|
||||
}
|
||||
if len(settleInfo) == model.NO {
|
||||
globals.SugarLogger.Debugf("门店[%d:%s],暂无结算信息", v.StoreID, v.StoreName)
|
||||
continue
|
||||
}
|
||||
|
||||
for orderId2, settle := range settleInfo {
|
||||
goodsOrder, err := partner.CurOrderManager.LoadOrder2(orderId2, model.VendorIDTaoVegetable)
|
||||
if err != nil || goodsOrder == nil {
|
||||
globals.SugarLogger.Debugf("门店[%d:%s],订单查询异常[%s:%v]", v.StoreID, v.StoreName, orderId2, err)
|
||||
continue
|
||||
}
|
||||
|
||||
goodsOrder.TotalShopMoney = utils.Float64TwoInt64(utils.Str2Float64(settle) * 100)
|
||||
if goodsOrder.EarningType == model.EarningTypePoints {
|
||||
waybill, _ := partner.CurOrderManager.LoadWaybill(goodsOrder.VendorWaybillID, goodsOrder.WaybillVendorID)
|
||||
if waybill == nil {
|
||||
if (goodsOrder.NewEarningPrice == 0 || goodsOrder.NewEarningPrice != goodsOrder.TotalShopMoney*int64(100-goodsOrder.OrderPayPercentage/2)/int64(100)) && goodsOrder.OrderPayPercentage <= 50 {
|
||||
goodsOrder.NewEarningPrice = goodsOrder.TotalShopMoney * int64(100-goodsOrder.OrderPayPercentage/2) / int64(100)
|
||||
}
|
||||
} else {
|
||||
if (goodsOrder.NewEarningPrice == 0 || goodsOrder.NewEarningPrice != (goodsOrder.TotalShopMoney-waybill.DesiredFee)*int64(100-goodsOrder.OrderPayPercentage/2)/int64(100)) && goodsOrder.OrderPayPercentage <= 50 {
|
||||
goodsOrder.NewEarningPrice = goodsOrder.TotalShopMoney*int64(100-goodsOrder.OrderPayPercentage/2)/int64(100) - waybill.DesiredFee
|
||||
}
|
||||
}
|
||||
}
|
||||
if _, err := dao.UpdateEntity(db, v, "TotalShopMoney", "NewEarningPrice"); err != nil {
|
||||
globals.SugarLogger.Errorf("更新本地订单结算信息错误 : %s", err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2030,27 +2030,27 @@ func RrefreshMtwmVendorAct(ctx *jxcontext.Context) (err error) {
|
||||
if len(actList) > 0 {
|
||||
for _, act := range actList {
|
||||
if act.Status > 0 {
|
||||
if checkActStoreSkuExist(db, storeMap.StoreID, utils.Str2Int(act.AppFoodCode), model.VendorIDMTWM, utils.Timestamp2Time(act.StartTime), utils.Timestamp2Time(act.EndTime)) {
|
||||
actVendor := &model.ActMtwmVendor{
|
||||
StoreID: storeMap.StoreID,
|
||||
SkuID: utils.Str2Int(act.AppFoodCode),
|
||||
VendorStoreID: storeMap.VendorStoreID,
|
||||
ActType: v,
|
||||
BeginAt: utils.Timestamp2Time(act.StartTime),
|
||||
EndAt: utils.Timestamp2Time(act.EndTime),
|
||||
SkuName: act.Name,
|
||||
OriginPrice: act.OriginalPrice,
|
||||
ActPrice: act.ActPrice,
|
||||
DiscountCoefficient: act.DiscountCoefficient,
|
||||
Status: act.Status,
|
||||
ItemID: utils.Int64ToStr(act.ItemID),
|
||||
OrderLimit: act.OrderLimit,
|
||||
Period: act.Period,
|
||||
WeeksTime: act.WeeksTime,
|
||||
SettingType: act.SettingType,
|
||||
}
|
||||
dao.CreateEntity(db, actVendor)
|
||||
//if checkActStoreSkuExist(db, storeMap.StoreID, utils.Str2Int(act.AppFoodCode), model.VendorIDMTWM, utils.Timestamp2Time(act.StartTime), utils.Timestamp2Time(act.EndTime)) {
|
||||
actVendor := &model.ActMtwmVendor{
|
||||
StoreID: storeMap.StoreID,
|
||||
SkuID: utils.Str2Int(act.AppFoodCode),
|
||||
VendorStoreID: storeMap.VendorStoreID,
|
||||
ActType: v,
|
||||
BeginAt: utils.Timestamp2Time(act.StartTime),
|
||||
EndAt: utils.Timestamp2Time(act.EndTime),
|
||||
SkuName: act.Name,
|
||||
OriginPrice: act.OriginalPrice,
|
||||
ActPrice: act.ActPrice,
|
||||
DiscountCoefficient: act.DiscountCoefficient,
|
||||
Status: act.Status,
|
||||
ItemID: utils.Int64ToStr(act.ItemID),
|
||||
OrderLimit: act.OrderLimit,
|
||||
Period: act.Period,
|
||||
WeeksTime: act.WeeksTime,
|
||||
SettingType: act.SettingType,
|
||||
}
|
||||
dao.CreateEntity(db, actVendor)
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2161,10 +2161,30 @@ func RrefreshEbaiVendorAct(ctx *jxcontext.Context) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
// GetActMtwmVendor 查询美团平台活动
|
||||
func GetActMtwmVendor(ctx *jxcontext.Context, storeIDs, skuIDs []int, keyword, beginAt, endAt string, actType, offset, pageSize int) (page *model.PagedInfo, err error) {
|
||||
return dao.GetActMtwmVendorPage(dao.GetDB(), storeIDs, skuIDs, keyword, utils.Str2Time(beginAt), utils.Str2Time(endAt), actType, offset, pageSize)
|
||||
}
|
||||
|
||||
// GetStoreNotHaveSku 根据输入的商品id判断,那些门店没有参数该活动
|
||||
func GetStoreNotHaveSku(skuId int, offSet, pageSize int) (interface{}, error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
haveActSku, err := dao.GetActMtwmVendorPage(db, nil, []int{skuId}, "", time.Time{}, time.Time{}, 0, 0, 2000)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 拥有此商品的门店
|
||||
storeIds := make([]int, 0, 0)
|
||||
for _, v := range haveActSku.Data.([]*model.ActMtwmVendor) {
|
||||
storeIds = append(storeIds, v.StoreID)
|
||||
}
|
||||
|
||||
return dao.GetDontHaveSku(db, storeIds, offSet, pageSize)
|
||||
}
|
||||
|
||||
func GetActMtwmVendorSku(ctx *jxcontext.Context, storeID int, keyword string, actType, offset, pageSize int) (page *model.PagedInfo, err error) {
|
||||
return dao.GetActMtwmVendorSkuPage(dao.GetDB(), storeID, keyword, actType, offset, pageSize)
|
||||
}
|
||||
|
||||
@@ -676,7 +676,6 @@ func (v *VendorSync) AmendAndPruneStoreStuff(ctx *jxcontext.Context, vendorIDs [
|
||||
|
||||
func (v *VendorSync) LoopStoresMap2(ctx *jxcontext.Context, parentTask tasksch.ITask, db *dao.DaoDB, taskName string, isAsync, isManageIt bool, vendorIDs []int, storeIDs []int, mustDirty bool, handler tasksch.WorkFunc, isContinueWhenError bool) (task tasksch.ITask, hint string, err error) {
|
||||
var storeMapList []*model.StoreMap
|
||||
//stores, _ := dao.GetStoresMapList(db, []int{model.VendorIDMTWM, model.VendorIDJD, model.VendorIDEBAI}, nil, []int{model.StoreStatusOpened, model.StoreStatusHaveRest}, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
|
||||
if storeMapList, err = dao.GetStoresMapList2(db, vendorIDs, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncYes, "", "", "", mustDirty); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
@@ -202,6 +202,12 @@ func Init() {
|
||||
"03:35:00",
|
||||
"09:35:00",
|
||||
})
|
||||
/// 更新淘鲜达结算信息
|
||||
ScheduleTimerFunc("UpdateTiktokShopTotalMoney", func() {
|
||||
orderman.UpdateTaoSettleInfo()
|
||||
}, []string{
|
||||
"23:20:00",
|
||||
})
|
||||
|
||||
// 每分钟轮询一次,推送骑手信息
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
@@ -273,8 +279,14 @@ func Init() {
|
||||
// syncStoreSkuTiktok()
|
||||
// }, []string{"13:00:00"})
|
||||
//}
|
||||
// 抖音更新门店商品 ,接口收费暂不使用
|
||||
if beego.BConfig.RunMode != "jxgy" {
|
||||
ScheduleTimerFunc("RefreshSyncSkuList_tao", func() {
|
||||
syncStoreSkuTao()
|
||||
}, []string{"13:00:00"})
|
||||
}
|
||||
|
||||
//刷新抖音门店token
|
||||
// 刷新抖音门店token
|
||||
if beego.BConfig.RunMode != "jxgy" {
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
cms.RefreshTiktokShopToken(jxcontext.AdminCtx)
|
||||
@@ -614,8 +626,6 @@ func syncStoreSkuTiktok() {
|
||||
switch step {
|
||||
case 0:
|
||||
if beego.BConfig.RunMode != "jxgy" {
|
||||
errList.AddErr(cms.DeleteSkuNameExPrefixOverdue(db))
|
||||
errList.AddErr(cms.SetMultiStoreSkuSyncModifyStatus(db, partner.GetMultiStoreVendorIDs()))
|
||||
_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, []int{model.VendorIDDD}, nil, false, nil, nil, syncFlag, true, true)
|
||||
errList.AddErr(err)
|
||||
}
|
||||
@@ -630,6 +640,31 @@ func syncStoreSkuTiktok() {
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
}
|
||||
|
||||
// syncStoreSkuTao 同步商品到淘鲜达
|
||||
func syncStoreSkuTao() {
|
||||
syncFlag := 0
|
||||
task := tasksch.NewParallelTask("同步京西商品到淘鲜达平台,方案二使用", nil, jxcontext.AdminCtx,
|
||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||
step := batchItemList[0].(int)
|
||||
errList := errlist.New()
|
||||
db := dao.GetDB()
|
||||
switch step {
|
||||
case 0:
|
||||
if beego.BConfig.RunMode != "jxgy" {
|
||||
_, err = cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, nil, 0, db, []int{model.VendorIDTaoVegetable}, nil, false, nil, nil, syncFlag, true, true)
|
||||
errList.AddErr(err)
|
||||
}
|
||||
case 1:
|
||||
errList.AddErr(err)
|
||||
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
|
||||
}
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "淘宝同步商品", utils.Format4Output(errList, false))
|
||||
err = errList.GetErrListAsOne()
|
||||
return retVal, err
|
||||
}, []int{0, 1})
|
||||
tasksch.HandleTask(task, nil, true).Run()
|
||||
}
|
||||
|
||||
func doDailyWork2() {
|
||||
if beego.BConfig.RunMode == "jxgy" {
|
||||
syncStoreSku()
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
const (
|
||||
ActTypeAll = -1
|
||||
ActSkuFake = 0 // 假活动,只用于存储活动结算信息
|
||||
ActSkuDirectDown = 3 // 直降
|
||||
ActSkuSecKill = 4 // 秒杀
|
||||
ActSkuDirectDown = 3 // 直降(折扣)
|
||||
ActSkuSecKill = 4 // 秒杀(爆品)
|
||||
ActSkuDiscount = 5 // 折扣
|
||||
|
||||
ActDiscountTypePrice = 1 //折扣类型是最低价
|
||||
@@ -262,24 +262,24 @@ func (*StoreSkuAct) TableUnique() [][]string {
|
||||
|
||||
type ActMtwmVendor struct {
|
||||
ModelIDCULD
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||
SkuID int `orm:"column(sku_id);index" json:"skuID"`
|
||||
VendorStoreID string `orm:"column(vendor_store_id)" json:"vendorStoreID"`
|
||||
BeginAt time.Time `json:"beginAt"` //活动时间
|
||||
EndAt time.Time `json:"endAt"`
|
||||
ActType int `json:"actType"` //活动类型 (折扣,秒杀)
|
||||
SkuName string `json:"skuName"` //商品名
|
||||
OriginPrice float64 `json:"originPrice"`
|
||||
ActPrice float64 `json:"actPrice"`
|
||||
DiscountCoefficient float64 `json:"discountCoefficient"` //折扣系数
|
||||
Status int `json:"status"` //活动当前的状态,参考值:0-已过期;1-已生效;2-待生效
|
||||
ItemID string `orm:"column(item_id)" json:"itemID"`
|
||||
OrderLimit int `json:"orderLimit"` //每单限购
|
||||
DayLimit int `json:"dayLimit"` //当日活动库存
|
||||
Period string `json:"period"` //生效时段
|
||||
WeeksTime string `json:"weeksTime"` //生效活动周期
|
||||
SettingType int `json:"settingType"` //活动开展类型,参考值:0-按折扣系数开展活动;1-按折扣价格开展活动。
|
||||
StoreName string `orm:"-" json:"storeName"`
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"` // 门店id
|
||||
SkuID int `orm:"column(sku_id);index" json:"skuID"` // 商品id
|
||||
VendorStoreID string `orm:"column(vendor_store_id)" json:"vendorStoreID"` // 平台门店id
|
||||
BeginAt time.Time `json:"beginAt"` //活动时间
|
||||
EndAt time.Time `json:"endAt"` //结束时间
|
||||
ActType int `json:"actType"` //活动类型 (4 折扣,3秒杀)
|
||||
SkuName string `json:"skuName"` //商品名
|
||||
OriginPrice float64 `json:"originPrice"` //商品原价,单位元。
|
||||
ActPrice float64 `json:"actPrice"` //活动价
|
||||
DiscountCoefficient float64 `json:"discountCoefficient"` //折扣系数
|
||||
Status int `json:"status"` //活动当前的状态,参考值:0-已过期;1-已生效;2-待生效
|
||||
ItemID string `orm:"column(item_id)" json:"itemID"` //活动id
|
||||
OrderLimit int `json:"orderLimit"` //每单限购
|
||||
DayLimit int `json:"dayLimit"` //当日活动库存
|
||||
Period string `json:"period"` //生效时段
|
||||
WeeksTime string `json:"weeksTime"` //生效活动周期
|
||||
SettingType int `json:"settingType"` //活动开展类型,参考值:0-按折扣系数开展活动;1-按折扣价格开展活动。
|
||||
StoreName string `orm:"-" json:"storeName"` // 门店名称
|
||||
}
|
||||
|
||||
func (*ActMtwmVendor) TableIndex() [][]string {
|
||||
|
||||
@@ -708,7 +708,7 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg
|
||||
acts []*model.ActMtwmVendor
|
||||
)
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS a.store_id, a.vendor_store_id, b.name store_name, a.act_type
|
||||
SELECT SQL_CALC_FOUND_ROWS b.name store_name ,a.*
|
||||
FROM act_mtwm_vendor a
|
||||
LEFT JOIN store b ON a.store_id = b.id
|
||||
`
|
||||
@@ -741,7 +741,7 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg
|
||||
GROUP BY 1, 2, 3, 4
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
sqlParams = append(sqlParams, pageSize, (offset-1)*pageSize)
|
||||
txDB, _ := Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@@ -757,6 +757,33 @@ func GetActMtwmVendorPage(db *DaoDB, storeIDs, skuIDs []int, keyword string, beg
|
||||
return page, err
|
||||
}
|
||||
|
||||
// GetDontHaveSku 获取不存在此商品活动的门店
|
||||
func GetDontHaveSku(db *DaoDB, storeIds []int, offSet, pageSize int) (interface{}, error) {
|
||||
var parma []interface{}
|
||||
sql := `
|
||||
SELECT a.store_id,b.name store_name FROM act_mtwm_vendor a
|
||||
LEFT JOIN store b ON a.store_id = b.id
|
||||
WHERE 1=1
|
||||
`
|
||||
type SkuAct struct {
|
||||
StoreId int `json:"store_id"`
|
||||
StoreName string `json:"store_name"`
|
||||
}
|
||||
|
||||
if len(storeIds) != 0 {
|
||||
sql += "AND a.store_id NOT IN (" + GenQuestionMarks(len(storeIds)) + ")"
|
||||
parma = append(parma, storeIds)
|
||||
}
|
||||
|
||||
sql += ` GROUP BY a.store_id LIMIT ? OFFSET ? `
|
||||
parma = append(parma, pageSize, (offSet-1)*pageSize)
|
||||
var result []*SkuAct
|
||||
if err := GetRows(db, &result, sql, parma); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func GetActMtwmVendorSkuPage(db *DaoDB, storeID int, keyword string, actType, offset, pageSize int) (page *model.PagedInfo, err error) {
|
||||
var (
|
||||
acts []*model.ActMtwmVendor
|
||||
@@ -777,7 +804,7 @@ func GetActMtwmVendorSkuPage(db *DaoDB, storeID int, keyword string, actType, of
|
||||
sql += `
|
||||
LIMIT ? OFFSET ?
|
||||
`
|
||||
sqlParams = append(sqlParams, pageSize, offset)
|
||||
sqlParams = append(sqlParams, (offset-1)*pageSize, pageSize)
|
||||
txDB, _ := Begin(db)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
|
||||
@@ -96,11 +96,6 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
continue
|
||||
}
|
||||
|
||||
// 平台自配送
|
||||
if v.WaybillVendorID == model.YES {
|
||||
continue
|
||||
}
|
||||
|
||||
if orderId == "" { // 订单id为空是,是定时轮询操作,不做此状态
|
||||
waybillList, _ := dao.GetWaybills(dao.GetDB(), v.VendorOrderID, nil)
|
||||
if len(waybillList) > 0 && waybillList[0].Status > model.WaybillStatusEndBegin {
|
||||
@@ -136,7 +131,8 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
}
|
||||
|
||||
taoDeliveryStatus := ""
|
||||
switch riderInfo.LogisticsStatus {
|
||||
//switch riderInfo.LogisticsStatus {
|
||||
switch v.Status {
|
||||
case 5: // 呼叫骑手
|
||||
riderInfo.LogisticsStatus = 0
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsStatusCALLRIDER
|
||||
@@ -492,15 +488,17 @@ func LoadingStoreOrderSettleAmount(startTime, endTime int64, jxStoreId []int) er
|
||||
}
|
||||
|
||||
// 如果收款账户为京西的收款账户,则此门店不是服务商(否则是服务商,使用门店发单[需要自己的账户充值金额才行]!)
|
||||
if settleId != model.NO && jxSettleIdMap[settleId] {
|
||||
brandSql := `UPDATE store_map s SET s.create_delivery_type = ?,s.is_service = ? WHERE s.vendor_store_id = ? AND s.deleted_at = ?`
|
||||
if _, err := dao.ExecuteSQL(db, brandSql, []interface{}{model.NO, model.NO, storeListValue.VendorStoreID, utils.DefaultTimeValue}...); err != nil {
|
||||
globals.SugarLogger.Debugf("将门店修改为非服务商和系统发单: %v", err)
|
||||
}
|
||||
} else {
|
||||
brandSql := `UPDATE store_map s SET s.create_delivery_type = ?,s.is_service = ? WHERE s.vendor_store_id = ? AND s.deleted_at = ?`
|
||||
if _, err := dao.ExecuteSQL(db, brandSql, []interface{}{model.YES, model.YES, storeListValue.VendorStoreID, utils.DefaultTimeValue}...); err != nil {
|
||||
globals.SugarLogger.Debugf("将门店修改为服务商和门店发单: %v", err)
|
||||
if settleId != 0 {
|
||||
if settleId != model.NO && jxSettleIdMap[settleId] {
|
||||
brandSql := `UPDATE store_map s SET s.create_delivery_type = ?,s.is_service = ? WHERE s.vendor_store_id = ? AND s.deleted_at = ?`
|
||||
if _, err := dao.ExecuteSQL(db, brandSql, []interface{}{model.NO, model.NO, storeListValue.VendorStoreID, utils.DefaultTimeValue}...); err != nil {
|
||||
globals.SugarLogger.Debugf("将门店修改为非服务商和系统发单: %v", err)
|
||||
}
|
||||
} else {
|
||||
brandSql := `UPDATE store_map s SET s.create_delivery_type = ?,s.is_service = ? WHERE s.vendor_store_id = ? AND s.deleted_at = ?`
|
||||
if _, err := dao.ExecuteSQL(db, brandSql, []interface{}{model.YES, model.YES, storeListValue.VendorStoreID, utils.DefaultTimeValue}...); err != nil {
|
||||
globals.SugarLogger.Debugf("将门店修改为服务商和门店发单: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -878,7 +878,9 @@ func GetOrderTotalShopMoney(appOrgCode string, vendorStoreID string, start, end
|
||||
var totalIndex int64 = 0
|
||||
result, _ := api.QueryBillList(param)
|
||||
for _, v := range *result.TxdBillDetailBOS {
|
||||
settlement[*v.BizOrderId] = *v.ReceivableAmount
|
||||
if *v.OrderType == "positive" {
|
||||
settlement[*v.BizOrderId] = *v.ReceivableAmount
|
||||
}
|
||||
}
|
||||
|
||||
if *result.Total > int64(pageSize) {
|
||||
@@ -891,7 +893,9 @@ func GetOrderTotalShopMoney(appOrgCode string, vendorStoreID string, start, end
|
||||
param.TxdBillListGetRequest.PageIndex = utils.Int64ToPointer(int64(i))
|
||||
result2, _ := api.QueryBillList(param)
|
||||
for _, v := range *result2.TxdBillDetailBOS {
|
||||
settlement[*v.BizOrderId] = *v.ReceivableAmount
|
||||
if *v.OrderType == "positive" {
|
||||
settlement[*v.BizOrderId] = *v.ReceivableAmount
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,6 +470,35 @@ func (c *ActController) GetActMtwmVendor() {
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 根据商品id查询未开展活动的门店信息
|
||||
// @Description 查询美团平台活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Param skuID query int false "skuID"
|
||||
// @Param offset query int false "起始序号(以0开始,缺省为0)"
|
||||
// @Param pageSize query int false "表页大小(缺省全部)"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetNotHaveSkuActList [get]
|
||||
func (c *ActController) GetNotHaveSkuActList() {
|
||||
c.callGetNotHaveSkuActList(func(params *tActGetNotHaveSkuActListParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = act.GetStoreNotHaveSku(params.SkuID, params.Offset, params.PageSize)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询美团平台活动
|
||||
// @Description 查询美团平台活动
|
||||
// @Param token header string true "认证token"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshMTActivityList [get]
|
||||
func (c *ActController) RefreshMTActivityList() {
|
||||
c.callRefreshMTActivityList(func(params *tActRefreshMTActivityListParams) (retVal interface{}, errCode string, err error) {
|
||||
err = act.RrefreshMtwmVendorAct(params.Ctx)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询美团平台活动sku
|
||||
// @Description 查询美团平台活动sku
|
||||
// @Param token header string true "认证token"
|
||||
|
||||
@@ -96,6 +96,14 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"],
|
||||
web.ControllerComments{
|
||||
Method: "GetNotHaveSkuActList",
|
||||
Router: `/GetNotHaveSkuActList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"],
|
||||
web.ControllerComments{
|
||||
@@ -105,6 +113,14 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"],
|
||||
web.ControllerComments{
|
||||
Method: "/RefreshMTActivityList",
|
||||
Router: `/RefreshMTActivityList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ActController"],
|
||||
web.ControllerComments{
|
||||
|
||||
Reference in New Issue
Block a user