diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 8d6b1dfb1..9a6757d0d 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -1,8 +1,12 @@ package com.engine.salary.biz; import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; +import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.PageUtil; import org.apache.ibatis.session.SqlSession; @@ -32,4 +36,18 @@ public class SIAccountBiz { } } + + public PageInfo listCommonPage(InsuranceAccountDetailParam queryParam) { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + InsuranceAccountDetailMapper insuranceAccountDetailMapper = sqlSession.getMapper(InsuranceAccountDetailMapper.class); + PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); + queryParam.setPaymentStatus(PaymentStatusEnum.COMMON.getValue()); + List list = insuranceAccountDetailMapper.list(queryParam); + PageInfo pageInfo = new PageInfo<>(list,InsuranceAccountDetailPO.class); + return pageInfo; + }finally { + sqlSession.close(); + } + } } diff --git a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java new file mode 100644 index 000000000..cce05d899 --- /dev/null +++ b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountDetailParam.java @@ -0,0 +1,22 @@ +package com.engine.salary.entity.siaccount.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/4/11 + * @Version V1.0 + **/ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class InsuranceAccountDetailParam extends BaseQueryParam { + + private String billMonth; //账单月份 + + private Integer paymentStatus; +} diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java new file mode 100644 index 000000000..205c8624c --- /dev/null +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java @@ -0,0 +1,23 @@ +package com.engine.salary.mapper.siaccount; + +import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/4/11 + * @Version V1.0 + **/ +public interface InsuranceAccountDetailMapper { + + /** + * 查询正常缴纳列表 + * @param queryParam + * @return + */ + List list(@Param("param")InsuranceAccountDetailParam queryParam); +} diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml new file mode 100644 index 000000000..668b12ce0 --- /dev/null +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t.id + , t.employee_id + , t.bill_month + , t.bill_status + , t.payment_status + , t.supplementary_month + , t.supplementary_projects + , t.resource_from + , t.social_pay_org + , t.social_account + , t.fund_pay_org + , t.fund_account + , t.supplement_fund_account + , t.other_pay_org + , t.social_scheme_id + , t.social_payment_base_string + , t.fund_scheme_id + , t.fund_payment_base_string + , t.other_scheme_id + , t.other_payment_base_string + , t.social_per_json + , t.social_per_sum + , t.fund_per_json + , t.fund_per_sum + , t.other_per_json + , t.other_per_sum + , t.per_sum + , t.social_com_json + , t.social_com_sum + , t.fund_com_json + , t.fund_com_sum + , t.other_com_json + , t.other_com_sum + , t.com_sum + , t.social_sum + , t.fund_sum + , t.other_sum + , t.total + , t.creator + , t.delete_type + , t.create_time + , t.update_time + , t.tenant_key + + + + + AND + t.bill_month = param.billMonth + + + AND + t.payment_status = param.paymentStatus + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/RecordsBuildService.java b/src/com/engine/salary/service/RecordsBuildService.java new file mode 100644 index 000000000..c67b2952b --- /dev/null +++ b/src/com/engine/salary/service/RecordsBuildService.java @@ -0,0 +1,22 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; + +import java.util.List; +import java.util.Map; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/4/11 + * @Version V1.0 + **/ +public interface RecordsBuildService { + + List> buildCommonRecords(List list, Long employeeId); + + List> buildCommonRecordsWithStyle(List list, Long employeeId); + + List> buildInspectRecords(List list); +} diff --git a/src/com/engine/salary/service/SIAccountService.java b/src/com/engine/salary/service/SIAccountService.java index bd69d4e5c..67499b2d9 100644 --- a/src/com/engine/salary/service/SIAccountService.java +++ b/src/com/engine/salary/service/SIAccountService.java @@ -1,6 +1,7 @@ package com.engine.salary.service; import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; import java.util.Map; @@ -13,5 +14,5 @@ import java.util.Map; public interface SIAccountService { Map listPage(InsuranceAccountBatchParam insuranceAccountBatchParam); - Map listCommonPage(String billMonth); + Map listCommonPage(InsuranceAccountDetailParam insuranceAccountDetailParam); } diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java new file mode 100644 index 000000000..bffca82c3 --- /dev/null +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -0,0 +1,150 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.salaryarchive.po.TaxAgentPO; +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; +import com.engine.salary.service.RecordsBuildService; +import com.engine.core.impl.Service; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.binding.MapperProxy; +import org.apache.ibatis.binding.MapperProxyFactory; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Author weaver_cl + * @Description: TODO + * @Date 2022/4/11 + * @Version V1.0 + **/ +public class RecordsBuildServiceImpl extends Service implements RecordsBuildService { + + @Override + public List> buildCommonRecords(List list, Long employeeId) { + List> result = new ArrayList<>(); + if (CollectionUtils.isEmpty(list)) { + return result; + } + List employeeIds = list.stream().map(item -> item.getEmployeeId()).collect(Collectors.toList()); +// List employeeByIds = hrmCommonEmployeeService.getEmployeeByIds(employeeIds); +// if (CollectionUtils.isEmpty(employeeByIds)) { +// return result; +// } +// List paymentList = new LambdaQueryChainWrapper<>(individualTaxWithholdingAgentMapper) +// .eq(TaxAgentPO::getTenantKey, tenantKey) +// .list(); +// SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100341, "该租户无扣缴义务人")); +// Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); +// Map collect = employeeByIds.stream().collect(Collectors.toMap(SimpleEmployee::getEmployeeId, Function.identity())); +// list.forEach(item -> { +// Map record = new HashMap<>(); +// SimpleEmployee simpleEmployee = collect.get(item.getEmployeeId()); +// record.put("id", item.getId()); +// record.put("employeeId", item.getEmployeeId()); +// record.put("billMonth", item.getBillMonth()); +// record.put("billStatus", SalaryEnumUtil.enumMatchByValue(item.getBillStatus(), BillStatusEnum.values(), BillStatusEnum.class)); +// record.put("userName", simpleEmployee.getUsername()); +// record.put("department", simpleEmployee.getDepartment().getName()); +// record.put("supplementaryMonth", item.getSupplementaryMonth()); +// record.put("mobile", simpleEmployee.getMobile()); +// record.put("employeeStatus", simpleEmployee.getStatus().getDescription()); +// ResourceFromEnum from = SalaryEnumUtil.enumMatchByValue(item.getResourceFrom(), ResourceFromEnum.values(), ResourceFromEnum.class); +// record.put("sourceFrom", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, from.getLabelId(), from.getDefaultLabel())); +// record.put("socialPayOrg", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName()); +// record.put("socialAccount", item.getSocialAccount()); +// record.put("socialSchemeName", siSchemeService.querySchemeName(item.getSocialSchemeId())); +// if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { +// Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : paymentMap.get(item.getFundPayOrg()).getName()); +// record.put("fundAccount", item.getFundAccount()); +// record.put("fundSchemeName", siSchemeService.querySchemeName(item.getFundSchemeId())); +// record.put("supplementFundAccount", item.getSupplementFundAccount()); +// if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { +// Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// socialJson.forEach((k, v) -> { +// record.put(k + "fundBase", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName()); +// record.put("otherSchemeName", siSchemeService.querySchemeName(item.getOtherSchemeId())); +// if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { +// Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// socialJson.forEach((k, v) -> { +// record.put(k + "otherBase", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// if (StringUtils.isNotEmpty(item.getSocialPerJson())) { +// Map socialJson = JSON.parseObject(item.getSocialPerJson(), new HashMap().getClass()); +// socialJson.forEach((k, v) -> { +// record.put(k + "socialPer", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("socialPerSum", SalaryEntityUtil.thousandthConvert(item.getSocialPerSum())); +// if (StringUtils.isNotEmpty(item.getFundPerJson())) { +// Map fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap().getClass()); +// fundPerJson.forEach((k, v) -> { +// record.put(k + "fundPer", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("fundPerSum", SalaryEntityUtil.thousandthConvert(item.getFundPerSum())); +// if (StringUtils.isNotEmpty(item.getOtherPerJson())) { +// Map fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap().getClass()); +// fundPerJson.forEach((k, v) -> { +// record.put(k + "otherPer", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("otherPerSum", SalaryEntityUtil.thousandthConvert(item.getOtherPerSum())); +// record.put("perSum", SalaryEntityUtil.thousandthConvert(item.getPerSum())); +// if (StringUtils.isNotEmpty(item.getSocialComJson())) { +// Map fundPerJson = JSON.parseObject(item.getSocialComJson(), new HashMap().getClass()); +// fundPerJson.forEach((k, v) -> { +// record.put(k + "socialCom", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("socialComSum", SalaryEntityUtil.thousandthConvert(item.getSocialComSum())); +// if (StringUtils.isNotEmpty(item.getFundComJson())) { +// Map fundPerJson = JSON.parseObject(item.getFundComJson(), new HashMap().getClass()); +// fundPerJson.forEach((k, v) -> { +// record.put(k + "fundCom", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("fundComSum", SalaryEntityUtil.thousandthConvert(item.getFundComSum())); +// if (StringUtils.isNotEmpty(item.getOtherComJson())) { +// Map fundPerJson = JSON.parseObject(item.getOtherComJson(), new HashMap().getClass()); +// fundPerJson.forEach((k, v) -> { +// record.put(k + "otherCom", SalaryEntityUtil.thousandthConvert((String) v)); +// }); +// } +// record.put("otherComSum", SalaryEntityUtil.thousandthConvert(item.getOtherComSum())); +// record.put("comSum", SalaryEntityUtil.thousandthConvert(item.getComSum())); +// record.put("socialSum", SalaryEntityUtil.thousandthConvert(item.getSocialSum())); +// record.put("fundSum", SalaryEntityUtil.thousandthConvert(item.getFundSum())); +// record.put("otherSum", SalaryEntityUtil.thousandthConvert(item.getOtherSum())); +// record.put("total", SalaryEntityUtil.thousandthConvert(item.getTotal())); + //result.add(record); + //}); + return result; + } + + @Override + public List> buildCommonRecordsWithStyle(List list, Long employeeId) { + return null; + } + + @Override + public List> buildInspectRecords(List list) { + return null; + } +} diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 6856f8ccc..c2c7e6a11 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1,18 +1,23 @@ package com.engine.salary.service.impl; import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIAccountBiz; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.entity.siaccount.bo.InsuranceAccountBO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO; import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; +import com.engine.salary.service.RecordsBuildService; import com.engine.salary.service.SIAccountService; import java.util.*; import com.engine.salary.util.page.PageInfo; +import weaver.hrm.User; /** @@ -25,6 +30,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { private SIAccountBiz siAccountBiz = new SIAccountBiz(); + public RecordsBuildService getService(User user) { + return ServiceUtil.getService(RecordsBuildServiceImpl.class,user); + } + @Override public Map listPage(InsuranceAccountBatchParam queryParam) { Long employeeId = (long)user.getUID(); @@ -85,10 +94,21 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } @Override - public Map listCommonPage(String billMonth) { + public Map listCommonPage(InsuranceAccountDetailParam queryParam) { Long employeeId = (long)user.getUID(); Map datas = new HashMap<>(); - return null; + //正常缴纳列表 + PageInfo pageInfo = siAccountBiz.listCommonPage(queryParam); + List insuranceAccountDetailPOS = pageInfo.getList(); + + //数据组装 + List> records = getService(user).buildCommonRecords(insuranceAccountDetailPOS, employeeId); + + + + return datas; } + + } diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 02e028204..6c06c24a2 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -1,8 +1,8 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; -import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; import com.engine.salary.service.SIAccountService; import com.engine.salary.service.impl.SIAccountServiceImpl; import com.engine.salary.util.ResponseResult; @@ -47,9 +47,9 @@ public class SIAccountController { @Path("/detail/common/list") @Produces(MediaType.APPLICATION_JSON) public String commonList(@Context HttpServletRequest request, @Context HttpServletResponse response, - @QueryParam("billMonth") String billMonth) { + @RequestBody InsuranceAccountDetailParam insuranceAccountDetailParam) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>().run(getService(user)::listCommonPage, billMonth); + return new ResponseResult>().run(getService(user)::listCommonPage, insuranceAccountDetailParam); }