薪酬系统-福利档案,导入模板下载、导入、基数调整记录功能,根据区分个人和公司福利基数逻辑改造

This commit is contained in:
sy 2023-12-07 09:41:46 +08:00
parent 6dca2a4380
commit 1287a97fe5
8 changed files with 234 additions and 56 deletions

View File

@ -2198,6 +2198,7 @@ public class SIArchivesBiz {
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getSocialSchemeId())
.adjustAfterBaseJson(po.getSocialPaymentBaseString())
.adjustAfterComBaseJson(po.getSocialPaymentComBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
@ -2207,6 +2208,7 @@ public class SIArchivesBiz {
InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString());
adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!"));
@ -2228,6 +2230,7 @@ public class SIArchivesBiz {
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getFundSchemeId())
.adjustAfterBaseJson(po.getFundPaymentBaseString())
.adjustAfterComBaseJson(po.getFundPaymentComBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
@ -2237,6 +2240,7 @@ public class SIArchivesBiz {
InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString());
adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!"));
@ -2257,6 +2261,7 @@ public class SIArchivesBiz {
InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder()
.adjustAfterSchemeId(po.getOtherSchemeId())
.adjustAfterBaseJson(po.getOtherPaymentBaseString())
.adjustAfterComBaseJson(po.getOtherPaymentComBaseString())
.welfareType(po.getWelfareType())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
@ -2266,6 +2271,7 @@ public class SIArchivesBiz {
InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0);
encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class);
adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString());
adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString());
adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId());
} else if (oldBaseInfoList.size() > 1) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!"));
@ -2279,10 +2285,7 @@ public class SIArchivesBiz {
//生成基数调整记录基数单元未变化则忽略
public List<InsuranceArchivesBaseHistoryPO> createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) {
Date now = new Date();
//判断是否要区分个人和单位福利基数
User user = new User(Math.toIntExact(creator));
SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM);
boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue());
boolean welBaseDiffSign = isDiffWelBase();
List<InsuranceArchivesBaseHistoryPO> toCreateAdjustHistoryList = new ArrayList<>();
//旧档案不存在基数信息则直接遍历新的基数数据生成调整记录旧档案存在基数信息则合并新旧基数数据遍历合并后的技术数据中的key生成调整记录

View File

@ -137,6 +137,7 @@
fund_end_time,
fund_start_time,
fund_payment_base_string,
fund_payment_com_base_string,
supplement_fund_account,
create_time,
creator,
@ -156,6 +157,7 @@
#{item.fundEndTime},
#{item.fundStartTime},
#{item.fundPaymentBaseString},
#{item.fundPaymentComBaseString},
#{item.supplementFundAccount},
#{item.createTime},
#{item.creator},
@ -177,6 +179,7 @@
fund_end_time,
fund_start_time,
fund_payment_base_string,
fund_payment_com_base_string,
supplement_fund_account,
create_time,
creator,
@ -195,6 +198,7 @@
#{item.fundEndTime,jdbcType=VARCHAR},
#{item.fundStartTime,jdbcType=VARCHAR},
#{item.fundPaymentBaseString,jdbcType=VARCHAR},
#{item.fundPaymentComBaseString,jdbcType=VARCHAR},
#{item.supplementFundAccount,jdbcType=VARCHAR},
#{item.createTime,jdbcType=DATE},
#{item.creator,jdbcType=DOUBLE},
@ -217,6 +221,7 @@
fund_end_time,
fund_start_time,
fund_payment_base_string,
fund_payment_com_base_string,
supplement_fund_account,
create_time,
creator,
@ -235,6 +240,7 @@
#{item.fundEndTime},
#{item.fundStartTime},
#{item.fundPaymentBaseString},
#{item.fundPaymentComBaseString},
#{item.supplementFundAccount},
#{item.createTime},
#{item.creator},

View File

@ -12,6 +12,7 @@
<result column="adjust_before_base_value" property="adjustBeforeBaseValue"/>
<result column="adjust_after_base_value" property="adjustAfterBaseValue"/>
<result column="adjust_welfare_item_id" property="adjustWelfareItemId"/>
<result column="payment_scope" property="paymentScope"/>
<result column="operator" property="operator"/>
<result column="operate_time" property="operateTime"/>
<result column="create_time" property="createTime"/>
@ -33,6 +34,7 @@
, t.adjust_before_base_value
, t.adjust_after_base_value
, t.adjust_welfare_item_id
, t.payment_scope
, t.operator
, t.operate_time
, t.create_time
@ -48,7 +50,7 @@
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
tenant_key,creator,delete_type,create_time,update_time,payment_scope)
VALUES
<foreach collection="infos" item="item" separator=",">
(
@ -67,7 +69,8 @@
#{item.creator},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
#{item.updateTime},
#{item.paymentScope}
)
</foreach>
</insert>
@ -77,7 +80,7 @@
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
tenant_key,creator,delete_type,create_time,update_time,payment_scope)
<foreach collection="infos" item="item" separator="union all">
select
#{item.id,jdbcType=DOUBLE},
@ -95,7 +98,8 @@
#{item.creator,jdbcType=DOUBLE},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
#{item.updateTime},
#{item.paymentScope}
from dual
</foreach>
</insert>
@ -106,7 +110,7 @@
adjust_before_scheme_id,adjust_after_scheme_id,
adjust_before_base_value,adjust_after_base_value,
adjust_welfare_item_id,operator,operate_time,
tenant_key,creator,delete_type,create_time,update_time)
tenant_key,creator,delete_type,create_time,update_time,payment_scope)
VALUES
(
#{item.id},
@ -124,7 +128,8 @@
#{item.creator},
#{item.deleteType},
#{item.createTime},
#{item.updateTime}
#{item.updateTime},
#{item.paymentScope}
)
</foreach>
</insert>
@ -148,6 +153,7 @@
, eo.lastname as operatorName
, ee.lastname as employeeName
, p.name as paymentOrganizationName
, t.payment_scope
FROM hrsa_insurance_base_history t
LEFT JOIN hrmresource eo on eo.id = t.operator
LEFT JOIN hrmresource ee on ee.id = t.employee_id
@ -180,6 +186,7 @@
, eo.lastname as operatorName
, ee.lastname as employeeName
, p.name as paymentOrganizationName
, t.payment_scope
FROM hrsa_insurance_base_history t
LEFT JOIN hrmresource eo on eo.id = t.operator
LEFT JOIN hrmresource ee on ee.id = t.employee_id
@ -216,6 +223,7 @@
, eo.lastname as operatorName
, ee.username as employeeName
, p.name as paymentOrganizationName
, t.payment_scope
FROM hrsa_insurance_base_history t
LEFT JOIN hrmresource eo on eo.id = t.operator
LEFT JOIN hrsa_external_employee ee on ee.id = t.employee_id

View File

@ -131,7 +131,8 @@
non_payment,
creator,
payment_organization,
other_payment_base_string)
other_payment_base_string,
other_payment_com_base_string)
VALUES
<foreach collection="otherSchemePOS" item="item" separator=",">
(
@ -148,7 +149,8 @@
#{item.nonPayment},
#{item.creator},
#{item.paymentOrganization},
#{item.otherPaymentBaseString}
#{item.otherPaymentBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>
@ -167,7 +169,8 @@
non_payment,
creator,
payment_organization,
other_payment_base_string)
other_payment_base_string,
other_payment_com_base_string)
<foreach collection="otherSchemePOS" item="item" separator="union all">
select
#{item.otherSchemeId,jdbcType=DOUBLE},
@ -183,7 +186,8 @@
#{item.nonPayment,jdbcType=INTEGER},
#{item.creator,jdbcType=DOUBLE},
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.otherPaymentBaseString,jdbcType=VARCHAR}
#{item.otherPaymentBaseString,jdbcType=VARCHAR},
#{item.otherPaymentComBaseString,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
@ -203,7 +207,8 @@
non_payment,
creator,
payment_organization,
other_payment_base_string)
other_payment_base_string,
other_payment_com_base_string)
VALUES
(
#{item.otherSchemeId},
@ -219,7 +224,8 @@
#{item.nonPayment},
#{item.creator},
#{item.paymentOrganization},
#{item.otherPaymentBaseString}
#{item.otherPaymentBaseString},
#{item.otherPaymentComBaseString}
)
</foreach>
</insert>

View File

@ -130,6 +130,7 @@
welfare_type,
delete_type,
social_payment_base_string,
social_payment_com_base_string,
social_scheme_id,
create_time,
social_end_time,
@ -148,6 +149,7 @@
#{item.welfareType},
#{item.deleteType},
#{item.socialPaymentBaseString},
#{item.socialPaymentComBaseString},
#{item.socialSchemeId},
#{item.createTime},
#{item.socialEndTime},
@ -168,6 +170,7 @@
welfare_type,
delete_type,
social_payment_base_string,
social_payment_com_base_string,
social_scheme_id,
create_time,
social_end_time,
@ -185,6 +188,7 @@
#{item.welfareType,jdbcType=INTEGER},
#{item.deleteType,jdbcType=INTEGER},
#{item.socialPaymentBaseString,jdbcType=VARCHAR},
#{item.socialPaymentComBaseString,jdbcType=VARCHAR},
#{item.socialSchemeId,jdbcType=DOUBLE},
#{item.createTime,jdbcType=DATE},
#{item.socialEndTime,jdbcType=VARCHAR},
@ -206,6 +210,7 @@
welfare_type,
delete_type,
social_payment_base_string,
social_payment_com_base_string,
social_scheme_id,
create_time,
social_end_time,
@ -223,6 +228,7 @@
#{item.welfareType},
#{item.deleteType},
#{item.socialPaymentBaseString},
#{item.socialPaymentComBaseString},
#{item.socialSchemeId},
#{item.createTime},
#{item.socialEndTime},

View File

@ -20,6 +20,7 @@ import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.sicategory.NonPaymentEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum;
import com.engine.salary.exception.SalaryRunTimeException;
@ -1158,6 +1159,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
public PageInfo<InsuranceArchivesBaseHistoryDTO> historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) {
List<InsuranceArchivesBaseHistoryDTO> adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId());
adjustHistoryDTOS.forEach(f -> {
if (StringUtils.isNotBlank(f.getPaymentScope())) {
if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) {
f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人"));
} else if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString())) {
f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "公司"));
} else {
f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司"));
}
} else {
f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司"));
}
});
PageInfo<InsuranceArchivesBaseHistoryDTO> listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(),
adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class);

View File

@ -27,6 +27,7 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelComment;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
@ -184,7 +185,7 @@ public class SIImportServiceImpl extends Service implements SIImportService {
//工作簿数据
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments);
return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName,excelComments);
}
@ -194,6 +195,7 @@ public class SIImportServiceImpl extends Service implements SIImportService {
* @return
*/
public List<String> buildHeader() {
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
List<String> result = new ArrayList<>();
result.add(SalaryI18nUtil.getI18nLabel( 85429, "姓名"));
result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
@ -206,7 +208,13 @@ public class SIImportServiceImpl extends Service implements SIImportService {
// result.add(SalaryI18nUtil.getI18nLabel( 91325, "社保缴纳组织"));
//社保福利基数
Map<String, Long> socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY);
socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数")));
if (welBaseDiffSign) {
socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人")));
socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位")));
} else {
socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数")));
}
result.add(SalaryI18nUtil.getI18nLabel( 91324, "社保账号"));
result.add(SalaryI18nUtil.getI18nLabel( 91319, "社保起始缴纳月"));
result.add(SalaryI18nUtil.getI18nLabel( 91320, "社保最后缴纳月"));
@ -215,7 +223,13 @@ public class SIImportServiceImpl extends Service implements SIImportService {
result.add(SalaryI18nUtil.getI18nLabel( 91486, "公积金账号"));
//公积金福利基数
Map<String, Long> fundMap = welfareNameIdMap( WelfareTypeEnum.ACCUMULATION_FUND);
fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数")));
if (welBaseDiffSign) {
fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人")));
fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位")));
} else {
fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数")));
}
result.add(SalaryI18nUtil.getI18nLabel( 91487, "补充公积金账号"));
result.add(SalaryI18nUtil.getI18nLabel( 91483, "公积金起始缴纳月"));
result.add(SalaryI18nUtil.getI18nLabel( 91484, "公积金最后缴纳月"));
@ -223,7 +237,13 @@ public class SIImportServiceImpl extends Service implements SIImportService {
// result.add(SalaryI18nUtil.getI18nLabel( 91497, "其他福利缴纳组织"));
//其他福利基数
Map<String, Long> otherMap = welfareNameIdMap( WelfareTypeEnum.OTHER);
otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数")));
if (welBaseDiffSign) {
otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人")));
otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位")));
} else {
otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数")));
}
result.add(SalaryI18nUtil.getI18nLabel( 91490, "其他福利起始缴纳月"));
result.add(SalaryI18nUtil.getI18nLabel( 91494, "其他福利最后缴纳月"));
return result;

View File

@ -1084,16 +1084,40 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator);
}
/**************校验申报基数**************/
for (Map.Entry<Long, String> entry : welfareMap.entrySet()) {
String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "申报基数");
String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString();
if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字"));
excelComments.add(errorMessageMap);
isError = true;
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (welBaseDiffSign) {
for (Map.Entry<Long, String> entry : welfareMap.entrySet()) {
String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人");
String keyComName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位");
String numberPerValue = findElement(singleAccount, keyPerName).get(keyPerName) == null ? "" : findElement(singleAccount, keyPerName).get(keyPerName).toString();
String numberComValue = findElement(singleAccount, keyComName).get(keyComName) == null ? "" : findElement(singleAccount, keyComName).get(keyComName).toString();
if (!"".equals(numberPerValue) && !NumberUtils.isParsable(numberPerValue)) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + keyPerName + SalaryI18nUtil.getI18nLabel(0, "请输入数字"));
excelComments.add(errorMessageMap);
isError = true;
}
if (!"".equals(numberComValue) && !NumberUtils.isParsable(numberComValue)) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + keyComName + SalaryI18nUtil.getI18nLabel(0, "请输入数字"));
excelComments.add(errorMessageMap);
isError = true;
}
}
} else {
for (Map.Entry<Long, String> entry : welfareMap.entrySet()) {
String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数");
String numberValue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString();
if (!"".equals(numberValue) && !NumberUtils.isParsable(numberValue)) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(0, "请输入数字"));
excelComments.add(errorMessageMap);
isError = true;
}
}
}
//生成福利档案基础信息数据
InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp());
if (!isError) {
@ -1108,17 +1132,25 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
if (socialCheckBase && fundCheckBase && otherCheckBase) {
Boolean socialCheckComBase = true;
Boolean fundCheckComBase = true;
Boolean otherCheckComBase = true;
if (welBaseDiffSign) {
socialCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
}
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);
} else {
String checkMessage = "该条数据中";
if (!socialCheckBase) {
if (!socialCheckBase || !socialCheckComBase) {
checkMessage = checkMessage + "社保福利基数、";
}
if (!fundCheckBase) {
if (!fundCheckBase || !fundCheckComBase) {
checkMessage = checkMessage + "公积金福利基数、";
}
if (!otherCheckBase) {
if (!otherCheckBase || !otherCheckComBase) {
checkMessage = checkMessage + "其他福利基数、";
}
checkMessage = checkMessage.substring(0, checkMessage.length() - 1);
@ -1162,12 +1194,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
String socialAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(SalaryI18nUtil.getI18nLabel(91324, "社保账号"));
Long socialSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")));
HashMap<String, String> oldSocialBaseMap = new HashMap<>();
HashMap<String, String> oldSocialComBaseMap = new HashMap<>();
if (oldSocialSchemeInfos.size() > 0) {
oldSocialSchemePO = oldSocialSchemeInfos.get(0);
encryptUtil.decrypt(oldSocialSchemePO, InsuranceArchivesSocialSchemePO.class);
BeanUtils.copyProperties(oldSocialSchemePO, insuranceArchivesSocialSchemePO);
//社保基数
oldSocialBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
oldSocialComBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
}
insuranceArchivesSocialSchemePO.setId(IdGenerator.generate());
@ -1202,21 +1236,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> socialPaymentBase = new HashMap<>();
HashMap<String, String> socialPaymentComBase = new HashMap<>();
for (Long insuranceId : insuranceIds) {
if (StringUtils.isBlank(welfareMap.get(insuranceId))) {
continue;
}
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId)));
if (welBaseDiffSign) {
Map<String, Object> itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (itemPerMap != null) {
String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId)));
}
}
Map<String, Object> itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (itemComMap != null) {
String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentComBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldSocialComBaseMap != null && StringUtils.isNotBlank(oldSocialComBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentComBase.put(String.valueOf(insuranceId), oldSocialComBaseMap.get(String.valueOf(insuranceId)));
}
}
insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBase));
} else {
Map<String, Object> itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (itemMap != null) {
String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId)));
}
}
}
}
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase));
}
@ -1243,12 +1304,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
String supplementFundAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号"));
Long fundSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")));
HashMap<String, String> oldFundBaseMap = new HashMap<>();
HashMap<String, String> oldFundComBaseMap = new HashMap<>();
if (oldFundSchemeInfos.size() > 0) {
oldFundSchemePO = oldFundSchemeInfos.get(0);
encryptUtil.decrypt(oldFundSchemePO, InsuranceArchivesFundSchemePO.class);
BeanUtils.copyProperties(oldFundSchemePO, insuranceArchivesFundSchemePO);
//社保基数
oldFundBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
oldFundComBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
}
insuranceArchivesFundSchemePO.setId(IdGenerator.generate());
@ -1286,24 +1349,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> socialPaymentBase = new HashMap<>();
HashMap<String, String> fundPaymentBase = new HashMap<>();
HashMap<String, String> fundPaymentComBase = new HashMap<>();
for (Long insuranceId : insuranceIds) {
if (StringUtils.isBlank(welfareMap.get(insuranceId))) {
continue;
}
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId)));
if (welBaseDiffSign) {
Map<String, Object> itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (itemPerMap != null) {
String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (StringUtils.isNotBlank(itemValue)) {
fundPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) {
fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId)));
}
}
Map<String, Object> itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (itemComMap != null) {
String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (StringUtils.isNotBlank(itemValue)) {
fundPaymentComBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldFundComBaseMap != null && StringUtils.isNotBlank(oldFundComBaseMap.get(String.valueOf(insuranceId)))) {
fundPaymentComBase.put(String.valueOf(insuranceId), oldFundComBaseMap.get(String.valueOf(insuranceId)));
}
}
insuranceArchivesFundSchemePO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBase));
} else {
Map<String, Object> itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (itemMap != null) {
String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
fundPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) {
fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId)));
}
}
}
}
insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase));
insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBase));
}
return insuranceArchivesFundSchemePO;
}
@ -1325,12 +1413,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
//设置其他福利方案起始缴纳月最后缴纳月
Long otherSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")));
HashMap<String, String> oldOtherBaseMap = new HashMap<>();
HashMap<String, String> oldOtherComBaseMap = new HashMap<>();
if (oldOtherSchemeInfos.size() > 0) {
oldOtherSchemePO = oldOtherSchemeInfos.get(0);
encryptUtil.decrypt(oldOtherSchemePO, InsuranceArchivesOtherSchemePO.class);
BeanUtils.copyProperties(oldOtherSchemePO, insuranceArchivesOtherSchemePO);
//社保基数
oldOtherBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
oldOtherComBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
}
insuranceArchivesOtherSchemePO.setId(IdGenerator.generate());
@ -1361,24 +1451,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesOtherSchemePO.setEmployeeId(employeeId);
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId());
encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class);
boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase();
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
HashMap<String, String> socialPaymentBase = new HashMap<>();
HashMap<String, String> otherPaymentBase = new HashMap<>();
HashMap<String, String> otherPaymentComBase = new HashMap<>();
for (Long insuranceId : insuranceIds) {
if (StringUtils.isBlank(welfareMap.get(insuranceId))) {
continue;
}
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
socialPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) {
socialPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId)));
if (welBaseDiffSign) {
Map<String, Object> itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (itemPerMap != null) {
String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"));
if (StringUtils.isNotBlank(itemValue)) {
otherPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) {
otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId)));
}
}
Map<String, Object> itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (itemComMap != null) {
String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"));
if (StringUtils.isNotBlank(itemValue)) {
otherPaymentComBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldOtherComBaseMap != null && StringUtils.isNotBlank(oldOtherComBaseMap.get(String.valueOf(insuranceId)))) {
otherPaymentComBase.put(String.valueOf(insuranceId), oldOtherComBaseMap.get(String.valueOf(insuranceId)));
}
}
insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBase));
} else {
Map<String, Object> itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (itemMap != null) {
String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数"));
if (StringUtils.isNotBlank(itemValue)) {
otherPaymentBase.put(String.valueOf(insuranceId), itemValue);
} else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) {
otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId)));
}
}
}
}
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase));
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBase));
}
return insuranceArchivesOtherSchemePO;
}