From e60b6c9cdc11fd436a0bcae225d1789db04c9504 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期四, 05 十月 2023 16:37:11 +0800
Subject: [PATCH] 测试数据入库功能

---
 src/main/java/com/smartearth/poiexcel/controller/EntController.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/smartearth/poiexcel/controller/EntController.java b/src/main/java/com/smartearth/poiexcel/controller/EntController.java
index 450d4ac..f1baa5b 100644
--- a/src/main/java/com/smartearth/poiexcel/controller/EntController.java
+++ b/src/main/java/com/smartearth/poiexcel/controller/EntController.java
@@ -71,4 +71,42 @@
             return fail(ex, -1);
         }
     }
+
+    @ApiOperation(value = "鎻掑叆浼佷笟")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "浠ょ墝", dataType = "String", paramType = "query", example = ""),
+            @ApiImplicitParam(name = "startDate", value = "寮�濮嬫棩鏈�", dataType = "String", paramType = "query", example = "2023-06-29"),
+            @ApiImplicitParam(name = "endDate", value = "缁撴潫鏃ユ湡", dataType = "String", paramType = "query", example = "2023-06-30"),
+            @ApiImplicitParam(name = "qylabel", value = "鏍囩", dataType = "Integer", paramType = "query", example = "寮�涓�"),
+            @ApiImplicitParam(name = "showCount", value = "鏄剧ず璁板綍鏁�", dataType = "Integer", paramType = "query", example = "10"),
+            @ApiImplicitParam(name = "currentPage", value = "褰撳墠鍒嗛〉鏁�", dataType = "Integer", paramType = "query", example = "1")
+    })
+    @GetMapping({"/insertEnts"})
+    public ResponseMsg<Object> insertEnts(String token, String startDate, String endDate, String qylabel, Integer showCount, Integer currentPage) {
+        try {
+            if (StringHelper.isEmpty(token)) {
+                token = entService.selectToken();
+            }
+            if (StringHelper.isEmpty(token)) {
+                return fail("鏌ヨ浠ょ墝澶辫触");
+            }
+            if (null == showCount || showCount < 1) {
+                showCount = 10;
+            }
+            if (null == currentPage || currentPage < 1) {
+                currentPage = 1;
+            }
+
+            List<EntEntity> list = entService.selectEnts(token, startDate, endDate, qylabel, showCount, currentPage);
+            if (null == list || list.isEmpty()) {
+                return fail("鏌ヨ浼佷笟涓虹┖");
+            }
+
+            Integer rows = entService.insertEnts(list);
+
+            return success(rows);
+        } catch (Exception ex) {
+            return fail(ex, -1);
+        }
+    }
 }

--
Gitblit v1.9.3