人员报送批量处理
This commit is contained in:
parent
17247f111f
commit
d0e7f7ed8c
|
|
@ -477,7 +477,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
} finally {
|
||||
}
|
||||
}
|
||||
return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg;
|
||||
return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -542,7 +542,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
} finally {
|
||||
}
|
||||
}
|
||||
return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg;
|
||||
return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -593,7 +593,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
.setStatus(true)
|
||||
.setFinish(false)
|
||||
.setMsg("");
|
||||
getEmployeeDeclareService(user).getDeclareFeedback(param,employeeDeclareRate);
|
||||
getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate);
|
||||
success++;
|
||||
} catch (Exception e) {
|
||||
log.error("获取报送结果反馈失败:{}", e.getMessage(), e);
|
||||
|
|
@ -602,7 +602,7 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
} finally {
|
||||
}
|
||||
}
|
||||
return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg;
|
||||
return String.format("成功:" + success + "个,失败:" + fail + "个%", fail == 0 ? "" : ",失败原因:" + msg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -417,26 +417,46 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
}
|
||||
|
||||
public String batSave(TaxDeclarationSaveParam param) {
|
||||
List<Long> taxAgentIds = param.getTaxAgentIds();
|
||||
int success = 0;
|
||||
int fail = 0;
|
||||
StringBuilder msg = new StringBuilder();
|
||||
for (Long taxAgentId : taxAgentIds) {
|
||||
try {
|
||||
param.setTaxAgentId(taxAgentId);
|
||||
getTaxDeclareRecordService(user).save(param);
|
||||
success++;
|
||||
} catch (SalaryRunTimeException e) {
|
||||
msg.append(e.getMessage()).append(";");
|
||||
fail++;
|
||||
} catch (Exception e) {
|
||||
log.error("个税申报表生成报错:{}", e.getMessage(), e);
|
||||
msg.append(e.getMessage()).append(";");
|
||||
fail++;
|
||||
} finally {
|
||||
TaxDeclarationRateDTO taxDeclarationRate = new TaxDeclarationRateDTO().setStatus(true)
|
||||
.setIndex(Util.null2String(IdGenerator.generate()))
|
||||
.setMsg(SalaryI18nUtil.getI18nLabel(95836, "生成申报表"));
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate);
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
List<Long> taxAgentIds = param.getTaxAgentIds();
|
||||
int success = 0;
|
||||
int fail = 0;
|
||||
StringBuilder msg = new StringBuilder();
|
||||
for (Long taxAgentId : taxAgentIds) {
|
||||
try {
|
||||
param.setTaxAgentId(taxAgentId);
|
||||
getTaxDeclareRecordService(user).save(param);
|
||||
success++;
|
||||
} catch (SalaryRunTimeException e) {
|
||||
msg.append(e.getMessage()).append(";");
|
||||
fail++;
|
||||
} catch (Exception e) {
|
||||
log.error("个税申报表生成报错:{}", e.getMessage(), e);
|
||||
msg.append(e.getMessage()).append(";");
|
||||
fail++;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
taxDeclarationRate.setStatus(fail==0).setFinish(true).setMsg(msg.toString());
|
||||
} catch (SalaryRunTimeException e) {
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("个税申报表生成报错:{}", e.getMessage(), e);
|
||||
taxDeclarationRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187276, "个税申报表生成报错:") + e.getMessage());
|
||||
} finally {
|
||||
getSalaryCacheService(user).set(SalaryCacheKey.TAX_DECLARATION + taxDeclarationRate.getIndex(), taxDeclarationRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg;
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "saveTaxDeclaration", localRunnable);
|
||||
return taxDeclarationRate.getIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue