| | |
| | | import com.gkhy.safePlatform.targetDuty.service.CommonService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetExamineService; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetMngService; |
| | | import com.gkhy.safePlatform.targetDuty.service.baseService.TargetExamineBaseService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private TargetExamineService targetExamineService; |
| | | @Resource |
| | | private TargetMngService targetMngService; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | private TargetExamineBaseService targetExamineBaseService; |
| | | // /** |
| | | // * 通过主键查询单条数据 |
| | | // * |
| | |
| | | */ |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.targetExamineService.getById(id)); |
| | | return new ResultVO<>(ResultCodes.OK,this.targetExamineBaseService.getById(id)); |
| | | } |
| | | |
| | | |
| | |
| | | public ResultVO update(@RequestBody TargetExamine infoDto) { |
| | | infoDto.setExamineDate(new Timestamp(new Date().getTime())); |
| | | if (infoDto.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,targetExamineService.save(infoDto)); |
| | | return new ResultVO<>(ResultCodes.OK,targetExamineBaseService.save(infoDto)); |
| | | } else { |
| | | targetExamineService.update(infoDto,new UpdateWrapper<TargetExamine>().eq("id",infoDto.getId())); |
| | | targetExamineBaseService.update(infoDto,new UpdateWrapper<TargetExamine>().eq("id",infoDto.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<TargetExamine> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | TargetExamine info = new TargetExamine(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | this.targetExamineService.updateBatchById(delList); |
| | | this.targetExamineService.delete(ids); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | |