| | |
| | | import me.zhengjie.modules.system.repository.SysConfigHolidayRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.RoleService; |
| | | import me.zhengjie.modules.system.service.SysCompanyService; |
| | | import me.zhengjie.modules.system.service.SysConfigIndividualIncomeTaxService; |
| | | import me.zhengjie.modules.system.service.SysUserLevelInsuranceService; |
| | | import me.zhengjie.modules.system.service.SysUserLevelOtherService; |
| | | import me.zhengjie.modules.system.service.SysUserLevelWageService; |
| | | import me.zhengjie.modules.system.service.UserService; |
| | | import me.zhengjie.modules.system.service.dto.RoleSmallDto; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria; |
| | | import me.zhengjie.modules.system.service.dto.SysConfigHolidayQueryCriteria; |
| | | import me.zhengjie.modules.system.service.dto.SysConfigIndividualIncomeTaxDto; |
| | | import me.zhengjie.modules.system.service.dto.SysConfigIndividualIncomeTaxQueryCriteria; |
| | |
| | | private final SysConfigHolidayRepository sysConfigHolidayRepository; |
| | | private final RoleService roleService; |
| | | private final DictDetailRepository dictDetailRepository; |
| | | private final SysCompanyService sysCompanyService; |
| | | // ==================== 以下为定时生成工资记录主要依赖 ==================== |
| | | private final UserService userService; |
| | | private final SysUserLevelWageService sysUserLevelWageService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SalaryDto> queryAll(SalaryQueryCriteria criteria){ |
| | | public List<SalaryDto> queryAll(SalaryQueryCriteria criteria) { |
| | | // 判断工资查询类工资年月是否为空 |
| | | if (criteria.getSalaryYearMonth() != null && !"".equals(criteria.getSalaryYearMonth())) { |
| | | // 工资年月:国际时间转中国时间 |
| | | criteria.setSalaryYearMonth(DateUtil.internationalTimeToChinaTime(criteria.getSalaryYearMonth())); |
| | | } |
| | | return salaryMapper.toDto(salaryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void download(List<SalaryDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | List<SysCompanyDto> sysCompanyDtoList = sysCompanyService.queryAll(new SysCompanyQueryCriteria()); |
| | | Map<Long, String> companyNameMap = sysCompanyDtoList.stream().collect(Collectors.toMap(companyDto -> companyDto.getId(), companyDto -> companyDto.getLabel())); |
| | | for (SalaryDto salary : all) { |
| | | String userNickName = salary.getUserId() != null ? userRepository.findById(salary.getUserId()).orElseGet(User::new).getNickName() : ""; |
| | | User user = userRepository.findById(salary.getUserId()).orElseGet(User::new); |
| | | String userNickName = salary.getUserId() != null ? user.getNickName() : ""; |
| | | String publicityStatus = salary.getPublicityStatus() != null ? dictDetailRepository.findByDictNameAndValue(Constant.PUBLICITY_STATUS, salary.getPublicityStatus()).getLabel() : ""; |
| | | String approveStatus = salary.getApproveStatus() != null ? dictDetailRepository.findByDictNameAndValue(Constant.APPROVE_STATUS, salary.getApproveStatus()).getLabel() : ""; |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("员工姓名", userNickName); |
| | | map.put("工资年月", salary.getSalaryYearMonth()); |
| | | map.put("公司", companyNameMap.get(user.getCompanyId())); |
| | | map.put("级别工资", salary.getLevelWage()); |
| | | map.put("基本工资比例", salary.getBasicWageProportion()); |
| | | map.put("基本工资", salary.getBasicWage()); |
| | |
| | | map.put("备注", salary.getRemarks()); |
| | | map.put("公示状态", publicityStatus); |
| | | map.put("承认状态", approveStatus); |
| | | map.put("创建者", salary.getCreateBy()); |
| | | map.put("创建时间", salary.getCreateTime()); |
| | | map.put("更新者", salary.getUpdateBy()); |
| | | map.put("更新时间", salary.getUpdateTime()); |
| | | // map.put("创建者", salary.getCreateBy()); |
| | | // map.put("创建时间", salary.getCreateTime()); |
| | | // map.put("更新者", salary.getUpdateBy()); |
| | | // map.put("更新时间", salary.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |