zhibing.pu
2024-06-21 cb7ba897d7978906cd0cae284ba042a6c7040fa6
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.google.gson.Gson;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.common.constant.factory.PageFactory;
import com.stylefeng.guns.core.shiro.ShiroKit;
@@ -13,8 +14,8 @@
import com.stylefeng.guns.modular.system.dao.OrderCancelMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil;
import com.stylefeng.guns.modular.system.util.HttpRequestUtil;
import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil;
import com.stylefeng.guns.modular.system.util.PushURL;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
@@ -57,17 +58,14 @@
    @Autowired
    private ITDriverService tDriverService;
    @Autowired
    private PushMinistryOfTransportUtil pushMinistryOfTransportUtil;
    @Resource
    private OrderCancelMapper orderCancelMapper;
    @Value("${pushMinistryOfTransport}")
    private boolean pushMinistryOfTransport;
    @Value("${filePath}")
    private String filePath;
    @Autowired
    private FleetEngineUtil fleetEngineUtil;
@@ -302,29 +300,27 @@
        OrderCancel orderCancel = new OrderCancel();
        orderCancel.setOrderId(tOrderPrivateCarId);
        orderCancel.setOrderType(1);
        orderCancel.setReason("平台取消订单");
        orderCancel.setRemark("平台取消订单");
        orderCancel.setReason("The platform cancels the order");
        orderCancel.setRemark("The platform cancels the order");
        orderCancel.setUserType(2);
        orderCancel.setState(2);
        orderCancel.setInsertTime(new Date());
        orderCancelMapper.insert(orderCancel);
        //修改行程信息
        try {
            fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderPrivateCar.getTripId(), null, null, null, null);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        //增加推送
        Map<String,String> map = new HashMap<>();
        map.put("id", tOrderPrivateCar.getId().toString());
        map.put("orderType", "1");
        String result = HttpRequestUtil.postRequest(PushURL.cancel_order_url, map);
        System.out.println("专车取消:【orderId="+tOrderPrivateCar.getId().toString()+"】,调用接口:"+result);
        new Thread(new Runnable() {
            @Override
            public void run() {
                if(pushMinistryOfTransport){//上传数据
                    pushMinistryOfTransportUtil.orderCancel(tOrderPrivateCarId);
                }
            }
        }).start();
        return SUCCESS_TIP;
    }