2024年6月19日 修复获取价格
This commit is contained in:
parent
f56a9cb904
commit
07e354502f
|
@ -63,7 +63,7 @@ public class CommonConfigUtil {
|
|||
*/
|
||||
public static boolean getBooleanValue(String value) {
|
||||
if(defValueIsEmpty(value)) return false;
|
||||
return Boolean.getBoolean(value);
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "出行相关", tags = { "出行" })
|
||||
@Api(value = "出行", tags = { "APP" })
|
||||
@RequestMapping(value = "/app/travelConf")
|
||||
public class AppTravelConfController {
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class AppTravelConfController {
|
|||
private TravelConfService service;
|
||||
|
||||
@GetMapping("/calcTravelPrice")
|
||||
@ApiOperation("根据技师ID和用户所选的经纬度获取出行价格")
|
||||
@ApiOperation("计算本次服务出行金额")
|
||||
public Result2<TravelPriceVo> calcTravelPrice(@ApiParam(value = "技师ID 示例:116", required = true, example = "116") Long artificerId,
|
||||
@ApiParam(value = "经度 示例:125.294234", required = true, example = "125.294234") String toLongitude,
|
||||
@ApiParam(value = "纬度 示例:43.887282", required = true, example = "43.887282") String toLatitude){
|
||||
|
|
|
@ -222,12 +222,12 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
|
|||
if (distanceJson == null) {
|
||||
throw new SqxException("驾车路线计算失败!");
|
||||
}
|
||||
//公里数
|
||||
//距离(米)
|
||||
Integer distances = distanceJson.getInteger("distance");
|
||||
vo.setDistances(distances);
|
||||
|
||||
//转换为公里数
|
||||
BigDecimal kilometerNum = NumberUtil.mul(distances, new BigDecimal("1000"));
|
||||
//转换为公里数【距离(米) * 1000】
|
||||
BigDecimal kilometerNum = NumberUtil.div(distances, new BigDecimal("1000"));
|
||||
vo.setKilometerNum(NumberUtil.decimalFormat("0.00", kilometerNum));
|
||||
|
||||
if(TravelEnum.PricingType.FIXED.getValue().equals(pricingType)) {
|
||||
|
|
Loading…
Reference in New Issue