| | |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.manager.controller.params.MatnrToGroupParams; |
| | | 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; |
| | |
| | | return R.ok().add(matnrService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @GetMapping("/matnr/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(matnrService.getById(id)); |
| | | return R.ok(matnrService.selectMatnrById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:save')") |
| | |
| | | return R.error("Update Fail"); |
| | | } |
| | | if (!FieldsUtils.getFieldsSta().isEmpty()) { |
| | | Matnr matnr1 = matnrService.getById(matnr.getId()); |
| | | params.put("fieldsIndex", matnr1.getFieldsIndex()); |
| | | FieldsUtils.updateFieldsValue(params); |
| | | } |
| | | |
| | |
| | | return R.ok(new PageResult().setRecords(matnrPage.getRecords()).setTotal(matnrPage.getTotal())); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @ApiOperation("绑定物料分组") |
| | | @PostMapping("/matnr/group/bind") |
| | | public R bindMatnrToGroup(@RequestBody MatnrToGroupParams params) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | if (matnrService.bindMatnrs(params)) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.error("操作失败!!"); |
| | | } |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | | @ApiOperation("导出物料信息") |
| | | @PostMapping("/matnr/export") |