Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -4744,10 +4744,9 @@ func RefreshStoreBind(ctx *jxcontext.Context) (err error) {
|
||||
|
||||
func UpdateVendorStoreBussinessStatus(ctx *jxcontext.Context, storeID int, vendorID []int, status int) (err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
db = dao.GetDB()
|
||||
errList = errlist.New()
|
||||
)
|
||||
|
||||
errList := make([]string, 0, 0)
|
||||
for _, v := range vendorID {
|
||||
storeDetail, err := dao.GetStoreDetail(db, storeID, v, "")
|
||||
if err != nil {
|
||||
@@ -4762,14 +4761,14 @@ func UpdateVendorStoreBussinessStatus(ctx *jxcontext.Context, storeID int, vendo
|
||||
dao.UpdateEntity(db, storeMaps[0], "IsOnline", "Status")
|
||||
}
|
||||
} else {
|
||||
errList = append(errList, fmt.Sprintf("平台[%d],门店id[%d],错误:%s", v, storeID, err.Error()))
|
||||
errList.AddErr(fmt.Errorf("平台[%d],门店id[%d],错误:%s", v, storeID, err))
|
||||
}
|
||||
}
|
||||
|
||||
if len(errList) == model.NO {
|
||||
return nil
|
||||
if errList.GetErrListAsOne() != nil {
|
||||
return errList.GetErrListAsOne()
|
||||
}
|
||||
return fmt.Errorf(strings.Join(errList, ","))
|
||||
return nil
|
||||
}
|
||||
|
||||
type JdPage struct {
|
||||
|
||||
@@ -574,5 +574,5 @@ func (c *PurchaseHandler) UpdateStoreLineStatus(ctx *jxcontext.Context, vendorOr
|
||||
//} else {
|
||||
// err = getAPI(vendorOrgCode, storeID, vendorStoreID).PoiOffline(vendorStoreID)
|
||||
//}
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
@@ -1169,7 +1170,7 @@ func (c *StoreController) GetStoreAcctBalance() {
|
||||
// @Description 直接修改平台门店上下线
|
||||
// @Param token header string true "认证token"
|
||||
// @Param storeID formData int true "门店ID"
|
||||
// @Param vendorIDs query string true "订单所属厂商列表[1,2,3],缺省不限制"
|
||||
// @Param vendorIDs formData string true "订单所属厂商列表[1,2,3],缺省不限制"
|
||||
// @Param status formData int true "状态,-1 下线,1上线"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
@@ -1177,10 +1178,10 @@ func (c *StoreController) GetStoreAcctBalance() {
|
||||
func (c *StoreController) UpdateVendorStoreBussinessStatus() {
|
||||
c.callUpdateVendorStoreBussinessStatus(func(params *tStoreUpdateVendorStoreBussinessStatusParams) (retVal interface{}, errCode string, err error) {
|
||||
var vendorIDList []int
|
||||
if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDList); err != nil {
|
||||
return retVal, "", err
|
||||
temp := strings.Split(params.VendorIDs, ",")
|
||||
for _, v := range temp {
|
||||
vendorIDList = append(vendorIDList, utils.Str2Int(v))
|
||||
}
|
||||
|
||||
err = cms.UpdateVendorStoreBussinessStatus(params.Ctx, params.StoreID, vendorIDList, params.Status)
|
||||
return retVal, "", err
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user