diff --git a/src/com/engine/salary/entity/siaccount/dto/QZReportListDTO.java b/src/com/engine/salary/entity/siaccount/dto/QZReportListDTO.java index b0443a76a..491de2fda 100644 --- a/src/com/engine/salary/entity/siaccount/dto/QZReportListDTO.java +++ b/src/com/engine/salary/entity/siaccount/dto/QZReportListDTO.java @@ -19,7 +19,6 @@ public class QZReportListDTO { /** * 公司名称 */ - @ElogTransform(name = "个税扣缴义务人") private Long paymentOrganization; private String paymentOrganizationName; /** diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 142947e52..a45f72839 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -558,28 +558,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } record.put("firstDepartmentName", depList.length >= 1 ? Util.formatMultiLang(depList[depList.length - 1], String.valueOf(user.getLanguage())) : ""); record.put("secondDepartmentName", depList.length >= 2 ? Util.formatMultiLang(depList[depList.length - 2], String.valueOf(user.getLanguage())) : ""); - record.put("jobcall", item.getJobcall()); + record.put("jobtitleName", simpleEmployee.getJobtitleName()); record.put("companystartdate", simpleEmployee.getCompanystartdate()); - record.put("dismissdate", item.getStatus() != null && UserStatusEnum.getUnavailableStatus().contains(item.getStatus()) ? simpleEmployee.getDismissdate() : ""); - //社保基数,取养老个人的基数 + record.put("dismissdate", simpleEmployee.getStatus() != null && UserStatusEnum.getUnavailableStatus().contains(simpleEmployee.getStatus()) ? simpleEmployee.getDismissdate() : ""); - if (!dynamicEmpInfo) { - record.put("department", item.getDepartmentName()); - record.put("departmentId", item.getDepartmentId()); - record.put("subcompany", item.getSubcompanyName()); - record.put("subcompanyId", item.getSubcompanyId()); - record.put("jobtitle", item.getJobtitleName()); - record.put("jobtitleId", item.getJobtitleId()); - record.put("jobcall", item.getJobcall()); - record.put("jobcallId", item.getJobcallId()); - record.put("employeeStatus", item.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(item.getStatus())) : ""); - } else { - record.put("department", simpleEmployee.getDepartmentName()); - record.put("departmentId", simpleEmployee.getDepartmentId()); - record.put("employeeStatus", simpleEmployee.getStatus() != null ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(simpleEmployee.getStatus())) : ""); - } - record.put("supplementaryMonth", item.getSupplementaryMonth()); ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 7f73a5376..234aeea76 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -16,6 +16,7 @@ import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.TaxAgentBiz; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.component.SalaryWeaTable; +import com.engine.salary.component.WeaTableColumnGroup; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.constant.SalaryItemConstant; @@ -172,7 +173,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } private SalarySysConfService getSalarySysConfService(User user) { - return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } private InsuranceSchemeMapper getInsuranceSchemeMapper() { @@ -358,7 +359,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //非系统人员核算明细 List extList = getInsuranceAccountDetailMapper().extList(queryParam); list.addAll(extList); - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(),queryParam.getPageSize(), + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, InsuranceAccountDetailPO.class); List insuranceAccountDetailPOS = pageInfo.getList(); encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); @@ -415,7 +416,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //非系统人员核算明细 List extList = getInsuranceAccountDetailMapper().extList(queryParam); list.addAll(extList); - PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(),queryParam.getPageSize(), + PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, InsuranceAccountDetailPO.class); List insuranceAccountDetailPOS = pageInfo.getList(); encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); @@ -929,7 +930,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream() .filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue()) || f.getPaymentStatus().equals(PaymentStatusEnum.REPAIR.getValue()) - || f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue()) ) + || f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) .collect(Collectors.toList()); List list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS); Map siAcctResultWithEmpAndPayStatus = insuranceAccountDetailPOS.stream() @@ -1029,7 +1030,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ + if (socialSpecialJson != null) { socialSpecialJson.forEach((k, v) -> { // String standardSocialPer = Util.null2String(record.get(k + "socialCommonPer")); // BigDecimal standardSocialPerVal = new BigDecimal(0); @@ -1099,7 +1100,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ + if (fundSpecialJson != null) { fundSpecialJson.forEach((k, v) -> { // String standardFundPer = Util.null2String(record.get(k + "fundCommonPer")); // BigDecimal standardFundPerVal = new BigDecimal(0); @@ -1253,7 +1254,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "socialPer"); commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "socialCommonPer"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "socialSpecial"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())), item.getId() + "socialSpecial"); repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "socialRepairPer"); balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "socialBalancePer"); } @@ -1263,7 +1264,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "fundPer"); commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "fundCommonPer"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "fundSpecial"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())), item.getId() + "fundSpecial"); repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "fundRepairPer"); balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "fundBalancePer"); } @@ -1349,7 +1350,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPOS = insuranceAccountDetailPOS.stream() .filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue()) || f.getPaymentStatus().equals(PaymentStatusEnum.REPAIR.getValue()) - || f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue()) ) + || f.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) .collect(Collectors.toList()); List list = buildNewInsuranceDetailPOS(insuranceAccountDetailPOS); // InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(list); @@ -1639,7 +1640,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "账单月份"); // List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "taxAgentName", "billMonth"); - List dataIndexList = Lists.newArrayList("userName", "department", "mobile", "workcode","idNo", "socialPayOrg", "billMonth"); + List dataIndexList = Lists.newArrayList("userName", "department", "mobile", "workcode", "idNo", "socialPayOrg", "billMonth"); // 查询福利核算项目 List welfareNames = (List) param.getWelfareNames(); headerList.addAll(welfareNames); @@ -1815,7 +1816,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode,idNo, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode, idNo, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -1845,7 +1846,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } - if (!isError){ + if (!isError) { List employeeIds = new ArrayList<>(); employeeIds.add(employeeId); //如果福利核算信息查询不到唯一匹配数据,不支持导入 @@ -1865,7 +1866,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } //校验补缴人员是否存在福利档案基础信息,并且runStatus处于正在缴纳或者待减员 InsuranceArchivesBaseInfoPO insuranceBaseInfo = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(paymentOrganization, employeeId); - if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) ) { + if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()))) { throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(0, "补缴未设置福利档案人员或不在福利在缴人员中,不可新建补缴信息!")); } List empIdsInPayMonthRange = listCanPayEmpIds(paymentOrganization, billMonth.substring(0, 7)); @@ -1902,10 +1903,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); insuranceAccountDetailPO.setDeleteType(0); InsuranceAccountDetailPO insertPO = handleInsuranceAccountDetail4AddSupplementary(insuranceAccountDetailPO, map); - if(!checkBalancePayInsurance(insertPO)) { + if (!checkBalancePayInsurance(insertPO)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "导入数据中存在福利档案中未设置的福利项缴纳数值!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "导入数据中存在福利档案中未设置的福利项缴纳数值!")); excelComments.add(errorMessageMap); } else { insertInsuranceAccountDetailList.add(insertPO); @@ -1913,23 +1914,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "本次福利核算不包含该人员")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "本次福利核算不包含该人员")); excelComments.add(errorMessageMap); } } else if (list.size() > 1) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员本次核算出现多组数据,请删除数据库中多余核算项")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员本次核算出现多组数据,请删除数据库中多余核算项")); excelComments.add(errorMessageMap); } else { //拼装待更新数据 encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map); //判断导入福利项是否符合福利方案设置缴纳项 - if(!checkBalancePayInsurance(updatePO)) { + if (!checkBalancePayInsurance(updatePO)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "导入数据中存在福利档案中未设置的福利项缴纳数值!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "导入数据中存在福利档案中未设置的福利项缴纳数值!")); excelComments.add(errorMessageMap); } else { updateInsuranceAccountDetailList.add(updatePO); @@ -1952,7 +1953,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 将待插入列表加密 encryptUtil.encryptList(insertInsuranceAccountDetailList, InsuranceAccountDetailPO.class); //更新 - for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { + for (InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { // getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); updateByEmployeeIdAndBillMonth(po); } @@ -2052,7 +2053,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "账单月份", "补缴月份"); - List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode","idNo", "taxAgentName", "billMonth", "supplementaryMonth"); + List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "idNo", "taxAgentName", "billMonth", "supplementaryMonth"); // 查询福利核算项目 List welfareNames = (List) param.getWelfareNames(); headerList.addAll(welfareNames); @@ -2077,7 +2078,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 获取福利台账中的补缴数据 - * @param billMonth 账单月份 + * + * @param billMonth 账单月份 * @param paymentOrganization 个税扣缴义务人id * @return */ @@ -2094,13 +2096,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员 List baseInfoPOList = getInsuranceBaseInfoMapper().listAll(); List canAccountIds = baseInfoPOList.stream() - .filter(f->f.getPaymentOrganization().equals(paymentOrganization) + .filter(f -> f.getPaymentOrganization().equals(paymentOrganization) && (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()))) .map(InsuranceArchivesBaseInfoPO::getEmployeeId) .collect(Collectors.toList()); supplyDataList = supplyDataList.stream().filter(f -> canAccountIds.contains(f.getEmployeeId())).collect(Collectors.toList()); - for(InsuranceAccountDetailPO po : supplyDataList) { + for (InsuranceAccountDetailPO po : supplyDataList) { Map resultMap = new HashMap<>(); employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId()); resultMap.put("username", employee.getUsername()); @@ -2119,7 +2121,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 获取福利台账中的补差数据 - * @param billMonth 账单月份 + * + * @param billMonth 账单月份 * @param paymentOrganization 个税扣缴义务人id * @return */ @@ -2134,7 +2137,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List balanceDataList = getInsuranceAccountDetailMapper().queryBalanceListByBillMonth(billMonth, paymentOrganization); - for(InsuranceAccountDetailPO po : balanceDataList) { + for (InsuranceAccountDetailPO po : balanceDataList) { Map resultMap = new HashMap<>(); employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId()); resultMap.put("username", employee.getUsername()); @@ -2153,7 +2156,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 获取福利台账中的正常缴纳数据 - * @param billMonth 账单月份 + * + * @param billMonth 账单月份 * @param paymentOrganization 个税扣缴义务人id * @return */ @@ -2169,13 +2173,13 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员 List baseInfoPOList = getInsuranceBaseInfoMapper().listAll(); List canAccountIds = baseInfoPOList.stream() - .filter(f->f.getPaymentOrganization().equals(paymentOrganization) + .filter(f -> f.getPaymentOrganization().equals(paymentOrganization) && (f.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue()) || f.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()))) .map(InsuranceArchivesBaseInfoPO::getEmployeeId) .collect(Collectors.toList()); normalDataList = normalDataList.stream().filter(f -> canAccountIds.contains(f.getEmployeeId())).collect(Collectors.toList()); - for(InsuranceAccountDetailPO po : normalDataList) { + for (InsuranceAccountDetailPO po : normalDataList) { Map resultMap = new HashMap<>(); employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId()); resultMap.put("username", employee.getUsername()); @@ -2216,7 +2220,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { && !"账单月份".equals(map.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - for(Map.Entry entry : toDealMap.entrySet()) { + for (Map.Entry entry : toDealMap.entrySet()) { //判断元素是否属于福利类 String keyName = entry.getKey(); //获取元素名后缀,方便之后判断“个人”或“单位” @@ -2412,7 +2416,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getSocialSpecialJson())) { Map socialSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ + if (socialSpecialJson != null) { Map socialComJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap().getClass()); socialComJson = socialComJson == null ? new HashMap<>() : socialComJson; Map finalSocialComJson = socialComJson; @@ -2432,7 +2436,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getFundSpecialJson())) { Map fundSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ + if (fundSpecialJson != null) { Map fundComJson = JSON.parseObject(insuranceAccountDetailPO.getFundComJson(), new HashMap().getClass()); fundComJson = fundComJson == null ? new HashMap<>() : fundComJson; Map finalFundComJson = fundComJson; @@ -2484,7 +2488,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { && !"账单月份".equals(map.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - for(Map.Entry entry : toDealMap.entrySet()) { + for (Map.Entry entry : toDealMap.entrySet()) { //判断元素是否属于福利类 String keyName = entry.getKey(); //获取元素名后缀,方便之后判断“个人”或“单位” @@ -2674,7 +2678,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * map中value值求和 */ - public String sumOfMapValue(Map welfarePay){ + public String sumOfMapValue(Map welfarePay) { BigDecimal sum = new BigDecimal("0"); for (String value : welfarePay.values()) { sum = sum.add(new BigDecimal(value)); @@ -2690,7 +2694,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map toDelMap = new HashMap<>(); //校验newMap中的value值是否为整数或者小数 - for(Map.Entry newEntry : newMap.entrySet()) { + for (Map.Entry newEntry : newMap.entrySet()) { String newValue = newEntry.getValue(); int l = newValue.length(); @@ -2727,7 +2731,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 判断字符串是否为整数或者小数或者负数 */ - public static boolean isNumeric(String str){ + public static boolean isNumeric(String str) { // Pattern pattern = Pattern.compile("[0-9]*\\.?[0-9]+"); Pattern pattern = Pattern.compile("^-?\\d+(\\.\\d+)?$"); @@ -2747,8 +2751,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //校验内容:billMonth的长度是否为7、年月连接符是否为“-” String connector; - if(billMonth.length() == 7){ - connector = billMonth.substring(4,5); + if (billMonth.length() == 7) { + connector = billMonth.substring(4, 5); return "-".equals(connector); } else { return false; @@ -2883,8 +2887,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List socialComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { for (ICategoryPO po : socialWelfareList) { - socialPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - socialComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + socialPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + socialComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); } socialBaseColumns.addAll(socialPerBaseColumns); socialBaseColumns.addAll(socialComBaseColumns); @@ -2900,8 +2904,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List fundComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { for (ICategoryPO po : fundWelfareList) { - fundPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - fundComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + fundPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + fundComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); } fundBaseColumns.addAll(fundPerBaseColumns); fundBaseColumns.addAll(fundComBaseColumns); @@ -2917,8 +2921,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List otherComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { for (ICategoryPO po : otherWelfareList) { - otherPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - otherComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + otherPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + otherComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); } otherBaseColumns.addAll(otherPerBaseColumns); otherBaseColumns.addAll(otherComBaseColumns); @@ -2931,33 +2935,33 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) List socialPerColumns = new ArrayList<>(); for (ICategoryPO po : socialWelPerList) { - socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "个人")); } //住房公积金个人、补充住房公积金个人 List fundPerColumns = new ArrayList<>(); for (ICategoryPO po : fundWelPerList) { - fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "个人")); } //其他个人(比如企业年金个人) List otherPerColumns = new ArrayList<>(); for (ICategoryPO po : otherWelPerList) { - otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "个人")); } //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) List socialComColumns = new ArrayList<>(); for (ICategoryPO po : socialWelComList) { - socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "单位")); } //住房公积金单位、补充住房公积金单位 List fundComColumns = new ArrayList<>(); for (ICategoryPO po : fundWelComList) { - fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "单位")); } //其他单位(比如企业年金单位) List otherComColumns = new ArrayList<>(); for (ICategoryPO po : otherWelComList) { - otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "单位")); } Map> welColumnMap = new HashMap<>(); @@ -3031,10 +3035,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for (ICategoryPO po : socialWelfareList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "socialPerBase"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "socialPerBase"); result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "socialComBase"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "socialComBase"); } } else { for (ICategoryPO po : socialWelfareList) { @@ -3048,10 +3052,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for (ICategoryPO po : fundWelfareList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "fundPerBase"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "fundPerBase"); result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "fundComBase"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "fundComBase"); } } else { for (ICategoryPO po : fundWelfareList) { @@ -3065,10 +3069,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for (ICategoryPO po : otherWelfareList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "otherPerBase"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "otherPerBase"); result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + SalaryI18nUtil.getI18nLabel(0, "申报基数") - + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "otherComBase"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "otherComBase"); } } else { for (ICategoryPO po : otherWelfareList) { @@ -3224,7 +3228,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, dataValue, deparmentName, mobile, workcode, idNo,null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, dataValue, deparmentName, mobile, workcode, idNo, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -3254,7 +3258,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } - if (!isError){ + if (!isError) { List employeeIds = new ArrayList<>(); employeeIds.add(employeeId); //根据员工id、个税扣缴义务人id、账单月份查询,如果当前对比表中存在数据,则记录为待删除数据 @@ -3303,8 +3307,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 将excel导入的数据行组装成ExcelInsuranceDetailPO对象 + * * @param billMonth 对比的账单月份 - * @param baseMap excel导入的对比数据 + * @param baseMap excel导入的对比数据 */ private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap, Map welColumnNameCodeMap) { // boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); @@ -3340,7 +3345,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { && !"工号".equals(map.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - for(Map.Entry entry : toDealMap.entrySet()) { + for (Map.Entry entry : toDealMap.entrySet()) { // //判断元素是否属于福利类 // String keyName = entry.getKey(); // //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” @@ -3578,7 +3583,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { taskExecutor.execute(() -> { if (paymentOrganization != null && billMonth != null) { - InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam(); + InsuranceAccountDetailParam refreshParam = new InsuranceAccountDetailParam(); refreshParam.setBillMonth(billMonth); refreshParam.setPaymentOrganization(paymentOrganization.toString()); PageInfo pageInfos = overView(refreshParam); @@ -3608,6 +3613,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } }); } + /** * 将通过id获取InsuranceAccountDetailPO中的社保、公积金、其他福利个人和公司缴纳数据 */ @@ -3756,7 +3762,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } //对比可进行缴纳福利项与上面的已有福利项生成map for (Map balancePayItem : balancePaymentGroup) { - Map target = (Map)targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")); + Map target = (Map) targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")); if (targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")) == null) { balancePayItem.put("insuranceValue", ""); balancePayItem.put("validNum", balancePayItem.get("validNum")); @@ -3774,15 +3780,16 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public String getTotalSign(String total) { if (StringUtils.isNotBlank(total)) { - return total.contains(SalaryI18nUtil.getI18nLabel(0,"社保")) ? "social" : (total.contains(SalaryI18nUtil.getI18nLabel(0,"公积金")) ? "fund" : "other" ); + return total.contains(SalaryI18nUtil.getI18nLabel(0, "社保")) ? "social" : (total.contains(SalaryI18nUtil.getI18nLabel(0, "公积金")) ? "fund" : "other"); } else { return ""; } } + public void getPaymentGroup(String baseJson, String groupType, String welfareType, Map dataMap, List addGroups) { if (StringUtils.isBlank(baseJson)) { - addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, null)); + addGroups.add(new SearchConditionGroup(welfareType + groupType + "缴纳", true, null)); return; } @@ -3804,7 +3811,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { baseJsonMap.put(groupPrefix + entry.getKey(), entry.getValue()); } dataMap.putAll(baseJsonMap); - addGroups.add(new SearchConditionGroup(welfareType + groupType +"缴纳", true, inputItems)); + addGroups.add(new SearchConditionGroup(welfareType + groupType + "缴纳", true, inputItems)); } /** @@ -3982,7 +3989,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getSocialSpecialJson())) { Map socialSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ + if (socialSpecialJson != null) { Map socialComJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap().getClass()); socialComJson = socialComJson == null ? new HashMap() : socialComJson; Map finalSocialComJson = socialComJson; @@ -4002,7 +4009,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getFundSpecialJson())) { Map fundSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ + if (fundSpecialJson != null) { Map fundComJson = JSON.parseObject(insuranceAccountDetailPO.getFundComJson(), new HashMap().getClass()); fundComJson = fundComJson == null ? new HashMap() : fundComJson; Map finalFundComJson = fundComJson; @@ -4042,8 +4049,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { SalaryI18nUtil.getI18nLabel(86317, "工号"), SalaryI18nUtil.getI18nLabel(86317, "证件号码"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人") - ); - List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode","idNo", "taxAgentName"); + ); + List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "workcode", "idNo", "taxAgentName"); // 查询福利核算项目 List welfareNames = (List) param.getWelfareNames(); headerList.addAll(welfareNames); @@ -4190,7 +4197,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue,salaryEmployees, name, departmentName, mobile, workcode,idNo, null); + List employeeSameIds = getSalaryEmployeeService(user).matchImportEmployee(confValue, salaryEmployees, name, departmentName, mobile, workcode, idNo, null); if (CollectionUtils.isEmpty(employeeSameIds)) { isError = true; @@ -4220,7 +4227,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } - if (!isError){ + if (!isError) { //如果福利核算信息查询不到唯一匹配数据,不支持导入 //根据员工id、个税扣缴义务人id、账单月份查询补差数据 @@ -4232,28 +4239,28 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (list.isEmpty()) { //新增数据情况 - InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId); + InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId); - if(!checkBalancePayInsurance(createPO)) { + if (!checkBalancePayInsurance(createPO)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); excelComments.add(errorMessageMap); } - if(checkBalance(createPO) && !isError) { + if (checkBalance(createPO) && !isError) { createInsuranceAccountDetailList.add(createPO); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!")); excelComments.add(errorMessageMap); } } else if (list.size() > 1) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月已存在多组补差数据,请删除数据库中多余项")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月已存在多组补差数据,请删除数据库中多余项")); excelComments.add(errorMessageMap); } else { //更新数据情况 @@ -4261,19 +4268,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map); - if(!checkBalancePayInsurance(updatePO)) { + if (!checkBalancePayInsurance(updatePO)) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); excelComments.add(errorMessageMap); } - if(checkBalance(updatePO) && !isError) { + if (checkBalance(updatePO) && !isError) { updateInsuranceAccountDetailList.add(updatePO); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(100579, "该人员在当前账单月不存在补差数据中的福利类,请检查补差缴纳信息!")); excelComments.add(errorMessageMap); } @@ -4295,7 +4302,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //将待更新列表加密 encryptUtil.encryptList(updateInsuranceAccountDetailList, InsuranceAccountDetailPO.class); //更新 - for(InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { + for (InsuranceAccountDetailPO po : updateInsuranceAccountDetailList) { // getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); updateByEmployeeIdAndBillMonth(po); } @@ -4462,7 +4469,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return datas; } - public Map countSum(List> records ){ + public Map countSum(List> records) { // 获取需要统计的列 String[] keys = {"Base", "Com", "Sum", "Per", "total", "Special"}; Set numKeys = new HashSet<>(); @@ -4471,28 +4478,28 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // numKeys.add(key); // } // } - for(int i =0; i < records.size(); i++){ + for (int i = 0; i < records.size(); i++) { Map record = records.get(i); - for(String key : record.keySet()){ - if(StringUtils.containsAny(key,keys)){ + for (String key : record.keySet()) { + if (StringUtils.containsAny(key, keys)) { numKeys.add(key); } } } Map sumRow = new HashMap<>(); - for(String numKey : numKeys){ + for (String numKey : numKeys) { BigDecimal value = new BigDecimal(0); - for(Map record : records){ + for (Map record : records) { BigDecimal addValue = null; - if(record.get(numKey) == null || StringUtils.isBlank(record.get(numKey).toString())){ + if (record.get(numKey) == null || StringUtils.isBlank(record.get(numKey).toString())) { addValue = new BigDecimal(0); - }else{ + } else { addValue = new BigDecimal(record.get(numKey).toString()); } value = value.add(addValue); } // sumRow.put(numKey,value); - sumRow.put(numKey,String.format("%.2f", value)); + sumRow.put(numKey, String.format("%.2f", value)); } return sumRow; @@ -4501,6 +4508,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 检查补差数据中的福利缴纳费用相关福利类别,是否在正常缴纳中有设置缴纳 + * * @param po * @return */ @@ -4535,6 +4543,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 检查补差数据中的福利缴纳费用相关福利项,是否在正常缴纳中方案所设置可缴纳 + * * @param po * @return */ @@ -4682,7 +4691,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } else { //目标员工未设置方案时,判断补差中是否设置(有效值)的福利项 - if(otherPerPayMap != null) { + if (otherPerPayMap != null) { for (Map.Entry entry : otherPerPayMap.entrySet()) { if (StringUtils.isNotBlank(entry.getValue())) { otherPayFlag = false; @@ -4720,7 +4729,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (detailPOS != null && detailPOS.size() > 0) { //开启缴纳的 insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(m -> { - return m.getInsuranceId() .toString() + "-" + m.getPaymentScope().toString(); + return m.getInsuranceId().toString() + "-" + m.getPaymentScope().toString(); }).collect(Collectors.toList()); } return insuranceIdList; @@ -4970,6 +4979,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 新建核算并归档 + * * @param param * @return */ @@ -5085,25 +5095,25 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 获取薪资核算人员规则 SalarySysConfPO salaryAcctEmployeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE); List status = new ArrayList<>(); - if(Objects.isNull(salaryAcctEmployeeRule) || StringUtils.equals(salaryAcctEmployeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue()) ){ + if (Objects.isNull(salaryAcctEmployeeRule) || StringUtils.equals(salaryAcctEmployeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())) { // 包含停缴 - status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(),EmployeeStatusEnum.STAY_DEL.getValue(), + status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(), EmployeeStatusEnum.STAY_DEL.getValue(), EmployeeStatusEnum.STOP_PAYMENT_FROM_DEL.getValue()); - }else{ - status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(),EmployeeStatusEnum.STAY_DEL.getValue()); + } else { + status = Arrays.asList(EmployeeStatusEnum.PAYING.getValue(), EmployeeStatusEnum.STAY_DEL.getValue()); } List finalStatus = status; //过滤出需要核算的人员,即福利档案基础信息表中runStatus为正在缴纳和待减员的人员 List baseInfoPOList = getInsuranceBaseInfoMapper().listAll(); List canAccountIds = baseInfoPOList.stream() - .filter(f->f.getPaymentOrganization().equals(param.getPaymentOrganization()) - && (finalStatus.contains(f.getRunStatus()) )) + .filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization()) + && (finalStatus.contains(f.getRunStatus()))) .map(InsuranceArchivesBaseInfoPO::getEmployeeId) .collect(Collectors.toList()); //20231122逻辑优化,过滤出不在起始缴纳月和最后缴纳月区间的人员 List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); - empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); + empIds = empIds.stream().filter(f -> canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); // List socials = siArchivesBiz.getSocialByEmployeeIds(empIds); List socials = getSIArchivesService(user).getSocialByEmployeeIds(empIds); @@ -5111,7 +5121,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { socials = socials.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList()); List emp1 = socials.stream() .filter(s -> !(StringUtils.isBlank(s.getSocialEndTime()) && StringUtils.isBlank(s.getSocialStartTime())) && - (StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01")))) ) + (StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01"))))) .map(InsuranceArchivesSocialSchemePO::getEmployeeId) .collect(Collectors.toList()); @@ -5278,10 +5288,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (count % 50 == 0 || count >= ids.size()) { if (count >= ids.size()) { - getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, BigDecimal.valueOf(0.99), false); + getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, BigDecimal.valueOf(0.99), false); log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization)); } else { - getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, count >= ids.size() ? count % 50 : 50); + getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, count >= ids.size() ? count % 50 : 50); log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization)); } @@ -5343,7 +5353,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(otherPerson.size() > 0) { + if (otherPerson.size() > 0) { otherPerson.forEach((id, object) -> { if (!needArchivesPerson.contains(id)) { needArchivesPerson.add(id); @@ -5417,7 +5427,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(otherCom.size() > 0) { + if (otherCom.size() > 0) { otherCom.forEach((id, object) -> { if (!needArchivesCom.contains(id)) { needArchivesCom.add(id); @@ -5508,8 +5518,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundperson = detailPOS.stream() .filter(item -> (finalXmidList.contains(item.getInsuranceId()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue())) || - (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) - && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) + (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 @@ -5524,7 +5534,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(fundperson.size() > 0) { + if (fundperson.size() > 0) { fundperson.forEach((id, object) -> { if (!needArchivesPerson.contains(id)) { needArchivesPerson.add(id); @@ -5584,7 +5594,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (ufTsrysjsbfldaPO != null && (ufTsrysjsbfldaPO.getGrbl() != null || ufTsrysjsbfldaPO.getDybl() != null || ufTsrysjsbfldaPO.getGrgdz() != null || ufTsrysjsbfldaPO.getDwgdz() != null)) { // 基数也要覆盖 // if (fundBaseMap.containsKey(String.valueOf(e))) { - fundBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + fundBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); // } } fundPerJsonMap.put(String.valueOf(e), result.toPlainString()); @@ -5613,8 +5623,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundCom = detailPOS.stream() .filter(item -> (finalComXmidList.contains(item.getInsuranceId()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) || - (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) - && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) + (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 @@ -5634,7 +5644,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(fundCom.size() > 0) { + if (fundCom.size() > 0) { fundCom.forEach((id, object) -> { if (!needArchivesCom.contains(id)) { needArchivesCom.add(id); @@ -5694,7 +5704,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (ufTsrysjsbfldaPO != null && (ufTsrysjsbfldaPO.getGrbl() != null || ufTsrysjsbfldaPO.getDybl() != null || ufTsrysjsbfldaPO.getGrgdz() != null || ufTsrysjsbfldaPO.getDwgdz() != null)) { // 基数也要覆盖 // if (fundBaseMap.containsKey(String.valueOf(e))) { - fundBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + fundBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); // } } fundComJsonMap.put(String.valueOf(e), result.toPlainString()); @@ -5748,8 +5758,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { .filter(item -> (finalXmidList.contains(item.getInsuranceId()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue())) || (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && - Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) && - (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) + Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_PERSON.getValue()) && + (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1")))) ) .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); @@ -5765,7 +5775,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(schemeperson.size() > 0) { + if (schemeperson.size() > 0) { schemeperson.forEach((id, object) -> { if (!needArchivesPerson.contains(id)) { needArchivesPerson.add(id); @@ -5825,7 +5835,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (ufTsrysjsbfldaPO != null && (ufTsrysjsbfldaPO.getGrbl() != null || ufTsrysjsbfldaPO.getDybl() != null || ufTsrysjsbfldaPO.getGrgdz() != null || ufTsrysjsbfldaPO.getDwgdz() != null)) { // 基数也要覆盖 // if (socialBaseMap.containsKey(String.valueOf(e))) { - socialBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + socialBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); // } } socialPerJsonMap.put(String.valueOf(e), result.toPlainString()); @@ -5853,7 +5863,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map schemeCom = detailPOS.stream() .filter(item -> (finalComXmidList.contains(item.getInsuranceId()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) || (Objects.equals(IsPaymentEnum.YES.getValue(), item.getIsPayment()) && Objects.equals(item.getPaymentScope(), PaymentScopeEnum.SCOPE_COMPANY.getValue()) && - (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) + (item.getPaymentCycle() == null || item.getPaymentCycle() == 0 || (item.getPaymentCycle() == 1 && String.valueOf(item.getCycleSetting().charAt(monthIndex)).equals("1"))))) .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 @@ -5873,7 +5883,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { }); } //避免福利档案的方案未设置基数,导致核算时遗漏这些福利项的核算,遍历下方案相关福利项,并将遗漏的福利项id添加 - if(schemeCom.size() > 0) { + if (schemeCom.size() > 0) { schemeCom.forEach((id, object) -> { if (!needArchivesCom.contains(id)) { needArchivesCom.add(id); @@ -5933,7 +5943,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (ufTsrysjsbfldaPO != null && (ufTsrysjsbfldaPO.getGrbl() != null || ufTsrysjsbfldaPO.getDybl() != null || ufTsrysjsbfldaPO.getGrgdz() != null || ufTsrysjsbfldaPO.getDwgdz() != null)) { // 基数也要覆盖 // if (socialBaseMap.containsKey(String.valueOf(e))) { - socialBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + socialBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); // } } sociaComJsonMap.put(String.valueOf(e), result.toPlainString()); @@ -5956,14 +5966,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 对于核算月和福利起始缴纳月处于同年时,要避免根据周期缴纳福利费用时,可能出现的多余费用缴纳情况 + * * @param schemeDetail 福利方案明细 - * @param billMonth 核算月 - * @param startMonth 福利起始缴纳月 + * @param billMonth 核算月 + * @param startMonth 福利起始缴纳月 * @return */ public Map checkCycleSettingWithStartMonth(Map schemeDetail, String billMonth, String startMonth) { - String billYear = billMonth.substring(0,4); - if (StringUtils.isNotBlank(startMonth) && billYear.equals(startMonth.substring(0,4))) { + String billYear = billMonth.substring(0, 4); + if (StringUtils.isNotBlank(startMonth) && billYear.equals(startMonth.substring(0, 4))) { int startMonthIndex = Integer.parseInt(startMonth.split("-")[1]) - 1; schemeDetail.forEach((k, v) -> { if (v.getPaymentCycle() != null && v.getPaymentCycle().equals(1) && startMonthIndex != 0) { @@ -5994,6 +6005,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 根据个税扣缴义务人和账单月,获取三类福利档案中符合缴纳开始结束月区间的人员id + * * @param paymentOrganization * @param billMonth * @return @@ -6082,6 +6094,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { batchSaveInspectDetail(insuranceAccountInspectPOS); } } + public void batchDelInspectDetail(List list) { List> lists = Lists.partition(list, 100); lists.forEach(getInsuranceAccountInspectMapper()::batchDelInspectDetails); @@ -6210,7 +6223,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for (InsuranceAccountDetailPO insuranceAccountDetailPO : insuranceAccountDetailPOS) { if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getSocialSpecialJson())) { Map socialSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ + if (socialSpecialJson != null) { Map socialComJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap().getClass()); socialComJson = socialComJson == null ? new HashMap<>() : socialComJson; Map finalSocialComJson = socialComJson; @@ -6229,7 +6242,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (StringUtils.isNotEmpty(insuranceAccountDetailPO.getFundSpecialJson())) { Map fundSpecialJson = JSON.parseObject(insuranceAccountDetailPO.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ + if (fundSpecialJson != null) { Map fundComJson = JSON.parseObject(insuranceAccountDetailPO.getFundComJson(), new HashMap().getClass()); fundComJson = fundComJson == null ? new HashMap<>() : fundComJson; Map finalFundComJson = fundComJson; @@ -6424,7 +6437,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString()); supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString()); supplementAccountBaseParam.setOtherPaymentBaseString(param.getOtherPaymentBaseString()); - } else if("3".equals(param.getSupplementType())) { + } else if ("3".equals(param.getSupplementType())) { supplementAccountBaseParam.setSocialPaymentPerString(param.getSocialPaymentPerString()); supplementAccountBaseParam.setSocialPaymentComString(param.getSocialPaymentComString()); supplementAccountBaseParam.setFundPaymentPerString(param.getFundPaymentPerString()); @@ -7197,7 +7210,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List list = new ArrayList<>(); for (Long id : ids) { - InsuranceAccountBatchPO batchPO= getInsuranceAccountBatchMapper().getById(id); + InsuranceAccountBatchPO batchPO = getInsuranceAccountBatchMapper().getById(id); Long paymentOrganization = batchPO.getPaymentOrganization(); String billMonth = batchPO.getBillMonth(); @@ -7216,6 +7229,31 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List> list1 = getService(user).buildQzReport(list, (long) user.getUID(), false); + List columns = Lists.newArrayList(); + columns.add(new WeaTableColumnGroup("150", "公司名称", "paymentOrganizationName")); + columns.add(new WeaTableColumnGroup("150", "工号", "workcode")); + columns.add(new WeaTableColumnGroup("150", "姓名", "userName")); + columns.add(new WeaTableColumnGroup("150", "一级部门", "firstDepartmentName")); + columns.add(new WeaTableColumnGroup("150", "二级部门", "secondDepartmentName")); + columns.add(new WeaTableColumnGroup("150", "实际工作地", "actualWorkplace")); + columns.add(new WeaTableColumnGroup("150", "劳动关系地", "laborWorkplace")); + columns.add(new WeaTableColumnGroup("150", "岗位名称", "jobtitleName")); + columns.add(new WeaTableColumnGroup("150", "进入日期", "companystartdate")); + columns.add(new WeaTableColumnGroup("150", "离职日期", "dismissdate")); + columns.add(new WeaTableColumnGroup("150", "社保基数", "socialBase")); + columns.add(new WeaTableColumnGroup("150", "公积金基数", "fundBase")); + + columns.add(new WeaTableColumnGroup("150", "养老保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "医疗保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "失业保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "工伤保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "生育保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "补充医疗保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "大病保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "住房公积金", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "养老保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + columns.add(new WeaTableColumnGroup("150", "养老保险", "", Lists.newArrayList(new WeaTableColumnGroup("150", "单位缴交额", "fundBase"), new WeaTableColumnGroup("150", "单位补缴额", "fundBase")))); + return null; } @@ -7250,7 +7288,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 钱智 公积金差异 if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ + if (fundSpecialJson != null) { Map fundComJson = JSON.parseObject(item.getFundComJson(), new HashMap().getClass()); fundComJson = fundComJson == null ? new HashMap() : fundComJson; Map finalFundComJson = fundComJson; @@ -7278,7 +7316,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { BigDecimal socialPaySum = new BigDecimal("0"); BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; for (InsuranceAccountDetailPO item : pos) { - if (StringUtils.isNotBlank(item.getSocialSum()) && SalaryEntityUtil.string2DoubleDefault0(item.getSocialSum()) != 0.0 ) { + if (StringUtils.isNotBlank(item.getSocialSum()) && SalaryEntityUtil.string2DoubleDefault0(item.getSocialSum()) != 0.0) { if (!PaymentStatusEnum.BALANCE.getValue().equals(item.getPaymentStatus())) { socialNum += 1; } @@ -7287,7 +7325,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 钱智 社保差异 if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ + if (socialSpecialJson != null) { Map socialComJson = JSON.parseObject(item.getSocialComJson(), new HashMap().getClass()); socialComJson = socialComJson == null ? new HashMap() : socialComJson; Map finalSocialComJson = socialComJson; @@ -7317,7 +7355,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public int checkIfBusinessAccounting(InsuranceAccountBatchPO param) { List list = getSIAccountUtilMapper().checkIfBusinessaccounting(param.getId()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); - return (int) list.stream().filter( f -> { + return (int) list.stream().filter(f -> { String billMonthBySob = sdf.format(convertSalaryMonthToBillMonth(f.getSalaryMonth(), f.getSocialSecurityCycleType())); return f.getBillmonth().equals(billMonthBySob.substring(0, 7)); }).count(); @@ -7351,6 +7389,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 正常缴纳页 删除社保核算人员 + * * @param param */ @Override @@ -7383,6 +7422,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 正常缴纳页 添加社保核算人员 + * * @param param */ @Override @@ -7412,20 +7452,20 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //过滤出需要核算的人员,即福利档案基础信息表中runStatus为正在缴纳和待减员的人员 List baseInfoPOList = getInsuranceBaseInfoMapper().listByEmployeeIds(empIds); List canAccountIds = baseInfoPOList.stream() - .filter(f->f.getPaymentOrganization().equals(param.getPaymentOrganization())) + .filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())) .map(InsuranceArchivesBaseInfoPO::getEmployeeId) .collect(Collectors.toList()); //20231122逻辑优化,过滤出不在起始缴纳月和最后缴纳月区间的人员 List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); - empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); + empIds = empIds.stream().filter(f -> canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); List socials = getSIArchivesService(user).getSocialByEmployeeIds(empIds); //过滤出目标个税扣缴义务人相关信息 socials = socials.stream().filter(f -> f.getPaymentOrganization().equals(param.getPaymentOrganization())).collect(Collectors.toList()); List emp1 = socials.stream() .filter(s -> !(StringUtils.isBlank(s.getSocialEndTime()) && StringUtils.isBlank(s.getSocialStartTime())) && - (StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01")))) ) + (StringUtils.isBlank(s.getSocialEndTime()) || (SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01") != null && !SalaryDateUtil.stringToDate(param.getBillMonth() + "-01").after(SalaryDateUtil.stringToDate(s.getSocialEndTime() + "-01"))))) .map(InsuranceArchivesSocialSchemePO::getEmployeeId) .collect(Collectors.toList()); @@ -7453,7 +7493,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List conNotAddEmpIds = param.getIncludes().stream().filter(empId -> !finalValidIds.contains(empId)).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(conNotAddEmpIds)) { String canNotAddName = getSalaryEmployeeService(user).listByIds(conNotAddEmpIds).stream().map(DataCollectionEmployee::getUsername).collect(Collectors.joining(",")); - throw new SalaryRunTimeException("添加失败,员工:" +canNotAddName + ",社保、公积金、其他福利需至少有一种在当前账单月需缴纳,并且社保档案需为在缴员工"); + throw new SalaryRunTimeException("添加失败,员工:" + canNotAddName + ",社保、公积金、其他福利需至少有一种在当前账单月需缴纳,并且社保档案需为在缴员工"); } addCommonEmpAndAccount(param.getBillMonth(), empIds, param.getPaymentOrganization()); @@ -7462,6 +7502,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { /** * 添加正常缴纳人员,并核算 + * * @param billMonth * @param ids * @param paymentOrganization