| | |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Matnr; |
| | | import com.vincent.rsf.server.manager.entity.excel.MatnrsTemplate; |
| | | import com.vincent.rsf.server.manager.service.MatnrService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @SecurityRequirement(name = HttpHeaders.AUTHORIZATION) |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @ApiOperation(value = "获取分类物料明细列表") |
| | | @PostMapping("/matnr/group") |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @ApiOperation("导出物料信息") |
| | | @PostMapping("/matnr/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(matnrService.list(), Matnr.class), response); |
| | | List<Matnr> matnrs = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().in(Matnr::getId, map.get("ids")).eq(Matnr::getStatus, 1)); |
| | | } else { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().last("limit 1")); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(null, MatnrsTemplate.class, true), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:save')") |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @ApiOperation("下载物料模板") |
| | | @PostMapping("/matnr/template/download") |
| | | public void download(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(null, MatnrsTemplate.class, true), response); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:update')") |
| | | @ApiOperation(value = "excel表格导入物料信息") |
| | | @PostMapping("/matnr/import") |
| | | public R listImport(MultipartFile file) throws Exception { |