Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
MustangDeng 2022-05-26 14:07:37 +08:00
commit a77bb4c508
23 changed files with 155 additions and 42 deletions

View File

@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
import com.engine.salary.mapper.datacollection.AddUpDeductionMapper;
import com.engine.salary.util.excel.ExcelUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -93,10 +94,14 @@ public class AddUpDeductionBiz extends BaseBean {
* @return
*/
public void batchSave(List<AddUpDeduction> param) {
if (CollectionUtils.isEmpty(param)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
mapper.insertData(param);
List<List<AddUpDeduction>> partition = Lists.partition(param, 100);
partition.forEach(mapper::insertData);
sqlSession.commit();
} finally {
sqlSession.close();
@ -110,10 +115,14 @@ public class AddUpDeductionBiz extends BaseBean {
* @return
*/
public void batchUpdate(List<AddUpDeduction> param) {
if (CollectionUtils.isEmpty(param)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpDeductionMapper mapper = sqlSession.getMapper(AddUpDeductionMapper.class);
mapper.updateData(param);
List<List<AddUpDeduction>> partition = Lists.partition(param, 100);
partition.forEach(mapper::updateData);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.dto.AddUpSituationRecordDTO;
import com.engine.salary.entity.datacollection.param.AddUpSituationQueryParam;
import com.engine.salary.mapper.datacollection.AddUpSituationMapper;
import com.engine.salary.util.excel.ExcelUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -93,10 +94,14 @@ public class AddUpSituationBiz extends BaseBean {
* @return
*/
public void batchSave(List<AddUpSituation> param) {
if (CollectionUtils.isEmpty(param)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
mapper.insertData(param);
List<List<AddUpSituation>> partition = Lists.partition(param, 100);
partition.forEach(mapper::insertData);
sqlSession.commit();
} finally {
sqlSession.close();
@ -110,10 +115,14 @@ public class AddUpSituationBiz extends BaseBean {
* @return
*/
public void batchUpdate(List<AddUpSituation> param) {
if (CollectionUtils.isEmpty(param)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AddUpSituationMapper mapper = sqlSession.getMapper(AddUpSituationMapper.class);
mapper.updateData(param);
List<List<AddUpSituation>> partition = Lists.partition(param, 100);
partition.forEach(mapper::updateData);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -4,6 +4,8 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO;
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO;
import com.engine.salary.mapper.datacollection.AttendQuoteDataMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -46,10 +48,14 @@ public class AttendQuoteDataBiz {
}
public void insertData(List<AttendQuoteDataPO> pos) {
if(CollectionUtils.isEmpty(pos)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AttendQuoteDataMapper mapper = sqlSession.getMapper(AttendQuoteDataMapper.class);
mapper.insertData(pos);
List<List<AttendQuoteDataPO>> partition = Lists.partition(pos, 100);
partition.forEach(mapper::insertData);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -2,6 +2,8 @@ package com.engine.salary.biz;
import com.engine.salary.entity.datacollection.po.AttendQuoteDataValuePO;
import com.engine.salary.mapper.datacollection.AttendQuoteDataValueMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -38,10 +40,14 @@ public class AttendQuoteDataValueBiz {
}
public void insertData(List<AttendQuoteDataValuePO> values) {
if(CollectionUtils.isEmpty(values)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AttendQuoteDataValueMapper mapper = sqlSession.getMapper(AttendQuoteDataValueMapper.class);
mapper.insertData(values);
List<List<AttendQuoteDataValuePO>> partition = Lists.partition(values, 100);
partition.forEach(mapper::insertData);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -4,6 +4,8 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
import com.engine.salary.entity.datacollection.param.AttendQuoteFieldQueryParam;
import com.engine.salary.entity.datacollection.po.AttendQuoteFieldPO;
import com.engine.salary.mapper.datacollection.AttendQuoteFieldMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -79,10 +81,14 @@ public class AttendQuoteFieldBiz {
}
public void saveBatch(List<AttendQuoteFieldPO> saves) {
if(CollectionUtils.isEmpty(saves)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
AttendQuoteFieldMapper mapper = sqlSession.getMapper(AttendQuoteFieldMapper.class);
mapper.saveBatch(saves);
List<List<AttendQuoteFieldPO>> partition = Lists.partition(saves, 100);
partition.forEach(mapper::saveBatch);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -6,6 +6,7 @@ import com.engine.salary.entity.datacollection.param.OtherDeductionQueryParam;
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
import com.engine.salary.mapper.datacollection.OtherDeductionMapper;
import com.engine.salary.util.excel.ExcelUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@ -93,10 +94,14 @@ public class OtherDeductionBiz extends BaseBean {
* @return
*/
public void batchSave(List<OtherDeductionPO> param) {
if(CollectionUtils.isEmpty(param)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
OtherDeductionMapper mapper = sqlSession.getMapper(OtherDeductionMapper.class);
mapper.insertData(param);
List<List<OtherDeductionPO>> partition = Lists.partition(param, 100);
partition.forEach(mapper::insertData);
sqlSession.commit();
} finally {
sqlSession.close();
@ -110,10 +115,14 @@ public class OtherDeductionBiz extends BaseBean {
* @return
*/
public void batchUpdate(List<OtherDeductionPO> param) {
if(CollectionUtils.isEmpty(param)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
OtherDeductionMapper mapper = sqlSession.getMapper(OtherDeductionMapper.class);
mapper.updateData(param);
List<List<OtherDeductionPO>> partition = Lists.partition(param, 100);
partition.forEach(mapper::updateData);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -6,6 +6,8 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -48,10 +50,14 @@ public class SalaryArchiveBiz {
}
public void batchInsert(List<SalaryArchivePO> salaryArchiveSaves) {
if (CollectionUtils.isEmpty(salaryArchiveSaves)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveMapper mapper = sqlSession.getMapper(SalaryArchiveMapper.class);
mapper.batchInsert(salaryArchiveSaves);
List<List<SalaryArchivePO>> partition = Lists.partition(salaryArchiveSaves, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -7,6 +7,8 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -77,10 +79,14 @@ public class SalaryArchiveItemBiz {
}
public void batchInsert(List<SalaryArchiveItemPO> salaryArchiveItemNews) {
if(CollectionUtils.isEmpty(salaryArchiveItemNews)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveItemMapper mapper = sqlSession.getMapper(SalaryArchiveItemMapper.class);
mapper.batchInsert(salaryArchiveItemNews);
List<List<SalaryArchiveItemPO>> partition = Lists.partition(salaryArchiveItemNews, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -3,6 +3,8 @@ package com.engine.salary.biz;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveTaxAgentQueryParam;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
import com.engine.salary.mapper.archive.SalaryArchiveTaxAgentMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -63,10 +65,14 @@ public class SalaryArchiveTaxAgentBiz {
}
public void batchInsert(List<SalaryArchiveTaxAgentPO> salaryArchiveTaxAgentSaves) {
if (CollectionUtils.isEmpty(salaryArchiveTaxAgentSaves)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryArchiveTaxAgentMapper mapper = sqlSession.getMapper(SalaryArchiveTaxAgentMapper.class);
mapper.batchInsert(salaryArchiveTaxAgentSaves);
List<List<SalaryArchiveTaxAgentPO>> partition = Lists.partition(salaryArchiveTaxAgentSaves, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -6,6 +6,8 @@ import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -45,10 +47,14 @@ public class SalaryItemBiz {
}
public void batchSave(Collection<SalaryItemPO> salaryItems) {
if(CollectionUtils.isEmpty(salaryItems)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalaryItemMapper mapper = sqlSession.getMapper(SalaryItemMapper.class);
mapper.batchInsert(salaryItems);
List<List<SalaryItemPO>> partition = Lists.partition((List) salaryItems, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -2,6 +2,8 @@ package com.engine.salary.biz;
import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO;
import com.engine.salary.mapper.salarysob.SalarySobAdjustRuleMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -32,10 +34,14 @@ public class SalarySobAdjustRuleBiz {
}
public void batchInsert(Collection<SalarySobAdjustRulePO> salarySobAdjustRulePOS) {
if (CollectionUtils.isEmpty(salarySobAdjustRulePOS)) {
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobAdjustRuleMapper mapper = sqlSession.getMapper(SalarySobAdjustRuleMapper.class);
mapper.batchInsert(salarySobAdjustRulePOS);
List<List<SalarySobAdjustRulePO>> partition = Lists.partition((List) salarySobAdjustRulePOS, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -5,6 +5,8 @@ import com.engine.salary.entity.salarysob.po.SalarySobCheckRulePO;
import com.engine.salary.mapper.salarysob.SalarySobCheckRuleMapper;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -57,10 +59,14 @@ public class SalarySobCheckRuleBiz {
}
public void batchInsert(Collection<SalarySobCheckRulePO> salarySobCheckRulePOS) {
if(CollectionUtils.isEmpty(salarySobCheckRulePOS)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobCheckRuleMapper mapper = sqlSession.getMapper(SalarySobCheckRuleMapper.class);
mapper.batchInsert(salarySobCheckRulePOS);
List<List<SalarySobCheckRulePO>> partition = Lists.partition((List) salarySobCheckRulePOS, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -4,6 +4,8 @@ import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO;
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
import com.engine.salary.mapper.salarysob.SalarySobDefaultEmpFieldMapper;
import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -26,10 +28,14 @@ public class SalarySobEmpFieldBiz {
}
public void batchInsert(Collection<SalarySobEmpFieldPO> salarySobEmpFieldPOS) {
if(CollectionUtils.isEmpty(salarySobEmpFieldPOS)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobEmpFieldMapper mapper = sqlSession.getMapper(SalarySobEmpFieldMapper.class);
mapper.batchInsert(salarySobEmpFieldPOS);
List<List<SalarySobEmpFieldPO>> partition = Lists.partition((List) salarySobEmpFieldPOS, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -2,6 +2,8 @@ package com.engine.salary.biz;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.mapper.salarysob.SalarySobItemMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -31,10 +33,14 @@ public class SalarySobItemBiz {
}
public void batchInsert(Collection<SalarySobItemPO> salarySobItemPOS) {
if(CollectionUtils.isEmpty(salarySobItemPOS)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobItemMapper mapper = sqlSession.getMapper(SalarySobItemMapper.class);
mapper.batchInsert(salarySobItemPOS);
List<List<SalarySobItemPO>> partition = Lists.partition((List) salarySobItemPOS, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -2,6 +2,8 @@ package com.engine.salary.biz;
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
import com.engine.salary.mapper.salarysob.SalarySobRangeMapper;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.session.SqlSession;
import weaver.conn.mybatis.MyBatisFactory;
@ -22,10 +24,14 @@ public class SalarySobRangeBiz {
}
public void batchInsert(Collection<SalarySobRangePO> needInsertSalarySobRanges) {
if(CollectionUtils.isEmpty(needInsertSalarySobRanges)){
return;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SalarySobRangeMapper mapper = sqlSession.getMapper(SalarySobRangeMapper.class);
mapper.batchInsert(needInsertSalarySobRanges);
List<List<SalarySobRangePO>> partition = Lists.partition((List) needInsertSalarySobRanges, 100);
partition.forEach(mapper::batchInsert);
sqlSession.commit();
} finally {
sqlSession.close();

View File

@ -5,7 +5,6 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface SalaryArchiveMapper {
@ -75,11 +74,11 @@ public interface SalaryArchiveMapper {
/**
* 批量删除薪资档案
* @param ids
*/
void deleteByIds(@Param("ids") Collection<Long> ids);
// /**
// * 批量删除薪资档案
// * @param ids
// */
// void deleteByIds(@Param("ids") Collection<Long> ids);
/**
* 批量插入

View File

@ -69,7 +69,6 @@ public interface SalarySobItemGroupMapper {
* 根据薪资账套id删除
*
* @param salarySobIds
* @param tenantKey
*/
void deleteBySalarySobIds(@Param("salarySobIds") Collection<Long> salarySobIds);
@ -77,7 +76,6 @@ public interface SalarySobItemGroupMapper {
* 根据主键id删除
*
* @param ids
* @param tenantKey
*/
void deleteByIds(@Param("ids") Collection<Long> ids);

View File

@ -23,6 +23,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -141,7 +142,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
.setDeleteType(0))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(newSalaryAcctEmployeePOS)) {
getSalaryAcctEmployeeMapper().batchInsert(newSalaryAcctEmployeePOS);
batchSave(newSalaryAcctEmployeePOS);
}
}
@ -300,7 +301,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(saveParam.getEmployeeIds(), salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
// 保存薪资核算人员
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
getSalaryAcctEmployeeMapper().batchInsert(salaryAcctEmployeePOS);
batchSave(salaryAcctEmployeePOS);
}
// 查询薪资账套记录日志用
@ -322,7 +323,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
@Override
public void batchSave(Collection<SalaryAcctEmployeePO> salaryAcctEmployeePOS) {
getSalaryAcctEmployeeMapper().batchInsert(salaryAcctEmployeePOS);
if(CollectionUtils.isEmpty(salaryAcctEmployeePOS)){
return;
}
List<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 100);
partition.forEach(getSalaryAcctEmployeeMapper()::batchInsert);
}
@Override
@ -408,7 +413,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2EmployeePO(employeeIds, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
// 保存薪资核算人员
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
getSalaryAcctEmployeeMapper().batchInsert(salaryAcctEmployeePOS);
batchSave(salaryAcctEmployeePOS);
}
}
@ -436,7 +441,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
getSalaryAcctEmployeeMapper().deleteBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId));
// 插入新的薪资核算人员
if (CollectionUtils.isNotEmpty(newSalaryAcctEmployeePOS)) {
getSalaryAcctEmployeeMapper().batchInsert(newSalaryAcctEmployeePOS);
batchSave(newSalaryAcctEmployeePOS);
}
}
}

View File

@ -336,7 +336,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
deleteBySalaryAcctEmployeeIds(Collections.singleton(saveParam.getSalaryAcctEmpId()));
// 保存薪资核算结果
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
getSalaryAcctResultMapper().batchInsert(salaryAcctResultPOS);
batchSave(salaryAcctResultPOS);
}
// 查询操作日志的targetName
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(salaryAcctEmployeePO.getSalaryAcctRecordId());
@ -359,7 +359,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public void batchSave(Collection<SalaryAcctResultPO> salaryAcctResultPOS) {
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
getSalaryAcctResultMapper().batchInsert(salaryAcctResultPOS);
List<List<SalaryAcctResultPO>> partition = Lists.partition((List) salaryAcctResultPOS, 100);
partition.forEach(getSalaryAcctResultMapper()::batchInsert);
}
}

View File

@ -30,6 +30,7 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.PageUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
@ -240,7 +241,11 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary
@Override
public void batchSave(Collection<ExcelAcctResultPO> excelAcctResultPOS) {
getExcelAcctResultMapper().batchInsert(excelAcctResultPOS);
if(CollectionUtils.isEmpty(excelAcctResultPOS)){
return;
}
List<List<ExcelAcctResultPO>> partition = Lists.partition((List) excelAcctResultPOS, 100);
partition.forEach(getExcelAcctResultMapper()::batchInsert);
}
@Override

View File

@ -14,6 +14,7 @@ import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxDeclarationDetailService;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.google.common.collect.Lists;
import com.mzlion.core.lang.CollectionUtils;
import java.util.Collection;
@ -32,6 +33,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
private TaxDeclarationDetailMapper getTaxDeclarationDetailMapper() {
return MapperProxyFactory.getProxy(TaxDeclarationDetailMapper.class);
}
private SalaryEmployeeService getSalaryEmployeeService() {
return (SalaryEmployeeService) ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@ -64,7 +66,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
PageInfo<TaxDeclarationDetailListDTO> dtoPage = new PageInfo<TaxDeclarationDetailListDTO>(TaxDeclarationDetailListDTO.class);
dtoPage.setPageNum(queryParam.getCurrent());
dtoPage.setPageSize(queryParam.getPageSize());
if(null==employeeIdPage){
if (null == employeeIdPage) {
return dtoPage;
}
if (CollectionUtils.isNotEmpty(employeeIdPage)) {
@ -72,7 +74,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
List<TaxDeclarationDetailPO> taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(queryParam.getTaxDeclarationId(), employeeIdPage);
// 查询人员
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService().listByIds(employeeIdPage);
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIdPage.getRecords(), tenantKey);
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIdPage.getRecords(), tenantKey);
// 转换成列表dto
TaxDeclarationBO.buildDetailListDTO(queryParam.getTaxDeclarationId(), dtoPage, taxDeclarationDetailPOS, simpleEmployees);
}
@ -91,8 +93,12 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
@Override
public void batchSave(Collection<TaxDeclarationDetailPO> taxDeclarationDetailPOS) {
getTaxDeclarationDetailMapper().batchInsert(taxDeclarationDetailPOS);
if (CollectionUtils.isNotEmpty(taxDeclarationDetailPOS)) {
List<List<TaxDeclarationDetailPO>> partition = Lists.partition((List) taxDeclarationDetailPOS, 100);
partition.forEach(getTaxDeclarationDetailMapper()::batchInsert);
}
}
public List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, List<Long> employeeIds) {
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyList();
@ -104,7 +110,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
// .eq(TaxDeclarationDetailPO::getTaxDeclarationId, taxDeclarationId)
// .in(TaxDeclarationDetailPO::getEmployeeId, employeeIds)
// .list();
return getTaxDeclarationDetailMapper().listByTaxDeclarationIdAndEmployeeIds(taxDeclarationId,employeeIds);
return getTaxDeclarationDetailMapper().listByTaxDeclarationIdAndEmployeeIds(taxDeclarationId, employeeIds);
}
@Override

View File

@ -22,9 +22,7 @@ public class MapperProxyFactory implements InvocationHandler {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
if (this.session == null) {
this.session = MyBatisFactory.sqlSessionFactory.openSession();
}
this.session = MyBatisFactory.sqlSessionFactory.openSession();
try {
Object target = session.getMapper(clazz);
return method.invoke(target, args);

View File

@ -7,6 +7,7 @@ import com.engine.salary.biz.SalaryItemBiz;
import com.engine.salary.biz.TaxAgentBiz;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.component.WeaFormOption;
import com.engine.salary.entity.datacollection.AddUpSituation;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
@ -267,7 +268,8 @@ public class TaxDeclarationWrapper extends Service {
if (CollectionUtils.isNotEmpty(result.getNeedInsertAccumulatedSituations())) {
Set<Long> taxAgentIds = SalaryEntityUtil.properties(result.getNeedInsertTaxDeclarations(), TaxDeclarationPO::getTaxAgentId);
getAddUpSituationService(user).deleteByTaxYearMonthAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxCycle),taxAgentIds);
getAddUpSituationMapper().insertData(Lists.newArrayList(result.getNeedInsertAccumulatedSituations()));
List<List<AddUpSituation>> partition = Lists.partition((List) result.getNeedInsertAccumulatedSituations(), 100);
partition.forEach(getAddUpSituationMapper()::insertData);
}
// 更新薪资核算记录的状态
getSalaryAcctRecordService(user).updateStatusByIds(salaryAcctRecordIds, SalaryAcctRecordStatusEnum.DECLARED);