钱智需求

This commit is contained in:
钱涛 2025-09-24 16:53:56 +08:00
parent 41fc2d5c13
commit f3f2eca609
3 changed files with 45 additions and 20 deletions

View File

@ -272,7 +272,7 @@
SELECT
<include refid="baseColumns"/>
FROM hrsa_employee_declare_opt t
WHERE id = #{taxAgentId} AND delete_type = 0
WHERE tax_agent_id = #{taxAgentId} AND delete_type = 0
</select>
</mapper>

View File

@ -58,6 +58,7 @@ public class EmployeeDeclareOptServiceImpl extends Service implements EmployeeDe
optPO.setStatus(po.getStatus());
optPO.setLastOperate(po.getLastOperate());
optPO.setLastOperateTime(now);
optPO.setUpdateTime(now);
getEmployeeDeclareOptMapper().updateIgnoreNull(optPO);
}

View File

@ -417,26 +417,50 @@ 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 {
// return "成功:" + success + "个,失败:" + fail + "个,失败原因:" + msg;
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();
}
/**