diff --git a/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/controller/MatterController.java b/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/controller/MatterController.java index 495d727..4ae618e 100644 --- a/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/controller/MatterController.java +++ b/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/controller/MatterController.java @@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; /** *
@@ -60,17 +59,18 @@ public class MatterController {
matterManage.saveOrUpdate(req);
}
- @PostMapping("/importGovServiceMatter")
+ @PostMapping("/importMatter")
@WebLog("导入政务服务事项")
@ApiOperation("导入政务服务事项")
- public void importGovServiceMatter(@RequestParam("file") MultipartFile file) {
- matterManage.govServiceMatterImport(file);
+ public void importMatter(@RequestParam("file") MultipartFile file,
+ @RequestParam("matterType") Integer matterType) {
+ matterManage.importMatter(file, matterType);
}
- @GetMapping("/downloadGovServiceMatterTemplate")
+ @GetMapping("/downloadMatterTemplate")
@WebLog("下载政策服务事项配置模板")
@ApiOperation("下载政策服务事项配置模板")
- public void downloadGovServiceMatterTemplate(HttpServletResponse response) {
+ public void downloadMatterTemplate(HttpServletResponse response) {
matterManage.downloadGovServiceMatterTemplate(response);
}
diff --git a/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/manage/AdminMatterManage.java b/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/manage/AdminMatterManage.java
index 3181002..0a6a75f 100644
--- a/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/manage/AdminMatterManage.java
+++ b/kq-vas-api/src/main/java/com/ningdatech/kqapi/admin/manage/AdminMatterManage.java
@@ -1,17 +1,13 @@
package com.ningdatech.kqapi.admin.manage;
import cn.hutool.core.io.resource.ClassPathResource;
-import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.util.StrUtil;
-import cn.hutool.http.ContentType;
import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -19,7 +15,6 @@ import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.ValidUtil;
-import com.ningdatech.basic.util.ValidatorUtil;
import com.ningdatech.kqapi.admin.mapper.ZoneMapper;
import com.ningdatech.kqapi.admin.model.dto.GovServiceMatterImportDTO;
import com.ningdatech.kqapi.admin.model.entity.Window;
@@ -28,6 +23,7 @@ import com.ningdatech.kqapi.admin.model.req.MatterListReq;
import com.ningdatech.kqapi.admin.model.vo.MatterDetailDTO;
import com.ningdatech.kqapi.admin.model.vo.MatterListVO;
import com.ningdatech.kqapi.admin.service.IWindowService;
+import com.ningdatech.kqapi.common.enumeration.IEnum;
import com.ningdatech.kqapi.common.exception.BizException;
import com.ningdatech.kqapi.zzsfw.enumeration.ItemTypeEnum;
import com.ningdatech.kqapi.zzsfw.model.entity.KqZzsfwMenu;
@@ -40,8 +36,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
@@ -156,7 +150,9 @@ public class AdminMatterManage {
zzsfwMenuService.saveOrUpdate(matter);
}
- public void govServiceMatterImport(MultipartFile file) {
+ public void importMatter(MultipartFile file, Integer matterType) {
+ ItemTypeEnum type = IEnum.getNoNull(ItemTypeEnum.class, matterType);
+ Assert.isTrue(!type.equals(ItemTypeEnum.SPECIAL), "不支持的导入类型");
try (InputStream is = file.getInputStream()) {
List