| | |
| | | */ |
| | | @PostMapping(value = "/addOrUpdate") |
| | | public ResultVO update(Authentication authentication, @RequestBody ExamineTemplateSaveOrUpdate examineTemplateSaveOrUpdate) { |
| | | if(!StringUtils.hasText(examineTemplateSaveOrUpdate.getTitle())){ |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少title"); |
| | | } |
| | | // 获取当前用户 |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | |
| | | //设置设定人ID和设定人部门ID |
| | | examineTemplateSaveOrUpdate.setSetPersonDepartmentId(currentUser.getDepId()); |
| | | examineTemplateSaveOrUpdate.setSetPersonId(currentUser.getUid()); |
| | | examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate); |
| | | examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate,authentication); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/delete",method = RequestMethod.POST) |
| | | public ResultVO delete(@RequestBody Long[] ids) { |
| | | if(ids == null){ |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL); |
| | | } |
| | | List<Long> idList = Arrays.asList(ids); |
| | | |
| | | List<ExamineTemplate> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | ExamineTemplate info = new ExamineTemplate(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | this.examineTemplateService.updateBatchById(delList); |
| | | this.examineTemplateService.delete(ids); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |