From b1f2f102034b4433201225b67a9fc78c08e532f0 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 06 六月 2025 18:35:03 +0800 Subject: [PATCH] 修改bug和管理后台报表 --- UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java | 64 +++++++++++++++---------------- 1 files changed, 31 insertions(+), 33 deletions(-) diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java index 64055d1..188670a 100644 --- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java +++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java @@ -622,7 +622,7 @@ } } }, 30000); - pushUtil.pushOrderState(2, driver.getId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), pushOrder.getPushTime(), audioUrl); + pushUtil.pushOrderState(2, driver.getId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), pushOrder.getPushTime(), audioUrl, "user"); } } Thread.sleep(pushOrder.getPushTime() * 1000);//设置等待时间 @@ -757,8 +757,7 @@ } orderLogistics.setDriverId(driverId); - orderLogistics.setCompanyId(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : ( - driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); + orderLogistics.setCompanyId(driver.getCompanyId()); orderLogistics.setState(2); orderLogistics.setCarId(driver.getCarId()); CarService query1 = carServiceMapper.query(1, driver.getCarId()); @@ -904,8 +903,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl); + pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl, "user"); } }).start(); } @@ -969,8 +968,7 @@ .eq("state", 1).like("type", "4")); if(driver1.getState() == 2 || null != driverWork){ orderLogistics.setDriverId(dr.getId()); - orderLogistics.setCompanyId(dr.getFranchiseeId() != null && dr.getFranchiseeId() != 0 ? dr.getFranchiseeId() : ( - dr.getCompanyId() != null && dr.getCompanyId() != 0 ? dr.getCompanyId() : 1)); + orderLogistics.setCompanyId(dr.getCompanyId()); orderLogistics.setState(2); orderLogistics.setCarId(dr.getCarId()); CarService query1 = carServiceMapper.query(4, dr.getCarId()); @@ -1039,8 +1037,8 @@ @Override public void run() { System.err.println("直推司机后推送司机订单状态"); - pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl); + pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl, "user"); } }).start(); @@ -1133,7 +1131,7 @@ if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(new BigDecimal(userCouponRecord.getFullMoney())) < 0){ return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); } - orderMoney = orderMoney.subtract(new BigDecimal(userCouponRecord.getMoney())).setScale(2, RoundingMode.HALF_EVEN); + orderMoney = orderMoney.subtract(new BigDecimal(userCouponRecord.getMoney())); orderLogistics.setCouponMoney(userCouponRecord.getMoney()); orderLogistics.setCouponId(couponId); } @@ -1149,7 +1147,7 @@ BigDecimal multiply1 = orderMoney.multiply(deductionRatio.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN); if(total > 0 && multiply1.doubleValue() > 0 && total.compareTo(multiply1.doubleValue()) >= 0){ orderLogistics.setRedPacketMoney(multiply1.doubleValue()); - orderMoney = orderMoney.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN); + orderMoney = orderMoney.subtract(multiply1); //获取红包id JSONArray jsonArray = new JSONArray(); @@ -1180,7 +1178,7 @@ orderLogistics.setRedPacketId(jsonArray.toJSONString()); }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){ orderLogistics.setRedPacketMoney(total); - orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); + orderMoney = orderMoney.subtract(new BigDecimal(total)); //获取红包id JSONArray jsonArray = new JSONArray(); for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { @@ -1328,8 +1326,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); } }).start(); @@ -1359,7 +1357,7 @@ } Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000)).setScale(0, RoundingMode.HALF_EVEN).longValue(); + Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); if(1 == finalLanguage1){ document.getElementById("english").remove(); document.getElementById("french").remove(); @@ -1934,8 +1932,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); Integer language1 = driver.getLanguage(); String text = ""; switch (language1){ @@ -2004,7 +2002,7 @@ aDouble = orderEvaluateService.queryDriverScore(orderLogistics.getDriverId()); } Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000)).setScale(0, RoundingMode.HALF_EVEN).longValue(); + Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); if(1 == finalLanguage){ document.getElementById("english").remove(); document.getElementById("french").remove(); @@ -2507,8 +2505,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); } }).start(); @@ -2565,8 +2563,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); } }).start(); @@ -2637,8 +2635,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); } }).start(); @@ -2660,7 +2658,7 @@ aDouble = orderEvaluateService.queryDriverScore(orderLogistics.getDriverId()); } Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); - Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000)).setScale(0, RoundingMode.HALF_EVEN).longValue(); + Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); if(1 == language){ document.getElementById("english").remove(); document.getElementById("french").remove(); @@ -3108,8 +3106,8 @@ new Thread(new Runnable() { @Override public void run() { - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); } }).start(); @@ -3318,8 +3316,8 @@ audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3"; break; } - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState() == 12 ? orderLogistics.getState() : 10, 0, audioUrl); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState() == 12 ? orderLogistics.getState() : 10, 0, audioUrl, "user"); } }).start(); driver.setState(2); @@ -3723,11 +3721,11 @@ } this.deleteTask(id);//删除定时任务 - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); }else{ incomeService.saveData(1, orderLogistics.getCompanyId(), 3, orderLogistics.getId(), 4, amount.doubleValue()); } - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); //添加消息 @@ -3800,11 +3798,11 @@ } this.deleteTask(orderLogistics.getId());//删除定时任务 - pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); }else{ incomeService.saveData(1, orderLogistics.getCompanyId(), 3, orderLogistics.getId(), 4, amount.doubleValue()); } - pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); + pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); //添加消息 systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 -- Gitblit v1.7.1