From bd9cabb77b9e712f1421f9b7f7a78807b87fb3d7 Mon Sep 17 00:00:00 2001 From: zhibing.pu <393733352@qq.com> Date: 星期一, 12 八月 2024 11:41:36 +0800 Subject: [PATCH] 修改2.0 bug --- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java | 5 + DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java | 2 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java | 5 + DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java | 74 ++++++++++++++++++++++++ DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 4 + DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java | 2 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml | 39 ++++++++++-- DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java | 4 + 8 files changed, 123 insertions(+), 12 deletions(-) diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java index e2a1ec1..bee5460 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java @@ -1479,7 +1479,7 @@ return ResultUtil.tokenErr(); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - List<ActivityWarpper> activityWarppers = driverService.queryMyActivity(uid, sdf.parse(time), language); + List<ActivityWarpper> activityWarppers = driverService.queryHistoryList(uid, sdf.parse(time), language); return ResultUtil.success(activityWarppers); }catch (Exception e){ e.printStackTrace(); diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java index 37a3de8..508ee95 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java @@ -1067,7 +1067,9 @@ pushUtil.removeTask(orderId, 4);//删除定时任务,结束推送数据 - systemNoticeService.addSystemNotice(1, language == 1 ? "司机已结束本次行程,谢谢使用" : language == 2 ? + UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId()); + Integer language1 = userInfo.getLanguage(); + systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ? "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderLogistics.getUserId()); //回滚司机状态为空闲 diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java index 3ab7da3..037883e 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java @@ -675,7 +675,9 @@ pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 - systemNoticeService.addSystemNotice(1, language == 1 ? "司机已结束本次行程,谢谢使用" : language == 2 ? + UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId()); + Integer language1 = userInfo.getLanguage(); + systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ? "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderPrivateCar.getUserId()); //回滚司机状态为空闲 diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java index 4aea57d..c4226fa 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java @@ -21,4 +21,9 @@ List<DriverActivityHistory> queryList(@Param("driverId") Integer driverId, @Param("type") Integer type, @Param("carryOut") Integer carryOut, @Param("start") Date start, @Param("end") Date end); + + + List<DriverActivityHistory> queryHistoryList(@Param("driverId") Integer driverId, @Param("type") Integer type, + @Param("carryOut") Integer carryOut, @Param("start") Date start, + @Param("end") Date end); } diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml index d7f2ee7..d1f80e0 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml @@ -19,14 +19,15 @@ <select id="query" resultType="map"> select - aa.*, - (CASE WHEN (select count(id) from t_driver_activity_history where driverId = #{driverId} and carryOut = 1 and `day` = aa.time) = 0 THEN 2 ELSE 1 END) carryOut + a.*, + CASE WHEN b.num = 0 THEN 2 ELSE 1 END as carryOut from ( - select - DATE_FORMAT(`day`, '%Y-%m-%d') as time, - DATE_FORMAT(`day`, '%Y-%m-%d') as paramTime - from t_driver_activity_history where driverId = #{driverId} group by `day` - ) as aa order by aa.time desc limit #{pageNum}, #{size} + select + DATE_FORMAT(`day`, '%Y-%m-%d') as time, + DATE_FORMAT(`day`, '%Y-%m-%d') as paramTime + from t_driver_activity_history where driverId = #{driverId} group by `day` + ) as a + left join (select `day`, count(id) as num from t_driver_activity_history where driverId = #{driverId} and carryOut = 1 group by `day`) b on (a.time = b.`day`) order by a.time desc limit #{pageNum}, #{size} </select> <select id="queryList" resultType="DriverActivityHistory"> @@ -50,4 +51,28 @@ and driverId = #{driverId} </if> </select> + + + + <select id="queryHistoryList" resultType="DriverActivityHistory"> + select + id as id, + `day` as `day`, + driverId as driverId, + `type` as `type`, + activityId as activityId, + carryOut as carryOut, + money as money, + insertTime as insertTime + from t_driver_activity_history where `day` between #{start} and #{end} + <if test="null != type"> + and `type` = #{type} + </if> + <if test="null != carryOut"> + and carryOut = #{carryOut} + </if> + <if test="null != driverId"> + and driverId = #{driverId} + </if> + </select> </mapper> \ No newline at end of file diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java index ea409b6..c9b3136 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverService.java @@ -275,7 +275,10 @@ * @throws Exception */ List<ActivityWarpper> queryMyActivity(Integer uid, Date time, Integer language) throws Exception; - + + + List<ActivityWarpper> queryHistoryList(Integer uid, Date time, Integer language) throws Exception; + /** * 获取历史活动 diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java index 6fa8d1c..1de4706 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverServiceImpl.java @@ -1834,6 +1834,80 @@ } return list; } + + + @Override + public List<ActivityWarpper> queryHistoryList(Integer uid, Date time, Integer language) throws Exception { + List<ActivityWarpper> list = new ArrayList<>(); + Map<String, Date> date = dateUtil.getStartAndEndDate(time); + List<DriverActivityHistory> driverActivityHistories = driverActivityHistoryMapper.queryHistoryList(uid, null, null, date.get("startTime"), date.get("endTime")); + + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); + for(DriverActivityHistory dah : driverActivityHistories){ + ActivityWarpper activityWarpper = new ActivityWarpper(); + switch (dah.getType()){ + case 1://邀请司机注册 + DriverActivityRegistered driverActivityRegistered = driverActivityRegisteredMapper.selectById(dah.getActivityId()); + activityWarpper.setId(driverActivityRegistered.getId()); + activityWarpper.setContent(language == 1 ? "邀请司机注册奖励GHS" + driverActivityRegistered.getMoney() : + language == 2 ? " Invite drivers to register for a reward of GHS" + driverActivityRegistered.getMoney(): + "Invitez les chauffeurs à s’inscrire pour une récompense de GHS" + driverActivityRegistered.getMoney()); + break; + case 2://邀请用户注册 + DriverActivityRegistered driverActivityRegistered1 = driverActivityRegisteredMapper.selectById(dah.getActivityId()); + activityWarpper.setId(driverActivityRegistered1.getId()); + activityWarpper.setContent(language == 1 ? "邀请用户注册奖励GHS" + driverActivityRegistered1.getMoney() : + language == 2 ? "Invite users to register for a reward of GHS" + driverActivityRegistered1.getMoney(): + "Invitez les utilisateurs à s’inscrire pour une récompense de GHS" + driverActivityRegistered1.getMoney()); + break; + case 3://累计在线 + DriverActivityOnline driverActivityOnline = driverActivityOnlineMapper.selectById(dah.getActivityId()); + activityWarpper.setId(driverActivityOnline.getId()); + StringBuffer sb = new StringBuffer(language == 1 ? "今日" : + language == 2 ? "Today, stay online receiving orders of " : "Aujourd’hui, reste en ligne à recevoir des commandes "); + DriverOnline query = driverOnlineMapper.query(uid, sdf1.format(new Date()), driverActivityOnline.getType(), 0); + Integer hour = 0; + if(null != query){ + hour = Long.valueOf(query.getDuration() / 3600).intValue(); + } + switch (driverActivityOnline.getType()){ + case 1: + sb.append(language == 1 ? "打车" : language == 2 ? "ride" : "de course"); + break; + case 2: + sb.append("出租车"); + continue; + case 3: + sb.append("城际出行"); + continue; + case 4: + sb.append(language == 1 ? "包裹" : language == 2 ? "delivery" : "de livraison"); + break; + } + String str = language == 1 ? "累计在线" +driverActivityOnline.getOnline() + "小时奖励GHS" +driverActivityOnline.getMoney(): + language == 2 ? " for " + driverActivityOnline.getOnline() + " hours to get a reward of GHS" + driverActivityOnline.getMoney(): + " pendant " + driverActivityOnline.getOnline() + " heures afin d'obtenir une récompense de GHS" + driverActivityOnline.getMoney(); + activityWarpper.setContent(sb.append(str).toString()); + activityWarpper.setCarryOut((dah.getCarryOut() == 2 || hour > driverActivityOnline.getOnline()) ? driverActivityOnline.getOnline() + "/" +driverActivityOnline.getOnline() : hour + "/" + driverActivityOnline.getOnline()); + break; + case 4://订单量 + DriverActivityOrder driverActivityOrder = driverActivityOrderMapper.selectById(dah.getActivityId()); + activityWarpper.setId(driverActivityOrder.getId()); + activityWarpper.setContent(language == 1 ? "今日" + driverActivityOrder.getStart() + "-" + driverActivityOrder.getEnd() + "累计接单" + driverActivityOrder.getOrderNum() + "单奖励GHS" + driverActivityOrder.getMoney(): + language == 2 ? "Today " + driverActivityOrder.getStart() + "-" + driverActivityOrder.getEnd() + ", complete " + driverActivityOrder.getOrderNum() + " orders for a reward of GHS" + driverActivityOrder.getMoney() : + "Aujourd’hui de " + driverActivityOrder.getStart() + " à " + driverActivityOrder.getEnd() + ", complétez " + driverActivityOrder.getOrderNum() + " commandes pour une récompense de GHS" + driverActivityOrder.getMoney()); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date start = sdf.parse(sdf1.format(time) + " " + driverActivityOrder.getStart() + ":00"); + Date end = sdf.parse(sdf1.format(time) + " " + driverActivityOrder.getEnd() + ":59"); + Integer integer = orderService.queryOrderNum(uid, start, end); + activityWarpper.setCarryOut(integer.compareTo(driverActivityOrder.getOrderNum()) > 0 ? driverActivityOrder.getOrderNum() + "/" + driverActivityOrder.getOrderNum() : integer + "/" + driverActivityOrder.getOrderNum()); + break; + } + list.add(activityWarpper); + } + return list; + } + /** diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java index 13a34c0..939d998 100644 --- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java +++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/quartz/jobs/OrderTimeOutJob.java @@ -137,7 +137,7 @@ if(0 == m){ describe = language == 1 ? "您的包裹订单已超时,请抓紧!" : language == 2 ? "Your delivery order is overdue, please go faster." : "Votre commande de Delivery est en retard, veuillez aller plus vite."; }else{ - describe = language == 1 ? "您的包裹订单已超时" + m + "分钟,请抓紧!" : language == 2 ? "Your delivery order is overdue for " + m + " minute(s), please go faster." : "Votre commande de Delivery est en retard depuis " + m + " minute(s), veuillez aller plus vite."; + describe = language == 1 ? "您的包裹订单已超时" + m + "分钟,请抓紧!" : language == 2 ? "Your delivery order is overdue for " + m + " minute(s), please go faster." : "Votre commande de livraison est en retard depuis " + m + " minute(s), veuillez aller plus vite."; } } } -- Gitblit v1.7.1