方法移动到check文件

This commit is contained in:
qidongsheng
2020-06-19 14:18:56 +08:00
39 changed files with 1446 additions and 408 deletions

View File

@@ -3,6 +3,7 @@ package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxstore/common"
"git.rosy.net.cn/jx-callback/business/jxstore/misc"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
@@ -546,7 +547,7 @@ func (c *StoreController) SyncStoresCourierInfo() {
// @router /GetStoreListByLocation [get]
func (c *StoreController) GetStoreListByLocation() {
c.callGetStoreListByLocation(func(params *tStoreGetStoreListByLocationParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetStoreListByLocation(params.Ctx, params.Lng, params.Lat, params.NeedWalkDistance)
retVal, err = common.GetStoreListByLocation(params.Ctx, params.Lng, params.Lat, 20000, params.NeedWalkDistance, false)
return retVal, "", err
})
}

View File

@@ -4,6 +4,8 @@ import (
"math"
"time"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
@@ -214,6 +216,7 @@ func (c *StoreSkuController) SyncStoresSkus() {
// @Param payload formData string true "json数据StoreSkuBindInfo对象数组"
// @Param isScale formData bool false "是否按门店结算比例缩放"
// @Param causeFlag formData int false "操作类型"
// @Param isRefreshHigh formData bool false "是否只刷门店价高于给的价"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Param isAsync formData bool false "是否异步操作"
// @Success 200 {object} controllers.CallResult
@@ -226,7 +229,28 @@ func (c *StoreSkuController) UpdateStoresSkus() {
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.Payload, &skuBindInfos); err != nil {
return retVal, "", err
}
retVal, err = cms.UpdateStoresSkus(params.Ctx, params.CauseFlag, storeIDs, skuBindInfos, params.IsScale, params.IsAsync, params.IsContinueWhenError)
retVal, err = cms.UpdateStoresSkus(params.Ctx, params.CauseFlag, storeIDs, skuBindInfos, params.IsScale, params.IsRefreshHigh, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}
// @Title 批量修改多商家商品绑定(不同步)
// @Description 批量修改多商家商品绑定(不同步)
// @Param token header string true "认证token"
// @Param storeIDs formData string false "门店ID列表"
// @Param payload formData string true "json数据StoreSkuBindInfo对象数组"
// @Param isRefreshHigh formData bool true "是否只刷门店价高于给的价"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateStoresSkusWithoutSync [put]
func (c *StoreSkuController) UpdateStoresSkusWithoutSync() {
c.callUpdateStoresSkusWithoutSync(func(params *tStoreSkuUpdateStoresSkusWithoutSyncParams) (retVal interface{}, errCode string, err error) {
var storeIDs []int
var skuBindInfos []*cms.StoreSkuBindInfo
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.Payload, &skuBindInfos); err != nil {
return retVal, "", err
}
err = cms.UpdateStoresSkusWithoutSync(params.Ctx, storeIDs, skuBindInfos, params.IsRefreshHigh)
return retVal, "", err
})
}
@@ -812,8 +836,8 @@ func (c *StoreSkuController) SyncMatterC4ToGy() {
})
}
// @Title 得到商家商品修改价格请求信息
// @Description 得到商家商品修改价格请求信息
// @Title 查询商品审核信息
// @Description 查询商品审核信息
// @Param token header string true "认证token"
// @Param applyTimeStart query string false "申请开始时间"
// @Param applyTimeEnd query string false "申请结束时间"
@@ -823,7 +847,11 @@ func (c *StoreSkuController) SyncMatterC4ToGy() {
// @Param remark query string false "不通过原因"
// @Param storeIDs query string false "门店ID列表"
// @Param nameIDs query string false "id列表对象当前指skuname id"
// @Param status query int false "审核状态"
// @Param statuss query string false "审核状态"
// @Param types query string false "改价类型1是普通改价2是关注"
// @Param keyword query string false "关键字"
// @Param marketManPhone query string false "市场负责人电话"
// @Param cityName query string false "城市名"
// @Param offset query int false "门店列表起始序号以0开始缺省为0"
// @Param pageSize query int false "门店列表页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
@@ -832,16 +860,33 @@ func (c *StoreSkuController) SyncMatterC4ToGy() {
func (c *StoreSkuController) GetStoreSkuAudit() {
c.callGetStoreSkuAudit(func(params *tStoreSkuGetStoreSkuAuditParams) (retVal interface{}, errCode string, err error) {
var (
timeList []time.Time
storeIDs, nameIDs []int
storeIDs, nameIDs, statuss, types []int
)
if timeList, err = jxutils.BatchStr2Time(params.ApplyTimeStart, params.ApplyTimeEnd, params.AuditTimeStart, params.AuditTimeEnd); err != nil {
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.NameIDs, &nameIDs, params.Statuss, &statuss, params.Types, &types); err != nil {
return retVal, "", err
}
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.NameIDs, &nameIDs); err != nil {
return retVal, "", err
}
retVal, err = cms.GetStoreSkuAudit(params.Ctx, storeIDs, nameIDs, nil, params.Status, params.Name, params.Remark, timeList[0], timeList[1], timeList[2], timeList[3], params.PageSize, params.Offset)
retVal, err = cms.GetStoreSkuAudit(params.Ctx, storeIDs, nameIDs, nil, statuss, types, params.Name, params.Remark, params.Keyword, params.MarketManPhone, params.CityName, params.ApplyTimeStart, params.ApplyTimeEnd, params.AuditTimeStart, params.AuditTimeEnd, params.PageSize, params.Offset)
return retVal, "", err
})
}
// @Title 审核商品
// @Description 审核商品
// @Param token header string true "认证token"
// @Param payload formData string true "json数据storeskuaudit对象"
// @Param status formData int false "审核标志1通过-1 不通过"
// @Param isAsync formData bool false "是否异步,缺省是同步"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /StoreSkuPriceAudit [post]
func (c *StoreSkuController) StoreSkuPriceAudit() {
c.callStoreSkuPriceAudit(func(params *tStoreSkuStoreSkuPriceAuditParams) (retVal interface{}, errCode string, err error) {
var storeSkuAudits []*model.StoreSkuAudit
if err = jxutils.Strings2Objs(params.Payload, &storeSkuAudits); err != nil {
return retVal, "", err
}
retVal, err = cms.StoreSkuPriceAudit(params.Ctx, storeSkuAudits, params.Status, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}

View File

@@ -1059,3 +1059,32 @@ func (c *OrderController) GetOrderUserBuyFirst() {
return retVal, "", err
})
}
// @Title 京东商城订单转移
// @Description 京东商城订单转移
// @Param token header string true "认证token"
// @Param storeID formData int true "转移的门店ID"
// @Param vendorOrderID formData string true "转移的订单号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TransferJdsOrder [post]
func (c *OrderController) TransferJdsOrder() {
c.callTransferJdsOrder(func(params *tOrderTransferJdsOrderParams) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.TransferJdsOrder(params.Ctx, params.VendorOrderID, params.StoreID)
return retVal, "", err
})
}
// @Title 京东商城订单发送京东物流
// @Description 京东商城订单发送京东物流
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /SendJdwlForJdsOrder [post]
func (c *OrderController) SendJdwlForJdsOrder() {
c.callSendJdwlForJdsOrder(func(params *tOrderSendJdwlForJdsOrderParams) (retVal interface{}, errCode string, err error) {
err = orderman.SendJdwlForJdsOrder(params.Ctx, params.VendorOrderID)
return retVal, "", err
})
}

View File

@@ -400,3 +400,17 @@ func (c *TempOpController) UploadJdsImage() {
return retVal, "", err
})
}
// @Title 京西刷新调价包和门店价格
// @Description 京西刷新调价包和门店价格
// @Param token header string true "认证token"
// @Param storeID formData int false "门店ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /RefreshJXPriceChange [post]
func (c *TempOpController) RefreshJXPriceChange() {
c.callRefreshJXPriceChange(func(params *tTempopRefreshJXPriceChangeParams) (retVal interface{}, errCode string, err error) {
retVal, err = tempop.RefreshJXPriceChange(params.Ctx, params.StoreID)
return retVal, "", err
})
}