| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.targetDuty.entity.RewardPunishmentDetail; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineMngDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.ExamineTemplateDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentDetailDto; |
| | | import com.gkhy.safePlatform.targetDuty.model.dto.resp.RewardPunishmentDetailExcel; |
| | | import com.gkhy.safePlatform.targetDuty.service.RewardPunishmentDetailService; |
| | | import com.gkhy.safePlatform.targetDuty.utils.DateUtils; |
| | |
| | | PageUtils.checkCheck(pageQuery); |
| | | return this.rewardPunishmentDetailService.queryAll(pageQuery); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | |
| | | */ |
| | | @GetMapping(value = "/selectOne/{id}") |
| | | public ResultVO selectOne(@PathVariable Serializable id) { |
| | | return new ResultVO<>(ResultCodes.OK,this.rewardPunishmentDetailService.getById(id)); |
| | | RewardPunishmentDetailDto mngDto = this.rewardPunishmentDetailService.selectOne(id); |
| | | return new ResultVO<>(ResultCodes.OK,mngDto); |
| | | } |
| | | |
| | | /** |
| | |
| | | return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少rewardPunishmentStandardId"); |
| | | } |
| | | |
| | | List<Long> pIdList = Arrays.stream(rewardPunishmentDetail.getPersonId().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<RewardPunishmentDetail> list = new ArrayList<>(); |
| | | pIdList.forEach(f->{ |
| | | RewardPunishmentDetail new1 = BeanCopyUtils.copyBean(rewardPunishmentDetail, RewardPunishmentDetail.class); |
| | | new1.setPersonId(f+""); |
| | | list.add(new1); |
| | | }); |
| | | // List<Long> pIdList = Arrays.stream(rewardPunishmentDetail.getPersonId().split(",")).map(s-> Long.parseLong(s.trim())) |
| | | // .collect(Collectors.toList()); |
| | | // |
| | | // List<RewardPunishmentDetail> list = new ArrayList<>(); |
| | | // pIdList.forEach(f->{ |
| | | // RewardPunishmentDetail new1 = BeanCopyUtils.copyBean(rewardPunishmentDetail, RewardPunishmentDetail.class); |
| | | // new1.setPersonId(f+""); |
| | | // list.add(new1); |
| | | // }); |
| | | if (rewardPunishmentDetail.getId() == null) { |
| | | return new ResultVO<>(ResultCodes.OK,rewardPunishmentDetailService.saveBatch(list)); |
| | | rewardPunishmentDetail.setCreateTime(new Date()); |
| | | return new ResultVO<>(ResultCodes.OK,rewardPunishmentDetailService.save(rewardPunishmentDetail)); |
| | | } else { |
| | | rewardPunishmentDetailService.updateBatchById(list); |
| | | rewardPunishmentDetailService.updateById(rewardPunishmentDetail); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | } |
| | |
| | | * @param ids 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "/delete") |
| | | public ResultVO delete(String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")) |
| | | .collect(Collectors.toList()); |
| | | @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); |
| | | this.rewardPunishmentDetailService.removeByIds(idList); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | |
| | | response.getOutputStream().close(); |
| | | } |
| | | |
| | | } |
| | | } |