核算是否采用线程池配置
This commit is contained in:
parent
c8f281613b
commit
fe4b8b1fb3
|
|
@ -76,6 +76,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -863,6 +865,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 12.4、是否采用系统算税
|
||||
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
|
||||
// 12.5、多线程运算,运算结果存放在临时表中
|
||||
//是否同步计算
|
||||
boolean isSync = "1".equals(getSalarySysConfService(user).getValueByCode(SALARY_ACCT_SYNC_TYPE));
|
||||
for (List<SalaryAcctEmployeePO> acctEmployeePOS : partition) {
|
||||
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
||||
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
||||
|
|
@ -884,13 +888,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.setVariableItems(variableItemPOS)
|
||||
.setTaxDeclarationFunction(taxDeclarationFunction);
|
||||
List<SalarySobBackItemPO> finalSalarySobBackItems = salarySobBackItems;
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
if (isSync) {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
} else {
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
}
|
||||
}
|
||||
// 13、等待所有子线程执行完毕
|
||||
childMonitor.await();
|
||||
|
|
|
|||
|
|
@ -71,6 +71,11 @@ public class SalarySysConstant {
|
|||
*/
|
||||
public static final String SALARY_ACCT_EMPLOYEE_RULE = "salaryAcctEmployeeRule";
|
||||
|
||||
/**
|
||||
* 是否采用线程池,同步异步。空/0异步, 1同步
|
||||
*/
|
||||
public static final String SALARY_ACCT_SYNC_TYPE = "SALARY_ACCT_SYNC_TYPE";
|
||||
|
||||
/**
|
||||
* 工资单二次验证方式
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue