| | |
| | | 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.*; |
| | | |
| | |
| | | @Resource |
| | | private ExamineMngService examineMngService; |
| | | |
| | | @Resource |
| | | private ExamineMngBaseService examineMngBaseService; |
| | | |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | |
| | | */ |
| | | @PostMapping(value = "/page/list") |
| | | public ResultVO selectAll(@RequestBody PageQuery<ExamineMngQueryCriteria> pageQuery){ |
| | | PageUtils.checkCheck(pageQuery); |
| | | |
| | | return this.examineMngService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | @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); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | |
| | | |
| | | System.out.println(JSONObject.toJSONString(examineTemplateSaveOrUpdate)); |
| | | } |
| | | } |
| | | } |