fix
songhuangfeng123
2022-09-20 f1f506172a3edff8d31e4db77b8940f115660919
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineMngController.java
@@ -11,6 +11,7 @@
import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineMngQueryCriteria;
import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineMngDto;
import com.gkhy.safePlatform.targetDuty.service.ExamineMngService;
import com.gkhy.safePlatform.targetDuty.service.baseService.ExamineMngBaseService;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
@@ -37,6 +38,10 @@
    @Resource
    private ExamineMngService examineMngService;
    @Resource
    private ExamineMngBaseService examineMngBaseService;
    /**
     * 分页查询所有数据
     *
@@ -45,10 +50,10 @@
     */
    @PostMapping(value = "/page/list")
    public ResultVO selectAll(@RequestBody PageQuery<ExamineMngQueryCriteria> pageQuery){
      PageUtils.checkCheck(pageQuery);
      return this.examineMngService.queryAll(pageQuery);
    }
    /**
     * 通过主键查询单条数据
@@ -71,13 +76,13 @@
    @PostMapping(value = "/addOrUpdate")
    public ResultVO update(Authentication authentication, @RequestBody ExamineMng examineMng) {
        // 获取当前用户
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
/*        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        examineMng.setExamineDepartmentId(currentUser.getDepId());
        examineMng.setExaminePersonId(currentUser.getUid());
        examineMng.setExaminePersonId(currentUser.getUid());*/
        if (examineMng.getId() == null) {
            return new ResultVO<>(ResultCodes.OK,examineMngService.save(examineMng));
            return new ResultVO<>(ResultCodes.OK,examineMngBaseService.save(examineMng));
        } else {
            examineMngService.update(examineMng,new UpdateWrapper<ExamineMng>().eq("id",examineMng.getId()));
            examineMngBaseService.update(examineMng,new UpdateWrapper<ExamineMng>().eq("id",examineMng.getId()));
            return new ResultVO<>(ResultCodes.OK);
        }
    }
@@ -90,19 +95,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<ExamineMng> delList = new ArrayList<>();
        idList.forEach(f->{
            ExamineMng info = new ExamineMng();
            info.setDelFlag(1);
            info.setId(f);
            delList.add(info);
        });
        this.examineMngService.updateBatchById(delList);
        this.examineMngService.delete(ids);
        return new ResultVO<>(ResultCodes.OK);
    }
@@ -124,4 +117,4 @@
        System.out.println(JSONObject.toJSONString(examineTemplateSaveOrUpdate));
    }
}
}