2024年6月19日 修复获取价格

This commit is contained in:
bai 2024-06-19 19:36:41 +08:00
parent f56a9cb904
commit 07e354502f
3 changed files with 6 additions and 6 deletions

View File

@ -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);
}

View File

@ -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){

View File

@ -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)) {