| | |
| | | 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; |
| | |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id批量删除站点 |