From 86ba593d1fe80c4261c1b21b1d5e4485a690a294 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 19 Sep 2022 11:01:17 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=B9=E5=BC=8F=E9=85=8D=E7=BD=AE-?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86-=E7=B4=AF=E8=AE=A1?= =?UTF-8?q?=E9=99=84=E5=8A=A0=E4=B8=93=E9=A1=B9=E6=89=A3=E9=99=A4-?= =?UTF-8?q?=E5=AF=BC=E5=85=A5,=E6=B7=BB=E5=8A=A0=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AD=9B=E9=80=89=E9=85=8D=E7=BD=AE=E5=8C=96?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AddUpDeductionServiceImpl.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index ca99f5b1f..d71068350 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -5,6 +5,7 @@ import com.api.browser.bean.SearchConditionItem; import com.api.browser.bean.SearchConditionOption; import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; +import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.AddUpDeductionBiz; @@ -28,7 +29,9 @@ import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; +import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; @@ -87,6 +90,10 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + @Override public Map getSearchCondition(Map params) { @@ -199,6 +206,9 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Date declareMonth = SalaryDateUtil.localDateToDate(LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER)); List list = getAddUpDeductionMapper().listSome(AddUpDeduction.builder().declareMonth(declareMonth).build()); + //查询对于人员信息导入筛选的全局配置 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); @@ -238,16 +248,12 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction String userName = dto.getUsername(); String deparmentName = dto.getDepartmentName(); String mobile = dto.getMobile(); -// List employeeSameIds = employees.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) -// && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))) -// .collect(Collectors.toList()); - //20220824需求迭代,增加手机号作为导入校验项 - List employeeSameIds = employees.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()); + String workcode = dto.getJobNum(); - if (StringUtils.isBlank(userName)) { + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List employeeSameIds = getSalaryAcctEmployeeService(user).matchImportEmployee(employees, userName, deparmentName, mobile, workcode); + + if (StringUtils.isBlank(userName) && "0".equals(salarySysConfPO.getConfValue())) { //姓名 不能为空 //错误消息对象 Map errorMessageMap = Maps.newHashMap(); From eb033d64fdc460f8c8cb572f893f6cb6f2d3a5ba Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 19 Sep 2022 14:14:17 +0800 Subject: [PATCH 2/5] =?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=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E9=A1=B5=E6=96=B0=E5=A2=9E=E8=A1=A5=E7=BC=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=A0=A1=E9=AA=8C=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=B8=AD=E6=98=AF=E5=90=A6=E5=B7=B2=E6=9C=89=E8=AF=A5=E7=BB=84?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E8=A1=A5=E7=BC=B4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 5 +++++ .../siaccount/InsuranceAccountDetailMapper.java | 10 ++++++++++ .../siaccount/InsuranceAccountDetailMapper.xml | 15 +++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index b3b13015c..7a9939a05 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -904,6 +904,11 @@ public class SIAccountBiz extends Service { //核算结果集 List pos = new ArrayList<>(); baseList.forEach(baseParam -> { + //判断人员id+账单月份+补缴月份在表中的唯一性 + List supplementList = getInsuranceAccountDetailMapper().querySupplementList(baseParam.getBillMonth(), baseParam.getPaymentOrganization(), baseParam.getEmployeeId(), baseParam.getSupplementaryMonth()); + if (supplementList.size() > 0) { + throw new SalaryRunTimeException("当前人员和账单月份已存在该补缴月份的数据!无法再次创建!"); + } InsuranceAccountDetailPO insuranceAccountDetailPO = accountSingleEmployeeBill(baseParam, longInsuranceArchivesAccountPOMap.get(baseParam.getEmployeeId()), employeeId); pos.add(insuranceAccountDetailPO); }); diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java index a75581cf9..d7c8ffa63 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java @@ -72,6 +72,16 @@ public interface InsuranceAccountDetailMapper { List queryList(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization, @Param("employeeIds") Collection employeeIds); + /** + * 查询补缴数据 + * @param billMonth + * @param paymentOrganization + * @param employeeId + * @param supplementaryMonth + * @return + */ + List querySupplementList(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization, @Param("employeeId") Long employeeId, @Param("supplementaryMonth") String supplementaryMonth); + /** * 根据账单月份删除 diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index e41efcd8d..09c8d58b8 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -188,6 +188,21 @@ +