songhuangfeng123
2022-09-08 bfb4c1e1d4e3f99f74a51ef5b67531f9d91d0dde
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java
@@ -69,16 +69,7 @@
     */
    @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);
    }
@@ -90,19 +81,7 @@
     */
    @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);
    }