| | |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | order.setServerPhone(phone); |
| | | orderService.updateById(order); |
| | | } |
| | | List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, orderId).list(); |
| | | changeDispatchService.removeBatchByIds(list); |
| | | // List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, orderId).list(); |
| | | // changeDispatchService.removeBatchByIds(list); |
| | | return R.ok(order); |
| | | } |
| | | |
| | |
| | | ).set(Order::getArriveTime, null).update(); |
| | | |
| | | //删除改派管理的订单 |
| | | List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, order.getId()).list(); |
| | | changeDispatchService.removeBatchByIds(list); |
| | | // List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, order.getId()).list(); |
| | | // changeDispatchService.removeBatchByIds(list); |
| | | |
| | | } |
| | | // } |
| | |
| | | order.setProvinceCode(orderRequest.getProvinceCode()); |
| | | order.setAreaCode(orderRequest.getAreaCode()); |
| | | return R.ok(orderService.updateById(order)); |
| | | } |
| | | |
| | | /** |
| | | * 批量修改订单时间 |
| | | * @param ids 站点多条id拼接 |
| | | */ |
| | | @ApiOperation(value = "订单列表-批量修改订单时间", tags = {"后台-订单管理[2.0]"}) |
| | | @GetMapping(value = "/batchUpdateTime") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "多个id ',' 拼接", name = "ids", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "修改上门时间", name = "time", dataType = "String", required = true), |
| | | }) |
| | | public R<Boolean> batchUpdateTime(@RequestParam("ids") String ids, @RequestParam("time") String time) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<Order> list = orderService.lambdaQuery().in(Order::getId, idList).list(); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | list.forEach(data -> data.setTime(time)); |
| | | orderService.updateBatchById(list); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | .eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, Constants.ZERO).list(); |
| | | return R.ok(!list.isEmpty()); |
| | | } |
| | | |
| | | @GetMapping(value = "/updateArrivalTime") |
| | | public R<Boolean> updateArrivalTime(@RequestParam("orderId")String orderId,@RequestParam("arriveTime")String arriveTime) { |
| | | Order byId = orderService.getById(orderId); |
| | | byId.setTime(arriveTime); |
| | | orderService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestParam("siteIds") List<String> siteIds |
| | | ) { |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).in(!siteIds.isEmpty(),Order::getSiteId, siteIds).in(!cityList.isEmpty(),Order::getCityCode, cityList).page(Page.of(pageNum, pageSize)); |
| | | .eq(Order::getIsDelete, 0) |
| | | .in(!cityList.isEmpty(),Order::getCityCode, cityList).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |