From 5000a7f971fd5632c1e729e80e3b8a0441eb20b0 Mon Sep 17 00:00:00 2001
From: ZY <zc857179121@qq.com>
Date: 星期五, 07 二月 2025 07:57:09 +0800
Subject: [PATCH] 关闭订单

---
 src/main/java/com/zy/asrs/controller/OrderLogController.java |   51 ++++++++++++++++++++++++++++-----------------------
 1 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/OrderLogController.java b/src/main/java/com/zy/asrs/controller/OrderLogController.java
index d256d77..26f1991 100644
--- a/src/main/java/com/zy/asrs/controller/OrderLogController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderLogController.java
@@ -9,6 +9,8 @@
 import com.core.common.*;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.result.WrkTraceVo;
+import com.zy.asrs.excel.CloseOrderReadListener;
+import com.zy.asrs.excel.ExcelOrder;
 import com.zy.asrs.service.*;
 import com.zy.common.web.BaseController;
 import lombok.extern.slf4j.Slf4j;
@@ -42,10 +44,12 @@
     private LocDetlService locDetlService;
     @Autowired
     private MatService matService;
+    @Autowired
+    private OrderService orderService;
 
     @RequestMapping(value = "/orderLog/nav/list/auth")
     @ManagerAuth
-    public R navList(@RequestParam(required = false) String orderNo){
+    public R navList(@RequestParam(required = false) String orderNo) {
         EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
         if (!Cools.isEmpty(orderNo)) {
             wrapper.like("order_no", orderNo);
@@ -73,15 +77,17 @@
 
     @RequestMapping(value = "/orderLog/head/page/auth")
     @ManagerAuth
-    public R head(@RequestParam(defaultValue = "1")Integer curr,
-                  @RequestParam(defaultValue = "10")Integer limit,
-                  @RequestParam(required = false)String orderByField,
-                  @RequestParam(required = false)String orderByType,
-                  @RequestParam Map<String, Object> param){
+    public R head(@RequestParam(defaultValue = "1") Integer curr,
+                  @RequestParam(defaultValue = "10") Integer limit,
+                  @RequestParam(required = false) String orderByField,
+                  @RequestParam(required = false) String orderByType,
+                  @RequestParam Map<String, Object> param) {
         EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
-        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else {
+        if (!Cools.isEmpty(orderByField)) {
+            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
+        } else {
             wrapper.orderBy("settle").orderBy("create_time", false);
         }
         wrapper.eq("status", 1);
@@ -90,12 +96,9 @@
 
     @RequestMapping(value = "/orderLog/detl/all/auth")
     @ManagerAuth
-    public R head(@RequestParam Long orderId){
+    public R head(@RequestParam Long orderId) {
         return R.ok().add(orderDetlLogService.selectList(new EntityWrapper<OrderDetlLog>().eq("order_id", orderId)));
     }
-
-
-
 
 
     @PostMapping(value = "/orderLog/wrk/trace/auth")
@@ -177,22 +180,24 @@
 
     @RequestMapping(value = "/orderLog/list/auth")
     @ManagerAuth
-    public R list(@RequestParam(defaultValue = "1")Integer curr,
-                  @RequestParam(defaultValue = "10")Integer limit,
-                  @RequestParam(required = false)String orderByField,
-                  @RequestParam(required = false)String orderByType,
-                  @RequestParam Map<String, Object> param){
+    public R list(@RequestParam(defaultValue = "1") Integer curr,
+                  @RequestParam(defaultValue = "10") Integer limit,
+                  @RequestParam(required = false) String orderByField,
+                  @RequestParam(required = false) String orderByType,
+                  @RequestParam Map<String, Object> param) {
         EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
-        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        if (!Cools.isEmpty(orderByField)) {
+            wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
+        }
         return R.ok(orderLogService.selectPage(new Page<>(curr, limit), wrapper));
     }
 
-    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
-        for (Map.Entry<String, Object> entry : map.entrySet()){
+    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper) {
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
             String val = String.valueOf(entry.getValue());
-            if (val.contains(RANGE_TIME_LINK)){
+            if (val.contains(RANGE_TIME_LINK)) {
                 String[] dates = val.split(RANGE_TIME_LINK);
                 wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                 wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
@@ -205,7 +210,7 @@
 
     @RequestMapping(value = "/orderLog/export/auth")
     @ManagerAuth
-    public R export(@RequestBody JSONObject param){
+    public R export(@RequestBody JSONObject param) {
         EntityWrapper<OrderLog> wrapper = new EntityWrapper<>();
         List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
         Map<String, Object> map = excludeTrash(param.getJSONObject("order"));
@@ -221,7 +226,7 @@
         wrapper.like("id", condition);
         Page<OrderLog> page = orderLogService.selectPage(new Page<>(0, 10), wrapper);
         List<Map<String, Object>> result = new ArrayList<>();
-        for (OrderLog order : page.getRecords()){
+        for (OrderLog order : page.getRecords()) {
             Map<String, Object> map = new HashMap<>();
             map.put("id", order.getId());
             map.put("value", order.getOrderNo());
@@ -234,7 +239,7 @@
     @ManagerAuth
     public R query(@RequestBody JSONObject param) {
         Wrapper<OrderLog> wrapper = new EntityWrapper<OrderLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
-        if (null != orderLogService.selectOne(wrapper)){
+        if (null != orderLogService.selectOne(wrapper)) {
             return R.parse(BaseRes.REPEAT).add(getComment(Order.class, String.valueOf(param.get("key"))));
         }
         return R.ok();

--
Gitblit v1.9.1