薪酬系统-福利台账,核算进度条逻辑优化
This commit is contained in:
parent
cf08bbd842
commit
237f42f2ae
|
|
@ -400,6 +400,12 @@ public class SIAccountBiz extends Service {
|
|||
if (count % 50 == 0 || count >= ids.size()) {
|
||||
//salaryAcctProgressService.getAndAddCalculatedQty(tenantKey + billMonth, count >= ids.size() ? count % 50 : 50);
|
||||
getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth, count >= ids.size() ? count % 50 : 50);
|
||||
if (count == ids.size()) {
|
||||
getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth, BigDecimal.valueOf(0.99), false);
|
||||
} else {
|
||||
getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth, BigDecimal.valueOf(count/ids.size()).setScale(2, BigDecimal.ROUND_HALF_UP), false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//临时表入库前先对(可能存在的)历史数据进行删除
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.engine.salary.service;
|
|||
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 核算进度
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -44,6 +46,13 @@ public interface SalaryAcctProgressService {
|
|||
*/
|
||||
void finish(String cacheKey, boolean checkStatus);
|
||||
|
||||
/**
|
||||
* 更新进度条
|
||||
*
|
||||
* @param cacheKey
|
||||
*/
|
||||
void updateProgress(String cacheKey, BigDecimal progress, boolean checkStatus);
|
||||
|
||||
/**
|
||||
* 获取进度条
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -69,6 +69,22 @@ public class SalaryAcctProgressServiceImpl extends Service implements SalaryAcct
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgress(String cacheKey, BigDecimal progress, boolean checkStatus) {
|
||||
String resultStr = (String) Util_DataCache.getObjVal(cacheKey);
|
||||
if (StringUtils.isNotEmpty(resultStr)) {
|
||||
SalaryAcctProgressDTO salaryAcctProgress = JsonUtil.parseObject(resultStr, SalaryAcctProgressDTO.class);
|
||||
if (salaryAcctProgress == null || !salaryAcctProgress.isStatus()) {
|
||||
return;
|
||||
}
|
||||
salaryAcctProgress.setTitle("核算中");
|
||||
salaryAcctProgress.setCalculatedQuantity(salaryAcctProgress.getTotalQuantity());
|
||||
salaryAcctProgress.setProgress(progress);
|
||||
salaryAcctProgress.setCheckStatus(checkStatus);
|
||||
Util_DataCache.setObjVal(cacheKey, JsonUtil.toJsonString(salaryAcctProgress));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryAcctProgressDTO getProgress(String cacheKey) {
|
||||
String resultStr = (String) Util_DataCache.getObjVal(cacheKey);
|
||||
|
|
|
|||
Loading…
Reference in New Issue