code
This commit is contained in:
@@ -460,6 +460,7 @@ func CreateFreightTemplate(storeCode int) (int64, error) {
|
|||||||
param.Columns = nil
|
param.Columns = nil
|
||||||
param.Template.TemplateName += "固定运费模板"
|
param.Template.TemplateName += "固定运费模板"
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("storeDetail.ProvinceCode==%d,storeDetail.CityCode==%d,storeDetail.DistrictCode==%d", storeDetail.ProvinceCode, storeDetail.CityCode, storeDetail.DistrictCode)
|
||||||
resp, err := getAPI(storeDetail.VendorOrgCode, storeCode, storeDetail.VendorStoreID).FreightTemplateCreate(param)
|
resp, err := getAPI(storeDetail.VendorOrgCode, storeCode, storeDetail.VendorStoreID).FreightTemplateCreate(param)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|||||||
@@ -116,8 +116,9 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
|||||||
localStore *LocalStore
|
localStore *LocalStore
|
||||||
vertex []warehouse_createFence_request.VerticesItem
|
vertex []warehouse_createFence_request.VerticesItem
|
||||||
param = &warehouse_createFence_request.WarehouseCreateFenceParam{}
|
param = &warehouse_createFence_request.WarehouseCreateFenceParam{}
|
||||||
|
sqlParam = []interface{}{}
|
||||||
)
|
)
|
||||||
sqlParam := []interface{}{}
|
|
||||||
sqlStr := `SELECT t.lng,t.lat,t.delivery_range_type,t.delivery_range FROM store t`
|
sqlStr := `SELECT t.lng,t.lat,t.delivery_range_type,t.delivery_range FROM store t`
|
||||||
if storeID != 0 {
|
if storeID != 0 {
|
||||||
sqlStr += " WHERE t.id = ? "
|
sqlStr += " WHERE t.id = ? "
|
||||||
@@ -126,7 +127,6 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
|||||||
return "", fmt.Errorf("storeID必填")
|
return "", fmt.Errorf("storeID必填")
|
||||||
}
|
}
|
||||||
if err = dao.GetRow(db, &localStore, sqlStr, sqlParam...); err == nil {
|
if err = dao.GetRow(db, &localStore, sqlStr, sqlParam...); err == nil {
|
||||||
globals.SugarLogger.Debug("localStore.DeliveryRangeType==============", localStore.DeliveryRangeType)
|
|
||||||
if localStore.DeliveryRangeType == LocalShapeCircular {
|
if localStore.DeliveryRangeType == LocalShapeCircular {
|
||||||
param = &warehouse_createFence_request.WarehouseCreateFenceParam{
|
param = &warehouse_createFence_request.WarehouseCreateFenceParam{
|
||||||
FenceInfo: &warehouse_createFence_request.FenceInfo{
|
FenceInfo: &warehouse_createFence_request.FenceInfo{
|
||||||
@@ -145,7 +145,6 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
|||||||
tempStr := strings.Split(localStore.DeliveryRange, ";")
|
tempStr := strings.Split(localStore.DeliveryRange, ";")
|
||||||
for v := len(tempStr) - 1; v > 0; v-- {
|
for v := len(tempStr) - 1; v > 0; v-- {
|
||||||
s2 := strings.Split(tempStr[v], ",")
|
s2 := strings.Split(tempStr[v], ",")
|
||||||
globals.SugarLogger.Debugf("len==%d\n s2[0]==%s\n s2[1]==%s\n s2==%s", len(s2), s2[0], s2[1], s2)
|
|
||||||
tLng, _ := strconv.ParseFloat(s2[0], 64)
|
tLng, _ := strconv.ParseFloat(s2[0], 64)
|
||||||
tLat, _ := strconv.ParseFloat(s2[1], 64)
|
tLat, _ := strconv.ParseFloat(s2[1], 64)
|
||||||
vertices := warehouse_createFence_request.VerticesItem{
|
vertices := warehouse_createFence_request.VerticesItem{
|
||||||
@@ -163,7 +162,7 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debug("多边形:vertex", param.FenceInfo.Polygon.Vertices)
|
globals.SugarLogger.Debug("多边形:vertex", param.FenceInfo.Polygon.Vertices)
|
||||||
}
|
}
|
||||||
resp, err := getAPI(appOrgCode, 0, "").CreateFence(param)
|
resp, err := getAPI(appOrgCode, 0, "").CreateFence(param)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user