| | |
| | | @PostMapping("/qlyInspect/save") |
| | | public R save(@RequestBody QlyInspect qlyInspect) { |
| | | qlyInspect.setCreateBy(getLoginUserId()); |
| | | qlyInspect.setCreateTime(new Date()); |
| | | qlyInspect.setUpdateBy(getLoginUserId()); |
| | | qlyInspect.setUpdateTime(new Date()); |
| | | if (!qlyInspectService.save(qlyInspect)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | |
| | | @OperationLog("Delete 质检信息") |
| | | @PostMapping("/qlyInspect/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (Objects.isNull(ids) || ids.length < 1) { |
| | | return R.error("能数不能为空!!"); |
| | | } |
| | | List<QlyInspect> qlyInspects = qlyInspectService.list(new LambdaQueryWrapper<QlyInspect>().in(QlyInspect::getId, ids)); |
| | | if (!qlyInspects.isEmpty()) { |
| | | return R.error("有明细列表存在!!"); |
| | | } |
| | | if (!qlyInspectService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |