From b0cc2cc19dcb47ecae39fc8288c56ba1d5f1831e Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 19 Sep 2022 15:11:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=96=B9=E5=BC=8F=E9=85=8D=E7=BD=AE-=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E5=8C=B9=E9=85=8D=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84confValue=E9=BB=98=E8=AE=A4=E8=AE=BE=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AddUpDeductionServiceImpl.java | 3 +- .../service/impl/SIAccountServiceImpl.java | 37 ++++++++++++++++++- .../service/impl/SISchemeServiceImpl.java | 3 +- .../impl/SalaryAcctEmployeeServiceImpl.java | 5 ++- .../impl/SalaryAcctExcelServiceImpl.java | 3 +- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index d71068350..f9ce2476f 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -208,6 +208,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; InputStream fileInputStream = null; try { @@ -253,7 +254,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List employeeSameIds = getSalaryAcctEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode); - if (StringUtils.isBlank(userName) && "0".equals(salarySysConfPO.getConfValue())) { + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { //姓名 不能为空 //错误消息对象 Map errorMessageMap = Maps.newHashMap(); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 8a7b11a3f..e01d6fdaa 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1036,7 +1036,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); - + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; //检验参数 //excel文件id String imageId = Util.null2String(importParam.getImageId()); @@ -1125,7 +1125,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) { //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 - if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) { + if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空")); @@ -1247,6 +1247,39 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } } + /** + * 导出“福利核算-补缴导入”模板 + */ + @Override + public XSSFWorkbook exportSupplyImportTemplate(InsuranceAcctDetailImportTemplateParam param) { + ValidUtil.doValidator(param); + + // 必须选择导入模板所需的薪资项目(福利项) + if (CollectionUtils.isEmpty(param.getWelfareNames())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99019, "参数错误,请选择导入模板所需的福利项目核算项")); + } + + // 模板表头(默认必带"个税扣缴义务人"、"姓名") + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), + "部门", + SalaryI18nUtil.getI18nLabel(86186, "手机号"), + SalaryI18nUtil.getI18nLabel(86317, "工号"), + SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), + "账单月份", + "补缴月份"); +// List dataIndexList = Lists.newArrayList("username", "departmentName", "mobile", "taxAgentName", "billMonth"); + // 查询福利核算项目 + List welfareNames = (List) param.getWelfareNames(); + headerList.addAll(welfareNames); + + // excel导出的数据 + List> rows = new ArrayList<>(); + rows.add(headerList); + + String sheetName = "福利核算导入模板"; + return ExcelUtil.genWorkbookV2(rows, sheetName); + } + /** * 将更新的数据设置到老的insuranceAccountDetailPO对象中 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 8469d03ba..526b1dce0 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -698,10 +698,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; String rowIndex = "第" + index + "行"; //仅在全局人员筛选配置为“0”时,才对用户名、部门名称、手机号有要求 - if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(salarySysConfPO.getConfValue())) { + if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(confValue)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowIndex + " 用户名、部门名称、手机号" + SalaryI18nUtil.getI18nLabel(100303, "不能同时为空")); excelComments.add(errorMessageMap); diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index fc5275fc4..18c65b4a0 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -491,14 +491,15 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; List employees = new ArrayList<>(); //“0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 - if ("0".equals(salarySysConfPO.getConfValue())) { + if ("0".equals(confValue)) { employees = employeeList.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) && (StringUtils.isBlank(mobile) || Objects.equals(e.getMobile(), mobile))) .collect(Collectors.toList()); - } else if ("1".equals(salarySysConfPO.getConfValue())) { + } else if ("1".equals(confValue)) { employees = employeeList.stream().filter(e -> (StringUtils.isBlank(workcode) || Objects.equals(e.getWorkcode(), workcode))) .collect(Collectors.toList()); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 3a4d85d35..4741b7fa5 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -530,6 +530,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; // 薪资核算记录的id Long salaryAcctRecordId = param.getSalaryAcctRecordId(); @@ -628,7 +629,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) { usernameIndex = j; - if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) { + if (StringUtils.isEmpty(dataValue) && "0".equals(confValue)) { isError = true; Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));