大族富创得薪资报表 搜索条件BUG修复

This commit is contained in:
dxfeng 2025-12-08 16:03:16 +08:00
parent c805c6a462
commit 8cd53675ba
3 changed files with 33 additions and 9 deletions

View File

@ -18,7 +18,7 @@ public interface DzSalaryReportMapper {
*
* @return
*/
List<DzSalaryReportDTO> getReportList(@Param("month") String month, @Param("deptIds") Set<String> deptIds);
List<DzSalaryReportDTO> getReportList(@Param("month") String month, @Param("productGrouping") String productGrouping, @Param("deptIds") Set<String> deptIds);
/**

View File

@ -10,12 +10,17 @@
and record.delete_type = 0
inner join hrsa_salary_item item on result.salary_item_id = item.id and item.delete_type = 0
inner join hrmresource e on e.id= result.employee_id
inner join cus_fielddata cus on cus.id = e.id and cus.SCOPE ='HrmCustomFieldByInfoType' and cus.SCOPEID = -1
where 1=1
<if test=" month !=null ">
and record.salary_month = #{month}
</if>
<if test=" productGrouping !=null and productGrouping !='' ">
and cus.field21 = #{productGrouping}
</if>
<if test=" deptIds !=null and deptIds.size() > 0">
and e.id in
and e.departmentid in
<foreach collection="deptIds" open="(" item="id" separator="," close=")">
#{id}
</foreach>

View File

@ -41,24 +41,43 @@ public class DzSalaryReportServiceImpl extends Service implements DzSalaryReport
String firstLevelDepartment = queryParam.getFirstDepartment();
String secondaryDepartment = queryParam.getSecondaryDepartment();
String thirdDepartment = queryParam.getThirdDepartment();
String productGrouping = queryParam.getProductGrouping();
String month = queryParam.getMonth();
if (StringUtils.isNotBlank(month) && month.length() == 7) {
month = month + "-01";
}
Set<String> departmentIds = new HashSet<>();
if (StringUtils.isNotBlank(thirdDepartment)) {
departmentIds.add(thirdDepartment);
String[] split = thirdDepartment.split(",");
if (split.length > 0) {
departmentIds.addAll(Arrays.asList(split));
}
} else {
if (StringUtils.isNotBlank(secondaryDepartment)) {
ArrayList allChildDeptByDepId = departmentComInfo.getAllChildDeptByDepId(new ArrayList<String>(), secondaryDepartment);
departmentIds.addAll(allChildDeptByDepId);
String[] split = secondaryDepartment.split(",");
if (split.length > 0) {
for (String s : split) {
ArrayList allChildDeptByDepId = departmentComInfo.getAllChildDeptByDepId(new ArrayList<String>(), s);
departmentIds.addAll(allChildDeptByDepId);
departmentIds.add(s);
}
}
} else {
if (StringUtils.isNotBlank(firstLevelDepartment)) {
ArrayList allChildDeptByDepId = departmentComInfo.getAllChildDeptByDepId(new ArrayList<String>(), firstLevelDepartment);
departmentIds.addAll(allChildDeptByDepId);
String[] split = firstLevelDepartment.split(",");
if (split.length > 0) {
for (String s : split) {
ArrayList allChildDeptByDepId = departmentComInfo.getAllChildDeptByDepId(new ArrayList<String>(), s);
departmentIds.addAll(allChildDeptByDepId);
departmentIds.add(s);
}
}
}
}
}
List<DzSalaryReportDTO> dzSalaryReportDTOS = getDzSalaryReportMapper().getReportList(month, departmentIds);
List<DzSalaryReportDTO> dzSalaryReportDTOS = getDzSalaryReportMapper().getReportList(month, productGrouping,departmentIds);
PageInfo<DzSalaryReportDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), dzSalaryReportDTOS, DzSalaryReportDTO.class);
// 遍历List 填充报表数据
List<DzSalaryReportDTO> list = pageInfo.getList();
@ -173,7 +192,7 @@ public class DzSalaryReportServiceImpl extends Service implements DzSalaryReport
rs.executeQuery("SELECT MAX(changedate) as dismissdate FROM HrmStatusHistory WHERE resourceid= ? and type_n=5", userId);
if (rs.next()) {
String dismissDate = rs.getString("dismissdate");
if(StringUtils.isBlank(dismissDate)){
if (StringUtils.isBlank(dismissDate)) {
dismissDate = resourceComInfo.getEndDate(userId);
}
report.setTerminationDate(dismissDate);