package com.zm.order.tool.server.controller;

import com.github.dozermapper.core.Mapper;
import com.zm.order.tool.server.convert.BussinessOrderConverter;
import com.zm.order.tool.server.dto.OrderCreateDTO;
import com.zm.order.tool.server.model.Order;
import com.zm.order.tool.server.request.*;
import com.zm.order.tool.server.service.ExceptionConstants;
import com.zm.order.tool.server.service.OrderDataHandleService;
import com.zm.order.tool.server.service.OrderScriptService;
import com.zm.order.tool.server.service.OrderWriteService;
import com.zm.order.tool.server.service.impl.TempOrderServiceImpl;
import com.zm.util.dto.Result;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 提供给业务操作订单的工具
 * @author zhuxiaofeng
 * @date 2021/8/12 10:29
 */
@ApiOperation("操作订单")
@RestController
@RequestMapping(value = "/qapi/business/order/")
public class BusinessOrderToolController {

    private static final Logger logger = LoggerFactory.getLogger(OrderScriptController.class);

    @Autowired
    private OrderWriteService service;

    @Autowired
    private OrderScriptService scriptService;

    @Autowired
    private TempOrderServiceImpl tempOrderService;

    @Autowired
    private OrderDataHandleService orderDataService;

    @Autowired
    private Mapper mapper;

    @Autowired
    private BussinessOrderConverter bussinessOrderConverter;

    @ApiOperation("临时修复数据")
    @PostMapping(value = "/feature/update")
    public Result tempUpdate() {
        Result result = new Result();
        try {
            service.fixOrderMergeFeature();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("临时修复数据seller")
    @PostMapping(value = "/feature/update/seller")
    public Result tempUpdateSeller() {
        Result result = new Result();
        try {
            service.fixOrderMergeFeatureSellerId();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("临时修复数据Refund")
    @PostMapping(value = "/feature/update/refund")
    public Result tempUpdateSellerRefund() {
        Result result = new Result();
        try {
            service.fixOrderMergeFeatureSellerIdRefund();
        } catch (Throwable e) {
            logger.error("tempUpdateSellerRefund[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单")
    @PostMapping(value = "/update")
    public Result updateOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderByOrderNoList(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("临时修改订单")
    @PostMapping(value = "/update/temp")
    public Result updateOrderTemp(@RequestBody CreateOrderRequest request) {
        Result result = new Result();
        try {
            service.updateOrderByOrderNoListTemp(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }


    @ApiOperation("创建订单")
    @PostMapping(value = "/create")
    public Result createOrder(@RequestBody CreateOrderRequest request) {
        Result result = new Result();
        try {
            OrderCreateDTO orderCreateDTO = bussinessOrderConverter.convert(request);
            result = service.createOrder(orderCreateDTO);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[createOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单商品信息")
    @PostMapping(value = "/item/update")
    public Result updateOrderItem(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderItemByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("新增订单商品")
    @PostMapping(value = "/item/insert")
    public Result insertOrderItem(@RequestBody BusinessItemInsertRequest request) {
        Result result = new Result();
        try {
            result = service.insertOrderItem(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("删除订单评论")
    @PostMapping(value = "/comment/del")
    public Result delOrderComment(@RequestBody DelOrderCommentRequest request) {
        Result result = new Result();
        try {
            result = service.delOrderComment(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("重复评论数据删除")
    @PostMapping(value = "/comment/duplicate/del")
    public Result delDuplicateOrderComment(@RequestBody DelOrderCommentRequest request) {
        Result result = new Result();
        try {
            result = service.delDuplicateOrderComment(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单支付明细数据")
    @PostMapping(value = "/pay/update")
    public Result updateOrderPayDetail(@RequestBody BusinessOrderUpdatePayDetailsRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderPayByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单地址信息")
    @PostMapping(value = "/addr/update")
    public Result updateAddrInfo(@RequestBody BusinessOrderUpdateAddrRequest request) {
        Result result = new Result();
        try {
            result = service.updateAddrOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("删除订单支付明细数据")
    @PostMapping(value = "/pay/del")
    public Result delOrderPayDetail(@RequestBody BusinessOrderUpdatePayDetailsRequest request) {
        Result result = new Result();
        try {
            result = service.delOrderPayByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("新增订单支付明细数据")
    @PostMapping(value = "/pay/add")
    public Result addOrderPayDetail(@RequestBody BusinessAddPayDetailsRequest request) {
        Result result = new Result();
        try {
            result = service.addOrderPayByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[addOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("批量查询订单基础信息列表")
    @PostMapping(value = "/base/list")
    public Result<List<Order>> orderBaseList(@RequestBody OrderBaseListRequest request) {
        Result<List<Order>> result = new Result();
        try {
           result = service.orderBaseList(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[addOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单支付明细数据")
    @PostMapping(value = "/pay/update/tmp")
    public Result updateOrderPayDetailTmp() {
        Result result = new Result();
        try {
            service.updateOrderPay();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetailTmp] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }
    @ApiOperation("临时同步子订单")
    @PostMapping(value = "/sub/sync/tmp")
    public Result subSync() {
        Result result = new Result();
        try {
            service.syncSubOrder();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetailTmp] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("删除订单及关联表")
    @PostMapping(value = "/delete")
    public Result deleteOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.deleteOrderByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("删除订单及关联表")
    @PostMapping(value = "/delete/real")
    public Result realDeleteOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.realDeleteOrderByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("temp删除订单及关联表")
    @PostMapping(value = "/delete/temp")
    public Result deleteTempOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.deleteOrderByOrderNoTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[deleteTempOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }


    @ApiOperation("从临时库获取订单号软删除订单及关联表")
    @PostMapping(value = "/delete/order/from/temp")
    public Result deleteFromTempOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.delOrderFromTempDB();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[deleteFromTempOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("临时处理itemSign")
    @PostMapping(value = "/item/update/temp")
    public Result itemTempUpdate(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            service.itemUpdateTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[itemTempUpdate] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改订单优惠数据")
    @PostMapping(value = "/discount/update")
    public Result updateOrderDiscount(@RequestBody BusinessOrderUpdateDiscountRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderDiscountByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("新增订单索引")
    @PostMapping(value = "/index/insert")
    public Result updateOrderDiscount(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            tempOrderService.insertOrderIndex(request.getOrderNo());
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderPayDetail] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("tidb同步临时库")
    @PostMapping(value = "/sync/order")
    public Result syncOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            tempOrderService.selectDelOrderToTb();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[syncOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("更新指定时间的updatedAt")
    @PostMapping(value = "/update/order/updated/at")
    public Result updateUpdatedAt(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            tempOrderService.updateUpdatedAt();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateUpdatedAt] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("tidb同步临时库")
    @PostMapping(value = "/del/order")
    public Result delOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            tempOrderService.delOrderToTb();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[delOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("tidb同步临时库")
    @PostMapping(value = "/del/order/refund")
    public Result delOrderRefund(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            tempOrderService.delOrderRefund();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[delOrderRefund] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("物理删除订单及关联表")
    @PostMapping(value = "/del/order/real")
    public Result realDelOrderRefund() {
        Result result = new Result();
        try {
            tempOrderService.realDelOrder();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[realDelOrderRefund] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }
    @ApiOperation("物理删除订单及关联表来源临时表")
    @PostMapping(value = "/del/order/real/tb")
    public Result realDelOrderTemp() {
        Result result = new Result();
        try {
            tempOrderService.realDelOrderByTb();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[realDelOrderTemp] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("订单合并消息")
    @PostMapping(value = "/merge")
    public Result orderMerge(@RequestBody OrderMergeRequest request) {
        Result result = new Result();
        try {
            tempOrderService.orderMerge(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[orderMerge] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("订单合并消息")
    @PostMapping(value = "/tidb/temp")
    public Result selectTidbToTemp() {
        Result result = new Result();
        try {
            tempOrderService.selectTidbToTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[orderMerge] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("临时库订单同步ES")
    @PostMapping(value = "/tidb/temp/to/es")
    public Result selectTidbToTempToEs() {
        Result result = new Result();
        try {
            tempOrderService.syncTempOrderToEs();
        } catch (Throwable e) {
            logger.error("selectTidbToTempToEs[orderMerge] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("商品评价同步ES")
    @PostMapping(value = "/item/comment/es")
    public Result syncItemComment(@RequestBody OrderSycRequest request) {
        Result result = new Result();
        try {
            result = orderDataService.syncItemComment(request);
        } catch (Throwable e) {
            logger.error("syncItemComment[syncItemComment] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改退款单")
    @PostMapping(value = "/refund/update")
    public Result updateRefund(@RequestBody UpdateRefundsRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderRefund(request);
        } catch (Throwable e) {
            logger.error("updateRefund[updateRefund] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("删除指定压测品牌数据")
    @PostMapping(value = "/del/test/order")
    public Result delTestOrder(@RequestBody DelTestOrderRequest request) {
        Result result = new Result();
        try {
            result = service.delTestOrder(request);
        } catch (Throwable e) {
            logger.error("delTestOrder[delTestOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }


    @ApiOperation("修改退款单商品")
    @PostMapping(value = "/refund/item/update")
    public Result updateRefundItem(@RequestBody UpdateRefundItemRequest request) {
        Result result = new Result();
        try {
            result = service.updateOrderRefundItem(request);
        } catch (Throwable e) {
            logger.error("updateRefundItem[updateRefundItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }



    @ApiOperation("删除单个加料")
    @PostMapping(value = "/del/item/batch")
    public Result delItemBatch(@RequestBody DelItemBatchRequest request) {
        Result result = new Result();
        try {
            result = service.delOrderItemBatch(request);
        } catch (Throwable e) {
            logger.error("updateRefundItem[updateRefundItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("检查表字段")
    @PostMapping(value = "/check/table")
    public Result tempTest(@RequestBody DelItemBatchRequest request) {
        Result result = new Result();
        try {
            scriptService.tempTest();
        } catch (Throwable e) {
            logger.error("business[tempTest] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修改评价统计数据")
    @PostMapping(value = "/item/comment/count")
    public Result updateCommentCount(@RequestBody UpdateCommentCountRequest request) {
        Result result = new Result();
        try {
            service.updateCommentCount(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateOrderItem] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("烘焙自定义支付历史数据变更")
    @PostMapping(value = "/baking/custom-pay")
    public Result customPay(@RequestBody UpdateCommentCountRequest request) {
        Result result = new Result();
        try {
            service.customPay();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[customPay] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("历史订单数据加密")
    @PostMapping(value = "/history-data-encrypt")
    public Result encryptOrder(@RequestBody UpdateCommentCountRequest request) {
        Result result = new Result();
        try {
            service.encryptOrder();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[encryptOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("jolibee历史订单数据加密")
    @PostMapping(value = "/history-data-encrypt-jolibee")
    public Result encryptOrderJolibee() {
        Result result = new Result();
        try {
            service.encryptOrderJolibee();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[encryptOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("历史退款单数据加密")
    @PostMapping(value = "/history-refund-encrypt")
    public Result encryptRefund() {
        Result result = new Result();
        try {
            service.encryptRefund();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[encryptOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("检查加密数据完整性")
    @PostMapping(value = "/check-encrypt-data")
    public Result check(@RequestBody UpdateCommentCountRequest request) {
        Result result = new Result();
        try {
            service.checkEncryptOrder();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[encryptOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("修复门店排队统计数据")
    @PostMapping(value = "/fix-line-up-count")
    public Result fixLineUpCount(@RequestBody FixLineUpCountRequest request) {
        Result result = new Result();
        try {
            result = service.fixLineUpCount(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[fixLineUpCount] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    private OrderWriteService orderWriteService;

    @ApiOperation("优化商品快照储存")
    @PostMapping(value = "/item-info-fix")
    public Result itemInfoFix(@RequestBody FixLineUpCountRequest request) {
        Result result = new Result();
        try {
            result = orderWriteService.updateOrderItemInfoTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[itemInfoFix] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }

    @ApiOperation("更新新库订单更新时间")
    @PostMapping(value = "/update/new-order")
    public Result updateNewOrder(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.updateNewOrderByOrderNo(request);
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateNewOrder] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }


    @ApiOperation("更新新库订单更新时间")
    @PostMapping(value = "/update/new-order/temp")
    public Result updateNewOrderTemp(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.updateNewOrderByOrderNoTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateNewOrderTemp] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }


    @ApiOperation("更新新库订单更新时间")
    @PostMapping(value = "/update/old-order/temp")
    public Result updateNewOrderTempTemp(@RequestBody BusinessOrderUpdateRequest request) {
        Result result = new Result();
        try {
            result = service.updateNewOrderByOrderNoTemp();
        } catch (Throwable e) {
            logger.error("BusinessOrderToolController[updateNewOrderTemp] failed!, cause by:{}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }
}
