Merge remote-tracking branch 'origin/release/2.5.3.2301.01' into release/2.5.3.2301.01
This commit is contained in:
commit
6d3c2ca856
|
|
@ -1014,7 +1014,20 @@ public class SIAccountBiz extends Service {
|
|||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.projects(param.getProjects())
|
||||
.billMonth(param.getBillMonth())
|
||||
.supplementType(param.getSupplementType())
|
||||
.build();
|
||||
if ("2".equals(param.getSupplementType())) {
|
||||
supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString());
|
||||
supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString());
|
||||
supplementAccountBaseParam.setOtherPaymentBaseString(param.getOtherPaymentBaseString());
|
||||
} else if("3".equals(param.getSupplementType())) {
|
||||
supplementAccountBaseParam.setSocialPaymentPerString(param.getSocialPaymentPerString());
|
||||
supplementAccountBaseParam.setSocialPaymentComString(param.getSocialPaymentComString());
|
||||
supplementAccountBaseParam.setFundPaymentPerString(param.getFundPaymentPerString());
|
||||
supplementAccountBaseParam.setFundPaymentComString(param.getFundPaymentComString());
|
||||
supplementAccountBaseParam.setOtherPaymentPerString(param.getOtherPaymentPerString());
|
||||
supplementAccountBaseParam.setOtherPaymentComString(param.getOtherPaymentComString());
|
||||
}
|
||||
baseList.add(supplementAccountBaseParam);
|
||||
});
|
||||
});
|
||||
|
|
@ -1070,13 +1083,43 @@ public class SIAccountBiz extends Service {
|
|||
//缴纳组织=个税扣缴义务人
|
||||
insuranceAccountDetailPO.setSocialPayOrg(baseParam.getPaymentOrganization());
|
||||
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
if ("2".equals(baseParam.getSupplementType())) {
|
||||
if (accountPO.getSocial() != null) {
|
||||
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
|
||||
}
|
||||
if (accountPO.getFund() != null) {
|
||||
accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString());
|
||||
}
|
||||
if (accountPO.getOther() != null) {
|
||||
accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString());
|
||||
}
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
} else if ("3".equals(baseParam.getSupplementType())) {
|
||||
accountSocialByData(insuranceAccountDetailPO, baseParam);
|
||||
accountFundByData(insuranceAccountDetailPO, baseParam);
|
||||
accountOtherByData(insuranceAccountDetailPO, baseParam);
|
||||
} else {
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
}
|
||||
|
||||
return account(insuranceAccountDetailPO);
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
if ("2".equals(baseParam.getSupplementType())) {
|
||||
if (accountPO.getSocial() != null) {
|
||||
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
|
||||
}
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
} else if ("3".equals(baseParam.getSupplementType())) {
|
||||
accountSocialByData(insuranceAccountDetailPO, baseParam);
|
||||
} else {
|
||||
accountSocial(insuranceAccountDetailPO, accountPO);
|
||||
}
|
||||
|
||||
}
|
||||
if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
|
||||
List<Long> ids = new ArrayList<>();
|
||||
|
|
@ -1092,13 +1135,44 @@ public class SIAccountBiz extends Service {
|
|||
.get();
|
||||
ids.add(insuranceCategoryPO.getId());
|
||||
}
|
||||
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
|
||||
if ("2".equals(baseParam.getSupplementType())) {
|
||||
if (accountPO.getSocial() != null) {
|
||||
accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString());
|
||||
}
|
||||
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
|
||||
} else if ("3".equals(baseParam.getSupplementType())) {
|
||||
accountEndowmentInsuranceByData(insuranceAccountDetailPO, baseParam, ids);
|
||||
} else {
|
||||
accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids);
|
||||
}
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
if ("2".equals(baseParam.getSupplementType())) {
|
||||
if (accountPO.getFund() != null) {
|
||||
accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString());
|
||||
}
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
} else if ("3".equals(baseParam.getSupplementType())) {
|
||||
accountFundByData(insuranceAccountDetailPO, baseParam);
|
||||
} else {
|
||||
accountFund(insuranceAccountDetailPO, accountPO);
|
||||
}
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
|
||||
if ("2".equals(baseParam.getSupplementType())) {
|
||||
if (accountPO.getOther() != null) {
|
||||
accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString());
|
||||
}
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
} else if ("3".equals(baseParam.getSupplementType())) {
|
||||
accountOtherByData(insuranceAccountDetailPO, baseParam);
|
||||
} else {
|
||||
accountOther(insuranceAccountDetailPO, accountPO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return account(insuranceAccountDetailPO);
|
||||
|
|
@ -1426,11 +1500,17 @@ public class SIAccountBiz extends Service {
|
|||
//需要核算社保的福利id 单位
|
||||
List<Long> needArchivesCom = new ArrayList<>();
|
||||
if (archivesCom != null) {
|
||||
archivesCom.forEach((id, value) -> {
|
||||
if (schemeCom.containsKey(Long.valueOf(id))) {
|
||||
needArchivesCom.add(Long.valueOf(id));
|
||||
categoryIds.forEach(item -> {
|
||||
if (archivesCom.containsKey(String.valueOf(item)) && schemeCom.containsKey(item)) {
|
||||
needArchivesCom.add(item);
|
||||
}
|
||||
});
|
||||
|
||||
// archivesCom.forEach((id, value) -> {
|
||||
// if (schemeCom.containsKey(Long.valueOf(id))) {
|
||||
// needArchivesCom.add(Long.valueOf(id));
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
List<BigDecimal> socialCom = new ArrayList<>();
|
||||
|
|
@ -1838,4 +1918,144 @@ public class SIAccountBiz extends Service {
|
|||
getInsuranceAccountDetailMapper().updateByEmployeeIdAndBillMonth(insuranceAccountDetailPO);
|
||||
}
|
||||
|
||||
public void accountFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
|
||||
//公积金个人
|
||||
if (StringUtils.isNotBlank(baseParam.getFundPaymentPerString())) {
|
||||
List<BigDecimal> fundPer = new ArrayList<>();
|
||||
HashMap<String, String> fundPerson = JSON.parseObject(baseParam.getFundPaymentPerString(), new HashMap<String, String>().getClass());
|
||||
fundPerson.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
fundPer.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setFundPerJson(baseParam.getFundPaymentPerString());
|
||||
BigDecimal fundPerSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : fundPer) {
|
||||
fundPerSum = fundPerSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setFundPerSum(fundPerSum.toPlainString());
|
||||
}
|
||||
//公积金单位
|
||||
if (StringUtils.isNotBlank(baseParam.getFundPaymentComString())) {
|
||||
List<BigDecimal> fundCom = new ArrayList<>();
|
||||
HashMap<String, String> fundComMap = JSON.parseObject(baseParam.getFundPaymentComString(), new HashMap<String, String>().getClass());
|
||||
fundComMap.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
fundCom.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setFundComJson(baseParam.getFundPaymentComString());
|
||||
BigDecimal fundComSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : fundCom) {
|
||||
fundComSum = fundComSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString());
|
||||
}
|
||||
}
|
||||
|
||||
public void accountOtherByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
|
||||
//其他福利个人
|
||||
if (StringUtils.isNotBlank(baseParam.getOtherPaymentPerString())) {
|
||||
List<BigDecimal> otherPer = new ArrayList<>();
|
||||
HashMap<String, String> otherPerMap = JSON.parseObject(baseParam.getOtherPaymentPerString(), new HashMap<String, String>().getClass());
|
||||
otherPerMap.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
otherPer.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setOtherPerJson(baseParam.getOtherPaymentPerString());
|
||||
BigDecimal otherPerSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : otherPer) {
|
||||
otherPerSum = otherPerSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString());
|
||||
}
|
||||
//其他福利单位
|
||||
if (StringUtils.isNotBlank(baseParam.getOtherPaymentComString())) {
|
||||
List<BigDecimal> otherCom = new ArrayList<>();
|
||||
HashMap<String, String> otherComMap = JSON.parseObject(baseParam.getOtherPaymentComString(), new HashMap<String, String>().getClass());
|
||||
otherComMap.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
otherCom.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setOtherComJson(baseParam.getOtherPaymentComString());
|
||||
BigDecimal otherComSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : otherCom) {
|
||||
otherComSum = otherComSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString());
|
||||
}
|
||||
}
|
||||
|
||||
public void accountSocialByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) {
|
||||
//社保个人
|
||||
if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) {
|
||||
List<BigDecimal> socialPer = new ArrayList<>();
|
||||
HashMap<String, String> archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap<String, String>().getClass());
|
||||
archivesPerson.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
socialPer.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setSocialPerJson(baseParam.getSocialPaymentPerString());
|
||||
BigDecimal socialPerSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : socialPer) {
|
||||
socialPerSum = socialPerSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
|
||||
}
|
||||
//社保单位
|
||||
if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) {
|
||||
List<BigDecimal> socialCom = new ArrayList<>();
|
||||
HashMap<String, String> archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap<String, String>().getClass());
|
||||
archivesCom.forEach((k, v) -> {
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
socialCom.add(result);
|
||||
});
|
||||
insuranceAccountDetailPO.setSocialComJson(baseParam.getSocialPaymentComString());
|
||||
BigDecimal socialComSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : socialCom) {
|
||||
socialComSum = socialComSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
|
||||
}
|
||||
}
|
||||
|
||||
public void accountEndowmentInsuranceByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam, List<Long> ids) {
|
||||
//社保个人
|
||||
if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) {
|
||||
List<BigDecimal> socialPer = new ArrayList<>();
|
||||
HashMap<String, String> archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap<String, String>().getClass());
|
||||
HashMap<String, String> socialPerson = new HashMap<>();
|
||||
archivesPerson.forEach((k, v) -> {
|
||||
if (ids.contains(Long.valueOf(k))) {
|
||||
socialPerson.put(k, v);
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
socialPer.add(result);
|
||||
}
|
||||
|
||||
});
|
||||
insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerson));
|
||||
BigDecimal socialPerSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : socialPer) {
|
||||
socialPerSum = socialPerSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString());
|
||||
}
|
||||
//社保单位
|
||||
if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) {
|
||||
List<BigDecimal> socialCom = new ArrayList<>();
|
||||
HashMap<String, String> archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap<String, String>().getClass());
|
||||
HashMap<String, String> socialComMap = new HashMap<>();
|
||||
archivesCom.forEach((k, v) -> {
|
||||
if (ids.contains(Long.valueOf(k))) {
|
||||
socialComMap.put(k, v);
|
||||
BigDecimal result = new BigDecimal(v);
|
||||
socialCom.add(result);
|
||||
}
|
||||
});
|
||||
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap));
|
||||
BigDecimal socialComSum = new BigDecimal("0");
|
||||
for (BigDecimal bigDecimal : socialCom) {
|
||||
socialComSum = socialComSum.add(bigDecimal);
|
||||
}
|
||||
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.cloudstore.eccom.pc.table.WeaTable;
|
|||
import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
|
|
@ -45,6 +46,7 @@ import com.engine.salary.util.SalaryFormItemUtil;
|
|||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.wrapper.TaxAgentWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import lombok.Data;
|
||||
|
|
@ -104,6 +106,10 @@ public class SIArchivesBiz {
|
|||
return MapperProxyFactory.getProxy(OtherSchemeMapper.class);
|
||||
}
|
||||
|
||||
private TaxAgentWrapper getTaxAgentWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxAgentWrapper.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param welfareType
|
||||
* @param employeeId
|
||||
|
|
@ -917,6 +923,8 @@ public class SIArchivesBiz {
|
|||
|
||||
request.setRunStatuses(param.getRunStatuses());
|
||||
|
||||
request.setTaxAgentId(param.getTaxAgentId());
|
||||
|
||||
apidatas = listPageEmployeePOS(request, operateId);
|
||||
|
||||
return apidatas;
|
||||
|
|
@ -978,9 +986,9 @@ public class SIArchivesBiz {
|
|||
log.info("buildTableData方法处理福利档案列表数据开始");
|
||||
sw.start("buildTableData方法处理福利档案列表数据");
|
||||
if (param.getExportData() != null && param.getExportData()) {
|
||||
records = buildTableData(page, true);
|
||||
records = buildTableData(pageInfo.getList(), true);
|
||||
} else {
|
||||
records = buildTableData(page, false);
|
||||
records = buildTableData(pageInfo.getList(), false);
|
||||
}
|
||||
sw.stop();
|
||||
log.info("buildTableData方法处理福利档案列表数据完成!");
|
||||
|
|
@ -1294,6 +1302,9 @@ public class SIArchivesBiz {
|
|||
.collect(Collectors.toList())
|
||||
.stream().map(item -> new SearchConditionOption(item.getId().toString(), item.getSchemeName())).collect(Collectors.toList());
|
||||
|
||||
List<Map<String, Object>> taxAgentList = getTaxAgentWrapper(user).selectListAsAdmin();
|
||||
List<SearchConditionOption> taxAgentOption = taxAgentList.stream().map(item -> new SearchConditionOption(item.get("id").toString(), item.get("content").toString())).collect(Collectors.toList());
|
||||
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
|
|
@ -1412,6 +1423,16 @@ public class SIArchivesBiz {
|
|||
otherSchemeId.setLabel("其它福利方案");
|
||||
conditionItems.add(otherSchemeId);
|
||||
|
||||
SearchConditionItem taxAgentId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "taxAgentId");
|
||||
taxAgentId.setInputType("select");
|
||||
taxAgentId.setOptions(taxAgentOption);
|
||||
taxAgentId.setColSpan(2);
|
||||
taxAgentId.setFieldcol(16);
|
||||
taxAgentId.setLabelcol(8);
|
||||
taxAgentId.setIsQuickSearch(true);
|
||||
taxAgentId.setLabel("个税扣缴义务人");
|
||||
conditionItems.add(taxAgentId);
|
||||
|
||||
addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems));
|
||||
apidatas.put("condition", addGroups);
|
||||
return apidatas;
|
||||
|
|
|
|||
|
|
@ -45,4 +45,54 @@ public class SaveSupplementaryAccountParam {
|
|||
*/
|
||||
@DataCheck(require = true,message = "个税扣缴义务人不能为空")
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 社保补缴基数
|
||||
*/
|
||||
private String socialPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 公积金补缴基数
|
||||
*/
|
||||
private String fundPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴基数
|
||||
*/
|
||||
private String otherPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 社保补缴金额_个人
|
||||
*/
|
||||
private String socialPaymentPerString;
|
||||
|
||||
/**
|
||||
* 社保补缴金额_单位
|
||||
*/
|
||||
private String socialPaymentComString;
|
||||
|
||||
/**
|
||||
* 公积金补缴金额_个人
|
||||
*/
|
||||
private String fundPaymentPerString;
|
||||
|
||||
/**
|
||||
* 公积金补缴金额_单位
|
||||
*/
|
||||
private String fundPaymentComString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴金额_个人
|
||||
*/
|
||||
private String otherPaymentPerString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴金额_单位
|
||||
*/
|
||||
private String otherPaymentComString;
|
||||
|
||||
/**
|
||||
* 补缴类型
|
||||
*/
|
||||
private String supplementType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,4 +37,54 @@ public class SupplementAccountBaseParam {
|
|||
|
||||
//补缴项目")
|
||||
private List<Integer> projects;
|
||||
|
||||
/**
|
||||
* 社保补缴基数
|
||||
*/
|
||||
private String socialPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 公积金补缴基数
|
||||
*/
|
||||
private String fundPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴基数
|
||||
*/
|
||||
private String otherPaymentBaseString;
|
||||
|
||||
/**
|
||||
* 社保补缴金额_个人
|
||||
*/
|
||||
private String socialPaymentPerString;
|
||||
|
||||
/**
|
||||
* 社保补缴金额_单位
|
||||
*/
|
||||
private String socialPaymentComString;
|
||||
|
||||
/**
|
||||
* 公积金补缴金额_个人
|
||||
*/
|
||||
private String fundPaymentPerString;
|
||||
|
||||
/**
|
||||
* 公积金补缴金额_单位
|
||||
*/
|
||||
private String fundPaymentComString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴金额_个人
|
||||
*/
|
||||
private String otherPaymentPerString;
|
||||
|
||||
/**
|
||||
* 其他福利补缴金额_单位
|
||||
*/
|
||||
private String otherPaymentComString;
|
||||
|
||||
/**
|
||||
* 补缴类型
|
||||
*/
|
||||
private String supplementType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ public class InsuranceArchivesListParam extends BaseQueryParam {
|
|||
private Collection<Long> taxAgentEmployeeIds;
|
||||
//个税扣缴义务人
|
||||
private Collection<Long> taxAgentIds;
|
||||
//个税扣缴义务人id
|
||||
private Long taxAgentId;
|
||||
//福利执行状态
|
||||
private List<String> runStatuses;
|
||||
|
||||
|
|
|
|||
|
|
@ -305,7 +305,8 @@
|
|||
t.fund_per_json,t.fund_com_json,t.other_per_json,
|
||||
t.other_com_json,t.social_per_sum,t.social_com_sum,
|
||||
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
|
||||
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization
|
||||
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
|
||||
t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string
|
||||
FROM
|
||||
hrsa_bill_detail t
|
||||
WHERE t.delete_type = 0
|
||||
|
|
|
|||
|
|
@ -421,6 +421,9 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.taxAgentId != null and param.taxAgentId != 0">
|
||||
AND base.payment_organization = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
|
|
@ -501,6 +504,9 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.taxAgentId != null and param.taxAgentId != 0">
|
||||
AND base.payment_organization = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
|
|
@ -580,6 +586,9 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.taxAgentId != null and param.taxAgentId != 0">
|
||||
AND base.payment_organization = #{param.taxAgentId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ public interface AddUpDeductionService {
|
|||
*/
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth);
|
||||
|
||||
List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth);
|
||||
|
||||
/**
|
||||
* @description 编辑累计专项附加扣除
|
||||
* @return void
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface SIRepairService {
|
||||
|
||||
List<Map<String, String>> getSupplementPaymentForm(SupplementAccountBaseParam param);
|
||||
|
||||
/**
|
||||
* 获取待编辑的补缴费用相关福利项
|
||||
*/
|
||||
List<Map<String, String>> getPaymentGroup(SupplementAccountBaseParam param);
|
||||
}
|
||||
|
|
@ -546,7 +546,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
List<Long> deleteIds = deleteParam.getIds();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
// 判断是否有核算过
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
for (int i = 0; i < deleteIds.size(); i++) {
|
||||
|
|
@ -604,7 +604,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
// 获取所有想要删除的数据
|
||||
List<AddUpDeductionDTO> list = addUpDeductionBiz.list(queryParam);
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr);
|
||||
for (AddUpDeductionDTO item : list) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
|
|
@ -1176,4 +1176,25 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth) {
|
||||
List<SalaryAcctEmployeePO> list = Lists.newArrayList();
|
||||
YearMonth month = YearMonth.parse(yearMonth);
|
||||
LocalDate salaryMonthDate = month.atDay(1);
|
||||
LocalDate salaryMonthEndDate = month.atEndOfMonth();
|
||||
List<SalaryAcctRecordPO> salaryAcctRecords = getSalaryAcctRecordService(user).listByTaxCycle(
|
||||
LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryMonthDate))
|
||||
.endDate(SalaryDateUtil.localDateToDate(salaryMonthEndDate)).build(),
|
||||
null);
|
||||
salaryAcctRecords.forEach(e -> {
|
||||
boolean isAccounted = e.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue();
|
||||
if (isAccounted) {
|
||||
// list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecords.get(0).getId())));
|
||||
list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId())));
|
||||
}
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ import java.io.InputStream;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -200,8 +201,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
queryParam.setTaxAgentIds(taxAgentIdsAsAdmin);
|
||||
}
|
||||
List<AddUpSituationDTO> list = getAddUpSituationMapper().list(queryParam);
|
||||
encryptUtil.decryptList(list, AddUpSituationDTO.class);
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpSituationDTO.class);
|
||||
PageInfo<AddUpSituationDTO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpSituationDTO.class);
|
||||
encryptUtil.decryptList(page.getList(), AddUpSituationDTO.class);
|
||||
return page;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1026,7 +1028,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
List<Long> deleteIds = deleteParam.getIds();
|
||||
// 已经核算过的不可操作
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER);
|
||||
salaryMonthDate = salaryMonthDate.plusMonths(1);
|
||||
String format = salaryMonthDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
// 判断是否有核算过
|
||||
List<Long> deleteList = new ArrayList<>();
|
||||
for(int i=0; i<deleteIds.size(); i++){
|
||||
|
|
@ -1069,7 +1074,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
}
|
||||
AddUpSituation queryParam = null;
|
||||
|
||||
if(deleteParam.getTaxAgentId() != null && (!deleteParam.getTaxAgentId().equals(""))){
|
||||
if(deleteParam.getTaxAgentId() != null && !deleteParam.getTaxAgentId().isEmpty()){
|
||||
// 设置了个税扣缴义务人
|
||||
Long taxAgentId = SalaryEntityUtil.string2Long(deleteParam.getTaxAgentId());
|
||||
boolean canDelete = taxAgentIds.stream().anyMatch(t -> Objects.equals(t , taxAgentId));
|
||||
|
|
@ -1085,8 +1090,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation
|
|||
|
||||
// 获取所有想要删除的数据
|
||||
List<AddUpSituation> list = biz.listSome(queryParam);
|
||||
LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER);
|
||||
String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
// 获取已经核算的数据
|
||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
|
||||
List<SalaryAcctEmployeePO> employees = getAddUpDeductionService(user).getAccountedEmployeeData(format);
|
||||
for(AddUpSituation item : list){
|
||||
if (CollectionUtils.isNotEmpty(employees)) {
|
||||
Optional<SalaryAcctEmployeePO> optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst();
|
||||
|
|
|
|||
|
|
@ -293,6 +293,17 @@ public class SICompensationServiceImpl extends Service implements SICompensation
|
|||
continue;
|
||||
}
|
||||
|
||||
//判断是否已有调差数据(个税扣缴义务人+账单月份+人员id)
|
||||
InsuranceCompensationPO nowCompensation = getInsuranceCompensationMapper().getOneByBillMonthPayOrgEmpId(InsuranceCompensationPO.builder()
|
||||
.billMonth(insuranceAccountDetailPO.getBillMonth())
|
||||
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization())
|
||||
.employeeId(insuranceAccountDetailPO.getEmployeeId())
|
||||
.build());
|
||||
if (nowCompensation != null) {
|
||||
errorList.add(usernameMap.get(param.getEmployeeId()) + "-调差失败:调差对象在当前月该缴纳组织下已存在调差数据!");
|
||||
continue;
|
||||
}
|
||||
|
||||
encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class);
|
||||
if (StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) {
|
||||
Map<String, String> socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap<String, String>().getClass());
|
||||
|
|
@ -534,7 +545,13 @@ public class SICompensationServiceImpl extends Service implements SICompensation
|
|||
//设置targetOptions
|
||||
Map<String,String> targetOptions = new HashMap<>();
|
||||
targetOptions.put("name", usernameMap.get(configPO.getEmployeeId()));
|
||||
targetOptions.put("id", detailPOMap.get(configPO.getEmployeeId()).getId().toString());
|
||||
// String target = detailPOMap.get(configPO.getEmployeeId()).getId().toString();
|
||||
String target = detailPOMap.get(configPO.getEmployeeId()) == null ? null : detailPOMap.get(configPO.getEmployeeId()).getId().toString();
|
||||
if (target == null) {
|
||||
continue;
|
||||
} else {
|
||||
targetOptions.put("id", detailPOMap.get(configPO.getEmployeeId()).getId().toString());
|
||||
}
|
||||
|
||||
dto.setTargetOptions(targetOptions);
|
||||
|
||||
|
|
@ -550,6 +567,18 @@ public class SICompensationServiceImpl extends Service implements SICompensation
|
|||
}
|
||||
dto.setCategoryTypeOptions(categoryTypeOptions);
|
||||
|
||||
//设置公司核算金额(单位)
|
||||
CompensationParam compensationParam = CompensationParam.builder()
|
||||
.categoryType(dto.getCategoryType())
|
||||
.employeeId(dto.getEmployeeId().toString())
|
||||
.paymentOrganization(dto.getPaymentOrganization())
|
||||
.target(Long.valueOf(dto.getTargetOptions().get("id")))
|
||||
.build();
|
||||
List<CompensationParam> paramList = new ArrayList<>();
|
||||
paramList.add(compensationParam);
|
||||
List<Map<String, String>> comTotalList = compensationComTotal(paramList);
|
||||
dto.setCompanyTotal(comTotalList.get(0).get("totalNum"));
|
||||
|
||||
compensationDTOList.add(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,453 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.siaccount.param.SaveSupplementaryAccountParam;
|
||||
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
|
||||
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
|
||||
import com.engine.salary.entity.siarchives.po.*;
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.enums.siaccount.ProjectTypeEnum;
|
||||
import com.engine.salary.enums.sicategory.DataTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
|
||||
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
import com.engine.salary.service.SIRepairService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 福利台账-补缴实现类
|
||||
* @Date: 2022/12/27
|
||||
**/
|
||||
public class SIRepairServiceImpl extends Service implements SIRepairService {
|
||||
|
||||
private EncryptUtil encryptUtil = new EncryptUtil();
|
||||
|
||||
private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() {
|
||||
return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class);
|
||||
}
|
||||
|
||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(SocialSchemeMapper.class);
|
||||
}
|
||||
|
||||
private FundSchemeMapper getFundSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(FundSchemeMapper.class);
|
||||
}
|
||||
|
||||
private OtherSchemeMapper getOtherSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(OtherSchemeMapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定月份的福利缴纳基数作为补缴基数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, String>> getSupplementPaymentForm(SupplementAccountBaseParam param) {
|
||||
|
||||
Long paymentOrganization = param.getPaymentOrganization();
|
||||
String billMonth = param.getBillMonth();
|
||||
List<Integer> projects = param.getProjects();
|
||||
Long employeeId = param.getEmployeeId();
|
||||
|
||||
List<InsuranceAccountDetailPO> detailPOList = getInsuranceAccountDetailMapper().queryNormalList(billMonth, paymentOrganization, employeeId);
|
||||
|
||||
if (detailPOList.size() > 1) {
|
||||
throw new SalaryRunTimeException("该人员本次核算出现多组数据,请删除数据库中多余核算项");
|
||||
} else if (detailPOList.size() == 0) {
|
||||
throw new SalaryRunTimeException("数据不存在");
|
||||
} else {
|
||||
InsuranceAccountDetailPO targetDetailPO = detailPOList.get(0);
|
||||
encryptUtil.decrypt(targetDetailPO, InsuranceAccountDetailPO.class);
|
||||
|
||||
String socialBaseString = targetDetailPO.getSocialPaymentBaseString();
|
||||
String fundBaseString = targetDetailPO.getFundPaymentBaseString();
|
||||
String otherBaseString = targetDetailPO.getOtherPaymentBaseString();
|
||||
|
||||
Map<String, String> socialBaseMap = JSON.parseObject(socialBaseString, HashMap.class);
|
||||
Map<String, String> fundBaseMap = JSON.parseObject(fundBaseString, HashMap.class);
|
||||
Map<String, String> otherBaseMap = JSON.parseObject(otherBaseString, HashMap.class);
|
||||
|
||||
Map<String, String> targetBaseMap = new HashMap<>();
|
||||
|
||||
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
|
||||
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
|
||||
Map<Long, Integer> welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType);
|
||||
|
||||
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
|
||||
if (socialBaseMap != null) {
|
||||
targetBaseMap.putAll(socialBaseMap);
|
||||
}
|
||||
if (fundBaseMap != null) {
|
||||
targetBaseMap.putAll(fundBaseMap);
|
||||
}
|
||||
if (otherBaseMap != null) {
|
||||
targetBaseMap.putAll(otherBaseMap);
|
||||
}
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
|
||||
if (socialBaseMap != null) {
|
||||
targetBaseMap.putAll(socialBaseMap);
|
||||
}
|
||||
}
|
||||
if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
|
||||
|
||||
List<ICategoryPO> list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue());
|
||||
|
||||
if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) {
|
||||
ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst()
|
||||
.get();
|
||||
|
||||
if (socialBaseMap != null && socialBaseMap.containsKey(insuranceCategoryPO.getId())) {
|
||||
targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue())) {
|
||||
ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93114, "医疗保险").equals(item.getInsuranceName())).findFirst()
|
||||
.get();
|
||||
if (socialBaseMap != null && socialBaseMap.containsKey(insuranceCategoryPO.getId())) {
|
||||
targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
|
||||
if (fundBaseMap != null) {
|
||||
targetBaseMap.putAll(fundBaseMap);
|
||||
}
|
||||
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
|
||||
|
||||
if (otherBaseMap != null) {
|
||||
targetBaseMap.putAll(otherBaseMap);
|
||||
}
|
||||
}
|
||||
|
||||
List<Map<String, String>> resulit = new ArrayList();
|
||||
if (targetBaseMap.size() > 0) {
|
||||
for (Map.Entry<String, String> entry : targetBaseMap.entrySet()) {
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("insuranceId", entry.getKey());
|
||||
map.put("insuranceName", categoryNameMap.get(Long.valueOf(entry.getKey())));
|
||||
map.put("insuranceBase", entry.getValue());
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(entry.getKey())) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(entry.getKey())) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
map.put("title", welfareTypeName);
|
||||
resulit.add(map);
|
||||
}
|
||||
}
|
||||
return resulit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待编辑的补缴费用相关福利项
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, String>> getPaymentGroup(SupplementAccountBaseParam param) {
|
||||
|
||||
Long paymentOrganization = param.getPaymentOrganization();
|
||||
List<Integer> projects = param.getProjects();
|
||||
Long employeeId = param.getEmployeeId();
|
||||
InsuranceArchivesSocialSchemePO socialSchemePO = new InsuranceArchivesSocialSchemePO();
|
||||
InsuranceArchivesFundSchemePO fundSchemePO = new InsuranceArchivesFundSchemePO();
|
||||
InsuranceArchivesOtherSchemePO otherSchemePO = new InsuranceArchivesOtherSchemePO();
|
||||
|
||||
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
|
||||
.employeeId(employeeId)
|
||||
.paymentOrganization(paymentOrganization)
|
||||
.build());
|
||||
if (socialSchemePOList.size() > 0) {
|
||||
encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class);
|
||||
socialSchemePO = socialSchemePOList.get(0);
|
||||
}
|
||||
|
||||
List<InsuranceArchivesFundSchemePO> fundSchemePOList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
|
||||
.employeeId(employeeId)
|
||||
.paymentOrganization(paymentOrganization)
|
||||
.build());
|
||||
if (fundSchemePOList.size() > 0) {
|
||||
encryptUtil.decryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class);
|
||||
fundSchemePO = fundSchemePOList.get(0);
|
||||
}
|
||||
|
||||
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
|
||||
.employeeId(employeeId)
|
||||
.paymentOrganization(paymentOrganization)
|
||||
.build());
|
||||
if (otherSchemePOList.size() > 0) {
|
||||
encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class);
|
||||
otherSchemePO = otherSchemePOList.get(0);
|
||||
}
|
||||
|
||||
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
|
||||
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
|
||||
Map<Long, Integer> welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType);
|
||||
|
||||
List<Map<String, String>> resultList = new ArrayList<>();
|
||||
if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
|
||||
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
|
||||
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
|
||||
socialMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
|
||||
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
fundMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
|
||||
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
otherMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
|
||||
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
|
||||
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
|
||||
socialMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
|
||||
&& (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
|
||||
&& (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
|
||||
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
|
||||
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
socialMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
|
||||
&& (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
|
||||
&& (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
|
||||
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
|
||||
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
|
||||
socialMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue()))
|
||||
&& (!projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue()))
|
||||
&& (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) {
|
||||
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
|
||||
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
socialMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
|
||||
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
|
||||
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
|
||||
fundMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
|
||||
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
|
||||
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
|
||||
|
||||
otherMap.forEach((k, v) -> {
|
||||
Map<String, String> perMap = new HashMap<>();
|
||||
Map<String, String> comMap = new HashMap<>();
|
||||
|
||||
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
|
||||
perMap.put("title", welfareTypeName);
|
||||
comMap.put("title", welfareTypeName);
|
||||
|
||||
perMap.put("insuranceId", k);
|
||||
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
perMap.put("paymentScope", "个人");
|
||||
|
||||
comMap.put("insuranceId", k);
|
||||
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
|
||||
comMap.put("paymentScope", "公司");
|
||||
|
||||
resultList.add(perMap);
|
||||
resultList.add(comMap);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -654,11 +654,14 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe
|
|||
List<Long> needUpdateSalaryAcctRecordIds = selfSalaryAcctRecordPOS.stream().filter(po -> po.getTaxCycle().equals(salaryAcctRecordPO.getTaxCycle()))
|
||||
.map(SalaryAcctRecordPO::getId).collect(Collectors.toList());
|
||||
if (Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue())) {
|
||||
// 更新薪资核算记录的状态
|
||||
updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED);
|
||||
if(needUpdateSalaryAcctRecordIds != null && needUpdateSalaryAcctRecordIds.size()>0){
|
||||
// 更新薪资核算记录的状态
|
||||
updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED);
|
||||
}
|
||||
// 删除个税申报表及往期累计情况
|
||||
getTaxDeclarationService(user).delete(salaryAcctRecordPO);
|
||||
}
|
||||
// 删除个税申报表及往期累计情况
|
||||
getTaxDeclarationService(user).delete(salaryAcctRecordPO);
|
||||
|
||||
// 更新薪资核算记录的状态
|
||||
salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue());
|
||||
salaryAcctRecordPO.setUpdateTime(new Date());
|
||||
|
|
|
|||
|
|
@ -878,4 +878,28 @@ public class SIAccountController {
|
|||
return new ResponseResult<InsuranceAccountDetailParam, Map<String, Object>>(user).run(getService(user)::listBalancePage, insuranceAccountDetailParam);
|
||||
}
|
||||
// **********************************补差 end*********************************/
|
||||
|
||||
/**
|
||||
* 取指定月份的福利缴纳基数作为补缴基数
|
||||
*/
|
||||
@POST
|
||||
@Path("/detail/getSupplementPaymentForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSupplementPaymentForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@RequestBody SupplementAccountBaseParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SupplementAccountBaseParam, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::getSupplementPaymentForm, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待编辑的补缴费用相关福利项
|
||||
*/
|
||||
@POST
|
||||
@Path("/detail/getPaymentGroup")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPaymentGroup(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@RequestBody SupplementAccountBaseParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SupplementAccountBaseParam, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::getPaymentGroup, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,15 @@ import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
|
|||
import com.engine.salary.entity.siaccount.param.CompensationParam;
|
||||
import com.engine.salary.entity.siaccount.param.InspectAccountParam;
|
||||
import com.engine.salary.entity.siaccount.param.RecessionParam;
|
||||
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
|
||||
import com.engine.salary.service.SIBalanceService;
|
||||
import com.engine.salary.service.SICompensationService;
|
||||
import com.engine.salary.service.SIRecessionService;
|
||||
import com.engine.salary.service.SIRepairService;
|
||||
import com.engine.salary.service.impl.SIBalanceServiceImpl;
|
||||
import com.engine.salary.service.impl.SICompensationServiceImpl;
|
||||
import com.engine.salary.service.impl.SIRecessionServiceImpl;
|
||||
import com.engine.salary.service.impl.SIRepairServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -41,6 +44,10 @@ public class SIAccountWrapper extends Service {
|
|||
return (SIBalanceService) ServiceUtil.getService(SIBalanceServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SIRepairService getSIRepairService(User user) {
|
||||
return (SIRepairService) ServiceUtil.getService(SIRepairServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增退差数据
|
||||
* @param param 退差请求体
|
||||
|
|
@ -130,4 +137,22 @@ public class SIAccountWrapper extends Service {
|
|||
long currentEmployeeId = user.getUID();
|
||||
getSIBalanceService(user).del(param, currentEmployeeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取指定月份的福利缴纳基数作为补缴基数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, String>> getSupplementPaymentForm(SupplementAccountBaseParam param) {
|
||||
return getSIRepairService(user).getSupplementPaymentForm(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取待编辑的补缴费用相关福利项
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, String>> getPaymentGroup(SupplementAccountBaseParam param) {
|
||||
return getSIRepairService(user).getPaymentGroup(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue