| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | |
| | | |
| | | @Autowired |
| | | private ITOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IAppOperationLogService appOperationLogService; |
| | | |
| | | |
| | | |
| | |
| | | TOrderPrivateCar tOrderPrivateCar = itOrderPrivateCarService.selectById(tReassign.getOrderId()); |
| | | tOrderPrivateCar.setState(tOrderPrivateCar.getOldState()); |
| | | itOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | appOperationLogService.addAppOperationLog(ShiroKit.getUser().getId(), "{\"type\":\"调度拒绝改派\",\"orderId\":\"" + tOrderPrivateCar.getId() + "\",\"driver\":\"" + JSON.toJSONString(tOrderPrivateCar) + "\"}"); |
| | | }else if (2 == optType){ |
| | | tReassign.setState(4); |
| | | tReassignService.updateById(tReassign); |
| | |
| | | TOrderPrivateCar tOrderPrivateCar = itOrderPrivateCarService.selectById(tReassign.getOrderId()); |
| | | tOrderPrivateCar.setState(10); |
| | | itOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | appOperationLogService.addAppOperationLog(ShiroKit.getUser().getId(), "{\"type\":\"调度取消订单\",\"orderId\":\"" + tOrderPrivateCar.getId() + "\",\"driver\":\"" + JSON.toJSONString(tOrderPrivateCar) + "\"}"); |
| | | |
| | | //修改司机状态"空闲" |
| | | TDriver driver = itDriverService.selectById(tReassign.getOriginalDriverId()); |
| | |
| | | @RequestMapping(value = "/selectDriver") |
| | | @ResponseBody |
| | | public Object selectDriver(@RequestParam Integer orderId,@RequestParam Integer driverId) { |
| | | int count = itOrderPrivateCarService.selectCount(new EntityWrapper<TOrderPrivateCar>().eq("driverId", driverId) |
| | | .in("state", Arrays.asList(2, 3, 4, 5, 6, 11)).eq("isDelete", 1)); |
| | | if(count > 0){ |
| | | throw new RuntimeException("司机正在服务中,请选择其他司机"); |
| | | } |
| | | //修改订单 |
| | | TReassign tReassign = tReassignService.selectById(orderId); |
| | | TOrderPrivateCar tOrderPrivateCar = itOrderPrivateCarService.selectById(tReassign.getOrderId()); |
| | |
| | | tOrderPrivateCar.setDriverId(driverId); |
| | | tOrderPrivateCar.setCarId(nowDriver.getCarId()); |
| | | itOrderPrivateCarService.updateById(tOrderPrivateCar); |
| | | appOperationLogService.addAppOperationLog(ShiroKit.getUser().getId(), "{\"type\":\"调度完成订单改派\",\"orderId\":\"" + tOrderPrivateCar.getId() + "\",\"driver\":\"" + JSON.toJSONString(tOrderPrivateCar) + "\"}"); |
| | | |
| | | //修改专车改派订单 |
| | | tReassign.setNowDriverId(driverId); |