From 410e261a251e07b17bba8aa9b098eb21c34de5cb Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 30 七月 2025 16:30:53 +0800 Subject: [PATCH] 添加证联集成 --- DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 36 insertions(+), 17 deletions(-) diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java index abdd299..aa50484 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java @@ -8,10 +8,8 @@ import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; -import com.stylefeng.guns.modular.system.model.Company; -import com.stylefeng.guns.modular.system.model.Driver; -import com.stylefeng.guns.modular.system.model.OrderAdditionalFee; -import com.stylefeng.guns.modular.system.model.OrderPosition; +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.util.*; import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; @@ -68,6 +66,12 @@ @Autowired private IOrderAdditionalFeeService orderAdditionalFeeService; + @Resource + private UserInfoMapper userInfoMapper; + + + @Autowired + private TDriverPromotionActivityService driverPromotionActivityService; @@ -133,7 +137,7 @@ * @throws Exception */ @Override - public synchronized ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { + public ResultUtil grabOrder(Integer orderId, Integer uid) throws Exception { OrderPrivateCar orderPrivateCar1 = orderPrivateCarService.selectById(orderId); if(null != orderPrivateCar1 && orderPrivateCar1.getType() == 3 && orderPrivateCar1.getState() != 1&& orderPrivateCar1.getState() != 11){ return ResultUtil.error("订单已被抢了"); @@ -196,16 +200,20 @@ orderTaxi.setSnatchOrderTime(new Date()); //调用高德创建轨迹 - String s = gdFalconUtil.selectTerminal(driver.getPhone()); - String track = gdFalconUtil.createTrack(s); - orderTaxi.setTrackId(track); +// String s = gdFalconUtil.selectTerminal(driver.getPhone()); +// String track = gdFalconUtil.createTrack(s); +// orderTaxi.setTrackId(track); +// +// //调用移动的小号接口 +// Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); +// if(String.valueOf(map.get("code")).equals("200")){ +// orderTaxi.setTelX(map.get("telX")); +// orderTaxi.setBindId(map.get("bindId")); +// } - //调用移动的小号接口 - Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); - if(String.valueOf(map.get("code")).equals("200")){ - orderTaxi.setTelX(map.get("telX")); - orderTaxi.setBindId(map.get("bindId")); - } + // 是否推广订单 + Integer promotion = isPromotion(orderTaxi.getUserId()); + orderTaxi.setPromotion(promotion); this.updateById(orderTaxi); @@ -279,7 +287,18 @@ return ResultUtil.success(orderTaxi.getId()); } + private Integer isPromotion(Integer userId){ + UserInfo userInfo = userInfoMapper.selectById(userId); + if(userInfo.getBindDriverId()!=null && userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ + String registAreaCode = userInfo.getRegistAreaCode(); + TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", registAreaCode).ge("startTime", new Date()).lt("endTime", new Date()).last("AND FIND_IN_SET(" + 1 + ", bizType) limit 1")); + if(tDriverPromotionActivity!=null){ + return 2; + } + } + return null; + } public OrderTaxi setOrderTaxi(OrderPrivateCar orderPrivateCar){ @@ -356,9 +375,9 @@ } //调用高德创建轨迹 - String s = gdFalconUtil.selectTerminal(driver.getPhone()); - String track = gdFalconUtil.createTrack(s); - orderTaxi.setTrackId(track); +// String s = gdFalconUtil.selectTerminal(driver.getPhone()); +// String track = gdFalconUtil.createTrack(s); +// orderTaxi.setTrackId(track); //调用移动的小号接口 TODO 车载端使用真实号码 // Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); -- Gitblit v1.7.1