DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -1,6 +1,5 @@ package com.stylefeng.guns.modular.api; import cn.hutool.core.io.FileUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; @@ -33,6 +32,7 @@ import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.geo.Circle; @@ -49,8 +49,6 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.io.File; import java.io.InputStream; import java.math.BigDecimal; import java.text.MessageFormat; import java.text.SimpleDateFormat; @@ -1870,8 +1868,20 @@ ArrayList<CompanyVo> companyVos = new ArrayList<>(); List<CompanyCity> companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("areaCode", areaCode).eq("state", 1)); if(companyCities.isEmpty()){ // 最后两位替换为0 String cityCode = areaCode.substring(0, areaCode.length() - 2) + "00"; companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("cityCode", cityCode).eq("state", 1)); } if(CollectionUtils.isEmpty(companyCities)) { // 最后四位替换为0 String provinceCode = areaCode.substring(0, areaCode.length() - 4) + "0000"; companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("provinceCode", provinceCode).eq("state", 1)); } if(CollectionUtils.isEmpty(companyCities)) { return ResultUtil.success(companyVos); } Wrapper<Company> in = new EntityWrapper<Company>().ne("type", 1).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList())); if(ToolUtil.isNotEmpty( name)){ UserYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/ServerCarModelServiceImpl.java
@@ -173,19 +173,19 @@ * @throws Exception */ public List<ServerCarModelWarpper> getPrice(Integer companyId, double distance, long duration, long wait, Integer type, Map<String, String> geocode) throws Exception { System.err.println("预估里程:" + distance); System.err.println("预估时间:" + duration); log.debug("预估里程:" + distance); log.debug("预估时间:" + duration); String provinceCode = geocode.get("provinceCode"); String cityCode = geocode.get("cityCode"); String districtCode = geocode.get("districtCode"); //获取匹配的城市价格配置 SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(provinceCode, cityCode, districtCode); System.err.println("获取匹配的城市价格配置:" + systemPriceCity); log.debug("获取匹配的城市价格配置:" + systemPriceCity); if (null == systemPriceCity) { return new ArrayList<>(); } List<Map<String, Object>> list = serverCarModelMapper.queryServerCarModel(type); System.err.println("获取匹配的城市价格配置111:" + list); log.debug("获取匹配的城市价格配置111:" + list); List<ServerCarModelWarpper> data = new ArrayList<>(); for (Map<String, Object> map : list) { Map<String, Object> query1 = systemPriceMapper.query(companyId, type, Integer.valueOf(map.get("id").toString()), systemPriceCity.getId()); @@ -431,11 +431,7 @@ * 专车费用计算 */ public Map<String, Object> calculationPrice(JSONObject rule, double distance, long duration, long wait, Double waitMoney) throws Exception { System.err.println("专车费计算参数1:" + rule); System.err.println("专车费计算参数2:" + distance); System.err.println("专车费计算参数3:" + duration); System.err.println("专车费计算参数4:" + wait); System.err.println("专车费计算参数5:" + waitMoney); log.debug("专车费计算参数1:{},参数2: {},参数3: {},参数4: {},参数5: {}", rule, distance, duration, wait, waitMoney); Map<String, Object> map = new HashMap<>(); Date date = new Date();