Merge branch 'release/个税版本' into release/个税&业务线

This commit is contained in:
钱涛 2025-10-23 18:32:33 +08:00
commit 25f0713bb3
9 changed files with 75 additions and 36 deletions

View File

@ -6,5 +6,5 @@ and employee_id not in
where tax_agent_id =id and delete_type = 0)
update hrsa_tax_agent_emp set delete_type = 3
update hrsa_tax_agent_emp set delete_type = 3 where delete_type = 0
where tax_agent_id=id and delete_type = 0 and employee_id not in (select employee_id from hrsa_salary_archive where tax_agent_id =id and delete_type = 0)

View File

@ -18,7 +18,8 @@ update hrsa_salary_archive set delete_type=3 where tax_agent_id=扣缴义务人
二、删除停薪员工档案
update hrsa_salary_archive set delete_type=3 where run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive set delete_type=3 where delete_type=0 and run_status in ('STOP_FROM_PENDING','STOP_FROM_SUSPEND')
update hrsa_salary_archive_item set delete_type=3 where delete_type=0
二、删除停薪员工社保档案
update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
@ -28,10 +29,10 @@ update hrsa_insurance_base_info set delete_type=3 where run_status in ('4','5')
--删除社保福利档案
update hrsa_insurance_base_info set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE employee_id = ? and payment_organization =?
update hrsa_insurance_base_info set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_social_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_fund_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
update hrsa_other_archives set delete_type=3 WHERE delete_type=0 and employee_id = ? and payment_organization =?
-- 删除薪资档案
update hrsa_salary_archive set delete_type=3 where employee_id = ? and tax_agent_id=?
@ -45,4 +46,11 @@ update hrsa_other_archives set delete_type=3;
update hrsa_tax_agent_emp set delete_type=3;
-- 删除核算记录和工资单信息
update hrsa_salary_acct_record set delete_type=3 where delete_type=0;
update hrsa_salary_acct_emp set delete_type=3 where delete_type=0;
update hrsa_salary_acct_result set delete_type=3 where delete_type=0;
update hrsa_salary_send set delete_type=3 where delete_type=0;
update hrsa_salary_send_info set delete_type=3 where delete_type=0;

View File

@ -1299,7 +1299,14 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public void updateLockStatusByParam(SalaryAcctResultUpdateLockStatusParam updateParam) {
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
Set<Long> acctEmpIds = updateParam.getAcctEmpIds();
List<SalaryAcctEmployeePO> salaryAcctEmployees;
if (CollUtil.isNotEmpty(acctEmpIds)) {
salaryAcctEmployees = getSalaryAcctEmployeeService(user).listByIds(acctEmpIds);
} else {
salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(updateParam.getSalaryAcctRecordId());
}
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
return;
}

View File

@ -662,8 +662,6 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
public XSSFWorkbook exportAdjustRecordList(SalaryItemAdjustRecordQueryParam queryParam) {
// 1.工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资项目调整记录");
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
String[] header = {
SalaryI18nUtil.getI18nLabel(85429, "姓名"),
SalaryI18nUtil.getI18nLabel(86187, "员工状态"),

View File

@ -514,7 +514,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
// 1.工作簿名称
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案");
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
Object[] header = {
new WeaTableColumnGroup("150px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "", "", 0),
new WeaTableColumnGroup("150px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "", "", 0),

View File

@ -136,6 +136,15 @@ public class SalaryEntityUtil {
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a));
}
public static <T, K, V> Map<K, V> convert2LinkedMap(Collection<T> objs, Function<T, K> keyMapper, Function<T, V> valueMapper) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();
}
return objs.stream()
.filter(e -> valueMapper.apply(e) != null && keyMapper.apply(e) != null)
.collect(Collectors.toMap(keyMapper, valueMapper, (a, b) -> a, LinkedHashMap::new));
}
public static <R, T> Map<R, List<T>> group2Map(Collection<T> objs, Function<T, R> function) {
if (CollectionUtils.isEmpty(objs)) {
return Maps.newHashMap();

View File

@ -469,7 +469,7 @@ public class EmployeeDeclareWrapper extends Service {
} finally {
}
}
return "成功:" + success + "个,失败:" + fail + ",失败原因:" + msg;
return String.format("成功:" + success + "个,失败:" + fail + "%s", fail == 0 ? "" : ",失败原因:" + msg);
}
/**
@ -534,7 +534,7 @@ public class EmployeeDeclareWrapper extends Service {
} finally {
}
}
return "成功:" + success + "个,失败:" + fail + ",失败原因:" + msg;
return String.format("成功:" + success + "个,失败:" + fail + "%s", fail == 0 ? "" : ",失败原因:" + msg);
}
/**
@ -585,7 +585,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);
@ -594,7 +594,7 @@ public class EmployeeDeclareWrapper extends Service {
} finally {
}
}
return "成功:" + success + "个,失败:" + fail + ",失败原因:" + msg;
return String.format("成功:" + success + "个,失败:" + fail + "%s", fail == 0 ? "" : ",失败原因:" + msg);
}

View File

@ -534,9 +534,6 @@ public class SalaryArchiveWrapper extends Service {
return map;
}
public Map<String, Object> selectSalaryArchiveColumns(String importType) {
return getSalaryArchiveService(user).selectSalaryArchiveColumns(SalaryArchiveImportTypeEnum.parseByValue(importType));
}
public Map<String, Object> checkSalaryArchiveInit(SalaryArchiveImportActionParam importData) {

View File

@ -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();
}
/**