From 07e4b1114feadc19478847a9bcda869b5d6a5bf7 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期五, 02 九月 2022 14:23:10 +0800
Subject: [PATCH] 项目目录结构调整

---
 equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/EquipmentInfoController.java |   89 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 66 insertions(+), 23 deletions(-)

diff --git a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/EquipmentInfoController.java b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/EquipmentInfoController.java
index fe40613..a883d88 100644
--- a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/EquipmentInfoController.java
+++ b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/EquipmentInfoController.java
@@ -1,26 +1,40 @@
 package com.gkhy.safePlatform.equipment.controller;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.gkhy.safePlatform.commons.utils.BeanCopyUtils;
 import com.gkhy.safePlatform.equipment.entity.*;
+import com.gkhy.safePlatform.equipment.model.dto.req.EquipmentInfoImportExcel;
 import com.gkhy.safePlatform.equipment.model.dto.req.EquipmentInfoSaveOrUpdate;
+import com.gkhy.safePlatform.equipment.model.dto.resp.EquipmentInfoExcel;
+import com.gkhy.safePlatform.equipment.utils.DateUtils;
+import com.gkhy.safePlatform.equipment.utils.QueryHelpPlus;
+import com.gkhy.safePlatform.equipment.utils.poihelper.ExcelLogs;
+import com.gkhy.safePlatform.equipment.utils.poihelper.ExcelUtil;
 import com.google.common.collect.Lists;
+
+import java.io.IOException;
+import java.net.URLEncoder;
 import java.sql.Timestamp;
 
 
 import com.gkhy.safePlatform.equipment.model.dto.resp.EquipmentInfoDto;
 import com.gkhy.safePlatform.equipment.service.EquipmentInfoService;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.gkhy.safePlatform.commons.query.PageQuery;
 import com.gkhy.safePlatform.commons.utils.PageUtils;
 import com.gkhy.safePlatform.commons.vo.ResultVO;
 import com.gkhy.safePlatform.commons.enums.ResultCodes;
 import com.gkhy.safePlatform.equipment.model.dto.req.EquipmentInfoQueryCriteria;
+import org.springframework.web.multipart.MultipartFile;
 
-import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.*;
 import java.util.stream.Collectors;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.Serializable;
-import java.util.List;
 
 /**
  * 设备设施详细信息(EquipmentInfo)表控制层
@@ -37,6 +51,10 @@
     @Resource
     private EquipmentInfoService equipmentInfoService;
 
+    @Autowired
+    public HttpServletRequest request;
+
+
     /**
      * 分页查询所有数据
      *
@@ -45,14 +63,9 @@
      */
     @PostMapping(value = "/page/list")
     public ResultVO selectAll(@RequestBody PageQuery<EquipmentInfoQueryCriteria> pageQuery){
-        if(pageQuery.getSearchParams().getInfoType() == null){
-            return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少infoType");
-        }
-
-		PageUtils.checkCheck(pageQuery.getPageIndex(), pageQuery.getPageSize());
 		return this.equipmentInfoService.queryAll(pageQuery);
     }
-
+	
 
     /**
      * 通过主键查询单条数据
@@ -73,13 +86,6 @@
      */
     @PostMapping(value = "/addOrUpdate")
     public ResultVO update(@RequestBody EquipmentInfoSaveOrUpdate infoDto) {
-        if(infoDto.getInfoType() == null || infoDto.getEquipmentTypeId() == null){
-            return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少infoType或者equipmentTypeId");
-        }
-        if(infoDto.getInfoType() == 3){
-            return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"infoType值异常");
-        }
-
         equipmentInfoService.addOrUpdate(infoDto);
         return new ResultVO<>(ResultCodes.OK);
     }
@@ -90,11 +96,10 @@
      * @param ids 主键结合
      * @return 删除结果
      */
-    @GetMapping(value = "/delete")
-    public ResultVO delete(String ids) {
-	List<String> idList = Arrays.stream(ids.split(","))
-                .collect(Collectors.toList());
-        this.equipmentInfoService.removeByIds(idList);
+    @RequestMapping(value = "/delete",method = RequestMethod.POST)
+    public ResultVO delete(@RequestBody Long[] ids) {
+
+        this.equipmentInfoService.delete(ids);
         return new ResultVO<>(ResultCodes.OK);
     }
 
@@ -108,6 +113,44 @@
 
         return new ResultVO<>(ResultCodes.OK,this.equipmentInfoService.statistics());
     }
+
+
+
+
+    /**
+     * 下载模板
+     *
+     */
+    @GetMapping(value = "/exportTemplate")
+    public void exportTemplate() throws IOException {
+        equipmentInfoService.exportTemplate();
+    }
+
+
+    /**
+     * 导入数据
+     *
+     */
+    @RequestMapping(value = "/importData")
+    public ResultVO importData(MultipartFile file) throws IOException {
+        equipmentInfoService.importData(file);
+        return new ResultVO<>(ResultCodes.OK);
+    }
+
+
+
+
+    /**
+     * 导出一览数据
+     *
+     */
+    @GetMapping(value = "/exportData")
+    public void exportData(EquipmentInfoQueryCriteria queryCriteria) throws IOException {
+        equipmentInfoService.exportData(queryCriteria);
+    }
+
+
+
 
     public static void main(String[] args) {
         EquipmentInfoDto infoDto = new EquipmentInfoDto();
@@ -217,8 +260,8 @@
         infoDto.setDestoryReason("");
         infoDto.setDestorySubmitDate(new Timestamp(new java.util.Date().getTime()));
         infoDto.setActualDestoryDate(new Timestamp(new java.util.Date().getTime()));
+
         System.out.println(JSONObject.toJSONString(infoDto));
 
-
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.9.2