luodangjia
2024-11-05 0c569ab4b38d972213eeaf7e8965f33f8ec650fd
ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/OrderController.java
@@ -404,12 +404,7 @@
    @RequiresPermissions("order_reassignment")
    @ApiOperation(value = "订单列表-订单派单/改派", tags = {"后台-订单管理"})
    @PostMapping(value = "/reassignment")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "操作类型(1:订单派单;2:订单改派)", name = "type", dataType = "Integer", required = true),
            @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true),
            @ApiImplicitParam(value = "服务人员id", name = "workerId", dataType = "Integer", required = true),
            @ApiImplicitParam(value = "改派原因", name = "applyReason", dataType = "String")
    })
    @Transactional(rollbackFor = Exception.class)
    public R<String> reassignment(@RequestBody OrderReasinDto orderReasinDto) {
//        String[] split = orderIds.split(",");
@@ -426,11 +421,22 @@
        if (Constants.TWO.equals(orderId.getType())) {
            if (order.getState().equals(Constants.SIX) || order.getState().equals(Constants.THREE)) {
                orderClient.updateState(order.getId(), Constants.ONE);
                //如果是待改派,将上门时间设置为最新的,并且更新再投原因
                if (order.getState().equals(Constants.SIX)){
                    dispatchClient.changeReason(order.getId(), orderReasinDto.getReason());
                    orderClient.updateArrivalTime(order.getId(),orderReasinDto.getArriveTime());
                }
            }
            // 订单状态为 待完工时,需要更改状态 待上门且清空师傅到达预约点时间
            if (order.getState().equals(Constants.TWO)) {
                orderClient.updateStateAndArrivalTime(orderId.getOrderId(), Constants.ONE);
            }
            // 生成改派信息
//            ChangeDispatch changeDispatch = new ChangeDispatch();
//            changeDispatch.setWorkerId(item.getServerId());