liujie
2025-07-26 570ae72b8ab5cf51b91fd6dc48411710dbf04125
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -20,6 +20,7 @@
import com.stylefeng.guns.modular.system.dao.SysIntegralMapper;
import com.stylefeng.guns.modular.system.dao.UserActivityDiscount1Mapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.model.vo.UnPayOrderVO;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.warpper.*;
@@ -29,6 +30,7 @@
import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService;
import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService;
import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
@@ -1718,6 +1720,14 @@
        if(Integer.valueOf(String.valueOf(map.get("state"))) == 11){
            map.put("state", map.get("oldState"));
        }
        if(Integer.valueOf(String.valueOf(map.get("state"))) ==7 &&  (map.get("responsibilityType")==null || Integer.valueOf(String.valueOf(map.get("responsibilityType")))<4)){
            map.put("appealButton", 1);
        }
        if(map.get("abnormalIntro")!=null){
            map.put("appealStatus", 1);
        }
        String driverId = (String) redisTemplate.opsForValue().get("DEVICE_" + map.get("driverId"));
        map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
        map.put("orderType", 2);
@@ -1742,7 +1752,7 @@
                endPushWarpper.setState(1);
                List<PushOrder> querys = pushOrderService.querys(null, 2, orderTaxi.getCompanyId());//获取需要推送的次数
                int time = 0;
                for(int i = 1; i <= querys.size(); i++){
                for(int i = 1; i <= querys.size()+5; i++){
                    PushOrder pushOrder = pushOrderService.querys(i, 2, orderTaxi.getCompanyId()).get(0);
                    time += pushOrder.getPushTime() * 1000;
                }
@@ -2099,7 +2109,7 @@
                    }
                    Company query = companyCityService.query(String.valueOf(orderTaxi.getStartLon()), String.valueOf(orderTaxi.getStartLat()));//获取起点所属分公司
                    List<PushOrder> querys = pushOrderService.querys(null, 2, query.getId());//获取需要推送的次数
                    for (int i = 1; i <= querys.size(); i++) {
                    for (int i = 1; i <= querys.size()+5; i++) {
                        PushOrder pushOrder = pushOrderService.querys(i, 2, query.getId()).get(0);
                        System.out.println("pushOrder:" + pushOrder);
                        //获取空闲司机
@@ -2130,7 +2140,7 @@
                        if (state != 1) {
                            break;
                        }
                        if (i == querys.size() && state == 1) {
                        if (i == querys.size()+5 && state == 1) {
                            pushUtil.pushEndPush(1, orderTaxi.getUserId(), orderTaxi.getId(), 2);
                            orderIds.remove(orderTaxi.getId());
                        }
@@ -2231,4 +2241,40 @@
        driverService.updateById(driver);
        systemNoticeService.addSystemNotice(1, "您已使用" + (payType == 1 ? "微信" : (payType==2?"支付宝":"云闪付")) + "成功完成感谢费支付,谢谢使用!", userInfo.getId(), 1);
    }
    @Override
    public List<UnPayOrderVO> getUnpayTaxiOrders(Integer uid) {
       EntityWrapper<OrderTaxi> wrapper = new EntityWrapper<>();
       wrapper.eq("userId", uid);
       wrapper.eq("state", 7);
        //查出未支付订单
       List<OrderTaxi> orderTaxiList = this.selectList(wrapper);
       List<UnPayOrderVO> unPayOrderVOList = new ArrayList<>();
       for (OrderTaxi orderTaxi:orderTaxiList) {
           UnPayOrderVO unPayOrderVO = new UnPayOrderVO();
           //添加司机信息
           DriverInfoWarpper driverInfoWarpper = new DriverInfoWarpper();
           Driver driver = driverService.selectById(orderTaxi.getDriverId());
           BeanUtils.copyProperties(driver, driverInfoWarpper);
           unPayOrderVO.setDriverInfoWarpper(driverInfoWarpper);
           //其余信息
           BeanUtils.copyProperties(orderTaxi, unPayOrderVO);
           unPayOrderVOList.add(unPayOrderVO);
        }
        return unPayOrderVOList;
    }
    @Override
    public void addAppeal(Integer uid, Integer orderId, String abnormalIntro, String abnormalImg) {
        OrderTaxi orderTaxi = this.selectById(orderId);
        if(orderTaxi.getState()!=7 || orderTaxi.getAbnormalIntro()!=null){
            throw new RuntimeException("此订单无法申诉");
        }
        orderTaxi.setAbnormalIntro(abnormalIntro);
        orderTaxi.setAbnormalImg(abnormalImg);
        orderTaxi.setAbnormal(1);
        this.baseMapper.updateById(orderTaxi);
    }
}