|
|
@@ -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<GovServiceMatterImportDTO> imports = EasyExcel.read(is, |
|
|
|
new AnalysisEventListener<GovServiceMatterImportDTO>() { |
|
|
@@ -212,7 +208,7 @@ public class AdminMatterManage { |
|
|
|
menu.setZoneName(zone.getZoneName()); |
|
|
|
menu.setDepartment(matter.getDepartment()); |
|
|
|
menu.setSort(99); |
|
|
|
menu.setType(ItemTypeEnum.GOV.getCode()); |
|
|
|
menu.setType(type.getCode()); |
|
|
|
newMatters.add(menu); |
|
|
|
} |
|
|
|
}); |
|
|
|