西部信托,个人薪资报表

This commit is contained in:
钱涛 2025-11-12 09:42:17 +08:00
parent 67c883513d
commit d254a1da92
3 changed files with 59 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
/**
@ -121,4 +122,6 @@ public class SalarySendInfoPO {
* 首次查看时间
*/
private Date firstReadingTime;
private Collection<Date> salaryMonths;
}

View File

@ -740,6 +740,12 @@
<if test="billReadStatus != null and billReadStatus != ''">
AND bill_read_status = #{billReadStatus}
</if>
<if test="salaryMonths != null and salaryMonths.size() > 0">
AND salary_month IN
<foreach collection="salaryMonths" open="(" item="salaryMonth" separator="," close=")">
#{salaryMonth}
</foreach>
</if>
ORDER BY id DESC
</select>
<select id="getNeedSendInfoList" resultType="com.engine.salary.entity.salaryBill.po.SalarySendInfoPO">

View File

@ -1,5 +1,6 @@
package com.engine.salary.report.wrapper;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.cloudstore.eccom.constant.WeaBoolAttr;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.cloudstore.eccom.result.WeaResultMsg;
@ -7,13 +8,17 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.component.WeaTableColumnGroup;
import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO;
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.setting.param.PageListTemplateQueryParam;
import com.engine.salary.entity.setting.po.PageListTemplatePO;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.mapper.salarybill.SalarySendInfoMapper;
import com.engine.salary.report.common.constant.SalaryConstant;
import com.engine.salary.report.entity.bo.SalaryStatisticsEmployeeBO;
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
import com.engine.salary.report.entity.dto.SalaryStatisticsEmployeeDetailResultDTO;
import com.engine.salary.report.entity.dto.SalaryStatisticsEmployeeListDTO;
@ -23,12 +28,17 @@ import com.engine.salary.report.entity.param.SalaryStatisticsEmployeeSalaryQuery
import com.engine.salary.report.service.SalaryStatisticsEmployeeService;
import com.engine.salary.report.service.impl.SalaryStatisticsEmployeeServiceImpl;
import com.engine.salary.report.util.ReportDataUtil;
import com.engine.salary.service.SalaryAcctEmployeeService;
import com.engine.salary.service.SalaryItemService;
import com.engine.salary.service.SalarySendService;
import com.engine.salary.service.SettingService;
import com.engine.salary.service.impl.SalaryAcctEmployeeServiceImpl;
import com.engine.salary.service.impl.SalaryItemServiceImpl;
import com.engine.salary.service.impl.SalarySendServiceImpl;
import com.engine.salary.service.impl.SettingServiceImpl;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.excel.ExcelFillUtils;
@ -80,6 +90,18 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
}
private SalarySendService getSalarySendService(User user) {
return ServiceUtil.getService(SalarySendServiceImpl.class, user);
}
private SalarySendInfoMapper getSalarySendInfoMapper() {
return SqlProxyHandle.getProxy(SalarySendInfoMapper.class);
}
//是否模板显示
private final boolean templateShow = "1".equals(getSalarySysConfService(user).getValueByCode(SALARY_DETAILS_REPORT_SHOW_TYPE));
@ -362,20 +384,44 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
public Map<String, Object> salaryReport(SalaryStatisticsEmployeeSalaryQueryParam queryParam) {
Map<String, Object> resultMap = Maps.newHashMap();
if (StringUtils.isBlank(queryParam.getStartDateStr()) || StringUtils.isBlank(queryParam.getEndDateStr())) {
return resultMap;
}
// 获取发薪人员
PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
// PageInfo<SalaryAcctEmployeePO> salaryAcctEmployeePageInfo = getSalaryStatisticsEmployeeService(user).listSalaryAcctEmp(queryParam);
List<Date> dataParam = new ArrayList<>();
if (StringUtils.isNotBlank(queryParam.getStartDateStr())) {
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getStartDateStr() + "-01 00:00:00"));
}
if (StringUtils.isNotBlank(queryParam.getEndDateStr())) {
dataParam.add(SalaryDateUtil.dateStrToLocalTime(queryParam.getEndDateStr() + "-01 00:00:00"));
}
Set<Date> salaryMonths = SalaryStatisticsEmployeeBO.getSalaryMonths(null, dataParam)
.stream()
.map(SalaryDateUtil::dateStrToLocalYearMonth)
.collect(Collectors.toSet());
//工资单数据按照已发放的工资单分页
SalarySendInfoPO build = SalarySendInfoPO.builder().salaryMonths(salaryMonths).employeeId((long) user.getUID()).build();
List<SalarySendInfoPO> salarySendInfoPOS = getSalarySendInfoMapper().listSome(build);
PageInfo<SalarySendInfoPO> salarySendInfoPOPageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), salarySendInfoPOS);
List<SalarySendInfoPO> list = salarySendInfoPOPageInfo.getList();
List<Long> recordIds = SalaryEntityUtil.properties(list, SalarySendInfoPO::getSalaryAcctRecordId, Collectors.toList());
SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder()
.salaryAcctRecordIds(recordIds)
.employeeIds(Collections.singletonList((long) user.getUID()))
.build();
List<SalaryAcctEmployeePO> salaryAcctEmployeeList = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam);
// 获取薪资核算结果
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeePageInfo.getList());
SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult = getSalaryStatisticsEmployeeService(user).getDetailSalaryAcctResultByAcctEmp(salaryAcctEmployeeList);
List<Map<String, Object>> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, null);
PageInfo<Map<String, Object>> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
pageInfo.setList(records);
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
pageInfo.setTotal(salarySendInfoPOPageInfo.getTotal());
List<WeaTableColumn> weaTableColumns = new ArrayList<>();
weaTableColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(87614, "薪资所属月"), "salaryMonth"));