From 4eb931686eb56182f90b424cc3ff9d24c37d26cd Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 5 Dec 2023 14:57:34 +0800 Subject: [PATCH 01/28] =?UTF-8?q?=E9=B2=81=E6=8E=A7=E6=95=B0=E5=AD=97temp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/bo/SalaryAcctResultReportBO.java | 39 ++++ .../salaryacct/bo/SalaryAcctResultBO.java | 29 +++ .../param/SalaryAcctResultBatchEditParam.java | 40 +++++ .../SalaryAcctResultBatchUpdateParam.java | 37 ++++ .../service/SalaryAcctRecordService.java | 6 + .../service/SalaryAcctResultService.java | 17 +- .../impl/SalaryAcctRecordServiceImpl.java | 99 +++++++++++ .../impl/SalaryAcctResultServiceImpl.java | 168 ++++++++++++++++++ .../salary/web/SalaryAcctController.java | 27 +++ .../wrapper/SalaryAcctRecordWrapper.java | 8 + .../wrapper/SalaryAcctResultWrapper.java | 21 ++- 11 files changed, 483 insertions(+), 8 deletions(-) create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java diff --git a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java index 6a23857a5..485389860 100644 --- a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java +++ b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java @@ -8,6 +8,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTempPO; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.math.NumberUtils; import java.util.*; @@ -62,6 +63,44 @@ public class SalaryAcctResultReportBO { .collect(Collectors.toList()); } + public static List lkszConvert2PO(List items, + SalaryAcctEmployeePO salaryAcctEmployee, + Long employeeId, Map emps) { + if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { + return Collections.emptyList(); + } + Date now = new Date(); + return items.stream() + .map(e -> { + SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() + .id(IdGenerator.generate()) + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(e.getSalaryItemId()) + .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployee.getId().toString()) + .employeeId(salaryAcctEmployee.getEmployeeId().toString()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .resultValue(e.getResultValue()) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + + DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployee.getEmployeeId()); + if (dataCollectionEmployee != null) { + po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); + po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); + po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); + po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); + po.setLocationId(dataCollectionEmployee.getLocationId()); + } + return po; + }) + .collect(Collectors.toList()); + } + public static List convert2ReportPO(Collection temps, Map emps) { // Map longDataCollectionEmployeeMap = SalaryEntityUtil.convert2Map(emps, DataCollectionEmployee::getEmployeeId); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 57b6e1927..29cae5d4a 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -27,6 +27,7 @@ import com.engine.salary.util.page.Column; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; @@ -577,6 +578,34 @@ public class SalaryAcctResultBO { .collect(Collectors.toList()); } + + public static List batchEditConvert2PO(Map salaryAcctResultOldPOMap, + List items, + SalaryAcctEmployeePO salaryAcctEmployee, + Long employeeId) { + if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { + return Collections.emptyList(); + } + Date now = new Date(); + return items.stream() + .map(e -> SalaryAcctResultPO.builder() + .salarySobId(salaryAcctEmployee.getSalarySobId()) + .salaryItemId(e.getSalaryItemId()) + .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployee.getId()) + .employeeId(salaryAcctEmployee.getEmployeeId()) + .taxAgentId(salaryAcctEmployee.getTaxAgentId()) + .resultValue(StringUtils.trim(e.getResultValue())) + .originResultValue(salaryAcctResultOldPOMap.get(salaryAcctEmployee.getId() + "-" + e.getSalaryItemId())) + .creator(employeeId) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()) + .collect(Collectors.toList()); + } + public static Map buildEmployeeFieldName() { Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields(); Map employeeFieldNameMap = Maps.newHashMapWithExpectedSize(declaredFields.length); diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java new file mode 100644 index 000000000..21922043c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java @@ -0,0 +1,40 @@ +package com.engine.salary.entity.salaryacct.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @ClassName SalaryAcctResultBatchUpdateParam + * @author Harryxzy + * @date 2023/12/4 13:48 + * @description 鲁控数字批量编辑参数 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SalaryAcctResultBatchEditParam { + + private Long salaryAcctRecordId; + + private List resultValueList; + + + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public class resultValue { + + // 薪资核算人员id + private Long salaryAcctEmpId; + + // 薪资项目值 + private List items; + } + +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java new file mode 100644 index 000000000..8eabde532 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @ClassName SalaryAcctResultBatchUpdateParam + * @author Harryxzy + * @date 2023/12/4 13:48 + * @description 鲁控数字批量更新参数 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SalaryAcctResultBatchUpdateParam { + + //薪资核算记录的id + @DataCheck(require = true, message = "薪资核算记录ID不得为空") + private Long salaryAcctRecordId; + + //薪资项目的Id + @DataCheck(require = true, message = "薪资项目id不得为空") + private Long salaryItemId; + + // 薪资核算人员id + private List salaryAcctEmpIdList; + + //薪资项目值 + private String value; + +} diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 1ba3419bf..319552b78 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -207,4 +207,10 @@ public interface SalaryAcctRecordService { List listSome(SalaryAcctRecordPO po); + + /** + * 鲁控数字-结账 + * @param salaryAcctRecordId + */ + void lkszJz(Long salaryAcctRecordId); } diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index 67320ed0d..871188360 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -4,10 +4,7 @@ import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.util.page.PageInfo; @@ -207,4 +204,16 @@ public interface SalaryAcctResultService { * @return */ Boolean checkAuth(Long salaryAcctRecordId); + + /** + * 鲁控数字薪资核算结果批量更新 + * @param param + */ + void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param); + + /** + * 鲁控数字薪资核算结果批量编辑 + * @param param + */ + void lkszBatchEdit(SalaryAcctResultBatchEditParam param); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 8038d08f7..1a189f762 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -4,6 +4,9 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; import com.engine.salary.entity.salaryBill.po.SalarySendPO; import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; @@ -12,6 +15,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; +import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; @@ -31,11 +35,14 @@ 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.util.valid.ValidUtil; +import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; +import java.time.YearMonth; import java.util.*; import java.util.stream.Collectors; @@ -77,6 +84,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySobItemService getSalarySobItemService(User user) { + return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); + } + // private SalaryCheckResultService salaryCheckResultService; // // private SalaryCheckResultDetailService salaryCheckResultDetailService; @@ -102,6 +113,10 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return ServiceUtil.getService(SalaryStatisticsReportServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + @Override public SalaryAcctRecordPO getById(Long id) { @@ -810,4 +825,88 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public List listSome(SalaryAcctRecordPO po) { return getSalaryAcctRecordMapper().listSome(po); } + + @Override + public void lkszJz(Long salaryAcctRecordId) { + SalaryAcctRecordPO salaryAcctRecordPO = getById(salaryAcctRecordId); + if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { + throw new SalaryRunTimeException("薪资核算记录不存在或已被删除"); + } + YearMonth salaryMonth = SalaryDateUtil.toYearMonth(SalaryDateUtil.dateToLocalDate(salaryAcctRecordPO.getSalaryMonth()).plusMonths(1)); + // 创建下一个月的薪资核算记录 + Long newSalaryAcctRecordId = save(SalaryAcctRecordSaveParam.builder().salarySobId(salaryAcctRecordPO.getSalarySobId()).salaryMonth(salaryMonth).build()); + // 查询下个月的薪资核算人员 + List salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(newSalaryAcctRecordId); + List acctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList()); + // 获取原来的薪资核算结果 + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + List salarySobItemIds = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); + List resultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(salaryAcctRecordId), salarySobItemIds); + // 过滤掉新的核算记录中不存在的人 + resultPOS = resultPOS.stream().filter(result -> acctEmpIds.contains(result.getEmployeeId())).collect(Collectors.toList()); + Map> resultMap = SalaryEntityUtil.group2Map(resultPOS, SalaryAcctResultPO::getEmployeeId); + // 查询人员信息,供报表使用 + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); + + // 需要保存的核算结果 + List needInsertResultList = new ArrayList<>(); + // 报表 + List needInsertResultReportList = new ArrayList<>(); + Date now = new Date(); + Long uid = Long.valueOf(user.getUID()); + salaryAcctEmployeePOList.stream().forEach(acctEmp -> { + List oldResultList = resultMap.get(acctEmp.getEmployeeId()); + oldResultList.stream().forEach(oldResult -> { + // 薪资核算结果 + needInsertResultList.add(SalaryAcctResultPO.builder() + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(oldResult.getSalaryItemId()) + .salaryAcctRecordId(newSalaryAcctRecordId) + .salaryAcctEmpId(acctEmp.getId()) + .employeeId(acctEmp.getEmployeeId()) + .taxAgentId(acctEmp.getTaxAgentId()) + .resultValue(StringUtils.trim(oldResult.getResultValue())) + .originResultValue(oldResult.getOriginResultValue()) + .creator(uid) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); + + // 报表结果 + SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() + .id(IdGenerator.generate()) + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(oldResult.getSalaryItemId()) + .salaryAcctRecordId(newSalaryAcctRecordId) + .salaryAcctEmpId(acctEmp.getId().toString()) + .employeeId(acctEmp.getEmployeeId().toString()) + .taxAgentId(acctEmp.getTaxAgentId()) + .resultValue(StringUtils.trim(oldResult.getResultValue())) + .creator(uid) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + + DataCollectionEmployee dataCollectionEmployee = emps.get(acctEmp.getEmployeeId()); + if (dataCollectionEmployee != null) { + po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); + po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); + po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); + po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); + po.setLocationId(dataCollectionEmployee.getLocationId()); + } + needInsertResultReportList.add(po); + }); + }); + + // 入库 + getSalaryAcctResultService(user).batchSave(needInsertResultList); + getSalaryAcctReportService(user).batchSave(needInsertResultReportList); + + } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 039546c4d..734f2ade4 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -4,6 +4,7 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.common.LocalDateRange; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; @@ -46,6 +47,7 @@ import com.engine.salary.util.SalaryI18nUtil; 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.util.valid.ValidUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -55,6 +57,7 @@ import com.weaver.util.threadPool.entity.LocalRunnable; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; @@ -1088,4 +1091,169 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } return true; } + + @Override + public void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param) { + ValidUtil.doValidator(param); + + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); + if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { + throw new SalaryRunTimeException("薪资核算记录不存在,或已被删除"); + } + List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); + // 薪资账套中包含的薪资项目 + List salarySobItemIds = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); + if (!salarySobItemIds.contains(param.getSalaryItemId())) { + throw new SalaryRunTimeException("该账套不包含该薪资项目或已被删除,请先检查账套"); + } + // 获取需要更新的核算人员信息 + List salaryAcctEmployeePOList = Collections.emptyList(); + if (CollectionUtils.isEmpty(param.getSalaryAcctEmpIdList())) { + // 没有选择核算人员,更新核算记录中所有人员 + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId())); + } else { + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listByIds(param.getSalaryAcctEmpIdList())); + } + + if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) { + List salaryAcctEmployeeIdList = SalaryEntityUtil.properties(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId, Collectors.toList()); + // 查询薪资核算结果 + List resultPOS = listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIdList, Collections.singleton(param.getSalaryItemId())); + Map salaryAcctResultPOMap = SalaryEntityUtil.convert2Map(resultPOS, SalaryAcctResultPO::getSalaryAcctEmpId); + List needUpdateList = new ArrayList<>(); + List needInsertList = new ArrayList<>(); + Date now = new Date(); + salaryAcctEmployeePOList.forEach(salaryAcctEmployeePO -> { + if (salaryAcctResultPOMap.containsKey(salaryAcctEmployeePO.getId())) { + // 更新 + SalaryAcctResultPO po = salaryAcctResultPOMap.get(salaryAcctEmployeePO.getId()); + po.setResultValue(param.getValue()); + po.setUpdateTime(now); + needUpdateList.add(po); + } else { + // 新增 + needInsertList.add(SalaryAcctResultPO.builder() + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId()) + .employeeId(salaryAcctEmployeePO.getEmployeeId()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(StringUtils.trim(param.getValue())) + .originResultValue("") + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build()); + } + }); + // 入库 + if (CollectionUtils.isNotEmpty(needUpdateList)) { + getSalaryAcctResultMapper().batchUpdate(needUpdateList); + } + + if (CollectionUtils.isNotEmpty(needInsertList)) { + getSalaryAcctResultMapper().batchInsert(needInsertList); + } + } + } + + @Override + public void lkszBatchEdit(SalaryAcctResultBatchEditParam param) { + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); + + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); + if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { + throw new SalaryRunTimeException("薪资核算结果不存在或已被删除"); + } + + List salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(param.getSalaryAcctRecordId()); + Map salaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId); + + // 需要更新数据的薪资核算人员id + List updateAcctEmpIds = param.getResultValueList().stream().map(SalaryAcctResultBatchEditParam.resultValue::getSalaryAcctEmpId).collect(Collectors.toList()); + // 查询原来的薪资核算结果 + List salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(updateAcctEmpIds).build()); + // 解密 + encryptUtil.decryptList(salaryAcctResultPOSOld, SalaryAcctResultPO.class); + // 保存参数转换成薪资核算结果po + List salaryAcctResultPOS = new ArrayList<>(); + // 获取薪资项目回算前的值 + Map salaryAcctResultOldPOMap = salaryAcctResultPOSOld.stream() + .collect(Collectors.groupingBy(p -> p.getSalaryAcctEmpId() + "-" + p.getSalaryItemId(), + Collectors.collectingAndThen(Collectors.maxBy(Comparator.comparing(SalaryAcctResultPO::getId)), + s -> s.map(SalaryAcctResultPO::getOriginResultValue).orElse("")))); + List salaryAcctResultReportPOS = new ArrayList<>(); + param.getResultValueList().forEach(resultValue -> { + SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeePOMap.get(resultValue.getSalaryAcctEmpId()); + salaryAcctResultPOS.addAll(SalaryAcctResultBO.batchEditConvert2PO(salaryAcctResultOldPOMap, resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID())); + // 报表 + salaryAcctResultReportPOS.addAll(SalaryAcctResultReportBO.lkszConvert2PO(resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID(), emps)); + }); + + // 删除原来的薪资核算结果 + param.getResultValueList().stream().forEach(resultValue -> { + List saveItemIds = resultValue.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList()); + deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getSalaryAcctEmpId()), saveItemIds); + // 报表 + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getSalaryAcctEmpId()), saveItemIds); + }); + + // 保存薪资核算结果 + if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { + // 加密 + encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); + List> partition = Lists.partition(salaryAcctResultPOS, 100); + partition.forEach(getSalaryAcctResultMapper()::batchInsert); + } + + //报表 + if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) { + getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); + } + } + + + public void temp(SalaryAcctResultSaveParam saveParam){ + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); + + // 查询薪资核算人员 + SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(saveParam.getSalaryAcctEmpId()); + if (Objects.isNull(salaryAcctEmployeePO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除")); + } + // 查询原来的薪资核算结果 + List salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(saveParam.getSalaryAcctEmpId()).build()); + // 解密 + encryptUtil.decryptList(salaryAcctResultPOSOld, SalaryAcctResultPO.class); + // 保存参数转换成薪资核算结果po + List salaryAcctResultPOS = SalaryAcctResultBO.convert2PO(salaryAcctResultPOSOld, saveParam, salaryAcctEmployeePO, (long) user.getUID()); + SalarySysConfPO autoLock = getSalarySysConfService(user).getOneByCode(SalarySysConstant.EDIT_IMPORT_AUTO_LOCK); + + // 删除原来的薪资核算结果 + List saveItemIds = saveParam.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList()); + deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds); + // 保存薪资核算结果 + if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { + // 加密 + encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); + List> partition = Lists.partition(salaryAcctResultPOS, 100); + partition.forEach(getSalaryAcctResultMapper()::batchInsert); + } + //报表 todo + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds); + List salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps); + if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) { + getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); + } + + + // 存储薪资核算结果数据来源日志 + salaryAcctResultPOS = getSalaryAcctRecordService(user).listBySalaryAcctEmpId(saveParam.getSalaryAcctEmpId()); + saveSalaryAcctResultLog(salaryAcctResultPOSOld, salaryAcctResultPOS); + } } \ No newline at end of file diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 078060a02..45de6654d 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -158,6 +158,15 @@ public class SalaryAcctController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::backCalculate, param.getSalaryAcctRecordId()); } + + // 结账 + @GET + @Path("/lkszJz") + @Produces(MediaType.APPLICATION_JSON) + public String lkszJz(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::lkszJz, id); + } /* ********************************薪资核算记录相关 end*********************************/ @@ -448,6 +457,24 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::updateLockStatusByParam, param); } + //鲁控数字批量更新 + @POST + @Path("/acctresult/lkszBatchUpdate") + @Produces(MediaType.APPLICATION_JSON) + public String lkszBatchUpdate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchUpdateParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::lkszBatchUpdate, param); + } + + //鲁控数字批量编辑 + @POST + @Path("/acctresult/lkszBatchEdit") + @Produces(MediaType.APPLICATION_JSON) + public String lkszBatchEdit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchEditParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::lkszBatchEdit, param); + } + //薪资核算 @POST @Path("/acctresult/accounting") diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 9c17eaf78..5cd43cecb 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -258,4 +258,12 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord public void backCalculate(Long salaryAcctRecordId){ getSalaryAcctRecordService(user).backCalculate(salaryAcctRecordId); } + + /** + * 鲁控数字-结账 + * @param salaryAcctRecordId + */ + public void lkszJz(Long salaryAcctRecordId) { + getSalaryAcctRecordService(user).lkszJz(salaryAcctRecordId); + } } diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index 8c0e6404d..59bbd3093 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -9,10 +9,7 @@ import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO; -import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; -import com.engine.salary.entity.salaryacct.param.SalaryAcctResultUpdateLockStatusParam; +import com.engine.salary.entity.salaryacct.param.*; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; @@ -260,6 +257,22 @@ public class SalaryAcctResultWrapper extends Service { return getSalaryAcctResultService(user).checkAuth(salaryAcctRecordId); } + /** + * 鲁控数字薪资核算结果批量更新 + * @param param + */ + public void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param) { + getSalaryAcctResultService(user).lkszBatchUpdate(param); + } + + /** + * 鲁控数字薪资核算结果批量编辑 + * @param param + */ + public void lkszBatchEdit(SalaryAcctResultBatchEditParam param) { + getSalaryAcctResultService(user).lkszBatchEdit(param); + } + /** * 薪资核算-校验 From 451c9fb07bc45cc2e026c1fafde520251b598c68 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 09:51:07 +0800 Subject: [PATCH 02/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E6=94=B9?= =?UTF-8?q?=E9=80=A0=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=BA=94=E7=94=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E7=9A=84=E5=8C=BA=E5=88=86=E5=BC=80=E5=85=B3?= =?UTF-8?q?=EF=BC=8C=E5=88=A4=E5=AE=9A=E5=90=8E=E5=B0=86=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E7=9A=84=E7=A6=8F=E5=88=A9=E5=9F=BA=E6=95=B0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=8C=BA=E5=88=86=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 68 ++++++++++++++++--- .../po/InsuranceAccountDetailPO.java | 18 +++++ .../dto/InsuranceArchivesFundSchemeDTO.java | 2 + .../dto/InsuranceArchivesOtherSchemeDTO.java | 2 + .../dto/InsuranceArchivesSocialSchemeDTO.java | 3 + .../po/InsuranceArchivesFundSchemePO.java | 7 ++ .../po/InsuranceArchivesOtherSchemePO.java | 6 ++ .../po/InsuranceArchivesSocialSchemePO.java | 6 ++ .../sys/constant/SalarySysConstant.java | 5 ++ .../impl/SalarySysConfServiceImpl.java | 12 ++++ 10 files changed, 119 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 528849995..e0ebc3bef 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -14,7 +14,6 @@ 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; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; @@ -37,6 +36,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.enums.OpenEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -65,6 +68,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl @@ -113,6 +118,10 @@ public class SIArchivesBiz { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -266,15 +275,18 @@ public class SIArchivesBiz { */ public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; default: } @@ -289,12 +301,16 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); @@ -311,13 +327,17 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); @@ -334,18 +354,28 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -361,9 +391,27 @@ public class SIArchivesBiz { if (schemeId == null) { return new ArrayList<>(); } - List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new) - ); + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + SICategoryBiz siCategoryBiz = new SICategoryBiz(); + list.forEach(insuranceSchemeDetail -> { + ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); SICategoryBiz siCategoryBiz = new SICategoryBiz(); list.forEach(insuranceSchemeDetail -> { ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index e8f7ce98f..9cd2ad7f0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -106,6 +106,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -117,6 +123,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -128,6 +140,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java index f85206c01..4fcfdbcd1 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java @@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO { //缴纳基数 private String fundPaymentBaseString; + + private String fundPaymentComBaseString; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java index a3c55fee5..3fa89c1c2 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java @@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO { private String otherPaymentBaseString; + private String otherPaymentComBaseString; + //private WeaForm otherPaymentBase; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java index 1be1afbca..d4fc1dae8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java @@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO { //社保缴纳基数 private String schemePaymentBaseString; + //社保缴纳基数——单位 + private String schemePaymentComBaseString; + } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java index 7b333f4e6..fc171c94b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -87,6 +87,13 @@ public class InsuranceArchivesFundSchemePO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java index 76146719d..9ad9d9668 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -77,6 +77,12 @@ public class InsuranceArchivesOtherSchemePO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java index e6f4ff038..645e5215b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -83,6 +83,12 @@ public class InsuranceArchivesSocialSchemePO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index c5b6b08db..df5ea5ea2 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -105,4 +105,9 @@ public class SalarySysConstant { * 核算固定列头数 */ public static final String SALARY_ACCT_FIXED_COLUMNS = "salaryAcctFixedColumns"; + + /** + * 应用设置是否福利档案基数区分个人和单位 + */ + public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom"; } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 57fb34878..74ead2a26 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -755,8 +755,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesSocialSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); } else { po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesSocialSchemePos, 50); @@ -782,8 +784,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesFundSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); } else { po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesFundSchemePos, 50); @@ -809,8 +813,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesOtherSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); } else { po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesOtherSchemePos, 50); @@ -869,6 +875,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo)); po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo)); po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo)); @@ -887,6 +896,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson())); po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum())); po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson())); From ec8cb6214ddb4b6f4a758b9f71c5750ab1bdabe8 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 14:04:12 +0800 Subject: [PATCH 03/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=B9=E9=80=A0=EF=BC=8C=E9=80=82=E9=85=8D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E7=A6=8F=E5=88=A9=E5=9F=BA=E6=95=B0?= =?UTF-8?q?=E6=8B=86=E5=88=86=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 163 ++++++++++++++++-- .../dto/InsuranceArchivesBaseHistoryDTO.java | 6 + .../param/InsuranceArchivesSaveParam.java | 2 + .../po/InsuranceArchivesBaseHistoryPO.java | 2 + .../mapper/siarchives/FundSchemeMapper.xml | 5 + .../mapper/siarchives/OtherSchemeMapper.xml | 9 +- .../mapper/siarchives/SocialSchemeMapper.xml | 5 + .../service/impl/SIArchivesServiceImpl.java | 2 +- .../service/impl/SISchemeServiceImpl.java | 6 +- 9 files changed, 175 insertions(+), 25 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index e0ebc3bef..a58021031 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -669,17 +669,20 @@ public class SIArchivesBiz { * @param param * @param employeeId */ - public void insert(InsuranceArchivesSaveParam param, long employeeId) { + public void insert(InsuranceArchivesSaveParam param, User user) { SalaryAssert.notNull(param.getWelfareType(), "福利类型为空"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (param.getWelfareType()) { case SOCIAL_SECURITY: - socialSave(param, employeeId); + socialSave(param, user, welBaseDiffSign); break; case ACCUMULATION_FUND: - fundSave(param, employeeId); + fundSave(param, user, welBaseDiffSign); break; case OTHER: - otherSave(param, employeeId); + otherSave(param, user, welBaseDiffSign); break; default: throw new SalaryRunTimeException("福利类型不存在"); @@ -691,7 +694,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void otherSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); @@ -714,6 +718,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getOtherSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -725,6 +730,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); //新数据 InsuranceArchivesOtherSchemePO updateOtherInfo = InsuranceArchivesOtherSchemePO.builder() @@ -744,9 +750,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.updateById(updateOtherInfo); //更新base_info表状态 @@ -780,9 +794,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.insert(insertOtherInfo); sqlSession.commit(); @@ -818,7 +840,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void fundSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); @@ -840,6 +863,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getFundSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -851,6 +875,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); //新数据 InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() .id(oldFundInfo.getId()) @@ -871,9 +896,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.updateById(updateFundInfo); //更新base_info表状态 @@ -909,9 +942,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.insert(insertFundInfo); sqlSession.commit(); @@ -949,8 +990,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void socialSave(InsuranceArchivesSaveParam paramReq, long employeeId) { - + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); @@ -977,6 +1018,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getSocialSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -990,6 +1032,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); //新数据 InsuranceArchivesSocialSchemePO updateSocialInfo = InsuranceArchivesSocialSchemePO.builder() @@ -1010,9 +1053,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.updateById(updateSocialInfo); //更新base_info表状态 @@ -1048,9 +1099,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.insert(insertSocialInfo); sqlSession.commit(); @@ -1088,14 +1147,11 @@ public class SIArchivesBiz { * @param paymentBaseString * @return */ - public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString) { + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { if (primaryId ==null || paymentBaseString == null) { return true; } - //设置缴纳对象和缴费状态 -// Integer paymentScope = 2; -// Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -1119,7 +1175,7 @@ public class SIArchivesBiz { return false; } List isPaymentList = insuranceSchemeDetailPOList.stream() - .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); if (isPaymentList.size() > 0) { InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); @@ -2035,6 +2091,11 @@ public class SIArchivesBiz { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); + //判断是否要区分个人和单位福利基数 + User user = new User(Math.toIntExact(creator)); + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2053,6 +2114,7 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2087,12 +2149,75 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } } + //如果系统应用设置拆分了个人和公司福利基数,则对adjustBeforeComBaseJson,adjustAfterComBaseJson也进行处理 + if (welBaseDiffSign) { + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } return toCreateAdjustHistoryList; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java index 259cc3e54..a0c2d57e8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java @@ -70,12 +70,18 @@ public class InsuranceArchivesBaseHistoryDTO { private String adjustAfterBaseJson; + private String adjustBeforeComBaseJson; + + private String adjustAfterComBaseJson; + @TableTitle(title = "对象", dataIndex = "employeeName", key = "employeeName") private String employeeName; @TableTitle(title = "个税扣缴义务人", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName") private String paymentOrganizationName; @TableTitle(title = "福利项名称", dataIndex = "welfareItemName", key = "welfareItemName") private String welfareItemName; + @TableTitle(title = "缴费对象", dataIndex = "paymentScope", key = "paymentScope") + private String paymentScope; @TableTitle(title = "调整前方案", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName") private String adjustBeforeSchemeName; @TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue") diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java index 7e4e46fb7..8d086b1ad 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java @@ -23,4 +23,6 @@ public class InsuranceArchivesSaveParam { private String baseForm; private String paymentForm; + + private String paymentComForm; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java index 6939c2258..52d31f804 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java @@ -77,4 +77,6 @@ public class InsuranceArchivesBaseHistoryPO { private Date createTime; private Date updateTime; + + private String paymentScope; } diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index fc91b8885..56731a58b 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -14,6 +14,7 @@ + @@ -35,6 +36,7 @@ , t.payment_organization , t.under_take , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -311,6 +313,7 @@ welfare_type = #{welfareType}, fund_payment_base_string = #{fundPaymentBaseString}, + fund_payment_com_base_string = #{fundPaymentComBaseString}, fund_scheme_id = #{fundSchemeId}, fund_end_time = #{fundEndTime}, fund_start_time = #{fundStartTime}, @@ -353,6 +356,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -371,6 +375,7 @@ #{fundEndTime}, #{fundStartTime}, #{fundPaymentBaseString}, + #{fundPaymentComBaseString}, #{supplementFundAccount}, #{createTime}, #{creator}, diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index d1a18db07..de0febe4f 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -12,6 +12,7 @@ + @@ -31,6 +32,7 @@ , t.payment_organization , t.under_take , t.other_payment_base_string + , t.other_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -292,6 +294,7 @@ welfare_type = #{welfareType}, other_payment_base_string = #{otherPaymentBaseString}, + other_payment_com_base_string = #{otherPaymentComBaseString}, other_scheme_id = #{otherSchemeId}, other_end_time = #{otherEndTime}, other_start_time = #{otherStartTime}, @@ -340,7 +343,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{otherSchemeId}, @@ -356,7 +360,8 @@ #{nonPayment}, #{creator}, #{paymentOrganization}, - #{otherPaymentBaseString} + #{otherPaymentBaseString}, + #{otherPaymentComBaseString} ) \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 8472020a2..c27048d10 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ , t.payment_organization , t.under_take , t.social_payment_base_string + , t.social_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -955,6 +957,7 @@ welfare_type = #{welfareType}, social_payment_base_string = #{socialPaymentBaseString}, + social_payment_com_base_string = #{socialPaymentComBaseString}, social_scheme_id = #{socialSchemeId}, social_end_time = #{socialEndTime}, social_start_time = #{socialStartTime}, @@ -994,6 +997,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -1011,6 +1015,7 @@ #{welfareType}, #{deleteType}, #{socialPaymentBaseString}, + #{socialPaymentComBaseString}, #{socialSchemeId}, #{createTime}, #{socialEndTime}, diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 59b4d8e48..11299554e 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -141,7 +141,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public String insert(InsuranceArchivesSaveParam param) { SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - siArchivesBiz.insert(param, (long) user.getUID()); + siArchivesBiz.insert(param, user); return null; } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 8746fdd48..d49f971e2 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1102,11 +1102,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); //校验福利基数是否符合上下限要求, - Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString()); + Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString()); + Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString()); + Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); if (socialCheckBase && fundCheckBase && otherCheckBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); From 6dca2a43800b08f8d4101f40ac6a2ff095f5e817 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 15:38:19 +0800 Subject: [PATCH 04/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=97=B6=EF=BC=8C=E6=A1=A3=E6=A1=88=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=8C=BA=E5=88=86=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9=E5=9F=BA?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 282 +++++++++++++++--- .../salary/web/SIArchivesController.java | 2 + 2 files changed, 241 insertions(+), 43 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index a58021031..eb4980815 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -13,6 +13,7 @@ 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.common.SalaryContext; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -1383,6 +1384,7 @@ public class SIArchivesBiz { * @return */ public List buildWeaTableColumns(List insuranceArchivesEmployeePOS, long operateId) { + Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId); List list = new ArrayList<>(); WeaTableColumn nameColumn = new WeaTableColumn("100px", "姓名", "employeeName"); @@ -1422,6 +1424,9 @@ public class SIArchivesBiz { * @return */ public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId) { + + boolean welBaseDiffSign = isDiffWelBase(); + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); @@ -1437,16 +1442,17 @@ public class SIArchivesBiz { Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); -// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); -// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); -// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; if (socialList.size() > 0) { for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { @@ -1455,6 +1461,14 @@ public class SIArchivesBiz { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } } @@ -1465,6 +1479,14 @@ public class SIArchivesBiz { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } } @@ -1475,11 +1497,20 @@ public class SIArchivesBiz { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); @@ -1489,34 +1520,89 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); +// socialSet.forEach(item -> { +// if (socialCollect.containsKey(Long.valueOf(item))) { +// socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); +// fundSet.forEach(item -> { +// if (fundCollect.containsKey(Long.valueOf(item))) { +// fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); - +// otherSet.forEach(item -> { +// if (otherCollect.containsKey(Long.valueOf(item))) { +// otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() .sorted(Map.Entry.comparingByKey()) @@ -1530,6 +1616,23 @@ public class SIArchivesBiz { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1552,6 +1655,9 @@ public class SIArchivesBiz { * @return */ public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + + boolean welBaseDiffSign = isDiffWelBase(); + List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -1599,16 +1705,39 @@ public class SIArchivesBiz { map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); map.put("socialEndTime", socialItem.getSocialEndTime()); @@ -1618,16 +1747,39 @@ public class SIArchivesBiz { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); map.put("fundEndTime", fundItem.getFundEndTime()); @@ -1637,16 +1789,39 @@ public class SIArchivesBiz { map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); } @@ -1669,6 +1844,19 @@ public class SIArchivesBiz { } return insuranceIdList; } + + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + /** * 获取信息提示 */ @@ -2296,4 +2484,12 @@ public class SIArchivesBiz { list.add(new WeaTableColumn("150px", "操作时间", "operatorTime")); return list; } + + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } } diff --git a/src/com/engine/salary/web/SIArchivesController.java b/src/com/engine/salary/web/SIArchivesController.java index ecc61b1b5..e0b3bfe89 100644 --- a/src/com/engine/salary/web/SIArchivesController.java +++ b/src/com/engine/salary/web/SIArchivesController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam; @@ -33,6 +34,7 @@ import java.util.Map; public class SIArchivesController { private SIArchivesService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIArchivesServiceImpl.class,user); } From 2a02e17c15e57958e48a68fd099a033c7bf4201d Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 6 Dec 2023 15:55:47 +0800 Subject: [PATCH 05/28] temp --- .../salary/service/impl/SalaryAcctResultServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 734f2ade4..f051dfefd 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1151,12 +1151,13 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe }); // 入库 if (CollectionUtils.isNotEmpty(needUpdateList)) { - getSalaryAcctResultMapper().batchUpdate(needUpdateList); - } + // 数据加密 + encryptUtil.encryptList(needUpdateList, SalaryAcctResultPO.class); + List> partition = Lists.partition(needUpdateList, 100); + partition.forEach(getSalaryAcctResultMapper()::batchUpdate); - if (CollectionUtils.isNotEmpty(needInsertList)) { - getSalaryAcctResultMapper().batchInsert(needInsertList); } + batchSave(needInsertList); } } From 419baeb8cd41050570327b61d740d16b949728b6 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 6 Dec 2023 16:05:08 +0800 Subject: [PATCH 06/28] =?UTF-8?q?=E9=B2=81=E6=8E=A7=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 1 - .../salary/component/WeaTableColumnGroup.java | 12 ++++ .../salaryacct/bo/SalaryAcctRecordBO.java | 3 + .../salaryacct/bo/SalaryAcctResultBO.java | 23 ++++---- .../dto/SalaryAcctResultDetailDTO.java | 3 + .../param/SalaryAcctResultBatchEditParam.java | 4 +- .../SalaryAcctResultBatchUpdateParam.java | 2 +- .../service/SalaryAcctRecordService.java | 2 +- .../service/SalaryAcctReportService.java | 2 + .../service/SalaryAcctResultService.java | 4 +- .../impl/SalaryAcctRecordServiceImpl.java | 3 +- .../impl/SalaryAcctReportServiceImpl.java | 13 +++++ .../impl/SalaryAcctResultServiceImpl.java | 58 +++++++++++++++---- .../salary/web/SalaryAcctController.java | 10 ++-- .../wrapper/SalaryAcctRecordWrapper.java | 2 +- .../wrapper/SalaryAcctResultWrapper.java | 6 +- 16 files changed, 109 insertions(+), 39 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 4ba839d57..4e5d4378e 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -7,7 +7,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; diff --git a/src/com/engine/salary/component/WeaTableColumnGroup.java b/src/com/engine/salary/component/WeaTableColumnGroup.java index dac9a3569..0dcd305af 100644 --- a/src/com/engine/salary/component/WeaTableColumnGroup.java +++ b/src/com/engine/salary/component/WeaTableColumnGroup.java @@ -18,6 +18,11 @@ public class WeaTableColumnGroup extends WeaTableColumn { */ private Integer pattern; + /** + * 字段类型 + */ + private String dataType; + private List children; public WeaTableColumnGroup() { @@ -40,6 +45,13 @@ public class WeaTableColumnGroup extends WeaTableColumn { this.pattern = pattern; } + public WeaTableColumnGroup(String width, String text, String column, String lockStatus, Integer pattern, String dataType) { + super(width, text, column); + this.lockStatus = lockStatus; + this.pattern = pattern; + this.dataType = dataType; + } + public WeaTableColumnGroup(String width, String text, String column, List children) { super(width, text, column); diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java index f07aa7d36..11a44f311 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -67,13 +67,16 @@ public class SalaryAcctRecordBO { btnList.add(new WeaTableOperate("删除", null, "1")); } btnList.add(new WeaTableOperate("归档", null, "2")); + btnList.add(new WeaTableOperate("结转", null, "6")); } else if (SalaryAcctRecordStatusEnum.ARCHIVED == salaryAcctRecordStatusEnum && ( salarySendMap.get(salaryAcctRecordPO.getId()) ==Boolean.TRUE ) ){ btnList.add(new WeaTableOperate("查看", null, "3")); btnList.add(new WeaTableOperate("重新核算", null, "4")); btnList.add(new WeaTableOperate("回算", null, "5")); + btnList.add(new WeaTableOperate("结转", null, "6")); } else { btnList.add(new WeaTableOperate("查看", null, "3")); btnList.add(new WeaTableOperate("重新核算", null, "4")); + btnList.add(new WeaTableOperate("结转", null, "6")); } return SalaryAcctRecordListDTO.builder() .id(salaryAcctRecordPO.getId()) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 29cae5d4a..bfa7210cc 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -141,9 +141,9 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup("150", salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); @@ -152,18 +152,18 @@ public class SalaryAcctResultBO { // 没有分类的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } // 回算的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern(), salarySobItemDTO.getDataType())); } } @@ -378,7 +378,8 @@ public class SalaryAcctResultBO { List salarySobBackItemPOS, List salaryBackItemPOS, Map salaryBackItemFormula, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { // 员工信息字段 Map employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee); @@ -407,7 +408,7 @@ public class SalaryAcctResultBO { List groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList()); if(CollectionUtils.isNotEmpty(groupItems)){ List items = groupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(groupPO.getId()) @@ -420,7 +421,7 @@ public class SalaryAcctResultBO { List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); if(CollectionUtils.isNotEmpty(noGroupItems)){ List items = noGroupItems.stream() - .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap)) + .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, lockItems)) .collect(Collectors.toList()); itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder() .salarySobItemGroupId(0L) @@ -492,7 +493,8 @@ public class SalaryAcctResultBO { private static SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO convert2SalaryAcctResultDetailItemDTO(SalarySobItemPO salarySobItemPO, SalaryItemPO salaryItemPO, Map resultValueMap, - Map formulaContentMap) { + Map formulaContentMap, + List lockItems) { SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0)); String itemFormulaContent; @@ -512,6 +514,7 @@ public class SalaryAcctResultBO { // .canEdit(Objects.equals(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getUseInEmployeeSalary).orElse(0), 0)) .canEdit(true) .pattern(salarySobItemPO.getPattern()) + .lockStatus(lockItems.contains(salarySobItemPO.getSalaryItemId()) ? LockStatusEnum.LOCK.getValue() : LockStatusEnum.UNLOCK.getValue()) .build(); } diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java index 1929494a9..8fadd2670 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -71,6 +71,9 @@ public class SalaryAcctResultDetailDTO { // 保留小数位数 private Integer pattern; + + // 锁定状态 + private String lockStatus; } @Data diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java index 21922043c..487527d51 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java @@ -28,10 +28,10 @@ public class SalaryAcctResultBatchEditParam { @Builder @AllArgsConstructor @NoArgsConstructor - public class resultValue { + public static class resultValue { // 薪资核算人员id - private Long salaryAcctEmpId; + private Long id; // 薪资项目值 private List items; diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java index 8eabde532..141b3a004 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -29,7 +29,7 @@ public class SalaryAcctResultBatchUpdateParam { private Long salaryItemId; // 薪资核算人员id - private List salaryAcctEmpIdList; + private List idList; //薪资项目值 private String value; diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 319552b78..9c3ba4f8c 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -209,7 +209,7 @@ public interface SalaryAcctRecordService { List listSome(SalaryAcctRecordPO po); /** - * 鲁控数字-结账 + * 鲁控数字-结转 * @param salaryAcctRecordId */ void lkszJz(Long salaryAcctRecordId); diff --git a/src/com/engine/salary/service/SalaryAcctReportService.java b/src/com/engine/salary/service/SalaryAcctReportService.java index c4c1636db..6cf5caa12 100644 --- a/src/com/engine/salary/service/SalaryAcctReportService.java +++ b/src/com/engine/salary/service/SalaryAcctReportService.java @@ -21,6 +21,8 @@ public interface SalaryAcctReportService { */ void batchSave(Collection pos); + void lkszBatchSave(Collection pos); + /** * 根据核算记录删除 * @param salaryAcctRecordIds diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index 871188360..ec8efb878 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -206,10 +206,10 @@ public interface SalaryAcctResultService { Boolean checkAuth(Long salaryAcctRecordId); /** - * 鲁控数字薪资核算结果批量更新 + * 薪资核算结果批量更新 * @param param */ - void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param); + void batchUpdate(SalaryAcctResultBatchUpdateParam param); /** * 鲁控数字薪资核算结果批量编辑 diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 1a189f762..ee596af21 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -906,7 +906,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe // 入库 getSalaryAcctResultService(user).batchSave(needInsertResultList); - getSalaryAcctReportService(user).batchSave(needInsertResultReportList); - + getSalaryAcctReportService(user).lkszBatchSave(needInsertResultReportList); } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java index 8371241fb..43b7160a8 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java @@ -62,6 +62,19 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe } } + @Override + public void lkszBatchSave(Collection pos) { + if (CollectionUtils.isNotEmpty(pos)) { + SalarySysConfPO disPlay = getSalarySysConfService(user).getOneByCode(DISPLAY_EMP_INFO_REPORT); + //默认不显示,关闭状态 + if (disPlay == null || OpenEnum.OFF.getValue().equals(disPlay.getConfValue())) { + pos = encryptUtil.encryptList(new ArrayList<>(pos), SalaryAcctResultReportPO.class); + } + List> partition = Lists.partition((List) pos, 100); + partition.forEach(getSalaryAcctResultReportMapper()::batchInsert); + } + } + @Override public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index f051dfefd..34148f289 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -54,6 +54,7 @@ import com.google.common.collect.Sets; import com.weaver.util.threadPool.ThreadPoolUtil; import com.weaver.util.threadPool.constant.ModulePoolEnum; import com.weaver.util.threadPool.entity.LocalRunnable; +import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -301,9 +302,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe TaxAgentPO taxAgent = getTaxAgentService(user).getById(salaryAcctEmployeePO.getTaxAgentId()); // 查询公式 Map formulaContentMap = getSalaryAcctResultService(user).getColumnBySalaryAcctRecordId(salaryAcctEmployeePO.getSalaryAcctRecordId()); + List lockItems = byId.getLockSalaryItemIds() == null ? Collections.emptyList() : byId.getLockSalaryItemIds(); // 转换成薪资核算结果详情dto - return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap); + return SalaryAcctResultBO.convert2DetailDTO(simpleEmployee, taxAgent, salaryAcctEmployeePO, salarySobEmpFieldPOS, salarySobItemGroupPOS, salarySobItemPOS, salaryItemPOS, salaryAcctResultPOS, salarySobBackItemPOList, salaryBackItemPOS, salaryBackItemFormula, formulaContentMap, lockItems); } @Override @@ -1093,7 +1095,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } @Override - public void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param) { + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { ValidUtil.doValidator(param); SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); @@ -1107,12 +1109,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe throw new SalaryRunTimeException("该账套不包含该薪资项目或已被删除,请先检查账套"); } // 获取需要更新的核算人员信息 - List salaryAcctEmployeePOList = Collections.emptyList(); - if (CollectionUtils.isEmpty(param.getSalaryAcctEmpIdList())) { + List salaryAcctEmployeePOList = new ArrayList<>(); + if (CollectionUtils.isEmpty(param.getIdList())) { // 没有选择核算人员,更新核算记录中所有人员 salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecordPO.getId())); } else { - salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listByIds(param.getSalaryAcctEmpIdList())); + salaryAcctEmployeePOList.addAll(getSalaryAcctEmployeeService(user).listByIds(param.getIdList())); } if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOList)) { @@ -1120,9 +1122,12 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 查询薪资核算结果 List resultPOS = listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIdList, Collections.singleton(param.getSalaryItemId())); Map salaryAcctResultPOMap = SalaryEntityUtil.convert2Map(resultPOS, SalaryAcctResultPO::getSalaryAcctEmpId); + List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); + Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); List needUpdateList = new ArrayList<>(); List needInsertList = new ArrayList<>(); Date now = new Date(); + List salaryAcctResultReportPOS = new ArrayList<>(); salaryAcctEmployeePOList.forEach(salaryAcctEmployeePO -> { if (salaryAcctResultPOMap.containsKey(salaryAcctEmployeePO.getId())) { // 更新 @@ -1139,7 +1144,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .salaryAcctEmpId(salaryAcctEmployeePO.getId()) .employeeId(salaryAcctEmployeePO.getEmployeeId()) .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) - .resultValue(StringUtils.trim(param.getValue())) + .resultValue(param.getValue()) .originResultValue("") .creator(Long.valueOf(user.getUID())) .createTime(now) @@ -1148,16 +1153,47 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) .build()); } + + // 报表 + SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() + .id(IdGenerator.generate()) + .salarySobId(salaryAcctRecordPO.getSalarySobId()) + .salaryItemId(param.getSalaryItemId()) + .salaryAcctRecordId(param.getSalaryAcctRecordId()) + .salaryAcctEmpId(salaryAcctEmployeePO.getId().toString()) + .employeeId(salaryAcctEmployeePO.getEmployeeId().toString()) + .taxAgentId(salaryAcctEmployeePO.getTaxAgentId()) + .resultValue(param.getValue()) + .creator(Long.valueOf(user.getUID())) + .createTime(now) + .updateTime(now) + .deleteType(NumberUtils.INTEGER_ZERO) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .build(); + DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployeePO.getEmployeeId()); + if (dataCollectionEmployee != null) { + po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); + po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); + po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); + po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); + po.setLocationId(dataCollectionEmployee.getLocationId()); + } + salaryAcctResultReportPOS.add(po); }); + // 入库 if (CollectionUtils.isNotEmpty(needUpdateList)) { // 数据加密 encryptUtil.encryptList(needUpdateList, SalaryAcctResultPO.class); List> partition = Lists.partition(needUpdateList, 100); partition.forEach(getSalaryAcctResultMapper()::batchUpdate); - } batchSave(needInsertList); + + // 报表入库前先删除 + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(param.getIdList(), Collections.singletonList(param.getSalaryItemId()) ); + getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); + } } @@ -1175,7 +1211,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe Map salaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId); // 需要更新数据的薪资核算人员id - List updateAcctEmpIds = param.getResultValueList().stream().map(SalaryAcctResultBatchEditParam.resultValue::getSalaryAcctEmpId).collect(Collectors.toList()); + List updateAcctEmpIds = param.getResultValueList().stream().map(SalaryAcctResultBatchEditParam.resultValue::getId).collect(Collectors.toList()); // 查询原来的薪资核算结果 List salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(updateAcctEmpIds).build()); // 解密 @@ -1189,7 +1225,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe s -> s.map(SalaryAcctResultPO::getOriginResultValue).orElse("")))); List salaryAcctResultReportPOS = new ArrayList<>(); param.getResultValueList().forEach(resultValue -> { - SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeePOMap.get(resultValue.getSalaryAcctEmpId()); + SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeePOMap.get(resultValue.getId()); salaryAcctResultPOS.addAll(SalaryAcctResultBO.batchEditConvert2PO(salaryAcctResultOldPOMap, resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID())); // 报表 salaryAcctResultReportPOS.addAll(SalaryAcctResultReportBO.lkszConvert2PO(resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID(), emps)); @@ -1198,9 +1234,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe // 删除原来的薪资核算结果 param.getResultValueList().stream().forEach(resultValue -> { List saveItemIds = resultValue.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList()); - deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getSalaryAcctEmpId()), saveItemIds); + deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getId()), saveItemIds); // 报表 - getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getSalaryAcctEmpId()), saveItemIds); + getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getId()), saveItemIds); }); // 保存薪资核算结果 diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index 45de6654d..027678e1d 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -159,7 +159,7 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::backCalculate, param.getSalaryAcctRecordId()); } - // 结账 + // 结转 @GET @Path("/lkszJz") @Produces(MediaType.APPLICATION_JSON) @@ -457,13 +457,13 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::updateLockStatusByParam, param); } - //鲁控数字批量更新 + //批量更新 @POST - @Path("/acctresult/lkszBatchUpdate") + @Path("/acctresult/batchUpdate") @Produces(MediaType.APPLICATION_JSON) - public String lkszBatchUpdate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchUpdateParam param) { + public String batchUpdate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchUpdateParam param) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::lkszBatchUpdate, param); + return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::batchUpdate, param); } //鲁控数字批量编辑 diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 5cd43cecb..9bf20496d 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -260,7 +260,7 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord } /** - * 鲁控数字-结账 + * 鲁控数字-结转 * @param salaryAcctRecordId */ public void lkszJz(Long salaryAcctRecordId) { diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index 59bbd3093..2bf31ef9c 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -258,11 +258,11 @@ public class SalaryAcctResultWrapper extends Service { } /** - * 鲁控数字薪资核算结果批量更新 + * 薪资核算结果批量更新 * @param param */ - public void lkszBatchUpdate(SalaryAcctResultBatchUpdateParam param) { - getSalaryAcctResultService(user).lkszBatchUpdate(param); + public void batchUpdate(SalaryAcctResultBatchUpdateParam param) { + getSalaryAcctResultService(user).batchUpdate(param); } /** From 1287a97fe5a6f8eaed47559b222067cf0c6f965b Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 7 Dec 2023 09:41:46 +0800 Subject: [PATCH 07/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=8B=E8=BD=BD=E3=80=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=81=E5=9F=BA=E6=95=B0=E8=B0=83=E6=95=B4=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 11 +- .../mapper/siarchives/FundSchemeMapper.xml | 6 + .../InsuranceBaseAdjustHistoryMapper.xml | 20 +- .../mapper/siarchives/OtherSchemeMapper.xml | 18 +- .../mapper/siarchives/SocialSchemeMapper.xml | 6 + .../service/impl/SIArchivesServiceImpl.java | 14 ++ .../service/impl/SIImportServiceImpl.java | 28 ++- .../service/impl/SISchemeServiceImpl.java | 187 ++++++++++++++---- 8 files changed, 234 insertions(+), 56 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index eb4980815..fbf526ca6 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -2198,6 +2198,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getSocialSchemeId()) .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2207,6 +2208,7 @@ public class SIArchivesBiz { InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); @@ -2228,6 +2230,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getFundSchemeId()) .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2237,6 +2240,7 @@ public class SIArchivesBiz { InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!")); @@ -2257,6 +2261,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getOtherSchemeId()) .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2266,6 +2271,7 @@ public class SIArchivesBiz { InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!")); @@ -2279,10 +2285,7 @@ public class SIArchivesBiz { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); - //判断是否要区分个人和单位福利基数 - User user = new User(Math.toIntExact(creator)); - SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); - boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + boolean welBaseDiffSign = isDiffWelBase(); List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index 56731a58b..afdde68a1 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -137,6 +137,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -156,6 +157,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -177,6 +179,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -195,6 +198,7 @@ #{item.fundEndTime,jdbcType=VARCHAR}, #{item.fundStartTime,jdbcType=VARCHAR}, #{item.fundPaymentBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, #{item.supplementFundAccount,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -217,6 +221,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -235,6 +240,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml index da02c83b5..0752177a1 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml @@ -12,6 +12,7 @@ + @@ -33,6 +34,7 @@ , t.adjust_before_base_value , t.adjust_after_base_value , t.adjust_welfare_item_id + , t.payment_scope , t.operator , t.operate_time , t.create_time @@ -48,7 +50,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( @@ -67,7 +69,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -77,7 +80,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) select #{item.id,jdbcType=DOUBLE}, @@ -95,7 +98,8 @@ #{item.creator,jdbcType=DOUBLE}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} from dual @@ -106,7 +110,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( #{item.id}, @@ -124,7 +128,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -148,6 +153,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -180,6 +186,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -216,6 +223,7 @@ , eo.lastname as operatorName , ee.username as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrsa_external_employee ee on ee.id = t.employee_id diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index de0febe4f..2d67257b4 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -131,7 +131,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( @@ -148,7 +149,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -167,7 +169,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) select #{item.otherSchemeId,jdbcType=DOUBLE}, @@ -183,7 +186,8 @@ #{item.nonPayment,jdbcType=INTEGER}, #{item.creator,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE}, - #{item.otherPaymentBaseString,jdbcType=VARCHAR} + #{item.otherPaymentBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -203,7 +207,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{item.otherSchemeId}, @@ -219,7 +224,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index c27048d10..79562932f 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -130,6 +130,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -148,6 +149,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -168,6 +170,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -185,6 +188,7 @@ #{item.welfareType,jdbcType=INTEGER}, #{item.deleteType,jdbcType=INTEGER}, #{item.socialPaymentBaseString,jdbcType=VARCHAR}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialSchemeId,jdbcType=DOUBLE}, #{item.createTime,jdbcType=DATE}, #{item.socialEndTime,jdbcType=VARCHAR}, @@ -206,6 +210,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -223,6 +228,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 11299554e..8738c66f9 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -20,6 +20,7 @@ import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.NonPaymentEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -1158,6 +1159,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService public PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) { List adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + adjustHistoryDTOS.forEach(f -> { + if (StringUtils.isNotBlank(f.getPaymentScope())) { + if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人")); + } else if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "公司")); + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + }); PageInfo listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class); diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 8fc7eccdb..c8b41704c 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -27,6 +27,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; @@ -184,7 +185,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { //工作簿数据 - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName,excelComments); } @@ -194,6 +195,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public List buildHeader() { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List result = new ArrayList<>(); result.add(SalaryI18nUtil.getI18nLabel( 85429, "姓名")); result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); @@ -206,7 +208,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91325, "社保缴纳组织")); //社保福利基数 Map socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY); - socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91324, "社保账号")); result.add(SalaryI18nUtil.getI18nLabel( 91319, "社保起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91320, "社保最后缴纳月")); @@ -215,7 +223,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { result.add(SalaryI18nUtil.getI18nLabel( 91486, "公积金账号")); //公积金福利基数 Map fundMap = welfareNameIdMap( WelfareTypeEnum.ACCUMULATION_FUND); - fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91487, "补充公积金账号")); result.add(SalaryI18nUtil.getI18nLabel( 91483, "公积金起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91484, "公积金最后缴纳月")); @@ -223,7 +237,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91497, "其他福利缴纳组织")); //其他福利基数 Map otherMap = welfareNameIdMap( WelfareTypeEnum.OTHER); - otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91490, "其他福利起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91494, "其他福利最后缴纳月")); return result; diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index d49f971e2..295fd5615 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1084,16 +1084,40 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } /**************校验申报基数**************/ - for (Map.Entry entry : welfareMap.entrySet()) { - String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "申报基数"); - String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); - if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字")); - excelComments.add(errorMessageMap); - isError = true; + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + if (welBaseDiffSign) { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"); + String keyComName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"); + String numberPerValue = findElement(singleAccount, keyPerName).get(keyPerName) == null ? "" : findElement(singleAccount, keyPerName).get(keyPerName).toString(); + String numberComValue = findElement(singleAccount, keyComName).get(keyComName) == null ? "" : findElement(singleAccount, keyComName).get(keyComName).toString(); + + if (!"".equals(numberPerValue) && !NumberUtils.isParsable(numberPerValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyPerName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + if (!"".equals(numberComValue) && !NumberUtils.isParsable(numberComValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyComName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + } + } else { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数"); + String numberValue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); + if (!"".equals(numberValue) && !NumberUtils.isParsable(numberValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } } } + //生成福利档案基础信息数据 InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp()); if (!isError) { @@ -1108,17 +1132,25 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - if (socialCheckBase && fundCheckBase && otherCheckBase) { + Boolean socialCheckComBase = true; + Boolean fundCheckComBase = true; + Boolean otherCheckComBase = true; + if (welBaseDiffSign) { + socialCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + } + if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } else { String checkMessage = "该条数据中"; - if (!socialCheckBase) { + if (!socialCheckBase || !socialCheckComBase) { checkMessage = checkMessage + "社保福利基数、"; } - if (!fundCheckBase) { + if (!fundCheckBase || !fundCheckComBase) { checkMessage = checkMessage + "公积金福利基数、"; } - if (!otherCheckBase) { + if (!otherCheckBase || !otherCheckComBase) { checkMessage = checkMessage + "其他福利基数、"; } checkMessage = checkMessage.substring(0, checkMessage.length() - 1); @@ -1162,12 +1194,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); Long socialSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))); HashMap oldSocialBaseMap = new HashMap<>(); + HashMap oldSocialComBaseMap = new HashMap<>(); if (oldSocialSchemeInfos.size() > 0) { oldSocialSchemePO = oldSocialSchemeInfos.get(0); encryptUtil.decrypt(oldSocialSchemePO, InsuranceArchivesSocialSchemePO.class); BeanUtils.copyProperties(oldSocialSchemePO, insuranceArchivesSocialSchemePO); //社保基数 oldSocialBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + oldSocialComBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesSocialSchemePO.setId(IdGenerator.generate()); @@ -1202,21 +1236,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); HashMap socialPaymentBase = new HashMap<>(); + HashMap socialPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialComBaseMap != null && StringUtils.isNotBlank(oldSocialComBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentComBase.put(String.valueOf(insuranceId), oldSocialComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } } } + } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); } @@ -1243,12 +1304,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String supplementFundAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); Long fundSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))); HashMap oldFundBaseMap = new HashMap<>(); + HashMap oldFundComBaseMap = new HashMap<>(); if (oldFundSchemeInfos.size() > 0) { oldFundSchemePO = oldFundSchemeInfos.get(0); encryptUtil.decrypt(oldFundSchemePO, InsuranceArchivesFundSchemePO.class); BeanUtils.copyProperties(oldFundSchemePO, insuranceArchivesFundSchemePO); //社保基数 oldFundBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + oldFundComBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesFundSchemePO.setId(IdGenerator.generate()); @@ -1286,24 +1349,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap fundPaymentBase = new HashMap<>(); + HashMap fundPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundComBaseMap != null && StringUtils.isNotBlank(oldFundComBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentComBase.put(String.valueOf(insuranceId), oldFundComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBase)); } return insuranceArchivesFundSchemePO; } @@ -1325,12 +1413,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //设置其他福利方案、起始缴纳月、最后缴纳月 Long otherSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))); HashMap oldOtherBaseMap = new HashMap<>(); + HashMap oldOtherComBaseMap = new HashMap<>(); if (oldOtherSchemeInfos.size() > 0) { oldOtherSchemePO = oldOtherSchemeInfos.get(0); encryptUtil.decrypt(oldOtherSchemePO, InsuranceArchivesOtherSchemePO.class); BeanUtils.copyProperties(oldOtherSchemePO, insuranceArchivesOtherSchemePO); //社保基数 oldOtherBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + oldOtherComBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesOtherSchemePO.setId(IdGenerator.generate()); @@ -1361,24 +1451,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO.setEmployeeId(employeeId); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap otherPaymentBase = new HashMap<>(); + HashMap otherPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherComBaseMap != null && StringUtils.isNotBlank(oldOtherComBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentComBase.put(String.valueOf(insuranceId), oldOtherComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBase)); } return insuranceArchivesOtherSchemePO; } From bb1b785f55e432d08fe5014c2ee7ff54d3067a2c Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 7 Dec 2023 11:06:19 +0800 Subject: [PATCH 08/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 35 +-- .../service/impl/SISchemeServiceImpl.java | 259 ++++++++++++++---- 2 files changed, 212 insertions(+), 82 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index fbf526ca6..32186cbbb 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1520,26 +1520,22 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); -// socialSet.forEach(item -> { -// if (socialCollect.containsKey(Long.valueOf(item))) { -// socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); + if (welBaseDiffSign) { socialSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); socialComSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { socialSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } @@ -1550,26 +1546,21 @@ public class SIArchivesBiz { Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); -// fundSet.forEach(item -> { -// if (fundCollect.containsKey(Long.valueOf(item))) { -// fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); if (welBaseDiffSign) { fundSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); fundComSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { fundSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } @@ -1580,26 +1571,22 @@ public class SIArchivesBiz { Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); -// otherSet.forEach(item -> { -// if (otherCollect.containsKey(Long.valueOf(item))) { -// otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); + if (welBaseDiffSign) { otherSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); otherComSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { otherSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 295fd5615..5b2552ef9 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -51,6 +51,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; @@ -261,6 +262,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public List> buildTableData(List insuranceArchivesEmployeePOS) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> records = new ArrayList<>(); List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -286,9 +288,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map fundSchemePOMap = SalaryEntityUtil.convert2Map(fundList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); Map otherSchemePOMap = SalaryEntityUtil.convert2Map(otherList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); -// Map socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); -// Map fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); -// Map otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); @@ -307,15 +306,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("socialName", getSiSchemeService().querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -326,15 +347,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -345,15 +388,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("otherName", getSiSchemeService().querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -422,11 +487,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } //工作簿数据 - List> rows = new LinkedList<>(); - List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); + List> rows = new LinkedList<>(); + List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); rows.add(collect); for (Map recordData : records) { - List row = new LinkedList<>(); + List row = new LinkedList<>(); for (WeaTableColumn column : columns) { try { Object o = recordData.get(column.getColumn()); @@ -437,20 +502,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } rows.add(row); } -// return salaryBatchService.simpleExportExcel(ExportExcelInfo.builder() -// .bizId(exportMap.get("biz")) -// .flag(true) -// .userId(employeeId) -// .eteamsId(eteamsId) -// .tenantKey(tenantKey) -// .operator(operator) -// .module(exportMap.get("module")) -// .fileName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 94629, "社保福利档案") + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now())) -// .handlerName("insuranceArchivesExportHandler") -// .dataType(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99915, "档案")) -// .function(exportMap.get("function")).build(), sheetList); //获取excel - return ExcelUtil.genWorkbook(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -532,10 +585,17 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + Map> result = new HashMap<>(); Set socialSet = new HashSet<>(); Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); @@ -571,6 +631,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } if (fundItem != null) { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { @@ -578,6 +646,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } if (otherItem != null) { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { @@ -585,42 +661,92 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() @@ -635,6 +761,23 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); From 1c5249c76e1bf3aac4f4ed3096863eda22aa819c Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 8 Dec 2023 11:16:18 +0800 Subject: [PATCH 09/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E3=80=81=E6=98=8E=E7=BB=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=8B=86=E5=88=86=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E5=9F=BA=E6=95=B0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 80 +++++- .../bo/InsuranceComparisonResultBO.java | 81 +++++- .../siaccount/po/ExcelInsuranceDetailPO.java | 18 ++ .../po/InsuranceAccountDetailTempPO.java | 18 ++ .../InsuranceAccountDetailMapper.xml | 36 ++- .../siaccount/SIAccountDetailTempMapper.xml | 30 ++- .../service/impl/ColumnBuildServiceImpl.java | 127 +++++++-- .../service/impl/RecordsBuildServiceImpl.java | 129 ++++++++- .../impl/SIAComparisonResultServiceImpl.java | 8 +- .../service/impl/SIAccountServiceImpl.java | 54 +++- .../service/impl/SIExportServiceImpl.java | 250 +++++++++++++++--- .../service/impl/SIRecessionServiceImpl.java | 3 + .../salary/web/SIAccountController.java | 4 +- 13 files changed, 730 insertions(+), 108 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 34b6aae17..c6df56a19 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -631,11 +631,13 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -719,7 +721,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -742,10 +750,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -787,6 +796,7 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -794,6 +804,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -876,7 +887,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -899,10 +916,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -945,12 +963,14 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1036,7 +1056,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1059,10 +1085,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1510,7 +1537,6 @@ public class SIAccountBiz extends Service { } else { accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); } - } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { @@ -1532,11 +1558,13 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -1611,7 +1639,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1626,10 +1660,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1671,6 +1706,7 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -1678,6 +1714,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -1751,7 +1788,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1766,10 +1809,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1812,12 +1856,14 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1896,7 +1942,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1911,10 +1963,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1964,6 +2017,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 6a85ddd20..79909c1e2 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -41,7 +41,7 @@ public class InsuranceComparisonResultBO { * 构建福利核算结果列表的表头(线下对比) * */ - public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet) { + public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, boolean welBaseDiffSign) { List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); @@ -67,21 +67,63 @@ public class InsuranceComparisonResultBO { columns.add(new Column("社保账号", "socialAccount", "socialAccount")); columns.add(new Column("社保方案名称", "socialSchemeName", "socialSchemeName")); //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "socialPerBase", po.getId() + "socialPerBase")); + socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "socialComBase", po.getId() + "socialComBase")); + } + columns.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + } } +// for (ICategoryPO po : socialWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); +// } columns.add(new Column("公积金账号", "fundAccount", "fundAccount")); columns.add(new Column("公积金方案名称", "fundSchemeName", "fundSchemeName")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "fundPerBase", po.getId() + "fundPerBase")); + fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "fundComBase", po.getId() + "fundComBase")); + } + columns.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + } } +// for (ICategoryPO po : fundWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); +// } columns.add(new Column("补充公积金账号", "supplementFundAccount", "supplementFundAccount")); columns.add(new Column("其他福利方案名称", "otherSchemeName", "otherSchemeName")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "otherPerBase", po.getId() + "otherPerBase")); + otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "otherComBase", po.getId() + "otherComBase")); + } + columns.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + } } +// for (ICategoryPO po : otherWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); +// } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -127,7 +169,8 @@ public class InsuranceComparisonResultBO { * 构建福利核算线下对比结果 * */ - public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap) { + public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS + , Map schemeIdNameMap, boolean welBaseDiffSign) { Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); @@ -177,6 +220,28 @@ public class InsuranceComparisonResultBO { if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); } + if (welBaseDiffSign) { + //社保基数-个人,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1); + //公积金基数-个人,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2); + //其他福利基数-个人,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3); + + //社保基数-公司,socialPaymentComBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1); + //公积金基数-公司,fundPaymentComBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2); + //其他福利基数-公司,otherPaymentComBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3); + } else { + //社保基数,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); + //公积金基数,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); + //其他福利基数,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + } //社保基数,socialPaymentBaseString welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); //公积金基数,fundPaymentBaseString diff --git a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java index 4e7889544..9660b8602 100644 --- a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java @@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 50897c6b2..dc8c1c2c0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; /** * 公积金方案ID */ @@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 2e52ce986..925718b0b 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -18,10 +18,13 @@ + + + @@ -69,10 +72,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -117,10 +123,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -420,7 +429,8 @@ 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.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string + t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string, + t.social_payment_com_base_string, t.fund_payment_com_base_string, t.other_payment_com_base_string FROM hrsa_bill_detail t WHERE t.delete_type = 0 @@ -711,7 +721,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -757,7 +768,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -766,7 +780,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.employeeId,jdbcType=DOUBLE}, @@ -811,7 +826,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -821,7 +839,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -866,7 +885,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml index f99461416..19b6fb3e5 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml @@ -18,10 +18,13 @@ + + + @@ -68,10 +71,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -130,7 +136,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -175,7 +182,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -184,7 +194,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select @@ -229,7 +240,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -239,7 +253,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -283,7 +298,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index f15ae19f1..5312f1c51 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.core.impl.Service; @@ -31,6 +32,8 @@ import java.util.stream.Collectors; **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } @@ -122,58 +125,128 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap, Long employeeId, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if(fundJson!=null){ fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if(otherJson!=null){ otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase"); + } + }); + } + // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -188,6 +261,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 138eb8cf1..a18ca32e0 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIArchivesBiz; @@ -15,6 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; @@ -60,8 +62,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + @Override public List> buildCommonRecords(List list, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); if (CollectionUtils.isEmpty(list)) { return result; @@ -99,34 +104,130 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("socialAccount", item.getSocialAccount()); record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId())); - if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", (String) v); +// if(socialJson!=null){ +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("fundAccount", item.getFundAccount()); record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); - if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", (String) v); + if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) { + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if(fundJson!=null){ +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId())); - if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", (String) v); + if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) { + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if(otherJson!=null){ +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } if (StringUtils.isNotEmpty(item.getSocialPerJson())) { diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index 89f725a87..23587a874 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO; import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO; @@ -45,6 +46,8 @@ import java.util.stream.Collectors; public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService { private EncryptUtil encryptUtil = new EncryptUtil(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private InsuranceExportMapper getInsuranceExportMapper() { return MapperProxyFactory.getProxy(InsuranceExportMapper.class); } @@ -140,6 +143,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar */ private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -200,10 +204,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); //3-构建福利核算对比结果列表表头 - List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet); + List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, welBaseDiffSign); //4-通过线上线下两份数据获得对比结果 Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); - List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap); + List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, welBaseDiffSign); // 系统值和线下值一致的人员 if (queryParam.isOnlyDiffEmployee()) { diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 282a6f545..d9387e62c 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -65,6 +65,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -2221,7 +2222,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { - + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //查询线上福利核算记录 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); insuranceExportParam.setBillMonth(param.getBillMonth()); @@ -2279,20 +2280,57 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // "养老保险申报基数" // "医疗保险申报基数" // "工伤保险申报基数" - for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : socialWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + //组装社保基数 + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : fundWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : otherWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -2335,7 +2373,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { rows.add(headerList); String sheetName = "福利核算-线下对比导入模板"; - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } /** diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index 1c351dfac..ac3ec8488 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIAccountBiz; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; @@ -17,6 +19,7 @@ import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; import com.engine.salary.enums.sicategory.DataTypeEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.mapper.InsuranceExportMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; @@ -37,6 +40,7 @@ import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -66,6 +70,8 @@ public class SIExportServiceImpl extends Service implements SIExportService { private SIAccountBiz siAccountBiz = new SIAccountBiz(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private SISchemeService getSISchemeService(User user) { return ServiceUtil.getService(SISchemeServiceImpl.class, user); } @@ -242,11 +248,12 @@ public class SIExportServiceImpl extends Service implements SIExportService { } excelSheetData.addAll(rows); - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, total); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName, total); } @Override public List> buildCommonRecords(List list) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); List paymentList = getTaxAgentMapper().listAll(); @@ -272,10 +279,42 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("socialSchemeName", schemeIdNameMap.get(item.getSocialSchemeId())); if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", v); +// if (socialJson != null) { +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } @@ -284,22 +323,86 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("fundSchemeName", schemeIdNameMap.get(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", v); + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if (fundJson != null) { +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", paymentMap.get(item.getOtherPayOrg()) == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName()); record.put("otherSchemeName", schemeIdNameMap.get(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", v); + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if (otherJson != null) { +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } @@ -628,58 +731,127 @@ public class SIExportServiceImpl extends Service implements SIExportService { } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if (socialJson != null) { socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if (fundJson != null) { fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if (otherJson != null) { otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase"); + } + }); + } // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -694,6 +866,24 @@ public class SIExportServiceImpl extends Service implements SIExportService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java index e1cf27275..e9a446dac 100644 --- a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java @@ -197,6 +197,9 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic // temp.setExternalFlag(insuranceAccountDetailPO.getExternalFlag()); temp.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()); // temp.setPaymentAgency(insuranceAccountDetailPO.getPaymentAgency()); + temp.setSocialPaymentComBaseString(insuranceAccountDetailPO.getSocialPaymentComBaseString()); + temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString()); + temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString()); } private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) { //退差社保个人缴费 diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 75ad6975a..ab9a41c9c 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO; @@ -37,11 +38,9 @@ import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.time.LocalDate; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 福利核算控制器 @@ -50,6 +49,7 @@ import java.util.stream.Collectors; public class SIAccountController { public SIAccountService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIAccountServiceImpl.class, user); } From 9d0d7a00fcf99f89b98f6dd8e29862107d60cb2c Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 8 Dec 2023 18:06:54 +0800 Subject: [PATCH 10/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=88=97=E8=A1=A8=E3=80=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA=EF=BC=8C=E9=80=82=E9=85=8D=E6=8B=86?= =?UTF-8?q?=E5=88=86=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=92=8C=E5=85=AC=E5=8F=B8=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/InsuranceComparisonResultBO.java | 6 - .../param/ExcelInsuranceImportParam.java | 3 +- .../siaccount/ExcelInsuranceDetailMapper.xml | 24 +- .../impl/SIAComparisonResultServiceImpl.java | 46 +- .../service/impl/SIAccountServiceImpl.java | 557 ++++++++++++++---- 5 files changed, 479 insertions(+), 157 deletions(-) diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 79909c1e2..c6e6b40a3 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -242,12 +242,6 @@ public class InsuranceComparisonResultBO { //其他福利基数,otherPaymentBaseString welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); } - //社保基数,socialPaymentBaseString - welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); - //公积金基数,fundPaymentBaseString - welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); - //其他福利基数,otherPaymentBaseString - welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); //社保个人socialPerJson welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1); //公积金个人fundPerJson diff --git a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java index 17b926b08..7a9090845 100644 --- a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java +++ b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java @@ -25,5 +25,6 @@ public class ExcelInsuranceImportParam { /** * 账单月份 */ - private String billMonth; + private String billMonth; + private String paymentOrganization; } diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index d45fdec16..15ac635ce 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -157,7 +157,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -204,7 +205,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -213,7 +217,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.id,jdbcType=DOUBLE}, @@ -259,7 +264,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -269,7 +277,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.id}, @@ -315,7 +324,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index 23587a874..389e4ef2b 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -25,6 +25,7 @@ import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -134,7 +135,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar String sheetName = "线下对比结果"; - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -231,7 +232,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar } private Set welfareInfo() { - + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set info = new HashSet<>(); List listAll = getICategoryMapper().listAll(); @@ -239,18 +240,37 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); - //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - info.add(po.getId() + "socialBase"); - } - //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - info.add(po.getId() + "fundBase"); - } - //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - info.add(po.getId() + "otherBase"); + if (welBaseDiffSign) { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialPerBase"); + info.add(po.getId() + "socialComBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundPerBase"); + info.add(po.getId() + "fundComBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherPerBase"); + info.add(po.getId() + "otherComBase"); + } + } else { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherBase"); + } } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelfareList) { info.add(po.getId() + "socialPer"); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index d9387e62c..1385b84d7 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2222,6 +2222,78 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { + Map> welColumnMap = createWelColumnMap(param); + + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), + SalaryI18nUtil.getI18nLabel(86185, "部门"), + SalaryI18nUtil.getI18nLabel(86186, "手机号"), + SalaryI18nUtil.getI18nLabel(86317, "工号"), + SalaryI18nUtil.getI18nLabel(86187, "员工状态"), + SalaryI18nUtil.getI18nLabel(100377, "数据来源"), + SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")); + headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")); + //组装社保基数 + if (welColumnMap.get("socialBase") != null) { + headerList.addAll(welColumnMap.get("socialBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); + //组装公积金基数 + if (welColumnMap.get("fundBase") != null) { + headerList.addAll(welColumnMap.get("fundBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); + //组装其他福利基数 + if (welColumnMap.get("otherBase") != null) { + headerList.addAll(welColumnMap.get("otherBase")); + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + if (welColumnMap.get("socialPer") != null) { + headerList.addAll(welColumnMap.get("socialPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计")); + //住房公积金个人、补充住房公积金个人 + if (welColumnMap.get("fundPer") != null) { + headerList.addAll(welColumnMap.get("fundPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计")); + //其他个人(比如企业年金个人) + if (welColumnMap.get("otherPer") != null) { + headerList.addAll(welColumnMap.get("otherPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计")); + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + if (welColumnMap.get("socialCom") != null) { + headerList.addAll(welColumnMap.get("socialCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计")); + //住房公积金单位、补充住房公积金单位 + if (welColumnMap.get("fundCom") != null) { + headerList.addAll(welColumnMap.get("fundCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计")); + //其他单位(比如企业年金单位) + if (welColumnMap.get("otherCom") != null) { + headerList.addAll(welColumnMap.get("otherCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计")); + + List> rows = new ArrayList<>(); + rows.add(headerList); + String sheetName = "福利核算-线下对比导入模板"; + + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + } + + public Map> createWelColumnMap(InsuranceAccountDetailParam param) { boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //查询线上福利核算记录 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); @@ -2266,114 +2338,238 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), - SalaryI18nUtil.getI18nLabel(86185, "部门"), - SalaryI18nUtil.getI18nLabel(86186, "手机号"), - SalaryI18nUtil.getI18nLabel(86317, "工号"), - SalaryI18nUtil.getI18nLabel(86187, "员工状态"), - SalaryI18nUtil.getI18nLabel(100377, "数据来源"), - SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")); - headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")); -// "失业保险申报基数" -// "生育保险申报基数" -// "养老保险申报基数" -// "医疗保险申报基数" -// "工伤保险申报基数" -// for (ICategoryPO po : socialWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } //组装社保基数 + List socialBaseColumns = new ArrayList<>(); + List socialPerBaseColumns = new ArrayList<>(); + List socialComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List socialComColumns = Lists.newArrayList(); for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - socialComColumns.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,"单位")); } - headerList.addAll(socialComColumns); + socialBaseColumns.addAll(socialPerBaseColumns); + socialBaseColumns.addAll(socialComBaseColumns); } else { for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + socialBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } - headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); + //组装公积金基数 -// for (ICategoryPO po : fundWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } + List fundBaseColumns = new ArrayList<>(); + List fundPerBaseColumns = Lists.newArrayList(); + List fundComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List fundComColumns = Lists.newArrayList(); for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - fundComColumns.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,"单位")); } - headerList.addAll(fundComColumns); + fundBaseColumns.addAll(fundPerBaseColumns); + fundBaseColumns.addAll(fundComBaseColumns); } else { for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + fundBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } - headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); + //组装其他福利基数 -// for (ICategoryPO po : otherWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } + List otherBaseColumns = new ArrayList<>(); + List otherPerBaseColumns = new ArrayList<>(); + List otherComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List otherComColumns = Lists.newArrayList(); for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - otherComColumns.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,"单位")); } - headerList.addAll(otherComColumns); + otherBaseColumns.addAll(otherPerBaseColumns); + otherBaseColumns.addAll(otherComBaseColumns); } else { for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + otherBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } + + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + List socialPerColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelPerList) { + socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //住房公积金个人、补充住房公积金个人 + List fundPerColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelPerList) { + fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //其他个人(比如企业年金个人) + List otherPerColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelPerList) { + otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + List socialComColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelComList) { + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + //住房公积金单位、补充住房公积金单位 + List fundComColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelComList) { + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + //其他单位(比如企业年金单位) + List otherComColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelComList) { + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + Map> welColumnMap = new HashMap<>(); + welColumnMap.put("socialPerBase", socialPerBaseColumns); + welColumnMap.put("fundPerBase", fundPerBaseColumns); + welColumnMap.put("otherPerBase", otherPerBaseColumns); + welColumnMap.put("socialComBase", socialComBaseColumns); + welColumnMap.put("fundComBase", fundComBaseColumns); + welColumnMap.put("otherComBase", otherComBaseColumns); + welColumnMap.put("socialBase", socialBaseColumns); + welColumnMap.put("fundBase", fundBaseColumns); + welColumnMap.put("otherBase", otherBaseColumns); + welColumnMap.put("socialPer", socialPerColumns); + welColumnMap.put("fundPer", fundPerColumns); + welColumnMap.put("otherPer", otherPerColumns); + welColumnMap.put("socialCom", socialComColumns); + welColumnMap.put("fundCom", fundComColumns); + welColumnMap.put("otherCom", otherComColumns); + return welColumnMap; + } + + public Map welColumnNameCodeMap(InsuranceAccountDetailParam param) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + //查询线上福利核算记录 + InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); + insuranceExportParam.setBillMonth(param.getBillMonth()); + insuranceExportParam.setPaymentOrganization(param.getPaymentOrganization()); + List accountExportPOS = getInsuranceExportMapper().exportAccount(param.getPaymentStatus(), insuranceExportParam); + + //整理线上核算记录相关的福利方案,并以此整理需要对比的福利项类别数据 + Set welfareSchemeIds = new HashSet<>(); + accountExportPOS.forEach(f -> { + welfareSchemeIds.add(f.getSocialSchemeId()); + welfareSchemeIds.add(f.getFundSchemeId()); + welfareSchemeIds.add(f.getOtherSchemeId()); + }); + List insuranceSchemeDetailPos = getInsuranceSchemeDetailMapper().listAll(); + List insuranceBaseIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insurancePerPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 2) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insuranceComPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + Set insuranceBaseSet = new HashSet<>(insuranceBaseIds); + Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); + Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); + + List listAll = getICategoryMapper().listAll(); + List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelComList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + + //组装社保基数 + Map result = new HashMap<>(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + 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"); + } + } else { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialBase"); + } + } + + //组装公积金基数 + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + 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"); + } + } else { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundBase"); + } + } + + //组装其他福利基数 + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + 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"); + } + } else { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherBase"); + } + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计")); //住房公积金个人、补充住房公积金个人 for (ICategoryPO po : fundWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计")); //其他个人(比如企业年金个人) for (ICategoryPO po : otherWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计")); //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) for (ICategoryPO po : socialWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计")); //住房公积金单位、补充住房公积金单位 for (ICategoryPO po : fundWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计")); + //其他单位(比如企业年金单位) for (ICategoryPO po : otherWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计")); - List> rows = new ArrayList<>(); - rows.add(headerList); - String sheetName = "福利核算-线下对比导入模板"; - - return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + return result; } /** @@ -2424,6 +2620,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } String billMonth = importParam.getBillMonth(); + + Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(importParam.getPaymentOrganization()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); //存储待更新的InsuranceAccountDetailPO数据 List addCompareList = new ArrayList<>(); //记录待删除hrsa_excel_bill_detail.id @@ -2518,7 +2720,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { idList.addAll(ids); } //拼装待更新数据 - addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map)); + addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map, welColumnNameCodeMap)); } @@ -2557,7 +2759,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { * @param billMonth 对比的账单月份 * @param baseMap excel导入的对比数据 */ - private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap) { + private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap, Map welColumnNameCodeMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO(); excelInsuranceDetailPO.setId(IdGenerator.generate()); @@ -2573,6 +2776,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundPaymentBaseMap = new HashMap<>(); Map otherPaymentBaseMap = new HashMap<>(); + Map socialPaymentComBaseMap = new HashMap<>(); + Map fundPaymentComBaseMap = new HashMap<>(); + Map otherPaymentComBaseMap = new HashMap<>(); + //筛选出福利核算项 Map toDealMap = baseMap.entrySet().stream() @@ -2586,73 +2793,157 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for(Map.Entry entry : toDealMap.entrySet()) { - //判断元素是否属于福利类 - String keyName = entry.getKey(); - //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” - String payScope = keyName.substring(keyName.length() - 2); - //获取福利类型 - Integer welfareType; - //根据元素名后缀,区分截取内容 - String targetWelfareName; - if ("基数".equals(payScope)) { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); - } else { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); - } - List categoryPOList = siCategoryBiz.listByName(targetWelfareName); - if (categoryPOList.size() == 1) { - ICategoryPO iCategoryPO = categoryPOList.get(0); - welfareType = iCategoryPO.getWelfareType(); +// //判断元素是否属于福利类 +// String keyName = entry.getKey(); +// //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” +// String payScope = keyName.substring(keyName.length() - 2); +// //获取福利类型 +// Integer welfareType; +// //根据元素名后缀,区分截取内容 +// String targetWelfareName; +// if ("基数".equals(payScope)) { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); +// } else { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); +// } +// List categoryPOList = siCategoryBiz.listByName(targetWelfareName); +// if (categoryPOList.size() == 1) { +// ICategoryPO iCategoryPO = categoryPOList.get(0); +// welfareType = iCategoryPO.getWelfareType(); +// +// switch (payScope) { +// case "个人": +// switch (welfareType) { +// case 1: +// socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// case "单位": +// switch (welfareType) { +// case 1: +// socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// case "基数": +// switch (welfareType) { +// case 1: +// socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// } +// } - switch (payScope) { - case "个人": - switch (welfareType) { - case 1: - socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; - case "单位": - switch (welfareType) { - case 1: - socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; - case "基数": - switch (welfareType) { - case 1: - socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; + if (welColumnNameCodeMap.get(entry.getKey()) != null) { + String code = welColumnNameCodeMap.get(entry.getKey()); + if (welBaseDiffSign) { + if (code.contains("socialPerBase")) { + code = code.replace("socialPerBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("socialComBase")) { + code = code.replace("socialComBase", ""); + socialPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPerBase")) { + code = code.replace("fundPerBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundComBase")) { + code = code.replace("fundComBase", ""); + fundPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPerBase")) { + code = code.replace("otherPerBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherComBase")) { + code = code.replace("otherComBase", ""); + otherPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + } else { + if (code.contains("socialBase")) { + code = code.replace("socialBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundBase")) { + code = code.replace("fundBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherBase")) { + code = code.replace("otherBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + } + + + if (code.contains("socialPer") && !code.contains("socialPerBase")) { + code = code.replace("socialPer", ""); + socialPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPer") && !code.contains("fundPerBase")) { + code = code.replace("fundPer", ""); + fundPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPer") && !code.contains("otherPerBase")) { + code = code.replace("otherPer", ""); + otherPerMap.put(code, entry.getValue().toString()); + continue; + } + + if (code.contains("socialCom") && !code.contains("socialComBase")) { + code = code.replace("socialCom", ""); + socialComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundCom") && !code.contains("fundComBase")) { + code = code.replace("fundCom", ""); + fundComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherCom") && !code.contains("otherComBase")) { + code = code.replace("otherCom", ""); + otherComMap.put(code, entry.getValue().toString()); + continue; } } - } //设置社保个人和公司缴纳明细 @@ -2669,6 +2960,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap)); excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap)); + excelInsuranceDetailPO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBaseMap)); + excelInsuranceDetailPO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBaseMap)); + excelInsuranceDetailPO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBaseMap)); + //组装新的insuranceAccountDetailPO对象数据 excelInsuranceDetailPO.setEmployeeId(employeeId); excelInsuranceDetailPO.setBillMonth(billMonth); From d6705e89177195c20886b7aa6c416517c301682c Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 11 Dec 2023 13:09:20 +0800 Subject: [PATCH 11/28] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/bo/SalaryAcctResultReportBO.java | 40 -------- .../salaryacct/bo/SalaryAcctRecordBO.java | 3 - .../param/SalaryAcctResultBatchEditParam.java | 40 -------- .../SalaryAcctResultBatchUpdateParam.java | 2 +- .../service/SalaryAcctRecordService.java | 6 -- .../service/SalaryAcctReportService.java | 2 - .../service/SalaryAcctResultService.java | 6 -- .../impl/SalaryAcctRecordServiceImpl.java | 83 ---------------- .../impl/SalaryAcctReportServiceImpl.java | 13 --- .../impl/SalaryAcctResultServiceImpl.java | 97 ------------------- .../salary/web/SalaryAcctController.java | 17 ---- .../wrapper/SalaryAcctRecordWrapper.java | 8 -- .../wrapper/SalaryAcctResultWrapper.java | 9 -- 13 files changed, 1 insertion(+), 325 deletions(-) delete mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java diff --git a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java index 485389860..06cb10a8a 100644 --- a/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java +++ b/src/com/engine/salary/entity/report/bo/SalaryAcctResultReportBO.java @@ -8,7 +8,6 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultTempPO; import dm.jdbc.util.IdGenerator; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.math.NumberUtils; import java.util.*; @@ -63,45 +62,6 @@ public class SalaryAcctResultReportBO { .collect(Collectors.toList()); } - public static List lkszConvert2PO(List items, - SalaryAcctEmployeePO salaryAcctEmployee, - Long employeeId, Map emps) { - if (CollectionUtils.isEmpty(items) || ObjectUtils.isEmpty(salaryAcctEmployee)) { - return Collections.emptyList(); - } - Date now = new Date(); - return items.stream() - .map(e -> { - SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() - .id(IdGenerator.generate()) - .salarySobId(salaryAcctEmployee.getSalarySobId()) - .salaryItemId(e.getSalaryItemId()) - .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) - .salaryAcctEmpId(salaryAcctEmployee.getId().toString()) - .employeeId(salaryAcctEmployee.getEmployeeId().toString()) - .taxAgentId(salaryAcctEmployee.getTaxAgentId()) - .resultValue(e.getResultValue()) - .creator(employeeId) - .createTime(now) - .updateTime(now) - .deleteType(NumberUtils.INTEGER_ZERO) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); - - DataCollectionEmployee dataCollectionEmployee = emps.get(salaryAcctEmployee.getEmployeeId()); - if (dataCollectionEmployee != null) { - po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); - po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); - po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); - po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); - po.setLocationId(dataCollectionEmployee.getLocationId()); - } - return po; - }) - .collect(Collectors.toList()); - } - - public static List convert2ReportPO(Collection temps, Map emps) { // Map longDataCollectionEmployeeMap = SalaryEntityUtil.convert2Map(emps, DataCollectionEmployee::getEmployeeId); if (CollectionUtils.isEmpty(temps)) { diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java index dbf3b552e..53eb473b6 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -70,16 +70,13 @@ public class SalaryAcctRecordBO { btnList.add(new WeaTableOperate("删除", null, "1")); } btnList.add(new WeaTableOperate("归档", null, "2")); - btnList.add(new WeaTableOperate("结转", null, "6")); } else if (SalaryAcctRecordStatusEnum.ARCHIVED == salaryAcctRecordStatusEnum && ( salarySendMap.get(salaryAcctRecordPO.getId()) ==Boolean.TRUE ) ){ btnList.add(new WeaTableOperate("查看", null, "3")); btnList.add(new WeaTableOperate("重新核算", null, "4")); btnList.add(new WeaTableOperate("回算", null, "5")); - btnList.add(new WeaTableOperate("结转", null, "6")); } else { btnList.add(new WeaTableOperate("查看", null, "3")); btnList.add(new WeaTableOperate("重新核算", null, "4")); - btnList.add(new WeaTableOperate("结转", null, "6")); } return SalaryAcctRecordListDTO.builder() .id(salaryAcctRecordPO.getId()) diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java deleted file mode 100644 index 487527d51..000000000 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchEditParam.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.engine.salary.entity.salaryacct.param; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * @ClassName SalaryAcctResultBatchUpdateParam - * @author Harryxzy - * @date 2023/12/4 13:48 - * @description 鲁控数字批量编辑参数 - */ -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class SalaryAcctResultBatchEditParam { - - private Long salaryAcctRecordId; - - private List resultValueList; - - - @Data - @Builder - @AllArgsConstructor - @NoArgsConstructor - public static class resultValue { - - // 薪资核算人员id - private Long id; - - // 薪资项目值 - private List items; - } - -} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java index 141b3a004..89c06ad5e 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultBatchUpdateParam.java @@ -12,7 +12,7 @@ import java.util.List; * @ClassName SalaryAcctResultBatchUpdateParam * @author Harryxzy * @date 2023/12/4 13:48 - * @description 鲁控数字批量更新参数 + * @description 批量更新参数 */ @Data @Builder diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index 9c3ba4f8c..1ba3419bf 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -207,10 +207,4 @@ public interface SalaryAcctRecordService { List listSome(SalaryAcctRecordPO po); - - /** - * 鲁控数字-结转 - * @param salaryAcctRecordId - */ - void lkszJz(Long salaryAcctRecordId); } diff --git a/src/com/engine/salary/service/SalaryAcctReportService.java b/src/com/engine/salary/service/SalaryAcctReportService.java index 6cf5caa12..c4c1636db 100644 --- a/src/com/engine/salary/service/SalaryAcctReportService.java +++ b/src/com/engine/salary/service/SalaryAcctReportService.java @@ -21,8 +21,6 @@ public interface SalaryAcctReportService { */ void batchSave(Collection pos); - void lkszBatchSave(Collection pos); - /** * 根据核算记录删除 * @param salaryAcctRecordIds diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index ec8efb878..0090f8330 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -210,10 +210,4 @@ public interface SalaryAcctResultService { * @param param */ void batchUpdate(SalaryAcctResultBatchUpdateParam param); - - /** - * 鲁控数字薪资核算结果批量编辑 - * @param param - */ - void lkszBatchEdit(SalaryAcctResultBatchEditParam param); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index ee596af21..d6924e489 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -825,87 +825,4 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe public List listSome(SalaryAcctRecordPO po) { return getSalaryAcctRecordMapper().listSome(po); } - - @Override - public void lkszJz(Long salaryAcctRecordId) { - SalaryAcctRecordPO salaryAcctRecordPO = getById(salaryAcctRecordId); - if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { - throw new SalaryRunTimeException("薪资核算记录不存在或已被删除"); - } - YearMonth salaryMonth = SalaryDateUtil.toYearMonth(SalaryDateUtil.dateToLocalDate(salaryAcctRecordPO.getSalaryMonth()).plusMonths(1)); - // 创建下一个月的薪资核算记录 - Long newSalaryAcctRecordId = save(SalaryAcctRecordSaveParam.builder().salarySobId(salaryAcctRecordPO.getSalarySobId()).salaryMonth(salaryMonth).build()); - // 查询下个月的薪资核算人员 - List salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(newSalaryAcctRecordId); - List acctEmpIds = salaryAcctEmployeePOList.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList()); - // 获取原来的薪资核算结果 - List salarySobItemPOS = getSalarySobItemService(user).listBySalarySobId(salaryAcctRecordPO.getSalarySobId()); - List salarySobItemIds = salarySobItemPOS.stream().map(SalarySobItemPO::getSalaryItemId).collect(Collectors.toList()); - List resultPOS = getSalaryAcctResultService(user).listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(salaryAcctRecordId), salarySobItemIds); - // 过滤掉新的核算记录中不存在的人 - resultPOS = resultPOS.stream().filter(result -> acctEmpIds.contains(result.getEmployeeId())).collect(Collectors.toList()); - Map> resultMap = SalaryEntityUtil.group2Map(resultPOS, SalaryAcctResultPO::getEmployeeId); - // 查询人员信息,供报表使用 - List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); - Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); - - // 需要保存的核算结果 - List needInsertResultList = new ArrayList<>(); - // 报表 - List needInsertResultReportList = new ArrayList<>(); - Date now = new Date(); - Long uid = Long.valueOf(user.getUID()); - salaryAcctEmployeePOList.stream().forEach(acctEmp -> { - List oldResultList = resultMap.get(acctEmp.getEmployeeId()); - oldResultList.stream().forEach(oldResult -> { - // 薪资核算结果 - needInsertResultList.add(SalaryAcctResultPO.builder() - .salarySobId(salaryAcctRecordPO.getSalarySobId()) - .salaryItemId(oldResult.getSalaryItemId()) - .salaryAcctRecordId(newSalaryAcctRecordId) - .salaryAcctEmpId(acctEmp.getId()) - .employeeId(acctEmp.getEmployeeId()) - .taxAgentId(acctEmp.getTaxAgentId()) - .resultValue(StringUtils.trim(oldResult.getResultValue())) - .originResultValue(oldResult.getOriginResultValue()) - .creator(uid) - .createTime(now) - .updateTime(now) - .deleteType(NumberUtils.INTEGER_ZERO) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build()); - - // 报表结果 - SalaryAcctResultReportPO po = SalaryAcctResultReportPO.builder() - .id(IdGenerator.generate()) - .salarySobId(salaryAcctRecordPO.getSalarySobId()) - .salaryItemId(oldResult.getSalaryItemId()) - .salaryAcctRecordId(newSalaryAcctRecordId) - .salaryAcctEmpId(acctEmp.getId().toString()) - .employeeId(acctEmp.getEmployeeId().toString()) - .taxAgentId(acctEmp.getTaxAgentId()) - .resultValue(StringUtils.trim(oldResult.getResultValue())) - .creator(uid) - .createTime(now) - .updateTime(now) - .deleteType(NumberUtils.INTEGER_ZERO) - .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) - .build(); - - DataCollectionEmployee dataCollectionEmployee = emps.get(acctEmp.getEmployeeId()); - if (dataCollectionEmployee != null) { - po.setDepartmentId(dataCollectionEmployee.getDepartmentId()); - po.setSubcompanyId(dataCollectionEmployee.getSubcompanyid()); - po.setCostcenterId(dataCollectionEmployee.getCostcenterId()); - po.setJobtitleId(dataCollectionEmployee.getJobtitleId()); - po.setLocationId(dataCollectionEmployee.getLocationId()); - } - needInsertResultReportList.add(po); - }); - }); - - // 入库 - getSalaryAcctResultService(user).batchSave(needInsertResultList); - getSalaryAcctReportService(user).lkszBatchSave(needInsertResultReportList); - } } diff --git a/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java index 43b7160a8..8371241fb 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctReportServiceImpl.java @@ -62,19 +62,6 @@ public class SalaryAcctReportServiceImpl extends Service implements SalaryAcctRe } } - @Override - public void lkszBatchSave(Collection pos) { - if (CollectionUtils.isNotEmpty(pos)) { - SalarySysConfPO disPlay = getSalarySysConfService(user).getOneByCode(DISPLAY_EMP_INFO_REPORT); - //默认不显示,关闭状态 - if (disPlay == null || OpenEnum.OFF.getValue().equals(disPlay.getConfValue())) { - pos = encryptUtil.encryptList(new ArrayList<>(pos), SalaryAcctResultReportPO.class); - } - List> partition = Lists.partition((List) pos, 100); - partition.forEach(getSalaryAcctResultReportMapper()::batchInsert); - } - } - @Override public void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds) { if (CollectionUtils.isNotEmpty(salaryAcctRecordIds)) { diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 34148f289..5369fea9e 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1196,101 +1196,4 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } - - @Override - public void lkszBatchEdit(SalaryAcctResultBatchEditParam param) { - List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); - Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); - - SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(param.getSalaryAcctRecordId()); - if (ObjectUtils.isEmpty(salaryAcctRecordPO)) { - throw new SalaryRunTimeException("薪资核算结果不存在或已被删除"); - } - - List salaryAcctEmployeePOList = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(param.getSalaryAcctRecordId()); - Map salaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeePOList, SalaryAcctEmployeePO::getId); - - // 需要更新数据的薪资核算人员id - List updateAcctEmpIds = param.getResultValueList().stream().map(SalaryAcctResultBatchEditParam.resultValue::getId).collect(Collectors.toList()); - // 查询原来的薪资核算结果 - List salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpIds(updateAcctEmpIds).build()); - // 解密 - encryptUtil.decryptList(salaryAcctResultPOSOld, SalaryAcctResultPO.class); - // 保存参数转换成薪资核算结果po - List salaryAcctResultPOS = new ArrayList<>(); - // 获取薪资项目回算前的值 - Map salaryAcctResultOldPOMap = salaryAcctResultPOSOld.stream() - .collect(Collectors.groupingBy(p -> p.getSalaryAcctEmpId() + "-" + p.getSalaryItemId(), - Collectors.collectingAndThen(Collectors.maxBy(Comparator.comparing(SalaryAcctResultPO::getId)), - s -> s.map(SalaryAcctResultPO::getOriginResultValue).orElse("")))); - List salaryAcctResultReportPOS = new ArrayList<>(); - param.getResultValueList().forEach(resultValue -> { - SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeePOMap.get(resultValue.getId()); - salaryAcctResultPOS.addAll(SalaryAcctResultBO.batchEditConvert2PO(salaryAcctResultOldPOMap, resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID())); - // 报表 - salaryAcctResultReportPOS.addAll(SalaryAcctResultReportBO.lkszConvert2PO(resultValue.getItems(), salaryAcctEmployeePO, (long) user.getUID(), emps)); - }); - - // 删除原来的薪资核算结果 - param.getResultValueList().stream().forEach(resultValue -> { - List saveItemIds = resultValue.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList()); - deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getId()), saveItemIds); - // 报表 - getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(resultValue.getId()), saveItemIds); - }); - - // 保存薪资核算结果 - if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { - // 加密 - encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); - List> partition = Lists.partition(salaryAcctResultPOS, 100); - partition.forEach(getSalaryAcctResultMapper()::batchInsert); - } - - //报表 - if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) { - getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); - } - } - - - public void temp(SalaryAcctResultSaveParam saveParam){ - List dataCollectionEmployees = getSalaryEmployeeService(user).listAllForReport(); - Map emps = SalaryEntityUtil.convert2Map(dataCollectionEmployees, DataCollectionEmployee::getEmployeeId); - - // 查询薪资核算人员 - SalaryAcctEmployeePO salaryAcctEmployeePO = getSalaryAcctEmployeeService(user).getById(saveParam.getSalaryAcctEmpId()); - if (Objects.isNull(salaryAcctEmployeePO)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除")); - } - // 查询原来的薪资核算结果 - List salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(saveParam.getSalaryAcctEmpId()).build()); - // 解密 - encryptUtil.decryptList(salaryAcctResultPOSOld, SalaryAcctResultPO.class); - // 保存参数转换成薪资核算结果po - List salaryAcctResultPOS = SalaryAcctResultBO.convert2PO(salaryAcctResultPOSOld, saveParam, salaryAcctEmployeePO, (long) user.getUID()); - SalarySysConfPO autoLock = getSalarySysConfService(user).getOneByCode(SalarySysConstant.EDIT_IMPORT_AUTO_LOCK); - - // 删除原来的薪资核算结果 - List saveItemIds = saveParam.getItems().stream().map(SalaryAcctResultSaveParam.SalaryAcctResultDetailItemParam::getSalaryItemId).collect(Collectors.toList()); - deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds); - // 保存薪资核算结果 - if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) { - // 加密 - encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); - List> partition = Lists.partition(salaryAcctResultPOS, 100); - partition.forEach(getSalaryAcctResultMapper()::batchInsert); - } - //报表 todo - getSalaryAcctReportService(user).deleteByAcctEmployeeIdsAndSalaryItemIds(Collections.singletonList(saveParam.getSalaryAcctEmpId()), saveItemIds); - List salaryAcctResultReportPOS = SalaryAcctResultReportBO.convert2PO(saveParam, salaryAcctEmployeePO, (long) user.getUID(), emps); - if (CollectionUtils.isNotEmpty(salaryAcctResultReportPOS)) { - getSalaryAcctReportService(user).batchSave(salaryAcctResultReportPOS); - } - - - // 存储薪资核算结果数据来源日志 - salaryAcctResultPOS = getSalaryAcctRecordService(user).listBySalaryAcctEmpId(saveParam.getSalaryAcctEmpId()); - saveSalaryAcctResultLog(salaryAcctResultPOSOld, salaryAcctResultPOS); - } } \ No newline at end of file diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java index c6032686c..4a8088761 100644 --- a/src/com/engine/salary/web/SalaryAcctController.java +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -159,14 +159,6 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::backCalculate, param.getSalaryAcctRecordId()); } - // 结转 - @GET - @Path("/lkszJz") - @Produces(MediaType.APPLICATION_JSON) - public String lkszJz(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalaryAcctRecordWrapper(user)::lkszJz, id); - } /* ********************************薪资核算记录相关 end*********************************/ @@ -466,15 +458,6 @@ public class SalaryAcctController { return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::batchUpdate, param); } - //鲁控数字批量编辑 - @POST - @Path("/acctresult/lkszBatchEdit") - @Produces(MediaType.APPLICATION_JSON) - public String lkszBatchEdit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctResultBatchEditParam param) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getSalaryAcctResultWrapper(user)::lkszBatchEdit, param); - } - //薪资核算 @POST @Path("/acctresult/accounting") diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 95b461e7d..b3d7d06e3 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -266,12 +266,4 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord public void backCalculate(Long salaryAcctRecordId){ getSalaryAcctRecordService(user).backCalculate(salaryAcctRecordId); } - - /** - * 鲁控数字-结转 - * @param salaryAcctRecordId - */ - public void lkszJz(Long salaryAcctRecordId) { - getSalaryAcctRecordService(user).lkszJz(salaryAcctRecordId); - } } diff --git a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java index 2bf31ef9c..5c1347343 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctResultWrapper.java @@ -265,15 +265,6 @@ public class SalaryAcctResultWrapper extends Service { getSalaryAcctResultService(user).batchUpdate(param); } - /** - * 鲁控数字薪资核算结果批量编辑 - * @param param - */ - public void lkszBatchEdit(SalaryAcctResultBatchEditParam param) { - getSalaryAcctResultService(user).lkszBatchEdit(param); - } - - /** * 薪资核算-校验 * From e97dab27fc162809bac36042006d229ca231b5ff Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 13 Dec 2023 10:51:24 +0800 Subject: [PATCH 12/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=8B=86=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E7=9B=B8=E5=85=B3sql?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/GS/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/JC/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202312130203.sql | 17 ++++++++ .../sqlupgrade/Oracle/sql202312130203.sql | 30 ++++++++++++++ resource/sqlupgrade/PG/sql202312130203.sql | 17 ++++++++ .../sqlupgrade/SQLServer/sql202312130203.sql | 30 ++++++++++++++ resource/sqlupgrade/ST/sql202312130203.sql | 39 +++++++++++++++++++ 8 files changed, 250 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202312130203.sql create mode 100644 resource/sqlupgrade/GS/sql202312130203.sql create mode 100644 resource/sqlupgrade/JC/sql202312130203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202312130203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202312130203.sql create mode 100644 resource/sqlupgrade/PG/sql202312130203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202312130203.sql create mode 100644 resource/sqlupgrade/ST/sql202312130203.sql diff --git a/resource/sqlupgrade/DM/sql202312130203.sql b/resource/sqlupgrade/DM/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202312130203.sql b/resource/sqlupgrade/GS/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202312130203.sql b/resource/sqlupgrade/JC/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql new file mode 100644 index 000000000..7ff70da9f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; diff --git a/resource/sqlupgrade/Oracle/sql202312130203.sql b/resource/sqlupgrade/Oracle/sql202312130203.sql new file mode 100644 index 000000000..f62d861b8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312130203.sql b/resource/sqlupgrade/PG/sql202312130203.sql new file mode 100644 index 000000000..9b9630ce6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312130203.sql b/resource/sqlupgrade/SQLServer/sql202312130203.sql new file mode 100644 index 000000000..0738202b3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar(10) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312130203.sql b/resource/sqlupgrade/ST/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + From 2685c724e4408337958de4dc7b64a58aaf492798 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 14 Dec 2023 13:59:39 +0800 Subject: [PATCH 13/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=BC=96=E8=BE=91=E9=A1=B5=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E8=BF=94=E5=9B=9E=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 32186cbbb..f2f3feee7 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -317,6 +317,12 @@ public class SIArchivesBiz { List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -344,6 +350,12 @@ public class SIArchivesBiz { List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } From 7cb0e686238e8e48ce887a84e32d7c5fe9298939 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 15 Dec 2023 09:50:20 +0800 Subject: [PATCH 14/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=BC=96=E8=BE=91=E9=A1=B5=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E4=BF=A1=E6=81=AF=E8=BF=94=E5=9B=9E=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/siarchives/bo/InsuranceArchivesBO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java index a96b96aad..710038513 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java @@ -35,6 +35,7 @@ public class InsuranceArchivesBO { .socialStartTime(po.getSocialStartTime()) .schemeAccount(po.getSocialAccount()) .schemePaymentBaseString(po.getSocialPaymentBaseString()) + .schemePaymentComBaseString(po.getSocialPaymentComBaseString()) .underTake(po.getUnderTake() == null ? null : String.valueOf(po.getUnderTake())) .build(); } @@ -52,6 +53,7 @@ public class InsuranceArchivesBO { .fundSchemeId(po.getFundSchemeId()) .paymentOrganization(po.getPaymentOrganization()) .fundPaymentBaseString(po.getFundPaymentBaseString()) + .fundPaymentComBaseString(po.getFundPaymentComBaseString()) .fundStartTime(po.getFundStartTime()) .supplementFundAccount(po.getSupplementFundAccount()) .nonPayment(po.getNonPayment()) @@ -72,6 +74,7 @@ public class InsuranceArchivesBO { .otherName(po.getOtherSchemeId() == null ? null : String.valueOf(po.getOtherSchemeId())) .otherSchemeId(po.getOtherSchemeId()) .otherPaymentBaseString(po.getOtherPaymentBaseString()) + .otherPaymentComBaseString(po.getOtherPaymentComBaseString()) .otherStartTime(po.getOtherStartTime()) .otherEndTime(po.getOtherEndTime()) .paymentOrganization(po.getPaymentOrganization()) From a5eb86ab068b7f5f36305be0e1a6e9eaad7f1303 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 21 Dec 2023 13:33:21 +0800 Subject: [PATCH 15/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E9=80=82=E9=85=8D=E7=A6=8F=E5=88=A9=E5=9F=BA?= =?UTF-8?q?=E6=95=B0=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 1385b84d7..cbed96243 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2540,33 +2540,33 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "socialPer"); } //住房公积金个人、补充住房公积金个人 for (ICategoryPO po : fundWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "fundPer"); } //其他个人(比如企业年金个人) for (ICategoryPO po : otherWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "otherPer"); } //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) for (ICategoryPO po : socialWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "socialCom"); } //住房公积金单位、补充住房公积金单位 for (ICategoryPO po : fundWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "fundCom"); } //其他单位(比如企业年金单位) for (ICategoryPO po : otherWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "otherCom"); } return result; @@ -2621,11 +2621,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { String billMonth = importParam.getBillMonth(); - Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() - .billMonth(billMonth) - .paymentOrganization(importParam.getPaymentOrganization()) - .paymentStatus(PaymentStatusEnum.COMMON.getValue()) - .build()); +// Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() +// .billMonth(billMonth) +// .paymentOrganization(importParam.getPaymentOrganization()) +// .paymentStatus(PaymentStatusEnum.COMMON.getValue()) +// .build()); + Map welColumnNameCodeMap = new HashMap<>(); //存储待更新的InsuranceAccountDetailPO数据 List addCompareList = new ArrayList<>(); //记录待删除hrsa_excel_bill_detail.id @@ -2647,6 +2648,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (taxAgentPoList.size() == 1) { paymentOrganization = taxAgentPoList.get(0).getId(); + welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(paymentOrganization.toString()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); From f03c0d0147749d0824466bd9caf884239463fc81 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 29 Dec 2023 10:27:35 +0800 Subject: [PATCH 16/28] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=87=B3=E8=B4=A6=E5=A5=97=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E8=BF=87=E6=BB=A4=E6=B2=A1=E6=9C=89=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9A=84=E8=B4=A6=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/SalaryItemServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 3c30540a4..b287d3792 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -421,6 +421,9 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService List salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId)); Set salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId); List salarySobs = getSalarySobService(user).listByIds(salarySobIds); + // 获取能够管理的义务人 + Set taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin(Long.valueOf(user.getUID())), TaxAgentPO::getId); + salarySobs = salarySobs.stream().filter(sob -> taxAgentIds.contains(sob.getTaxAgentId())).collect(Collectors.toList()); return salarySobs.stream().map(m -> { Map map = new HashMap<>(); map.put("id", String.valueOf(m.getId())); From fe00f5c0e74247d579b3fb41b41ae46389d87339 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 2 Jan 2024 14:40:33 +0800 Subject: [PATCH 17/28] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=8D=95=E5=8F=91?= =?UTF-8?q?=E9=80=81action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/FileSalaryAcctRecordAction.java | 15 ++- .../salary/action/SendSalaryAction.java | 118 ++++++++++++++++++ .../salary/service/SalarySendService.java | 2 + .../service/impl/SalarySendServiceImpl.java | 5 + 4 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 src/com/engine/salary/action/SendSalaryAction.java diff --git a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java index 7d6d22fb7..838c4c494 100644 --- a/src/com/engine/salary/action/FileSalaryAcctRecordAction.java +++ b/src/com/engine/salary/action/FileSalaryAcctRecordAction.java @@ -1,12 +1,14 @@ package com.engine.salary.action; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryAcctRecordService; import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import weaver.general.BaseBean; import weaver.general.Util; import weaver.hrm.User; import weaver.interfaces.workflow.action.Action; @@ -59,8 +61,19 @@ public class FileSalaryAcctRecordAction implements Action { } User user = new User(); user.setUid(1); + Long acctRecordId = Long.valueOf(salaryAcctRecordId); + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(acctRecordId); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() > 1) { + BaseBean baseBean = new BaseBean(); + baseBean.writeLog("核算记录归档action, 该核算记录已经归档:" + salaryAcctRecordPO.getId()); + return SUCCESS; + } try { - getSalaryAcctRecordService(user).file(Long.valueOf(salaryAcctRecordId)); + getSalaryAcctRecordService(user).file(acctRecordId); } catch (Exception e) { requestInfo.getRequestManager().setMessage(e.getMessage()); return FAILURE_AND_CONTINUE; diff --git a/src/com/engine/salary/action/SendSalaryAction.java b/src/com/engine/salary/action/SendSalaryAction.java new file mode 100644 index 000000000..f0f3ef154 --- /dev/null +++ b/src/com/engine/salary/action/SendSalaryAction.java @@ -0,0 +1,118 @@ +package com.engine.salary.action; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.biz.SalarySendInfoBiz; +import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam; +import com.engine.salary.entity.salaryBill.po.SalarySendPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.SalaryBillService; +import com.engine.salary.service.SalarySendService; +import com.engine.salary.service.SalaryTemplateService; +import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; +import com.engine.salary.service.impl.SalaryBillServiceImpl; +import com.engine.salary.service.impl.SalarySendServiceImpl; +import com.engine.salary.service.impl.SalaryTemplateServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; +import weaver.hrm.User; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.Property; +import weaver.soa.workflow.request.RequestInfo; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author Harryxzy + * @ClassName FileSalaryAcctRecordAction + * @date 2023/12/13 9:17 + * @description 工资单发放action + */ +@Slf4j +public class SendSalaryAction implements Action { + + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + + private SalarySendService getSalarySendService(User user) { + return ServiceUtil.getService(SalarySendServiceImpl.class, user); + } + + private SalaryTemplateService getSalaryTemplateService(User user) { + return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user); + } + + private SalarySendInfoBiz salarySendInfoMapper = new SalarySendInfoBiz(); + + private SalaryBillService getSalaryBillService(User user) { + return ServiceUtil.getService(SalaryBillServiceImpl.class, user); + } + + + /** + * 发放id(核算记录id,工资单id)流程字段名 + */ + private String idFieldName; + + /** + * 根据什么id(核算记录id,工资单id)发工资单 + */ + private String sendBy; + + + @Override + public String execute(RequestInfo requestInfo) { + Property[] properties = requestInfo.getMainTableInfo().getProperty(); + Map fieldMap = Arrays.stream(properties).collect(Collectors.toMap(Property::getName, + property -> Util.null2String(property.getValue()))); + String idStr = fieldMap.get(idFieldName); + if (StringUtils.isBlank(idStr)) { + requestInfo.getRequestManager().setMessage("核算记录id或工资单id不能为空"); + return FAILURE_AND_CONTINUE; + } + User user = new User(); + user.setUid(1); + Long id = Long.valueOf(idStr); + SalarySendPO salarySendPO; + if(!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salaryAcctRecordId")) { + // 根据核算记录id发 + SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(id); + if (salaryAcctRecordPO == null) { + requestInfo.getRequestManager().setMessage("薪资核算记录不存在,或已被删除"); + return FAILURE_AND_CONTINUE; + } + if (salaryAcctRecordPO.getStatus() == 1) { + requestInfo.getRequestManager().setMessage("核算记录还未归档,请先归档"); + return FAILURE_AND_CONTINUE; + } + // 获取工资单id + List salarySendPOList = getSalarySendService(user).listSome(SalarySendPO.builder().salaryAccountingId(id).sendStatus(0).build()); + salarySendPO = salarySendPOList.get(0); + } else if (!org.h2.util.StringUtils.isNullOrEmpty(sendBy) && sendBy.equals("salarySendId")) { + // 根据工资单发 + salarySendPO = getSalarySendService(user).getById(id); + } else { + requestInfo.getRequestManager().setMessage("请先维护根据什么id发放工资单的sendBy参数"); + return FAILURE_AND_CONTINUE; + } + + if (salarySendPO == null || salarySendPO.getId() == null) { + requestInfo.getRequestManager().setMessage("工资单不存在或已被删除!"); + return FAILURE_AND_CONTINUE; + } + try { + // 全部发放 + getSalaryBillService(user).grant(SalarySendGrantParam.builder().salarySendId(salarySendPO.getId()).build()); + } catch (Exception e) { + requestInfo.getRequestManager().setMessage(e.getMessage()); + return FAILURE_AND_CONTINUE; + } + return SUCCESS; + } +} diff --git a/src/com/engine/salary/service/SalarySendService.java b/src/com/engine/salary/service/SalarySendService.java index 90da3440f..72fc71423 100644 --- a/src/com/engine/salary/service/SalarySendService.java +++ b/src/com/engine/salary/service/SalarySendService.java @@ -216,4 +216,6 @@ public interface SalarySendService { void autoConfirmSalaryBill(List needAutoIds); List getByIds(List salarySendId); + + List listSome(SalarySendPO param); } diff --git a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java index 5c3a92f0d..20cb9f176 100644 --- a/src/com/engine/salary/service/impl/SalarySendServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendServiceImpl.java @@ -1725,4 +1725,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService } return getSalarySendMapper().getByIds(salarySendId); } + + @Override + public List listSome(SalarySendPO param) { + return getSalarySendMapper().listSome(param); + } } From 7945c84fbb5b4c2c47acd930a4e4afdb36bbb467 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 2 Jan 2024 16:37:07 +0800 Subject: [PATCH 18/28] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/salaryacct/bo/SalaryAcctResultBO.java | 16 ++++++++-------- .../entity/salaryitem/bo/SalaryItemBO.java | 5 ++++- .../entity/salaryitem/dto/SalaryItemFormDTO.java | 3 +++ .../entity/salaryitem/dto/SalaryItemListDTO.java | 3 +++ .../salaryitem/param/SalaryItemSaveParam.java | 5 +++++ .../entity/salaryitem/po/SalaryItemPO.java | 5 +++++ .../salarysob/bo/SalarySobItemAggregateBO.java | 1 + .../entity/salarysob/dto/SalarySobItemDTO.java | 3 +++ .../mapper/salaryitem/SalaryItemMapper.xml | 12 +++++++++++- .../service/impl/SalaryItemServiceImpl.java | 1 + .../engine/salary/util/page/SalaryPageUtil.java | 5 ++++- 11 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 392ac81e6..0cd19d52b 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -170,7 +170,7 @@ public class SalaryAcctResultBO { List columns = Lists.newArrayList(); // 员工信息字段 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName()), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName(), 0), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); } // 薪资项目分组下的薪资项目 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { @@ -180,29 +180,29 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } - WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName()), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName(), 0), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); columns.add(weaTableColumnWapper); } // 没有分类的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), salarySobItemDTO.getWidth()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } // 回算的薪资项目 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName(), 0), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } diff --git a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java index f65c9f924..c11c58954 100644 --- a/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java +++ b/src/com/engine/salary/entity/salaryitem/bo/SalaryItemBO.java @@ -117,6 +117,7 @@ public class SalaryItemBO { .description(salaryItemPO.getDescription()) .canDelete(true) .canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE)) + .width(salaryItemPO.getWidth()) .build(); } ).collect(Collectors.toList()); @@ -200,7 +201,8 @@ public class SalaryItemBO { .setCanEdit(salaryItemPO.getCanEdit()) .setTaxAgentIds(salaryItemPO.getTaxAgentIds()) .setSharedType(salaryItemPO.getSharedType()) - .setSortedIndex(salaryItemPO.getSortedIndex()); + .setSortedIndex(salaryItemPO.getSortedIndex()) + .setWidth(salaryItemPO.getWidth()); } /** @@ -280,6 +282,7 @@ public class SalaryItemBO { .sharedType(Optional.ofNullable(saveParam.getSharedType()).orElse(0)) .taxAgentIds(saveParam.getTaxAgentIds()) .sortedIndex(saveParam.getSortedIndex()) + .width(saveParam.getWidth()) .build(); // 开启了"薪资档案引用",取值方式固定为输入 // if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) { diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java index 5101bf2e4..da0c6d4d5 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemFormDTO.java @@ -95,4 +95,7 @@ public class SalaryItemFormDTO { private String taxAgentIds; private Integer sortedIndex; + + // 宽度 + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java index adb0dc4b1..1e0af69d4 100644 --- a/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java +++ b/src/com/engine/salary/entity/salaryitem/dto/SalaryItemListDTO.java @@ -105,6 +105,9 @@ public class SalaryItemListDTO { @TableTitle(title = "显示顺序",dataIndex = "sortedIndex",key = "sortedIndex") private Integer sortedIndex; + // 宽度 + private Integer width; + @SalaryTableColumn(text = "操作", width = "20%", column = "operate") private String operate; } diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index 916342dfd..a200cea77 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -102,4 +102,9 @@ public class SalaryItemSaveParam { * 排序 */ private Integer sortedIndex; + + /** + * 宽度 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java index 3115f0efa..3929bfed4 100644 --- a/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java +++ b/src/com/engine/salary/entity/salaryitem/po/SalaryItemPO.java @@ -159,4 +159,9 @@ public class SalaryItemPO { * 排序 */ private Integer sortedIndex; + + /** + * 宽度 + */ + private Integer width; } diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index be5bcf6c3..511e946c7 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -143,6 +143,7 @@ public class SalarySobItemAggregateBO { .sortedIndex(salarySobItemPO.getSortedIndex()) .canEdit(openFormulaForcedEditing || Objects.equals(salaryItemPO.getCanEdit(), 1)) .canDelete(openFormulaForcedEditing || salaryItemPO.getCanDelete() == null || Objects.equals(salaryItemPO.getCanDelete(), 1)) + .width(salaryItemPO.getWidth()) .build()); } } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java index 81bbc138a..8b23d6446 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemDTO.java @@ -109,4 +109,7 @@ public class SalarySobItemDTO { * 保留小数位数 */ private Integer pattern; + + // 显示宽度 + private Integer width; } diff --git a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml index 7dd705c72..93ec756ca 100644 --- a/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml +++ b/src/com/engine/salary/mapper/salaryitem/SalaryItemMapper.xml @@ -51,7 +51,8 @@ t.shared_type, t.tax_agent_ids, t.sorted_index, - t.hide_default + t.hide_default, + t.width @@ -217,6 +218,9 @@ sorted_index, + + width, + @@ -288,6 +292,9 @@ #{sortedIndex}, + + #{width}, + @@ -359,6 +366,9 @@ tax_agent_ids=#{taxAgentIds}, + + width=#{width}, + sorted_index=#{sortedIndex}, WHERE id = #{id} AND delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index b287d3792..a6afb5bd3 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -254,6 +254,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService newSalaryItemPO.setSharedType(saveParam.getSharedType()); newSalaryItemPO.setTaxAgentIds(saveParam.getTaxAgentIds()); newSalaryItemPO.setSortedIndex(saveParam.getSortedIndex()); + newSalaryItemPO.setWidth(saveParam.getWidth()); salaryItemBiz.updateById(newSalaryItemPO); //改名后更新公式 diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index 0e75d79d2..bc8892eee 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -91,7 +91,10 @@ public class SalaryPageUtil { endIndex > source.size() ? source.size() : endIndex); } - public static String selfAdaption(String chars) { + public static String selfAdaption(String chars, Integer width) { + if (width != null && width != 0){ + return width + ""; + } int adaption = 0; if (chars != null) { From 9ca420b5e6d6961a1dd7662331651e14e5101b6b Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 4 Jan 2024 10:39:41 +0800 Subject: [PATCH 19/28] =?UTF-8?q?fix=E5=88=A0=E9=99=A4=E4=B9=89=E5=8A=A1?= =?UTF-8?q?=E4=BA=BA=E6=97=B6=EF=BC=8C=E6=B2=A1=E5=88=86=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/TaxAgentEmpServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java index 7cd9cfd6f..f7fd19a94 100644 --- a/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentEmpServiceImpl.java @@ -53,7 +53,9 @@ public class TaxAgentEmpServiceImpl extends Service implements TaxAgentEmpServic return; } List idList = taxAgentEmpList.stream().map(TaxAgentEmpPO::getId).collect(Collectors.toList()); - getTaxAgentEmpMapper().deleteByIds(idList); + + List> partition = Lists.partition(idList, 500); + partition.forEach(getTaxAgentEmpMapper()::deleteByIds); } @Override From 681c0fb18eeaadc8d4d5345503db1fc3386976c9 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 8 Jan 2024 10:57:55 +0800 Subject: [PATCH 20/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=AD=E6=9B=B4=E6=96=B0=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8=E5=92=8C=E5=AD=90=E8=A1=A8=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index f2f3feee7..977adaab4 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -705,7 +705,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -781,8 +781,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -851,7 +852,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -927,8 +928,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -1001,7 +1003,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -1084,8 +1086,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() From c0c93490fe58359c40d1bc04796efa4384fa9c1f Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 8 Jan 2024 15:32:49 +0800 Subject: [PATCH 21/28] sql --- resource/sqlupgrade/DM/sql202401080103.sql | 3 +++ resource/sqlupgrade/GS/sql202401080103.sql | 3 +++ resource/sqlupgrade/JC/sql202401080103.sql | 3 +++ resource/sqlupgrade/Mysql/sql202401080103.sql | 1 + resource/sqlupgrade/Oracle/sql202401080103.sql | 2 ++ resource/sqlupgrade/PG/sql202401080103.sql | 1 + resource/sqlupgrade/SQLServer/sql202401080103.sql | 2 ++ resource/sqlupgrade/ST/sql202401080103.sql | 3 +++ 8 files changed, 18 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202401080103.sql create mode 100644 resource/sqlupgrade/GS/sql202401080103.sql create mode 100644 resource/sqlupgrade/JC/sql202401080103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202401080103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202401080103.sql create mode 100644 resource/sqlupgrade/PG/sql202401080103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202401080103.sql create mode 100644 resource/sqlupgrade/ST/sql202401080103.sql diff --git a/resource/sqlupgrade/DM/sql202401080103.sql b/resource/sqlupgrade/DM/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/GS/sql202401080103.sql b/resource/sqlupgrade/GS/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/JC/sql202401080103.sql b/resource/sqlupgrade/JC/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202401080103.sql b/resource/sqlupgrade/Mysql/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202401080103.sql b/resource/sqlupgrade/Oracle/sql202401080103.sql new file mode 100644 index 000000000..fc148da4a --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202401080103.sql b/resource/sqlupgrade/PG/sql202401080103.sql new file mode 100644 index 000000000..f5fb1c6f1 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202401080103.sql @@ -0,0 +1 @@ +alter table hrsa_salary_item add width int null; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202401080103.sql b/resource/sqlupgrade/SQLServer/sql202401080103.sql new file mode 100644 index 000000000..ff92fddf9 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202401080103.sql @@ -0,0 +1,2 @@ +alter table hrsa_salary_item add width int null +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202401080103.sql b/resource/sqlupgrade/ST/sql202401080103.sql new file mode 100644 index 000000000..754d4529d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202401080103.sql @@ -0,0 +1,3 @@ +alter table hrsa_salary_item add width int null; +/ + From f5aa425f2cca9b0d11ec3351d8b7465ef4bc2d56 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 9 Jan 2024 13:21:45 +0800 Subject: [PATCH 22/28] =?UTF-8?q?fix=E5=85=AC=E5=BC=8F=EF=BC=8C=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E7=8A=B6=E6=80=81=E5=8F=98=E9=87=8F=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=80=BCbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryacct/bo/CalculateFormulaVarBO.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 74835472d..8251ea51f 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.salaryacct.bo; +import cn.hutool.core.util.NumberUtil; import com.engine.salary.annotation.SalaryFormulaVar; import com.engine.salary.common.LocalDateRange; import com.engine.salary.constant.SalaryFormulaFieldConstant; @@ -18,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobAdjustRulePO; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; import com.engine.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum; @@ -551,6 +553,10 @@ public class CalculateFormulaVarBO { } // 填充到返回结果集中 employeeMap.forEach((key, po) -> { + // 获取po的状态 + if(po.getStatus() != null && NumberUtil.isNumber(po.getStatus())) { + po.setStatusName(UserStatusEnum.getDefaultLabelByValue(new Integer(po.getStatus()))); + } List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); Map map = JsonUtil.parseMap(po, String.class); formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { From 3b761341fcc14e9f660e925ea7d87eed366c05e7 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 10 Jan 2024 11:20:36 +0800 Subject: [PATCH 23/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9F=BA=E6=95=B0=E8=87=AA=E5=8A=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 58 +++++++++++++++++++ .../service/impl/SISchemeServiceImpl.java | 35 ++++++++++- .../sys/constant/SalarySysConstant.java | 5 ++ 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 977adaab4..4f62417c6 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1217,6 +1217,64 @@ public class SIArchivesBiz { return true; } + + /** + * 校验福利基数是否符合上下限要求,并返回符合要求的数据 + * @param primaryId + * @param paymentBaseString + * @return + */ + public String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { + + if (primaryId ==null || paymentBaseString == null) { + return paymentBaseString; + } + Map paymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + Map newPaymentBaseJson = JSON.parseObject(paymentBaseString, HashMap.class); + if (paymentBaseJson == null) { + return null; + } + + for (Map.Entry entry : paymentBaseJson.entrySet()) { + + //判断福利值是否为空/数字 + if (entry.getValue() == null || entry.getValue().length() == 0) { + continue; + } else if (!isNumeric(entry.getValue())) { + log.info("福利值非数字!"); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + //根据福利方案id、险种id + List insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey())); + log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + if (insuranceSchemeDetailPOList.size() == 0) { + log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey())); + newPaymentBaseJson.remove(entry.getKey()); + continue; + } + List checkList = insuranceSchemeDetailPOList.stream() + .filter(f -> f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); + if (checkList.size() > 0) { + InsuranceSchemeDetailPO insuranceSchemeDetailPO = checkList.get(0); + encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class); + String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit(); + String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit(); + if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) { + //数值低于对应福利明细下限 + log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}!", entry.getKey(), entry.getValue(), lowerLimit); + newPaymentBaseJson.put(entry.getKey(), lowerLimit); + } + if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) { + //数值高于对应福利明细上限 + log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} !", entry.getKey(), entry.getValue(), upperLimit); + newPaymentBaseJson.put(entry.getKey(), upperLimit); + } + } + } + return JSON.toJSONString(newPaymentBaseJson); + } + /** * 档案列表 *

diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 5b2552ef9..da2c8b0ae 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -44,6 +44,7 @@ import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; +import com.engine.salary.sys.enums.OpenEnum; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.*; @@ -74,6 +75,7 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_AUTO_ADJUST; import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; /** @@ -1263,7 +1265,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //生成福利档案基础信息数据 InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp()); - if (!isError) { + + //判断是否福利档案导入时,不符合上下限的基数调整为上限/下限 + SalarySysConfPO welBaseAutoAdjust = getSalarySysConfService(user).getOneByCode(WEL_BASE_AUTO_ADJUST); + boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue()); + + if (!isError && !welBaseAutoAdjustSign) { insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); @@ -1304,6 +1311,32 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { isError = true; } + } else if (!isError) { + //校验福利基数是否符合上下限要求,不符合上下限的基数调整为上限 /下限 + String newSocialPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newFundPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + String newOtherPaymentBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString); + + if (welBaseDiffSign) { + String newSocialPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newFundPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + String newOtherPaymentComBaseString = siArchivesBiz.checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(newSocialPaymentComBaseString); + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(newFundPaymentComBaseString); + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(newOtherPaymentComBaseString); + } + + insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO); + insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO); + insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); + insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); + + insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } return isError; } diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index df5ea5ea2..afe54d3c0 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -110,4 +110,9 @@ public class SalarySysConstant { * 应用设置是否福利档案基数区分个人和单位 */ public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom"; + + /** + * 应用设置是否福利档案导入时,不符合上下限的基数调整为上限 /下限 + */ + public static final String WEL_BASE_AUTO_ADJUST = "welBaseAutoAdjust"; } From be68f01145cca15a1f0d5416a0ff6e463a428a85 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 15 Jan 2024 09:45:19 +0800 Subject: [PATCH 24/28] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8Cmysql=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=ADsql=E8=84=9A=E6=9C=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/Mysql/sql202312130203.sql | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql index 7ff70da9f..15acb233a 100644 --- a/resource/sqlupgrade/Mysql/sql202312130203.sql +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -1,17 +1,17 @@ -ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string text NULL; -ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string text NULL; -ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string text NULL; -ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; -ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string text NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string text NULL; ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; From e38fd9be992244d5aeb32b36fdda0d9bdc7004f9 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 15 Jan 2024 10:51:53 +0800 Subject: [PATCH 25/28] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=B7=E5=A7=8B=E3=80=81=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=8F=91=E8=96=AA=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/SalaryArchiveQueryParam.java | 22 ++++++++++++ .../mapper/archive/SalaryArchiveMapper.xml | 36 +++++++++++++++++++ .../impl/SalaryArchiveServiceImpl.java | 13 +++++++ 3 files changed, 71 insertions(+) diff --git a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java index 12a02998d..505ce3264 100644 --- a/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java +++ b/src/com/engine/salary/entity/salaryarchive/param/SalaryArchiveQueryParam.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Collection; +import java.util.Date; import java.util.List; /** @@ -88,4 +89,25 @@ public class SalaryArchiveQueryParam extends BaseQueryParam { */ private boolean extSalaryArchiveList; + + private String payStartDateStartDateStr; + private String payStartDateEndDateStr; + + // 起始发薪日期起 + private Date payStartDateStartDate; + + // 起始发薪日期止 + private Date payStartDateEndDate; + + // 最后发薪日期起 + private String payEndDateStartDateStr; + // 最后发薪日期止 + private String payEndDateEndDateStr; + + // 最后发薪日期起 + private Date payEndDateStartDate; + + // 最后发薪日期止 + private Date payEndDateEndDate; + } diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 03facc683..ea4f6498b 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -183,6 +183,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -264,6 +276,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date = ]]> #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date = ]]> #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} @@ -346,6 +370,18 @@ #{runStatus} + + AND pay_start_date = ]]> #{param.payStartDateStartDate} + + + AND pay_start_date = ]]> #{param.payStartDateEndDate} + + + AND pay_end_date = ]]> #{param.payEndDateStartDate} + + + AND pay_end_date = ]]> #{param.payEndDateEndDate} + ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 5ba7bd575..1fbe1b525 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -163,6 +163,19 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe if (queryParam.isExtSalaryArchiveList()) { return getSalaryArchiveMapper().listExtSalaryArchive(queryParam); } + if (StringUtils.isNotBlank(queryParam.getPayStartDateStartDateStr())) { + queryParam.setPayStartDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayStartDateEndDateStr())) { + queryParam.setPayStartDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayStartDateEndDateStr())); + } + + if (StringUtils.isNotBlank(queryParam.getPayEndDateStartDateStr())) { + queryParam.setPayEndDateStartDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateStartDateStr())); + } + if (Objects.nonNull(queryParam.getPayEndDateEndDateStr())) { + queryParam.setPayEndDateEndDate(SalaryDateUtil.stringToDate(queryParam.getPayEndDateEndDateStr())); + } return getSalaryArchiveMapper().list(queryParam); } From 0a6467aaa6e5749b531d3d460a9cd108cdb46812 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 15 Jan 2024 18:48:05 +0800 Subject: [PATCH 26/28] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B5=B7=E5=A7=8B=E3=80=81=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=8F=91=E8=96=AA=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/mapper/archive/SalaryArchiveMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index ea4f6498b..c08dd87e2 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -280,13 +280,13 @@ AND pay_start_date = ]]> #{param.payStartDateStartDate} - AND pay_start_date = ]]> #{param.payStartDateEndDate} + AND pay_start_date #{param.payStartDateEndDate} AND pay_end_date = ]]> #{param.payEndDateStartDate} - AND pay_end_date = ]]> #{param.payEndDateEndDate} + AND pay_end_date #{param.payEndDateEndDate} @@ -374,13 +374,13 @@ AND pay_start_date = ]]> #{param.payStartDateStartDate} - AND pay_start_date = ]]> #{param.payStartDateEndDate} + AND pay_start_date #{param.payStartDateEndDate} AND pay_end_date = ]]> #{param.payEndDateStartDate} - AND pay_end_date = ]]> #{param.payEndDateEndDate} + AND pay_end_date #{param.payEndDateEndDate} From db4b44e62cd5ca7d4746494288ffc34495f91a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 16 Jan 2024 16:35:37 +0800 Subject: [PATCH 27/28] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98=E7=8A=B6=E6=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryArchiveServiceImpl.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 5ba7bd575..aa3b0eaf3 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -320,11 +320,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe @Override public void deleteSalaryArchive(Collection salaryArchiveIds) { - if(CollectionUtils.isEmpty(salaryArchiveIds)){ + if (CollectionUtils.isEmpty(salaryArchiveIds)) { throw new SalaryRunTimeException("薪资档案参数为空!"); } SalarySysConfPO canDelete = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ARCHIVE_DELETE); - if(Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(),"0") ){ + if (Objects.isNull(canDelete) || StringUtils.equals(canDelete.getConfValue(), "0")) { throw new SalaryRunTimeException("不允许删除薪资档案,请先开启删除档案规则配置!"); } List salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build()); @@ -333,17 +333,17 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()) .stream().map(TaxAgentPO::getId).collect(Collectors.toList()); boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId())); - if(CollectionUtils.isEmpty(salaryArchiveList) || err){ + if (CollectionUtils.isEmpty(salaryArchiveList) || err) { throw new SalaryRunTimeException("薪资档案不存在,或没有权限删除该薪资档案!"); } Optional fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue()) && !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst(); - if(fixedList.isPresent()){ + if (fixedList.isPresent()) { throw new SalaryRunTimeException("发薪员工、待停薪员工、停薪_来自待停薪,无法删除薪资档案!"); } List deleteIds = salaryArchiveList.stream().map(SalaryArchivePO::getId).collect(Collectors.toList()); // 删除薪资档案及档案项目 - if(CollectionUtils.isNotEmpty(deleteIds)){ + if (CollectionUtils.isNotEmpty(deleteIds)) { getSalaryArchiveMapper().deleteByIds(deleteIds); getSalaryArchiveItemMapper().deleteBySalaryArchiveId(deleteIds); } @@ -432,7 +432,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe List salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); // 1.获取薪资档案所对应的当前生效的薪资项目数据 List salaryArchiveItemList = Collections.emptyList(); - if(CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage){ + if (CollectionUtils.isNotEmpty(ids) && CollectionUtils.isNotEmpty(salaryItemIds) || !isPage) { salaryArchiveItemList = getCurrentEffectiveItemList(ids, salaryItemIds); } List finalSalaryArchiveItemList = salaryArchiveItemList; @@ -461,7 +461,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 3.组装数据 List> listMaps = new ArrayList<>(); salaryArchives.forEach(e -> { - e.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus()))); + e.setEmployeeStatus(NumberUtils.isCreatable(e.getEmployeeStatus()) ? UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(e.getEmployeeStatus())) : ""); Map map = new LinkedHashMap<>(); map.put("id", e.getId()); @@ -757,11 +757,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe // 获取核算人员规则 List statusList = Collections.emptyList(); SalarySysConfPO employeeRule = getSalarySysConfService(user).getOneByCode(SalarySysConstant.SALARY_ACCT_EMPLOYEE_RULE); - if(Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())){ + if (Objects.isNull(employeeRule) || StringUtils.equals(employeeRule.getConfValue(), SalaryAcctEmployeeRuleEnum.BYPAYENDTIME.getValue())) { // 默认包含停薪列表 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue(), - SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue() ); - }else{ + SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()); + } else { // 仅包含发薪、待定薪 statusList = Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue()); } From a3aa0f5ca10a9228a548b9e16cef3ca64cfe53b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 17 Jan 2024 10:55:42 +0800 Subject: [PATCH 28/28] =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E6=96=87?= =?UTF-8?q?=E5=AD=97=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/util/page/SalaryPageUtil.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/util/page/SalaryPageUtil.java b/src/com/engine/salary/util/page/SalaryPageUtil.java index bc8892eee..a91fe1d2a 100644 --- a/src/com/engine/salary/util/page/SalaryPageUtil.java +++ b/src/com/engine/salary/util/page/SalaryPageUtil.java @@ -3,6 +3,9 @@ package com.engine.salary.util.page; import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; +import java.awt.*; +import java.awt.font.FontRenderContext; +import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -91,18 +94,23 @@ public class SalaryPageUtil { endIndex > source.size() ? source.size() : endIndex); } + + static Font font = new Font("Arial", Font.PLAIN, 12); // 设置字体样式、大小等属性 + static FontRenderContext frc = new FontRenderContext(null, true, false); +// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + + /** + * 自适应文字长度 + * @param chars + * @param width + * @return + */ public static String selfAdaption(String chars, Integer width) { - if (width != null && width != 0){ + if (width != null && width != 0) { return width + ""; } - int adaption = 0; - - if (chars != null) { - adaption = chars.length() * 12 + 55; - } - if (adaption < 79) { - adaption = 79; - } - return adaption + ""; + Rectangle2D bounds = font.getStringBounds(chars, frc); + int pxLength = (int) Math.ceil(bounds.getWidth()); + return pxLength + 55 + ""; } }