1
This commit is contained in:
@@ -54,14 +54,12 @@ func SplicingTimeToDoudian(openTime1, closeTime1, openTime2, closeTime2 int16) (
|
||||
s1 = ts1 + tOpenTime1[:len1] + ":" + tOpenTime1[len1+1:] + "0"
|
||||
tCloseTime1 := utils.Int64ToStr(int64(closeTime1))
|
||||
len2 := len(tCloseTime1) - 2
|
||||
globals.SugarLogger.Debug("tCloseTime1,len2==========", tCloseTime1, len2)
|
||||
if utils.Str2Int(tCloseTime1[:len2]) <= 9 {
|
||||
ts2 = "0"
|
||||
}
|
||||
s2 = ts2 + tCloseTime1[:len2] + ":" + tCloseTime1[len2+1:] + "0"
|
||||
timeStr += s1 + "-" + s2
|
||||
if openTime2 != 0 && closeTime2 != 0 {
|
||||
globals.SugarLogger.Debug("sdjksejfqujahfq", openTime2, closeTime2)
|
||||
tOpenTime2 := utils.Int64ToStr(int64(openTime2))
|
||||
len3 := len(tOpenTime2) - 2
|
||||
if utils.Str2Int(tOpenTime2[:len3]) <= 9 {
|
||||
@@ -83,9 +81,9 @@ func SplicingTimeToDoudian(openTime1, closeTime1, openTime2, closeTime2 int16) (
|
||||
// shop/batchCreateStore 批量创建门店
|
||||
func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName string, params map[string]interface{}, storeDetail *dao.StoreDetail) (vendorStoreID string, err error) {
|
||||
var (
|
||||
//storeIDs string
|
||||
tempStoreID []int64
|
||||
//lists []shop_batchCreateStore_request.StoreListItem
|
||||
storeIDs string
|
||||
tempStoreID []int64
|
||||
lists []shop_batchCreateStore_request.StoreListItem
|
||||
ShopBatchCreateStoreParam *shop_batchCreateStore_request.ShopBatchCreateStoreParam
|
||||
FreightTemplate = &model.FreightTemplate{}
|
||||
)
|
||||
@@ -102,8 +100,6 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
for j := 1; j <= 7; j++ {
|
||||
m[int64(j)] = timeStr
|
||||
}
|
||||
globals.SugarLogger.Debug("mmmmmmmmmmmmmmmm", m)
|
||||
lists := []shop_batchCreateStore_request.StoreListItem{}
|
||||
list := shop_batchCreateStore_request.StoreListItem{
|
||||
RowId: 1,
|
||||
Name: storeDetail.Name,
|
||||
@@ -119,30 +115,24 @@ func (P *PurchaseHandler) CreateStore2(db *dao.DaoDB, storeID int, userName stri
|
||||
DayMap: m,
|
||||
},
|
||||
}
|
||||
globals.SugarLogger.Debug("list===================", list.Name, list.OpenTime)
|
||||
lists = append(lists, list)
|
||||
ShopBatchCreateStoreParam = &shop_batchCreateStore_request.ShopBatchCreateStoreParam{
|
||||
StoreList: lists,
|
||||
}
|
||||
globals.SugarLogger.Debug("lists,ShopBatchCreateStoreParam", list, ShopBatchCreateStoreParam)
|
||||
if resp, err := a.BatchCreateStore(ShopBatchCreateStoreParam); err != nil {
|
||||
globals.SugarLogger.Debug("BatchCreateStore wrong on :%v", ShopBatchCreateStoreParam, err)
|
||||
return "", err
|
||||
} else {
|
||||
if len(resp.ResultList) == 0 {
|
||||
return "", errors.New(fmt.Sprintf("创建店铺失败:%v", err))
|
||||
}
|
||||
var storeIDs string
|
||||
for k, v := range resp.ResultList {
|
||||
globals.SugarLogger.Debug("jhsadfgjhafjgh")
|
||||
if k != len(resp.ResultList) {
|
||||
globals.SugarLogger.Debug("defafafaggh")
|
||||
storeIDs = utils.Int64ToStr(v.Store.StoreId) + ","
|
||||
}
|
||||
storeIDs = utils.Int64ToStr(v.Store.StoreId)
|
||||
}
|
||||
globals.SugarLogger.Debug("storeIDs==============", storeIDs, utils.Int64ToStr(resp.ResultList[0].Store.StoreId))
|
||||
if utils.Str2Int(storeIDs) == 0 {
|
||||
//if len(resp.ResultList) == 0 {
|
||||
// return "", errors.New(fmt.Sprintf("创建店铺失败:%v", err))
|
||||
//}
|
||||
//for k, v := range resp.ResultList {
|
||||
// if k != len(resp.ResultList) {
|
||||
// storeIDs = utils.Int64ToStr(v.Store.StoreId) + ","
|
||||
// }
|
||||
// storeIDs = utils.Int64ToStr(v.Store.StoreId)
|
||||
//}
|
||||
storeIDs = utils.Int64ToStr(resp.ResultList[0].Store.StoreId)
|
||||
if utils.Str2Int(storeIDs) == 0 || len(resp.ResultList) == 0 {
|
||||
return "", errors.New(fmt.Sprintf("创建店铺失败,storeIDs = 0:%v,%v", err, resp.ResultList[0].Msg))
|
||||
}
|
||||
//创建并绑定运费模板
|
||||
|
||||
Reference in New Issue
Block a user