核算异常信息

This commit is contained in:
钱涛 2023-05-17 17:38:12 +08:00
parent 404db31695
commit ff8dcf1769
4 changed files with 15 additions and 6 deletions

View File

@ -37,6 +37,15 @@ public class ExcelResult implements Serializable {
private String formulaId;
private String dataType;
public ExcelResult() {
}
public ExcelResult(boolean status, Object data, String errorMsg) {
this.status = status;
this.data = data;
this.errorMsg = errorMsg;
}
public String getExpress() {
return express;
}

View File

@ -53,7 +53,7 @@ public class FormulaRunServiceImpl extends Service implements FormulaRunService
return runSQL(expressFormula, formulaVars);
}
log.error("express execute fail, {} not in ReferenceTypeEnum ", expressFormula.getReferenceType());
return new ExcelResult();
return new ExcelResult(false, "", "");
}
private ExcelResult runSQL(ExpressFormula expressFormula, List<FormulaVar> formulaVars) {

View File

@ -169,7 +169,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
Map<Long, SalarySobBackItemPO> salarySobBackItemMap = SalaryEntityUtil.convert2Map(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
List<SalaryAcctResultTempPO> salaryAcctResultTempPOS = Lists.newArrayList();
// 开始核算
String noticeMsg = "";
StringBuilder noticeMsg = new StringBuilder();
for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) {
Long salaryAcctEmployeePOId = salaryAcctEmployeePO.getId();
//1 获取当前薪资核算人员的公式中的变量的值
@ -203,8 +203,8 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
//公式异常
if (!result.isStatus()) {
String username = empInfo.stream().filter(emp -> StringUtils.equals("employeeInfo_username", emp.getFieldId())).findFirst().map(CalculateFormulaVarBO.FormulaVarValue::getFieldValue).orElse("");
String errorMsg = username + "" + salaryItemPO.getName() + "核算异常,原因:" + result.getErrorMsg();
noticeMsg = noticeMsg + errorMsg + "/n";
String errorMsg = String.format("%s的%s核算异常原因%s /n ", username, salaryItemPO.getName(), result.getErrorMsg());
noticeMsg.append(errorMsg);
}
} else {
// 处理取值类型为输入/导入的薪资项目
@ -257,7 +257,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
// 更新薪资核算进度
getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + salaryAcctCalculateBO.getSalaryAcctRecordPO().getId(),
salaryAcctCalculateBO.getSalaryAcctEmployeePOS().size(),
noticeMsg
noticeMsg.toString()
);
// 记录子线程执行结果
salaryAcctCalculateBO.getResults().add(new SalaryAcctCalculateBO.Result(true, StringUtils.EMPTY));

View File

@ -58,7 +58,7 @@ public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaSe
}
private FormulaRunService getFormulaRunService(User user) {
return (FormulaRunService) ServiceUtil.getService(FormulaRunServiceImpl.class, user);
return ServiceUtil.getService(FormulaRunServiceImpl.class, user);
}
private RemoteExcelService getRemoteExcelService(User user) {