| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.dto.TbProjectDTO; |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectExcel; |
| | | import cn.gistack.sm.sjztmd.excel.TbProjectImporter; |
| | | import cn.gistack.sm.sjztmd.service.ITbProjectService; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsParams; |
| | | import cn.gistack.sm.sjztmd.statisticsVO.StatisticsTableProject; |
| | | import cn.gistack.sm.sjztmd.vo.TbProjectVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 导入模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | public void exportUser(HttpServletResponse response) { |
| | | List<TbProjectExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "用户数据模板", "用户数据表", list, TbProjectExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导入用户 |
| | | */ |
| | | @PostMapping("import-tb-project") |
| | | public R importUser(MultipartFile file, Integer isCovered) { |
| | | TbProjectImporter userImporter = new TbProjectImporter(tbProjectService, isCovered == 1); |
| | | ExcelUtil.save(file, userImporter, TbProjectExcel.class); |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | } |