| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.Worktype; |
| | | import com.doumee.service.business.WorktypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.*; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | ExcelExporter.build(Worktype.class).export(worktypeService.findPage(pageWrap).getRecords(), "工种信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("导入模板") |
| | | @PostMapping("/importExcel/{id}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | @RequiresPermissions("business:worktype:create") |
| | | public ApiResponse<List<String>> importExcel (@ApiParam(value = "file") MultipartFile file,@PathVariable Integer id) { |
| | | return ApiResponse.success(worktypeService .importBatch(file,id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:worktype:query") |