cloudroam
2024-12-09 fad73d860dce9ea18a4a6d45d9bf35d6b066a008
src/main/java/com/mzl/flower/web/payment/OrderController.java
@@ -4,11 +4,14 @@
import com.mzl.flower.base.BaseController;
import com.mzl.flower.base.R;
import com.mzl.flower.base.ReturnDataDTO;
import com.mzl.flower.base.annotation.OperationLog;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.payment.OrderAddressUpdateDTO;
import com.mzl.flower.dto.request.payment.OrderDeliveryNoDTO;
import com.mzl.flower.dto.request.payment.OrderQueryDTO;
import com.mzl.flower.dto.response.payment.*;
import com.mzl.flower.entity.log.OperationRecord;
import com.mzl.flower.entity.payment.Order;
import com.mzl.flower.service.payment.DeliveryOrderService;
import com.mzl.flower.service.payment.OrderService;
import com.mzl.flower.service.payment.UserPaymentV3Service;
@@ -23,6 +26,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.util.List;
@RestController
@@ -71,10 +75,14 @@
    }
    @PostMapping("/list/send")
    @OperationLog(value = "发货", type = "order_list")
    @ApiOperation(value = "没有合伙人的花店上传快递号发货")
    public ResponseEntity<ReturnDataDTO> saveDeliveryNo(@RequestBody OrderDeliveryNoDTO dto) {
        orderService.saveDeliveryNo(dto);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(dto.getId());
        String content = "订单发货id:【" + dto.getId() + "】,订单号:【" + orderInfoById.getOrderNo() + "】,快递号:【" + dto.getDeliveryNo() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/abnormal/details")
@@ -87,10 +95,14 @@
    }
    @GetMapping("/list/abnormal/process")
    @OperationLog(value = "异常订单处理", type = "order_list")
    @ApiOperation(value = "异常订单处理(不管有没有退款金额,建议都要处理)")
    public ResponseEntity<ReturnDataDTO> processLevelDown(String id) {
    public ResponseEntity<ReturnDataDTO> processLevelDown(String id) throws Exception {
        orderService.processAbnormalOrder(id);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(id);
        String content = "订单退款id:【" + id + "】,订单号:【" + orderInfoById.getOrderNo() + "】操作退款,降级打款记录id:【" + orderInfoById.getTransferId() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/check/info/reduce")
@@ -171,6 +183,7 @@
    }
    @GetMapping(value = "/refund")
    @OperationLog(value = "订单退款", type = "order_list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "订单id", required = true, dataType = "String", paramType = "query"),
    })
@@ -178,14 +191,21 @@
    public ResponseEntity<ReturnDataDTO> refundOrder(String id) {
        orderService.refundCheckAdmin(id);
        paymentV3Service.refundOrder(id);
        return returnData(R.SUCCESS.getCode(), null);
        Order orderInfoById = orderService.getOrderInfoById(id);
        String content = "订单退款id:【" + id + "】,订单号:【" + orderInfoById.getOrderNo() + "】操作退款";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @PostMapping("/page/update")
    @OperationLog(value = "订单修改", type = "order_list")
    @ApiOperation(value = "订单修改", notes = "订单修改")
    public ResponseEntity<ReturnDataDTO> operationUpdate(@Validated @RequestBody OrderAddressUpdateDTO dto) {
        orderService.operationUpdate(dto);
        return returnData(R.SUCCESS.getCode(),null);
        Order orderInfoById = orderService.getOrderInfoById(dto.getId());
        String content = "订单修改id:【" + dto.getId() + "】,订单号:【" + orderInfoById.getOrderNo() + "】,地区:【" + dto.getCustomerProvince() + dto.getCustomerCity() + dto.getCustomerRegion() + "】,详细地址:【" + dto.getCustomerAddress() + "】,联系方式:【" + dto.getCustomerTel() + "】";
        OperationRecord operationRecord = getOperationRecord(content);
        return returnData(R.SUCCESS.getCode(), null, operationRecord);
    }
    @GetMapping("/list/export")
@@ -193,4 +213,18 @@
    public void exportOrderDetail(HttpServletResponse response, OrderQueryDTO queryOrderDTO) {
        orderService.exportOrderDetail(response, queryOrderDTO);
    }
    @GetMapping("/time/now")
    @ApiOperation(value = "订单导出")
    public  ResponseEntity<Long> getNowTime() {
        return returnData(R.SUCCESS.getCode(),System.currentTimeMillis());
    }
    @GetMapping("/elk/date")
    @ApiOperation(value = "订单日期刷新")
    public  ResponseEntity<Long> getElkDate() {
        orderService.refreshDate();
        return returnData(R.SUCCESS.getCode(),System.currentTimeMillis());
    }
}