Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -6014,3 +6014,23 @@ func GetVendorOrgCode(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID i
|
|||||||
}
|
}
|
||||||
return storeMap, dao.GetEntitiesByKV(db, &storeMap, cond, false)
|
return storeMap, dao.GetEntitiesByKV(db, &storeMap, cond, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量辅助创建电子围栏
|
||||||
|
func AssistCreateFence(relInfo map[string]map[int64]string) (string, error) {
|
||||||
|
errList := errlist.New()
|
||||||
|
for k, v := range relInfo {
|
||||||
|
for i, j := range v {
|
||||||
|
if fenceID, err := tiktok_store.CreateFenceByStore(k, i); err != nil {
|
||||||
|
errList.AddErr(fmt.Errorf("平台门店(%s),门店(%d) 创建电子围栏失败:%v", j, i, err))
|
||||||
|
} else {
|
||||||
|
if err := tiktok_store.BindFenceByStore(k, utils.Str2Int64(j), []string{fenceID}); err != nil {
|
||||||
|
errList.AddErr(fmt.Errorf("平台门店(%s),门店(%d)绑定电子围栏失败:%v", j, i, err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if errList.GetErrListAsOne() != nil {
|
||||||
|
return fmt.Sprintf("批量创建电子围栏错误,请根据提示处理:%v", errList.GetErrListAsOne()), nil
|
||||||
|
}
|
||||||
|
return "", nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -1080,6 +1080,7 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
|||||||
sql += " LIMIT ? OFFSET ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
sqlParams = append(sqlParams, pageSize, offset)
|
sqlParams = append(sqlParams, pageSize, offset)
|
||||||
globals.SugarLogger.Debugf("sqlParams pageSize=====%d,offset==========%d", pageSize, offset)
|
globals.SugarLogger.Debugf("sqlParams pageSize=====%d,offset==========%d", pageSize, offset)
|
||||||
|
globals.SugarLogger.Debugf("test sql=======================%s", sql)
|
||||||
txDB, _ := Begin(db)
|
txDB, _ := Begin(db)
|
||||||
defer Commit(db, txDB)
|
defer Commit(db, txDB)
|
||||||
if err = GetRowsTx(txDB, &orders, sql, sqlParams...); err == nil {
|
if err = GetRowsTx(txDB, &orders, sql, sqlParams...); err == nil {
|
||||||
|
|||||||
@@ -168,18 +168,6 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//直接创建电子围栏方式 暂时未使用
|
|
||||||
func CreateFenceDirectly(param warehouse_createFence_request.WarehouseCreateFenceParam) (fenceID string, err error) {
|
|
||||||
info := &warehouse_createFence_request.WarehouseCreateFenceParam{
|
|
||||||
FenceInfo: param.FenceInfo,
|
|
||||||
}
|
|
||||||
resp, err := getAPI("", 0, "").CreateFence(info)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return resp.FenceId, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// 通过门店更新电子围栏
|
// 通过门店更新电子围栏
|
||||||
func UpdateFenceByStore(appOrgCode, outFenceID string, storeID int) error {
|
func UpdateFenceByStore(appOrgCode, outFenceID string, storeID int) error {
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -1508,11 +1508,19 @@ func (c *StoreController) GetDDScope() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Title 批量绑定抖店与京西门店
|
// @Title 创建抖店电子围栏
|
||||||
// @Description 批量绑定抖店与京西门店
|
// @Description 创建抖店电子围栏
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param storeID formData int true "门店ID"
|
// @Param payload formData string true "json数据,[]string对象"
|
||||||
// @Param vendorStoreID formData string true "平台门店ID"
|
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /BatchBindVendorStore [post]
|
// @router /CreateDDStoreFence [post]
|
||||||
|
func (c *StoreController) CreateDDStoreFence() {
|
||||||
|
c.callCreateDDStoreFence(func(params *tStoreCreateDDStoreFenceParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
payload := make(map[string]map[int64]string)
|
||||||
|
if err = utils.UnmarshalUseNumber([]byte(params.Payload), &payload); err == nil {
|
||||||
|
retVal, err = cms.AssistCreateFence(payload)
|
||||||
|
}
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -2963,6 +2963,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreController"],
|
||||||
|
web.ControllerComments{
|
||||||
|
Method: "AssistCreateFence",
|
||||||
|
Router: `/AssistCreateFence`,
|
||||||
|
AllowHTTPMethods: []string{"post"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"],
|
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:StoreSkuController"],
|
||||||
web.ControllerComments{
|
web.ControllerComments{
|
||||||
Method: "BackUpStoreSkuBind",
|
Method: "BackUpStoreSkuBind",
|
||||||
|
|||||||
Reference in New Issue
Block a user