| | |
| | | package cn.gistack.sm.sjztmd.controller; |
| | | |
| | | import cn.gistack.sm.sjztmd.entity.TbAttResBase; |
| | | import cn.gistack.sm.sjztmd.entity.TbFileStorageLocation; |
| | | import cn.gistack.sm.sjztmd.entity.TbResStagCapDisc; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImport; |
| | | import cn.gistack.sm.sjztmd.excel.TbResStagCapDiscImportExcel; |
| | | import cn.gistack.sm.sjztmd.service.ITbResStagCapDiscService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | 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.status(tbResStagCapDiscService.auditByGuid(list)); |
| | | } |
| | | |
| | | /** |
| | | * 导入模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | @ApiOperation(value = "导入模板") |
| | | public void exportUser(HttpServletResponse response) { |
| | | List<TbResStagCapDiscImportExcel> list = new ArrayList<>(); |
| | | ExcelUtil.export(response, "水位库容导入模板", "水位库容数据表", list, TbResStagCapDiscImportExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导入数据(返回数据给前端,由前端进行真正的保存) |
| | | */ |
| | | @PostMapping("import-tbResStagCapDisc") |
| | | @ApiOperation(value = "导入用户", notes = "传入excel") |
| | | public R importUser(MultipartFile file,String resGuid) { |
| | | |
| | | List<TbResStagCapDisc> list = tbResStagCapDiscService.readExcel(file); |
| | | |
| | | return R.data(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |