parent
4cb15bf386
commit
abeb57e19a
@ -0,0 +1,62 @@
|
||||
package com.mashibing.constant;
|
||||
|
||||
public class AmapConfigConstants {
|
||||
/**
|
||||
* 路径规划地址
|
||||
*/
|
||||
public static final String DIRECTION_URL = "https://restapi.amap.com/v3/direction/driving";
|
||||
|
||||
/**
|
||||
* 行政区域查询
|
||||
*/
|
||||
public static final String DISTRICT_URL = "https://restapi.amap.com/v3/config/district";
|
||||
|
||||
/**
|
||||
* 新增服务
|
||||
*/
|
||||
public static final String SERVICE_ADD_URL = "https://tsapi.amap.com/v1/track/service/add";
|
||||
|
||||
/**
|
||||
* 创建终端
|
||||
*/
|
||||
public static final String TERMINAL_ADD = "https://tsapi.amap.com/v1/track/terminal/add";
|
||||
|
||||
/**
|
||||
* 创建轨迹
|
||||
*/
|
||||
public static final String TRACK_ADD = "https://tsapi.amap.com/v1/track/trace/add";
|
||||
|
||||
/**
|
||||
* 轨迹点上传
|
||||
*/
|
||||
public static final String POINT_UPLOAD = "https://tsapi.amap.com/v1/track/point/upload";
|
||||
|
||||
/**
|
||||
* 终端搜索
|
||||
*/
|
||||
public static final String TERMINAL_AROUNDSEARCH = "https://tsapi.amap.com/v1/track/terminal/aroundsearch";
|
||||
|
||||
|
||||
/**
|
||||
* 路径规划 json key值
|
||||
*/
|
||||
public static final String STATUS = "status";
|
||||
|
||||
public static final String ROUTE = "route";
|
||||
|
||||
public static final String PATHS = "paths";
|
||||
|
||||
public static final String DISTANCE = "distance";
|
||||
|
||||
public static final String DURATION = "duration";
|
||||
|
||||
public static final String DISTRICTS = "districts";
|
||||
|
||||
public static final String ADCODE = "adcode";
|
||||
|
||||
public static final String NAME = "name";
|
||||
|
||||
public static final String LEVEL = "level";
|
||||
|
||||
public static final String STREET = "street";
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.mashibing.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ForecastPriceResponse {
|
||||
|
||||
private double price;
|
||||
|
||||
private String cityCode;
|
||||
|
||||
private String vehicleType;
|
||||
|
||||
private String fareType;
|
||||
|
||||
private Integer fareVersion;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.mashibing.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class BigDecimalUtils {
|
||||
|
||||
/**
|
||||
* 加法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double add(double v1 , double v2){
|
||||
BigDecimal b1 = BigDecimal.valueOf(v1);
|
||||
BigDecimal b2 = BigDecimal.valueOf(v2);
|
||||
|
||||
return b1.add(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 减法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double substract(double v1,double v2){
|
||||
BigDecimal b1 = BigDecimal.valueOf(v1);
|
||||
BigDecimal b2 = BigDecimal.valueOf(v2);
|
||||
return b1.subtract(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 乘法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double multiply(double v1,double v2){
|
||||
BigDecimal b1 = BigDecimal.valueOf(v1);
|
||||
BigDecimal b2 = BigDecimal.valueOf(v2);
|
||||
return b1.multiply(b2).doubleValue();
|
||||
|
||||
}
|
||||
/**
|
||||
* 除法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double divide(int v1, int v2){
|
||||
if (v2 <= 0){
|
||||
throw new IllegalArgumentException("除数非法");
|
||||
}
|
||||
|
||||
BigDecimal b1 = BigDecimal.valueOf(v1);
|
||||
BigDecimal b2 = BigDecimal.valueOf(v2);
|
||||
return b1.divide(b2,2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue