| | |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.service.impl.OpenCityServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.OrderUtil; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.CreateTravelItineraryRequest; |
| | |
| | | |
| | | @Resource |
| | | private SystemPriceMapper systemPriceMapper; |
| | | |
| | | @Autowired |
| | | private ISystemPriceCityService systemPriceCityService; |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | @Autowired |
| | | private OpenCityServiceImpl openCityServiceImpl; |
| | | |
| | | |
| | | /** |
| | | * 获取司机端首页订单列表 |
| | | * |
| | |
| | | * @throws Exception |
| | | */ |
| | | public OrderPrivateCar setMoney(OrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception { |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | SystemPriceCity systemPriceCity = systemPriceCityService.queryOne(geocode.get("provinceCode"), geocode.get("cityCode"), geocode.get("districtCode")); |
| | | Map<String, Object> query1 = systemPriceMapper.query(systemPriceCity.getId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | //开始根据不同的方式计算金额 |
| | | double amount = 0; |
| | | JSONObject jsonObject = JSON.parseObject(String.valueOf(query1.get("content"))); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:24 |
| | | */ |
| | | public interface SystemPriceCityMapper extends BaseMapper<SystemPriceCity> { |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取价格 |
| | | * @param companyId |
| | | * @param systemPriceCityId |
| | | * @param type |
| | | * @return |
| | | */ |
| | | Map<String, Object> query(@Param("companyId") Integer companyId, @Param("type") Integer type, |
| | | Map<String, Object> query(@Param("systemPriceCityId") Integer systemPriceCityId, @Param("type") Integer type, |
| | | @Param("serverCarModelId") Integer serverCarModelId); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.SystemPriceCityMapper"> |
| | | |
| | | </mapper> |
| | |
| | | contentExclusive as contentExclusive, |
| | | contentPrice as contentPrice, |
| | | isOpen as isOpen |
| | | from t_system_price where state = 1 and companyId = #{companyId} |
| | | from t_system_price where state = 1 and systemPriceCityId = #{systemPriceCityId} |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | | </if> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:16 |
| | | */ |
| | | @Data |
| | | @TableName("t_system_price_city") |
| | | public class SystemPriceCity extends BaseBean { |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("areaCode") |
| | | private String areaCode; |
| | | /** |
| | | * 省名称 |
| | | */ |
| | | @TableField("areaName") |
| | | private String areaName; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 市名称 |
| | | */ |
| | | @TableField("cityName") |
| | | private String cityName; |
| | | /** |
| | | * 区县编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 区县名称 |
| | | */ |
| | | @TableField("provinceName") |
| | | private String provinceName; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:24 |
| | | */ |
| | | public interface ISystemPriceCityService extends IService<SystemPriceCity> { |
| | | |
| | | |
| | | /** |
| | | * 查询匹配的数据 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param districtCode |
| | | * @return |
| | | */ |
| | | SystemPriceCity queryOne(String provinceCode, String cityCode, String districtCode); |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceCityMapper; |
| | | import com.stylefeng.guns.modular.system.model.SystemPriceCity; |
| | | import com.stylefeng.guns.modular.system.service.ISystemPriceCityService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2025/7/26 9:25 |
| | | */ |
| | | @Service |
| | | public class SystemPriceCityServiceImpl extends ServiceImpl<SystemPriceCityMapper, SystemPriceCity> implements ISystemPriceCityService { |
| | | |
| | | |
| | | /** |
| | | * 查询匹配数据 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param districtCode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SystemPriceCity queryOne(String provinceCode, String cityCode, String districtCode) { |
| | | SystemPriceCity systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode).eq("provinceCode", districtCode)); |
| | | if(null == systemPriceCity){ |
| | | systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode).eq("cityCode", cityCode)); |
| | | if(null == systemPriceCity){ |
| | | systemPriceCity = this.selectOne(new EntityWrapper<SystemPriceCity>().eq("areaCode", provinceCode)); |
| | | } |
| | | } |
| | | return systemPriceCity; |
| | | }} |
| | |
| | | /** |
| | | * 私钥地址 |
| | | */ |
| | | // String privateKeyPath = "C:\\Users\\Admin\\Desktop\\qyt\\private_key_test.pem"; |
| | | String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | String privateKeyPath = "C:\\Users\\Admin\\Desktop\\qyt\\private_key_test.pem"; |
| | | // String privateKeyPath = "C:\\Users\\39373\\Desktop\\黔云通\\private_key_test.pem"; |
| | | /** |
| | | * 私钥地址 |
| | | */ |