| | |
| | | import com.stylefeng.guns.modular.system.service.ITOrderLogisticsService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | @ResponseBody |
| | | public Object cancel(@RequestParam Integer tOrderLogisticsId) { |
| | | TOrderLogistics tOrderLogistics = tOrderLogisticsService.selectById(tOrderLogisticsId); |
| | | |
| | | if(Arrays.asList(6, 7, 8, 9, 10).contains(tOrderLogistics.getState())){ |
| | | return ERROR; |
| | | } |
| | | //修改之前司机状态 -- 空闲 |
| | | if(null != tOrderLogistics.getDriverId()){ |
| | | TDriver driver = itDriverService.selectById(tOrderLogistics.getDriverId()); |
| | |
| | | for (int i = 0; i < 5; i++) { |
| | | updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, tOrderLogistics.getTripId(), null, null, null, null); |
| | | if(updateTrip){ |
| | | tOrderLogistics.setIsover(1); |
| | | tOrderLogisticsService.updateById(tOrderLogistics); |
| | | break; |
| | | } |
| | | try { |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }else{ |
| | | tOrderLogistics.setIsover(1); |
| | | tOrderLogisticsService.updateById(tOrderLogistics); |
| | | } |
| | | |
| | | |