| | |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.ServerCarModelWarpper; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class ServerCarModelServiceImpl extends ServiceImpl<ServerCarModelMapper, ServerCarModel> implements IServerCarModelService { |
| | | |
| | |
| | | return data; |
| | | } |
| | | |
| | | |
| | | public ServerCarModelWarpper getTextPrice(Integer companyId, double distance, long duration, long wait, Integer type, Map<String, String> geocode) throws Exception { |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | |
| | | if (null == query1) {//排除没有设置价格的车型 |
| | | return null; |
| | | } |
| | | |
| | | log.debug("出租车-城市价格配置:{}", JSONArray.toJSONString(systemPriceCity)); |
| | | log.debug("出租车-设置价格的配置:{}", JSONArray.toJSONString(query1)); |
| | | log.debug("出租车-实际公里:{}", distance); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | double d = distance / 1000;//实际公里 |
| | | double t = duration / 60;//实际时间 |
| | |
| | | serverCarModelWarpper.setContentNotThree(new JSONObject()); |
| | | serverCarModelWarpper.setContentExclusive(jsonObject); |
| | | serverCarModelWarpper.setContentPrice(new JSONObject()); |
| | | |
| | | log.debug("出租车-价格计算结果为:{}", JSONArray.toJSONString(serverCarModelWarpper)); |
| | | return serverCarModelWarpper; |
| | | } |
| | | |