songhuangfeng123
2022-08-03 81695c67562b55493a2e98263223c5440e28feed
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/RewardPunishmentDetailController.java
@@ -61,7 +61,7 @@
      PageUtils.checkCheck(pageQuery);
      return this.rewardPunishmentDetailService.queryAll(pageQuery);
    }
    /**
     * 通过主键查询单条数据
@@ -89,19 +89,19 @@
            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));
            return new ResultVO<>(ResultCodes.OK,rewardPunishmentDetailService.save(rewardPunishmentDetail));
        } else {
            rewardPunishmentDetailService.updateBatchById(list);
            rewardPunishmentDetailService.updateById(rewardPunishmentDetail);
            return new ResultVO<>(ResultCodes.OK);
        }
    }
@@ -112,10 +112,12 @@
     * @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);
    }
@@ -148,4 +150,4 @@
        response.getOutputStream().close();
    }
}
}