Merge branch 'release/2.19.1.2501.01' into release/3.0.2.2504.01

This commit is contained in:
钱涛 2025-04-17 14:24:23 +08:00
commit 083f266a85
5 changed files with 53 additions and 13 deletions

View File

@ -7,6 +7,8 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
import com.engine.salary.mapper.salarybill.SalarySendRangeObjMapper;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -23,6 +25,10 @@ public class SalarySendRangeObjBiz {
return ServiceUtil.getService(TaxAgentServiceImpl.class);
}
private SalarySendRangeObjMapper getSalarySendRangeObjMapper() {
return MapperProxyFactory.getProxy(SalarySendRangeObjMapper.class);
}
public <R> R applyMapper(Function<SalarySendRangeObjMapper, R> mapper) {
try (SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession()) {
final SalarySendRangeObjMapper salarySendRangeObjMapper = sqlSession.getMapper(SalarySendRangeObjMapper.class);
@ -41,7 +47,13 @@ public class SalarySendRangeObjBiz {
}
public List<SalarySendUserInfoDTO> getSalarySendUserInfoDTOs(List<Long> employees) {
List<SalarySendUserInfoDTO> userDTOs = applyMapper(mapper -> mapper.getUserInfoByEmployeeIds(employees));
List<SalarySendUserInfoDTO> userDTOs = new ArrayList<>();
List<List<Long>> partition = Lists.partition(employees, 500);
partition.forEach(l->{
List<SalarySendUserInfoDTO> userInfos = getSalarySendRangeObjMapper().getUserInfoByEmployeeIds(l);
userDTOs.addAll(userInfos);
});
Map<Long, SalarySendUserInfoDTO> userMap = userDTOs.stream()
.collect(Collectors.toMap(SalarySendUserInfoDTO::getResourceId, Function.identity()));

View File

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.YearMonth;
import java.util.List;
/**
* 薪资核算列表查询参数
@ -31,6 +32,11 @@ public class SalaryAcctRecordQueryParam extends BaseQueryParam {
//账套名称")
private String name;
/**
* 扣缴义务人id集合
*/
private List<Long> taxAgentIds;
private String startMonthStr;
private String endMonthStr;
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
@ -187,6 +188,21 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
po.setSalarySobIds(salarySobIds);
}
if (CollUtil.isNotEmpty(queryParam.getTaxAgentIds())) {
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByTaxAgentIds(queryParam.getTaxAgentIds());
if (CollectionUtils.isEmpty(salarySobPOS)) {
return page;
}
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
Collection<Long> existIds = po.getSalarySobIds();
if (CollectionUtils.isNotEmpty(existIds)) {
existIds = SalaryEntityUtil.intersectionForList(existIds, salarySobIds);
po.setSalarySobIds(existIds);
} else {
po.setSalarySobIds(salarySobIds);
}
}
LocalDateRange localDateRange = new LocalDateRange();
if (Objects.nonNull(queryParam.getStartMonth())) {
localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getStartMonth().atDay(1)));
@ -804,6 +820,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
@Override
public void updateDate(Long id, Date updateTime) {
getSalaryAcctRecordMapper().updateDate(id,updateTime);
getSalaryAcctRecordMapper().updateDate(id, updateTime);
}
}

View File

@ -1357,7 +1357,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyList();
}
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
List<List<Long>> partition = Lists.partition(employeeIds, 500);
List<SalaryArchivePO> resultList = new ArrayList<>();
partition.forEach(part -> {
resultList.addAll(getSalaryArchiveMapper().listPayEndDateIsNull(part));
});
return resultList;
}
@Override

View File

@ -166,16 +166,6 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
&& Optional.ofNullable(salaryBillProgress.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(136104, "有其他人员正在发送中,请等待其他人员发送结束后再操作"));
}
// 初始化进度
ProgressDTO initProgress = ProgressDTO.builder()
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
.totalQuantity(NumberUtils.INTEGER_ZERO)
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
.progress(BigDecimal.ZERO)
.status(true)
.message("")
.build();
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
List<Long> ids = param.getIds();
@ -187,6 +177,17 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
throw new SalaryRunTimeException("工资发放范围内没有匹配员工");
}
}
// 初始化进度
ProgressDTO initProgress = ProgressDTO.builder()
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
.totalQuantity(NumberUtils.INTEGER_ZERO)
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
.progress(BigDecimal.ZERO)
.status(true)
.message("")
.build();
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
// 异步执行
List<Long> finalIds = ids;
LocalRunnable localRunnable = new LocalRunnable() {