Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0
| | |
| | | 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(); |
| | |
| | | |
| | | |
| | | 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()); |
| | | |
| | | //回滚司机状态为空闲 |
| | |
| | | |
| | | |
| | | 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()); |
| | | |
| | | //回滚司机状态为空闲 |
| | |
| | | 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); |
| | | } |
| | |
| | | |
| | | <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"> |
| | |
| | | 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> |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<ActivityWarpper> queryMyActivity(Integer uid, Date time, Integer language) throws Exception; |
| | | |
| | | |
| | | |
| | | List<ActivityWarpper> queryHistoryList(Integer uid, Date time, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取历史活动 |
| | |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | 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."; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TOrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TOrderLogistics; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderLogisticsService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private FleetEngineUtil fleetEngineUtil; |
| | | |
| | | @Resource |
| | | private ITUserService userService; |
| | | |
| | | @Resource |
| | | private OrderCancelMapper orderCancelMapper; |
| | | |
| | | /** |
| | | * 跳转到小件物流订单首页 |
| | |
| | | |
| | | tOrderLogistics.setState(10); |
| | | tOrderLogisticsService.updateById(tOrderLogistics); |
| | | |
| | | |
| | | TUser tUser = userService.selectById(tOrderLogistics.getUserId()); |
| | | Integer language = tUser.getLanguage(); |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(tOrderLogisticsId); |
| | | orderCancel.setOrderType(4); |
| | | orderCancel.setReason(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setRemark(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setUserType(2); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | //修改行程信息 |
| | | try { |
| | | fleetEngineUtil.updateTrip("CANCELED", null, null, tOrderLogistics.getTripId(), null, null, null, null); |
| | |
| | | |
| | | @Autowired |
| | | private FleetEngineUtil fleetEngineUtil; |
| | | |
| | | @Resource |
| | | private ITUserService userService; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | tOrderPrivateCar.setState(10); |
| | | tOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | |
| | | |
| | | TUser tUser = userService.selectById(tOrderPrivateCar.getUserId()); |
| | | Integer language = tUser.getLanguage(); |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(tOrderPrivateCarId); |
| | | orderCancel.setOrderType(1); |
| | | orderCancel.setReason("The platform cancels the order"); |
| | | orderCancel.setRemark("The platform cancels the order"); |
| | | orderCancel.setReason(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setRemark(language == 1 ? "平台取消订单" : language == 2 ? "The platform cancelled the order" : "La plateforme a annulé la commande"); |
| | | orderCancel.setUserType(2); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private DriverWorkMapper driverWorkMapper; |
| | | private IDriverWorkService driverWorkService; |
| | | |
| | | |
| | | @Value("${filePath}") |
| | |
| | | } |
| | | |
| | | Driver driver1 = driverService.selectById(driver.getId()); |
| | | DriverWork driverWork = driverWorkMapper.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "4").getEntity()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "4")); |
| | | if(null == driverWork || driver1.getState() != 2){ |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | Driver driver1 = driverService.selectById(dr.getId()); |
| | | DriverWork driverWork = driverWorkMapper.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "4").getEntity()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .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() : ( |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande."); |
| | | } |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 12){ |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 11 && orderLogistics.getState() != 12){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale."); |
| | | } |
| | | |
| | |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if(orderLogistics.getState() == 10 || orderLogistics.getState() == 12){ |
| | | if((orderLogistics.getState() == 10 || orderLogistics.getState() == 12) && null != orderLogistics.getDriverId()){ |
| | | //修改行程信息 |
| | | fleetEngineUtil.updateTrip("CANCELED", null, null, orderLogistics.getTripId(), null, null, null, null); |
| | | } |
| | |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private DriverWorkMapper driverWorkMapper; |
| | | private IDriverWorkService driverWorkService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | Driver driver = driverService.selectById(dr.getId()); |
| | | DriverWork driverWork = driverWorkMapper.selectOne(new EntityWrapper<DriverWork>().eq("driverId", dr.getId()) |
| | | .eq("state", 1).like("type", "1").getEntity()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", dr.getId()) |
| | | .eq("state", 1).like("type", "1")); |
| | | if(driver.getState() == 2 && null != driverWork){ |
| | | orderPrivateCar.setDriverId(dr.getId()); |
| | | orderPrivateCar.setCompanyId(dr.getFranchiseeId() != null && dr.getFranchiseeId() != 0 ? dr.getFranchiseeId() : ( |
| | |
| | | if(null == orderPrivateCar){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande."); |
| | | } |
| | | if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 12){ |
| | | if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 11 && orderPrivateCar.getState() != 12){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale."); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //修改行程信息 |
| | | if(orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12){ |
| | | if((orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12) && null != orderPrivateCar.getDriverId()){ |
| | | fleetEngineUtil.updateTrip("CANCELED", null, null, orderPrivateCar.getTripId(), null, null, null, null); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | Driver driver1 = driverService.selectById(driver.getId()); |
| | | DriverWork driverWork = driverWorkMapper.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "1").getEntity()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "1")); |
| | | if(driver1.getState() != 2 || null == driverWork){ |
| | | continue; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.DriverWork; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/10 17:32 |
| | | */ |
| | | public interface IDriverWorkService extends IService<DriverWork> { |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.DriverWorkMapper; |
| | | import com.stylefeng.guns.modular.system.model.DriverWork; |
| | | import com.stylefeng.guns.modular.system.service.IDriverWorkService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/8/10 17:33 |
| | | */ |
| | | @Service |
| | | public class DriverWorkServiceImpl extends ServiceImpl<DriverWorkMapper, DriverWork> implements IDriverWorkService { |
| | | } |