二开,标记数据获取上个月的值
This commit is contained in:
parent
26f1d5b0b3
commit
db2b80cddf
|
|
@ -193,10 +193,19 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
// 查询上个薪资所属月核算人员薪资数据
|
||||
sw.start("查询上个薪资所属月核算人员薪资数据");
|
||||
List<SalaryAcctResultPO> lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds);
|
||||
Map<String, String> lastMonthResultMap = SalaryEntityUtil.convert2Map(lastMonthResultPOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId() + "_" + e.getSalaryItemId(), SalaryAcctResultPO::getResultValue);
|
||||
//查询上个月标记数据,赋值到本月锁定并标记
|
||||
// SalaryAcctEmployeeQueryParam salaryAcctEmployeeQueryParam = SalaryAcctEmployeeQueryParam.builder()
|
||||
// .salaryMonths(Sets.newHashSet(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1)))
|
||||
// .salarySobIds(Collections.singleton(salaryAcctCalculateBO.getSalarySobPO().getId()))
|
||||
// .employeeIds(employeeIds).build();
|
||||
// List<SalaryAcctEmployeePO> lastMonthEmployeePOS = getSalaryAcctEmployeeService(user).listByParam(salaryAcctEmployeeQueryParam);
|
||||
// Map<String, List<Long>> lastMonthEmpMarkItemsMap = SalaryEntityUtil.convert2Map(lastMonthEmployeePOS, e -> e.getEmployeeId() + "_" + e.getTaxAgentId(), SalaryAcctEmployeePO::getMarkItems);
|
||||
|
||||
sw.stop();
|
||||
// 10、转换成公式编辑器中的变量
|
||||
sw.start("转换成公式编辑器中的变量");
|
||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS);
|
||||
CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList, lastMonthResultPOS);
|
||||
Map<String, List<CalculateFormulaVarBO.FormulaVarValue>> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO);
|
||||
sw.stop();
|
||||
sw.start("数据结构准备");
|
||||
|
|
@ -217,6 +226,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
|
||||
Long salaryAcctEmployeePOId = salaryAcctEmployeePO.getId();
|
||||
List<Long> lockItems = salaryAcctEmployeePO.getLockItems();
|
||||
List<Long> markItems = salaryAcctEmployeePO.getMarkItems();
|
||||
//1 获取当前薪资核算人员的公式中的变量的值
|
||||
List<CalculateFormulaVarBO.FormulaVarValue> formulaVarValues = formulaVarMap.get(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
//2 人员信息
|
||||
|
|
@ -280,6 +290,11 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
|
|||
// 处理小数点
|
||||
resultValue = SalaryAcctFormulaBO.roundResultValue(resultValue, salaryItemPO, salarySobBackItems, salarySobBackItemMap, salaryItemIdKeySalarySobItemPOMap);
|
||||
|
||||
//如果标记了,取上个月标记的值
|
||||
if (markItems != null && markItems.contains(salaryItemId)) {
|
||||
resultValue = lastMonthResultMap.getOrDefault(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId() + "_" + salaryItemId, StringUtils.EMPTY);
|
||||
}
|
||||
|
||||
//是否锁定
|
||||
if (lockItems != null && lockItems.contains(salaryItemId)) {
|
||||
resultValue = empItemValueMap.getOrDefault(salaryAcctEmployeePOId + "_" + salaryItemId, StringUtils.EMPTY);
|
||||
|
|
|
|||
Loading…
Reference in New Issue