From 877c9a7d2ee34ebf1a1e4c19cd7c1f8560709b0d Mon Sep 17 00:00:00 2001
From: wenwj <‘1106994300@qq.com>
Date: 星期三, 09 四月 2025 14:11:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.50.149:8085/r/aps-backend into dev

---
 aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java |   68 +++++++++++++++++++---------------
 1 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java
index 557fd43..7bb607d 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/ApsPlatePlanController.java
@@ -5,6 +5,11 @@
 
 import com.aps.common.core.domain.R;
 import com.aps.common.core.utils.file.FileUtils;
+import com.aps.common.core.utils.uuid.IdUtils;
+import com.aps.common.security.utils.DictUtils;
+import com.aps.core.domain.ApsPartPlanTemp;
+import com.aps.core.domain.ApsPlatePlanTemp;
+import com.aps.system.api.domain.SysDictData;
 import com.aps.system.api.domain.SysFile;
 import jakarta.servlet.http.HttpServletResponse;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,8 +40,7 @@
  */
 @RestController
 @RequestMapping("/ApsPlatePlan")
-public class ApsPlatePlanController extends BaseController
-{
+public class ApsPlatePlanController extends BaseController {
     @Autowired
     private IApsPlatePlanService apsPlatePlanService;
 
@@ -45,8 +49,7 @@
      */
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:list")
     @GetMapping("/list")
-    public TableDataInfo list(ApsPlatePlan apsPlatePlan)
-    {
+    public TableDataInfo list(ApsPlatePlan apsPlatePlan) {
         startPage();
         List<ApsPlatePlan> list = apsPlatePlanService.selectApsPlatePlanList(apsPlatePlan);
         return getDataTable(list);
@@ -58,8 +61,7 @@
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:export")
     @Log(title = "閽i噾璁″垝绠$悊", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, ApsPlatePlan apsPlatePlan)
-    {
+    public void export(HttpServletResponse response, ApsPlatePlan apsPlatePlan) {
         List<ApsPlatePlan> list = apsPlatePlanService.selectApsPlatePlanList(apsPlatePlan);
         ExcelUtil<ApsPlatePlan> util = new ExcelUtil<ApsPlatePlan>(ApsPlatePlan.class);
         util.exportExcel(response, list, "閽i噾璁″垝绠$悊鏁版嵁");
@@ -70,8 +72,7 @@
      */
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:query")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return success(apsPlatePlanService.selectApsPlatePlanById(id));
     }
 
@@ -81,8 +82,7 @@
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:add")
     @Log(title = "閽i噾璁″垝绠$悊", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody ApsPlatePlan apsPlatePlan)
-    {
+    public AjaxResult add(@RequestBody ApsPlatePlan apsPlatePlan) {
         return toAjax(apsPlatePlanService.insertApsPlatePlan(apsPlatePlan));
     }
 
@@ -92,8 +92,7 @@
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:edit")
     @Log(title = "閽i噾璁″垝绠$悊", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody ApsPlatePlan apsPlatePlan)
-    {
+    public AjaxResult edit(@RequestBody ApsPlatePlan apsPlatePlan) {
         return toAjax(apsPlatePlanService.updateApsPlatePlan(apsPlatePlan));
     }
 
@@ -102,27 +101,36 @@
      */
     @RequiresPermissions("ApsPlatePlan:ApsPlatePlan:remove")
     @Log(title = "閽i噾璁″垝绠$悊", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(apsPlatePlanService.deleteApsPlatePlanByIds(ids));
     }
 
-    @PostMapping("/upload")
-    public AjaxResult upload(MultipartFile file)
-    {
-        try
-        {
-            // 涓婁紶骞惰繑鍥炶闂湴鍧�
-            ExcelUtil<ApsPlatePlan> util = new ExcelUtil<ApsPlatePlan>(ApsPlatePlan.class);
-            List<ApsPlatePlan> userList = util.importExcel(file.getInputStream());
-            System.out.println(userList.size());
-
+    /**
+     * 瀵煎叆Excel鏁版嵁
+     * @param file
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws Exception {
+        ExcelUtil<ApsPlatePlanTemp> util = new ExcelUtil<ApsPlatePlanTemp>(ApsPlatePlanTemp.class);
+        List<ApsPlatePlanTemp> platePlanTemps = util.importExcel(file.getInputStream());
+        //鍒ゆ柇瀵煎叆鏁版嵁鏄惁涓虹┖
+        if (platePlanTemps.size() > 0) {
+            String batchNum = apsPlatePlanService.importData(platePlanTemps);
+            return AjaxResult.success("瀵煎叆鎴愬姛锛�",batchNum);
+        } else {
+            return AjaxResult.error("妯℃澘鍐呭涓虹┖");
         }
-        catch (Exception e)
-        {
-
-        }
-        return toAjax(true);
+    }
+    /**
+     * 纭閮ㄥ垎璁″垝鎺у埗鍣�
+     * @param planTemp 鍖呭惈閮ㄥ垎璁″垝淇℃伅鐨勪复鏃跺璞★紝鐢ㄤ簬纭璁″垝
+     * @return 杩斿洖鎿嶄綔缁撴灉鐨凙jaxResult瀵硅薄
+     */
+    @GetMapping("/confirmPart")
+    public AjaxResult confirmPart(ApsPlatePlanTemp planTemp) {
+        return toAjax(apsPlatePlanService.confirmPlan(planTemp));
     }
 }

--
Gitblit v1.9.3