艾志工业薪酬优化

This commit is contained in:
Harryxzy 2025-06-06 14:23:23 +08:00
parent dd398775e6
commit ec1298314a
7 changed files with 66 additions and 3 deletions

View File

@ -1160,7 +1160,7 @@ public class SalaryStatisticsReportBO {
if (totalRule != null && 1 == totalRule.getM2mValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(157146, "上周期(求和)"), k + UD + SUM + P_LAST));
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(157147, "求和环比差值"), k + UD + SUM + P_M2M_D_VALUE));
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(157148, "求和环比增幅"), k + UD + SUM + P_M2M_INCREASE));
// children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(157148, "求和环比增幅"), k + UD + SUM + P_M2M_INCREASE));
}
if (totalRule != null && 1 == totalRule.getY2yValue()) {
children.add(new WeaTableColumnGroup(COL_WIDTH, SalaryI18nUtil.getI18nLabel(180673, "同比周期(求和)"), k + UD + SUM + P_SAME));

View File

@ -51,6 +51,15 @@ public class SalaryStatisticsEmployeeSalaryQueryParam extends BaseQueryParam {
// 部分导出id
private List<Long> ids;
// 艾志合同签署类型编号
private List<String> htqslxList;
// 艾志人事代理公司编号
private List<String> rsdlgsList;
//状态(多选)
private List<String> statuses;
// 导出时显示列定制信息
List<String> columns;
}

View File

@ -39,7 +39,9 @@ import com.wbi.util.Util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.util.*;
@ -348,7 +350,8 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
List<Long> finalTaxAgentIds = taxAgentIds;
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmployee -> finalTaxAgentIds.contains(acctEmployee.getTaxAgentId()) || bmIdList.contains(acctEmployee.getDepartmentId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(queryParam.getSubCompanyIds()) || CollectionUtils.isNotEmpty(queryParam.getDepartmentIds()) || StringUtils.isNotBlank(queryParam.getKeyword())) {
if (CollectionUtils.isNotEmpty(queryParam.getSubCompanyIds()) || CollectionUtils.isNotEmpty(queryParam.getDepartmentIds())
|| StringUtils.isNotBlank(queryParam.getKeyword()) || CollectionUtils.isNotEmpty(queryParam.getStatuses())) {
// 根据分部部门筛选
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listBySubCompanyOrDepartment(queryParam.getSubCompanyIds(), queryParam.getDepartmentIds());
// 根据关键词过滤
@ -357,6 +360,9 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
.filter(e -> (StringUtils.isNotEmpty(e.getUsername()) && e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword()))))
.collect(Collectors.toList());
}
if (CollectionUtils.isNotEmpty(queryParam.getStatuses())) {
employeeList = employeeList.stream().filter(e -> queryParam.getStatuses().contains(e.getStatus())).collect(Collectors.toList());
}
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
}
@ -367,6 +373,34 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
}
BaseBean baseBean = new BaseBean();
// 艾志 合同签署类型
if (CollectionUtils.isNotEmpty(queryParam.getHtqslxList())) {
List<Long> salaryAcctEmpIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
Long htqslxItemId = NumberUtils.isCreatable(baseBean.getPropValue("azgySalary", "htqslx_item_id"))
? Long.valueOf(baseBean.getPropValue("azgySalary", "htqslx_item_id")) : 0L;
List<SalaryAcctResultPO> list = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, Collections.singletonList(htqslxItemId));
List<Long> acctEmpId = list.stream().filter(result -> queryParam.getHtqslxList().contains(result.getResultValue())).map(SalaryAcctResultPO::getSalaryAcctEmpId).distinct().collect(Collectors.toList());
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> acctEmpId.contains(acctEmp.getId())).collect(Collectors.toList());
}
// 艾志 人事代理公司
if (CollectionUtils.isNotEmpty(queryParam.getRsdlgsList())) {
List<Long> salaryAcctEmpIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
// 获取人事代理公司编号对应的名称
String sql = "select rsdlgs from uf_rsdlgs where bh in("+ StringUtils.join(queryParam.getRsdlgsList(), ",") + ")";
rs.execute(sql);
ArrayList<String> rsdlgsNames = new ArrayList<>();
while (rs.next()) {
rsdlgsNames.add(rs.getString(1));
}
Long rsdlgsItemId = NumberUtils.isCreatable(baseBean.getPropValue("azgySalary", "rsdlgs_item_id"))
? Long.valueOf(baseBean.getPropValue("azgySalary", "rsdlgs_item_id")) : 0L;
List<SalaryAcctResultPO> list = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmpIds, Collections.singletonList(rsdlgsItemId));
List<Long> acctEmpId = list.stream().filter(result -> rsdlgsNames.contains(result.getResultValue())).map(SalaryAcctResultPO::getSalaryAcctEmpId).distinct().collect(Collectors.toList());
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> acctEmpId.contains(acctEmp.getId())).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
return new PageInfo<>();
}

View File

@ -993,7 +993,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
//排除未归档数据
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
List<Long> salaryAcctRecordIds = salaryAcctRecordPOS.stream()
.filter(po -> !Objects.equals(po.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()))
// .filter(po -> !Objects.equals(po.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()))
.map(SalaryAcctRecordPO::getId)
.collect(Collectors.toList());

View File

@ -39,6 +39,8 @@ import com.engine.salary.enums.salaryaccounting.SalaryAcctResultDataSourceEnum;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.report.service.SalaryStatisticsReportService;
import com.engine.salary.report.service.impl.SalaryStatisticsReportServiceImpl;
import com.engine.salary.service.*;
import com.engine.salary.sys.constant.SalarySysConstant;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
@ -171,6 +173,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
}
private SalaryStatisticsReportService getSalaryStatisticsReportService(User user) {
return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user);
}
@Override
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
ValidUtil.doValidator(queryParam);
@ -1544,6 +1550,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
apidatas.put("successCount", successCount);
apidatas.put("errorCount", failCount);
apidatas.put("errorData", excelComments);
// 删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
} finally {
IOUtils.closeQuietly(fileInputStream);

View File

@ -727,6 +727,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
List<List<SalaryAcctResultPO>> partition = Lists.partition(salaryAcctResultPOS, 100);
partition.forEach(getSalaryAcctResultMapper()::batchInsert);
}
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
//报表
// getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds);
// List<SalaryAcctResultReportPO> salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps);
@ -954,6 +956,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
stopWatch.stop();
stopWatch.start("数据写入耗时");
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
// 14判断子线程执行结果
boolean allSuccess = calculateResults.stream().allMatch(SalaryAcctCalculateBO.Result::isStatus);

View File

@ -25,6 +25,8 @@ import com.engine.salary.exception.OnlineCalculateTaxException;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.remote.tax.client.CalculateClient;
import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse;
import com.engine.salary.report.service.SalaryStatisticsReportService;
import com.engine.salary.report.service.impl.SalaryStatisticsReportServiceImpl;
import com.engine.salary.service.*;
import com.engine.salary.util.*;
import com.engine.salary.util.db.IdGenerator;
@ -86,6 +88,10 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
}
private SalaryStatisticsReportService getSalaryStatisticsReportService(User user) {
return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user);
}
@Override
public SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam) {
@ -300,6 +306,8 @@ public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxSe
getSalaryAcctResultService(user).batchSave(addResultPOS);
getSalaryAcctResultService(user).batchUpdate(updateResultPOS);
getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId());
//删除报表缓存
getSalaryStatisticsReportService(user).removeReportCache();
// 记录日志
getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.GET_CALC_TAX_FEEDBACK);
}