Pu Zhibing
2024-12-12 f4c42ef27bf35c59dc7f23e49e8f7671b4baa378
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -1155,8 +1155,7 @@
                        userRedPacketRecordService.updateBatchById(userRedPacketRecords);
                    }
                    orderLogistics.setRedPacketId(jsonArray.toJSONString());
                }
                if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
                    orderLogistics.setRedPacketMoney(total);
                    orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN);
                    //获取红包id
@@ -1264,21 +1263,21 @@
                userCouponRecord.setEndTime(new Date());
                userCouponRecordService.updateById(userCouponRecord);
            }
            if(null != orderLogistics.getRedPacketId()){
                JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId());
                for (int i = 0; i < jsonArray.size(); i++) {
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    Integer id1 = jsonObject.getInteger("id");
                    Double money = jsonObject.getDouble("money");
                    UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1);
                    userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money);
                    if(0 == userRedPacketRecord.getRemainingAmount()){
                        userRedPacketRecord.setState(2);
                        userRedPacketRecord.setEndTime(new Date());
                    }
                    userRedPacketRecordService.updateById(userRedPacketRecord);
                }
            }
//            if(null != orderLogistics.getRedPacketId()){
//                JSONArray jsonArray = JSON.parseArray(orderLogistics.getRedPacketId());
//                for (int i = 0; i < jsonArray.size(); i++) {
//                    JSONObject jsonObject = jsonArray.getJSONObject(i);
//                    Integer id1 = jsonObject.getInteger("id");
//                    Double money = jsonObject.getDouble("money");
//                    UserRedPacketRecord userRedPacketRecord = userRedPacketRecordService.selectById(id1);
//                    userRedPacketRecord.setRemainingAmount(userRedPacketRecord.getRemainingAmount() - money);
//                    if(0 == userRedPacketRecord.getRemainingAmount()){
//                        userRedPacketRecord.setState(2);
//                        userRedPacketRecord.setEndTime(new Date());
//                    }
//                    userRedPacketRecordService.updateById(userRedPacketRecord);
//                }
//            }
    
            //添加已收入明细
            Company company = companyService.selectById(orderLogistics.getCompanyId());
@@ -3261,10 +3260,10 @@
        if(orderLogistics.getState() == 10 || orderLogistics.getState() == 12){
            Car car = carService.selectById(orderLogistics.getCarId());
            //修改行程信息
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
            boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null);
            if(!updateTrip){
                for (int i = 0; i < 5; i++) {
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null);
                    updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderLogistics.getTripId(), null, null, null, null);
                    if(updateTrip){
                        break;
                    }