From 2c5a0e133b64bb0a46b1419c48e9b62a4779e268 Mon Sep 17 00:00:00 2001
From: cloudroam <cloudroam>
Date: 星期一, 09 十二月 2024 16:13:17 +0800
Subject: [PATCH] add: 供应商子账号

---
 src/main/java/com/mzl/flower/web/payment/OrderController.java |   51 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/mzl/flower/web/payment/OrderController.java b/src/main/java/com/mzl/flower/web/payment/OrderController.java
index 16ed168..fb13881 100644
--- a/src/main/java/com/mzl/flower/web/payment/OrderController.java
+++ b/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;
@@ -22,6 +25,8 @@
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDateTime;
 import java.util.List;
 
 @RestController
@@ -51,7 +56,6 @@
     public ResponseEntity<ReturnDataDTO<Page<OrderPlatformListDTO>>> selectOrderList(Page page, OrderQueryDTO dto){
         return returnData(R.SUCCESS.getCode(), orderService.selectOrderPlatformList(page, dto));
     }
-
     @GetMapping("/list/view")
     @ApiOperation(value = "订单详情")
     @ApiImplicitParams({
@@ -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,40 @@
     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")
+    @ApiOperation(value = "订单导出")
+    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());
     }
 
 }

--
Gitblit v1.9.3