bug修改 订单数据查询优化 数据上传行政区划代码更换为订单所属行政区划代码
3个文件已修改
169 ■■■■ 已修改文件
DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml 122 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
@@ -103,12 +103,17 @@
     * 订单发起接口
     * @param orderId
     */
    public void orderCreate(Integer orderId) throws Exception {
    public void orderCreate(Integer orderId)  {
        OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
        Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
        JSONObject jsonObject = new JSONObject();
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("Address", geocode.get("provinceCode"));//发起第行政区划代码
@@ -153,14 +158,19 @@
     * 订单成功接口
     * @param orderId
     */
    public void orderMatch(Integer orderId) throws Exception {
    public void orderMatch(Integer orderId)  {
        OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
        Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
        Car car = carService.selectById(orderPrivateCar.getCarId());
        String value = redisUtil.getValue("DRIVER" + orderPrivateCar.getDriverId());
        JSONObject jsonObject = new JSONObject();
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("Address", geocode.get("provinceCode"));//发起第行政区划代码
@@ -375,7 +385,7 @@
     * 经营支付接口
     * @param orderId
     */
    public void operatePay(Integer orderId) throws Exception {
    public void operatePay(Integer orderId)  {
        OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
        Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
        Map<String, Object> query = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
@@ -385,7 +395,12 @@
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("OrderId", orderPrivateCar.getOrderNum());//订单号
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("OnArea", geocode.get("provinceCode"));//发起第行政区划代码
@@ -481,7 +496,7 @@
     * 驾驶员定位信息
     * @param orderId
     */
    public void positionDriver(Integer orderId) throws Exception {
    public void positionDriver(Integer orderId) {
        OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
        Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
        Car car = carService.selectById(orderPrivateCar.getCarId());
@@ -524,7 +539,12 @@
        }
        jsonObject.put("LicenseId", driver.getIdCard());//机动车驾驶证号
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("DriverRegionCode", geocode.get("provinceCode"));//发起第行政区划代码
@@ -567,7 +587,7 @@
     * 车辆定位信息
     * @param orderId
     */
    public void positionVehicle(Integer orderId) throws Exception {
    public void positionVehicle(Integer orderId) {
        OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
        Car car = carService.selectById(orderPrivateCar.getCarId());
        List<OrderPosition> orderPositions = null;
@@ -603,7 +623,12 @@
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("VehicleNo", car.getCarLicensePlate());//车辆号牌
        if (orderPrivateCar.getBoardingLon()!=null && orderPrivateCar.getBoardingLat()!=null){
            Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            Map<String, String> geocode = null;
            try {
                geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getBoardingLon() + "", orderPrivateCar.getBoardingLat() + "");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (geocode!=null){
                System.err.println("数据上传--经纬度转行政区划代码");
                jsonObject.put("VehicleRegionCode", geocode.get("provinceCode"));//发起第行政区划代码
ManagementZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
@@ -77,58 +77,132 @@
    <!--根据条件查询专车订单列表-->
    <select id="getPrivateCarOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
        SELECT * FROM (SELECT ui.nickName as userName,ui.phone as userPhone,CONCAT(di.`name`,'-',di.phone) as driver,CONCAT(cb.`name`,'-',ci.carLicensePlate) as car,
        sc.`name` as serverCarModel,ot.* FROM t_order_private_car as ot
        LEFT JOIN t_user as ui on ui.id = ot.userId
        LEFT JOIN t_driver as di on di.id = ot.driverId
        LEFT JOIN t_car as ci on ci.id= ot.carId
        LEFT JOIN t_car_brand as cb on cb.id = ci.carBrandId
        LEFT JOIN t_server_carmodel as sc on sc.id = ot.serverCarModelId
        ) as o
        SELECT
        ui.nickName as userName,
        ui.phone as userPhone,
        CONCAT(di.`name`, '-', di.phone) as driver,
        CONCAT(cb.`name`, '-', ci.carLicensePlate) as car,
        sc.`name` as serverCarModel,
        ot.id,
        ot.type,
        ot.userId,
        ot.driverId,
        ot.carId,
        ot.orderNum,
        ot.placementLon,
        ot.placementLat,
        ot.placementAddress,
        ot.startLon,
        ot.startLat,
        ot.endLon,
        ot.startAddress,
        ot.endLat,
        ot.endAddress,
        ot.boardingLon,
        ot.boardingLat,
        ot.boardingAddress,
        ot.boardingTime,
        ot.getoffLon,
        ot.getoffLat,
        ot.getoffAddress,
        ot.getoffTime,
        ot.mileage,
        ot.payManner,
        ot.payType,
        ot.orderMoney,
        ot.startMoney,
        ot.mileageMoney,
        ot.durationMoney,
        ot.longDistanceMoney,
        ot.parkMoney,
        ot.roadTollMoney,
        ot.redPacketMoney,
        ot.couponMoney,
        ot.redPacketId,
        ot.couponId,
        ot.discount,
        ot.discountMoney,
        ot.activityId,
        ot.companyId,
        ot.payMoney,
        ot.substitute,
        ot.passengers,
        ot.passengersPhone,
        ot.state,
        ot.insertTime,
        ot.travelTime,
        ot.snatchOrderTime,
        ot.setOutTime,
        ot.arriveTime,
        ot.startServiceTime,
        ot.endServiceTime,
        ot.orderType,
        ot.orderSource,
        ot.invoiceId,
        ot.isReassign,
        ot.reassignNotice,
        ot.trackId,
        ot.isDelete,
        ot.oldState,
        ot.telX,
        ot.bindId,
        ot.serverCarModelId
        FROM
        t_order_private_car as ot
        LEFT JOIN
        t_user as ui ON ui.id = ot.userId
        LEFT JOIN
        t_driver as di ON di.id = ot.driverId
        LEFT JOIN
        t_car as ci ON ci.id = ot.carId
        LEFT JOIN
        t_car_brand as cb ON cb.id = ci.carBrandId
        LEFT JOIN
        t_server_carmodel as sc ON sc.id = ot.serverCarModelId
        <where>
            o.isDelete = 1 and o.type = 1
            ot.isDelete = 1
            AND ot.type = 1
            <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
                AND (o.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
                AND (ot.insertTime BETWEEN CONCAT(#{beginTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59'))
            </if>
            <if test="orderNum != null and orderNum != ''">
                and o.orderNum  LIKE CONCAT('%',#{orderNum},'%')
                AND ot.orderNum LIKE CONCAT('%', #{orderNum}, '%')
            </if>
            <if test="orderSource != null and orderSource != ''">
                and o.orderSource = #{orderSource}
                AND ot.orderSource = #{orderSource}
            </if>
            <if test="userName != null and userName != ''">
                and o.userName  LIKE CONCAT('%',#{userName},'%')
                AND ui.nickName LIKE CONCAT('%', #{userName}, '%')
            </if>
            <if test="userPhone != null and userPhone != ''">
                and o.userPhone  LIKE CONCAT('%',#{userPhone},'%')
                AND ui.phone LIKE CONCAT('%', #{userPhone}, '%')
            </if>
            <if test="passengers != null and passengers != ''">
                and o.passengers  LIKE CONCAT('%',#{passengers},'%')
                AND ot.passengers LIKE CONCAT('%', #{passengers}, '%')
            </if>
            <if test="passengersPhone != null and passengersPhone != ''">
                and o.passengersPhone  LIKE CONCAT('%',#{passengersPhone},'%')
                AND ot.passengersPhone LIKE CONCAT('%', #{passengersPhone}, '%')
            </if>
            <if test="serverCarModelId != null and serverCarModelId != ''">
                and o.serverCarModelId  = #{serverCarModelId}
                AND ot.serverCarModelId = #{serverCarModelId}
            </if>
            <if test="driver != null and driver != ''">
                and o.driver  LIKE CONCAT('%',#{driver},'%')
                AND (di.`name` LIKE CONCAT('%', #{driver}, '%') OR di.phone LIKE CONCAT('%', #{driver}, '%'))
            </if>
            <if test="state != null and state != ''">
                and o.state = #{state}
                AND ot.state = #{state}
            </if>
            <if test="smsNumber != null and smsNumber != ''">
                and o.smsNumber = #{smsNumber}
                AND ot.smsNumber = #{smsNumber}
            </if>
            <if test="roleType != null and roleType != '' and roleType == 2">
                and (o.companyId = #{nowUserId} or FIND_IN_SET(o.companyId,(SELECT GROUP_CONCAT(id) as ids FROM t_company where superiorId = #{nowUserId} GROUP BY superiorId)))
                AND (ot.companyId = #{nowUserId} OR FIND_IN_SET(ot.companyId, (SELECT GROUP_CONCAT(id) as ids FROM t_company WHERE superiorId = #{nowUserId} GROUP BY superiorId)))
            </if>
            <if test="roleType != null and roleType != '' and roleType == 3">
                and o.companyId = #{nowUserId}
                AND ot.companyId = #{nowUserId}
            </if>
        </where>
        order by o.id desc
        order by ot.id desc
    </select>
    <!--根据专车订单ID获取专车订单详情-->
MinistryOfTransport/src/main/java/com/sinata/ministryoftransport/util/MinistryOfTransport.java
@@ -46,7 +46,7 @@
        Map<String, Object> data = new HashMap<>();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("CompanyId", CompanyId);
        jsonObject.put("CompanyName", baseInfoCompanya.getCompanyName());//公司名称
        jsonObject.put("CompanyName", baseInfoCompany.getCompanyName());//公司名称
        jsonObject.put("Identifier", baseInfoCompany.getIdentifier());//统一社会信用代码
        jsonObject.put("Address", baseInfoCompany.getAddress());//注册地行政区划代码
        jsonObject.put("BusinessScope", baseInfoCompany.getBusinessScope());//经营范围