xuhy
2025-04-17 6e70ee2d0b73f70fe1140cc7d51c4e847d50aa51
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -48,6 +48,7 @@
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;
@@ -450,6 +451,26 @@
        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批量删除站点
@@ -632,10 +653,10 @@
     */
    @ApiOperation(value = "师傅端-订单列表", tags = {"师傅端"})
    @GetMapping(value = "/orderListWorker")
    public R<Page<Order>> orderListWorker(@RequestParam("userId") Integer userId, @RequestParam("state") Integer state,
    public R<Page<Order>> orderListWorker(@RequestParam("userId") Integer userId, @RequestParam("state") Integer state,@RequestParam("searchValues") String searchValues,
                                          @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
                                          @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
        return R.ok(orderService.orderListWorker(userId, state, pageNum, pageSize));
        return R.ok(orderService.orderListWorker(userId, state, searchValues,pageNum, pageSize));
    }
    /**
@@ -864,4 +885,19 @@
        return R.ok(orderService.placeOrder(userOrderRequest));
    }
    /**
     * 师傅端-打电话
     */
    @ApiOperation(value = "打电话", tags = {"师傅端-打电话[2.0]"})
    @GetMapping(value = "/call")
    public R<String> call(@RequestParam Integer orderId) {
        Order order = orderService.getById(orderId);
        if(Objects.isNull(order)){
            return R.fail("订单不存在");
        }
        order.setState(2);
        orderService.updateById(order);
        return R.ok();
    }
}