| | |
| | | */ |
| | | @Override |
| | | public List<CoalPayRepDto> selectCoalPayList(CoalPayReq coalPay) { |
| | | List<CoalPayRepDto> coalPayRepDtos = new ArrayList<>(); |
| | | List<CoalPay> coalPays = coalPayMapper.selectCoalPayList(coalPay); |
| | | for (CoalPay pay : coalPays) { |
| | | CoalPayRepDto coalPayRepDto = new CoalPayRepDto(); |
| | | BeanUtils.copyProperties(pay, coalPayRepDto); |
| | | // List<CoalPayRepDto> coalPayRepDtos = new ArrayList<>(); |
| | | List<CoalPayRepDto> coalPays = coalPayMapper.selectCoalPayList(coalPay); |
| | | for (CoalPayRepDto pay : coalPays) { |
| | | // CoalPayRepDto coalPayRepDto = new CoalPayRepDto(); |
| | | // BeanUtils.copyProperties(pay, coalPayRepDto); |
| | | //部门数据 |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(pay.getDeptId()); |
| | | coalPayRepDto.setDeptName(sysDept.getDeptName()); |
| | | pay.setDeptName(sysDept.getDeptName()); |
| | | //工种数据 |
| | | List<CoalCategory> coalCategories = coalCategoryMapper.selectByCoalPayId(pay.getId()); |
| | | coalPayRepDto.setCoalCategoryList(coalCategories); |
| | | pay.setCoalCategoryList(coalCategories); |
| | | //学员数据 |
| | | List<CoalPayStudent> coalPayStudents = coalPayStudentService.selectByCoalPayId(pay.getId()); |
| | | List<CoalPayStudent> havePay = coalPayStudents.stream() |
| | | .filter(stu -> stu.getPayStatus() != null && stu.getPayStatus() == 1) |
| | | .collect(Collectors.toList()); |
| | | coalPayRepDto.setTotalNum(coalPayStudents.size()); |
| | | coalPayRepDto.setHavePayNum(havePay.size()); |
| | | coalPayRepDtos.add(coalPayRepDto); |
| | | pay.setTotalNum(coalPayStudents.size()); |
| | | pay.setHavePayNum(havePay.size()); |
| | | // coalPayRepDtos.add(coalPayRepDto); |
| | | } |
| | | return coalPayRepDtos; |
| | | return coalPays; |
| | | } |
| | | |
| | | @Override |