From 7be9424f73b8627012b09a3627cde540dc13697b Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 16 Nov 2022 15:45:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E9=80=80=E5=B7=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=97=E8=A1=A8=E5=8A=9F=E8=83=BDv2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/InsuranceAccountDetailParam.java | 6 ++ .../InsuranceAccountDetailMapper.xml | 22 +++++++ .../salary/service/ColumnBuildService.java | 4 +- .../salary/service/SIAccountService.java | 7 +++ .../service/impl/ColumnBuildServiceImpl.java | 7 ++- .../service/impl/SIAccountServiceImpl.java | 60 ++++++++++++++++++- 6 files changed, 100 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java index 8d2dd900a..747f6455b 100644 --- a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java +++ b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java @@ -34,4 +34,10 @@ public class InsuranceAccountDetailParam extends BaseQueryParam { * 退差月份 */ private List recessionMonthList; + + private List taxAgents; + /** + * 核算创建人 + */ + private Long creator; } diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 80f21c5ef..029e8486c 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -160,6 +160,10 @@ AND t.payment_organization = #{param.paymentOrganization} + + AND + t.creator = #{param.creator} + @@ -181,6 +185,12 @@ #{recessionMonth} + + AND t.payment_organization IN + + #{taxAgent} + + @@ -201,6 +211,12 @@ #{recessionMonth} + + AND t.payment_organization IN + + #{taxAgent} + + @@ -221,6 +237,12 @@ #{recessionMonth} + + AND t.payment_organization IN + + #{taxAgent} + + diff --git a/src/com/engine/salary/service/ColumnBuildService.java b/src/com/engine/salary/service/ColumnBuildService.java index 87836b44b..9ec02d2e6 100644 --- a/src/com/engine/salary/service/ColumnBuildService.java +++ b/src/com/engine/salary/service/ColumnBuildService.java @@ -18,10 +18,10 @@ public interface ColumnBuildService { * * @param pos pos * @param tenantKey 租户key - * @param flag + * @param paymentStatus 缴纳状态 * @return */ - List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, boolean flag); + List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, Integer paymentStatus); List buildCommonColumns(List pos); diff --git a/src/com/engine/salary/service/SIAccountService.java b/src/com/engine/salary/service/SIAccountService.java index e7e61f8e6..ddebc102a 100644 --- a/src/com/engine/salary/service/SIAccountService.java +++ b/src/com/engine/salary/service/SIAccountService.java @@ -49,6 +49,13 @@ public interface SIAccountService { */ Map listSupplementaryPage(InsuranceAccountDetailParam insuranceAccountDetailParam); + /** + * 获取退差列表 + * @param insuranceAccountDetailParam + * @return + */ + Map listRecessionPage(InsuranceAccountDetailParam insuranceAccountDetailParam); + /** * 根据姓名获取补缴缴纳列表 * @param insuranceAccountDetailParam diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index b66f347bc..93eedcbd7 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -12,6 +12,7 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sicategory.po.ICategoryPO; +import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.service.ColumnBuildService; @@ -30,7 +31,7 @@ import java.util.stream.Collectors; **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { @Override - public List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, boolean flag) { + public List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, Integer paymentStatus) { List list = new ArrayList<>(); Map categoryIdNameMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); Map> columns = buildPaymentTitle(pos, categoryIdNameMap, employeeId, tenantKey); @@ -49,8 +50,10 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86186, "手机号"), "mobile")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 86187, "员工状态"), "employeeStatus")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100377, "数据来源"), "sourceFrom")); - if (flag) { + if (paymentStatus.equals(PaymentStatusEnum.REPAIR.getValue())) { list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100379, "补缴月份"), "supplementaryMonth")); + } else if (paymentStatus.equals(PaymentStatusEnum.RECESSION.getValue())) { + list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 100379, "退差月份"), "supplementaryMonth")); } list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91325, "个税扣缴义务人"), "socialPayOrg")); list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 91324, "社保账号"), "socialAccount")); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index bc2a18a49..d4714367d 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -259,7 +259,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //动态列组装 - List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, false); + List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); WeaTable table = new WeaTable(); table.setPageUID(UUID.randomUUID().toString()); @@ -322,7 +322,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //动态列组装 - List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, true); + List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); SalaryWeaTable table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class); table.setColumns(weaTableColumn); @@ -349,6 +349,62 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return listSupplementaryPage(queryParam); } + @Override + public Map listRecessionPage(InsuranceAccountDetailParam queryParam) { + Long employeeId = (long) user.getUID(); + Map datas = new HashMap<>(); + + // 分权逻辑 + Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); + if (needAuth) { + Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); + List taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(taxAgents)) { + //防止普通用户查询 + queryParam.setTaxAgents(Collections.singletonList(-1L)); + } else { + queryParam.setTaxAgents(taxAgents); + } + } + + //补缴缴纳列表 + queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue()); + + //排序配置 + OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); + queryParam.setOrderRule(orderRule); + + SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); + List list = getInsuranceAccountDetailMapper().list(queryParam); + PageInfo pageInfo = new PageInfo<>(list, InsuranceAccountDetailPO.class); + List insuranceAccountDetailPOS = pageInfo.getList(); + InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(insuranceAccountDetailPOS); + //数据组装 + List> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId); + PageInfo> pageInfos = new PageInfo<>(records); + pageInfos.setTotal(pageInfo.getTotal()); + pageInfos.setPageNum(queryParam.getCurrent()); + pageInfos.setPageSize(queryParam.getPageSize()); + + + //动态列组装 + List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); + + SalaryWeaTable table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class); + table.setColumns(weaTableColumn); + List columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList()); + pageInfos.setColumns(columns); + + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + + datas.put("pageInfo", pageInfos); + //datas.put("dataKey",result.getResultMap()); + return datas; + } + @Override public Map getForm(Map params) { Map apidatas = new HashMap<>();