1
This commit is contained in:
@@ -325,7 +325,7 @@ type Store struct {
|
|||||||
AutoReplyType int8 `json:"autoReplyType"` // 订单评价自动回复类型
|
AutoReplyType int8 `json:"autoReplyType"` // 订单评价自动回复类型
|
||||||
LinkStoreID int `orm:"column(link_store_id);default(0);index" json:"linkStoreID"` // 关联门店ID
|
LinkStoreID int `orm:"column(link_store_id);default(0);index" json:"linkStoreID"` // 关联门店ID
|
||||||
StoreLevel string `orm:"default(C);size(32)" json:"storeLevel"` // 门店等级(筛选用,京西的)
|
StoreLevel string `orm:"default(C);size(32)" json:"storeLevel"` // 门店等级(筛选用,京西的)
|
||||||
Comment string `orm:"size(255)" json:"comment"` //门店备注
|
Comment string `orm:"size(255)" json:"comment"` // 门店备注
|
||||||
|
|
||||||
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
PrinterDisabled int8 `orm:"default(0)" json:"printerDisabled"` // 是否禁用网络打印机
|
||||||
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体0:(正常大小1份),1:(大字体一份),2(正常字体两份),3(打字体两份)
|
PrinterFontSize int8 `orm:"default(0)" json:"printerFontSize"` // 打印字体0:(正常大小1份),1:(大字体一份),2(正常字体两份),3(打字体两份)
|
||||||
|
|||||||
@@ -67,13 +67,12 @@ func CreateSaleTemp(storeId int64, api *tiktokShop.API) (int64, error) {
|
|||||||
func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao.StoreDetail) (int64, error) {
|
func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao.StoreDetail) (int64, error) {
|
||||||
// 没有模板是查询线上模板
|
// 没有模板是查询线上模板
|
||||||
freightId, _ := api.GetStoreBindTemp(utils.Str2Int64(vendorStoreID))
|
freightId, _ := api.GetStoreBindTemp(utils.Str2Int64(vendorStoreID))
|
||||||
globals.SugarLogger.Debugf("freightId =err %d", freightId)
|
|
||||||
if freightId == 0 {
|
if freightId == 0 {
|
||||||
// 创建门店运费模板
|
// 创建门店运费模板
|
||||||
productProvince := utils.Str2Int64(utils.Int2Str(storeDetail.ProvinceCode)[0:2])
|
productProvince := utils.Str2Int64(utils.Int2Str(storeDetail.ProvinceCode)[0:2])
|
||||||
tempDetail := &freightTemplate_create_request.FreightTemplateCreateParam{
|
tempDetail := &freightTemplate_create_request.FreightTemplateCreateParam{
|
||||||
Template: &freightTemplate_create_request.Template{
|
Template: &freightTemplate_create_request.Template{
|
||||||
TemplateName: storeDetail.Name + "_" + utils.Int64ToStr(rand.Int63n(int64(storeDetail.ID))) + "_系统模板",
|
TemplateName: storeDetail.Name + "_" + utils.Int64ToStr(rand.Int63n(int64(storeDetail.ID))) + "_",
|
||||||
ProductProvince: productProvince,
|
ProductProvince: productProvince,
|
||||||
ProductCity: int64(storeDetail.CityCode),
|
ProductCity: int64(storeDetail.CityCode),
|
||||||
CalculateType: 2,
|
CalculateType: 2,
|
||||||
@@ -81,7 +80,8 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao
|
|||||||
RuleType: 1, // 模板类型-0:阶梯计价 1:固定运费 2:卖家包邮 3:货到付款
|
RuleType: 1, // 模板类型-0:阶梯计价 1:固定运费 2:卖家包邮 3:货到付款
|
||||||
FixedAmount: 500, //固定运费 单位:分
|
FixedAmount: 500, //固定运费 单位:分
|
||||||
},
|
},
|
||||||
Columns: []freightTemplate_create_request.ColumnsItem{
|
}
|
||||||
|
Columns := []freightTemplate_create_request.ColumnsItem{
|
||||||
{
|
{
|
||||||
RuleAddress: fmt.Sprintf(`{"%d":{"%s":{"%s":nil}}}`, productProvince, utils.Int2Str(storeDetail.CityCode), utils.Int2Str(storeDetail.DistrictCode)),
|
RuleAddress: fmt.Sprintf(`{"%d":{"%s":{"%s":nil}}}`, productProvince, utils.Int2Str(storeDetail.CityCode), utils.Int2Str(storeDetail.DistrictCode)),
|
||||||
IsOverFree: true,
|
IsOverFree: true,
|
||||||
@@ -102,7 +102,14 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao
|
|||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
// 固定运费模板
|
||||||
|
if storeDetail.DeliveryFeeDeductionSill == 0 {
|
||||||
|
tempDetail.Template.TemplateName += "固定运费模板"
|
||||||
|
} else {
|
||||||
|
// 满减运费模板
|
||||||
|
tempDetail.Template.TemplateName += "满减运费模板"
|
||||||
|
tempDetail.Columns = Columns // 满减
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("tempDetail ========= %s", utils.Format4Output(tempDetail, false))
|
globals.SugarLogger.Debugf("tempDetail ========= %s", utils.Format4Output(tempDetail, false))
|
||||||
temp, err := api.FreightTemplateCreate(tempDetail)
|
temp, err := api.FreightTemplateCreate(tempDetail)
|
||||||
|
|||||||
Reference in New Issue
Block a user