From 6a78f6662534214f836dfb7ffa7d6b55dc0353ab Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期二, 05 八月 2025 18:40:16 +0800 Subject: [PATCH] update --- DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 14 +++- DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemPriceCity.java | 44 ++++++++++++++ DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceCityMapper.java | 11 +++ DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SystemPriceCityServiceImpl.java | 36 ++++++++++++ DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceCityMapper.xml | 5 + DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml | 2 DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceMapper.java | 4 DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java | 4 DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISystemPriceCityService.java | 22 +++++++ 9 files changed, 134 insertions(+), 8 deletions(-) diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java index b5f8ad0..0e0d2b5 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java @@ -15,6 +15,7 @@ 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; @@ -39,6 +40,9 @@ @Resource private SystemPriceMapper systemPriceMapper; + + @Autowired + private ISystemPriceCityService systemPriceCityService; @Autowired private IDriverService driverService; @@ -103,8 +107,10 @@ @Resource private RedisTemplate<String, Object> redisTemplate; - - + @Autowired + private OpenCityServiceImpl openCityServiceImpl; + + /** * 获取司机端首页订单列表 * @@ -1043,7 +1049,9 @@ * @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"))); diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceCityMapper.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceCityMapper.java new file mode 100644 index 0000000..f4f4d7a --- /dev/null +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceCityMapper.java @@ -0,0 +1,11 @@ +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> { +} diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceMapper.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceMapper.java index ef37769..29dd249 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceMapper.java +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SystemPriceMapper.java @@ -11,10 +11,10 @@ /** * 获取价格 - * @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); } diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceCityMapper.xml b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceCityMapper.xml new file mode 100644 index 0000000..5fbb1c7 --- /dev/null +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceCityMapper.xml @@ -0,0 +1,5 @@ +<?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> \ No newline at end of file diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml index 98a54d0..d4070cd 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SystemPriceMapper.xml @@ -24,7 +24,7 @@ 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> diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemPriceCity.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemPriceCity.java new file mode 100644 index 0000000..a1abb22 --- /dev/null +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SystemPriceCity.java @@ -0,0 +1,44 @@ +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; +} diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISystemPriceCityService.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISystemPriceCityService.java new file mode 100644 index 0000000..213b937 --- /dev/null +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISystemPriceCityService.java @@ -0,0 +1,22 @@ +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); + +} diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SystemPriceCityServiceImpl.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SystemPriceCityServiceImpl.java new file mode 100644 index 0000000..be8b967 --- /dev/null +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SystemPriceCityServiceImpl.java @@ -0,0 +1,36 @@ +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; + }} diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java index faa0c9f..ceca48f 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/qianyuntong/QianYunTongProperties.java @@ -16,8 +16,8 @@ /** * 私钥地址 */ -// 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"; /** * 私钥地址 */ -- Gitblit v1.7.1