2022-04-11 19:07:35 +08:00
|
|
|
package com.engine.salary.entity.siaccount.bo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO;
|
|
|
|
|
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
|
|
|
|
|
import com.engine.salary.enums.siaccount.BillStatusEnum;
|
2022-08-09 16:54:29 +08:00
|
|
|
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
2022-04-11 19:07:35 +08:00
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
|
|
|
|
import com.engine.salary.util.SalaryEnumUtil;
|
2022-06-09 18:31:36 +08:00
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
2022-04-11 19:07:35 +08:00
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
* @Description:
|
|
|
|
|
* @Date 2022/4/11
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
public class InsuranceAccountBO {
|
|
|
|
|
|
|
|
|
|
// public static Wrapper<InsuranceAccountInspectPO> buildInspectListWrapper(String billMonth, String tenantKey) {
|
|
|
|
|
// LambdaQueryWrapper<InsuranceAccountInspectPO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
// lambdaQueryWrapper.eq(InsuranceAccountInspectPO::getTenantKey, tenantKey);
|
|
|
|
|
// lambdaQueryWrapper.eq(InsuranceAccountInspectPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
// lambdaQueryWrapper.eq(InsuranceAccountInspectPO::getBillMonth, billMonth);
|
|
|
|
|
// return lambdaQueryWrapper;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public static Wrapper<InsuranceAccountBatchPO> buildBatchListWrapper(String startTime, String endTime, String tenantKey) {
|
|
|
|
|
// LambdaQueryWrapper<InsuranceAccountBatchPO> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
// lambdaQueryWrapper.eq(InsuranceAccountBatchPO::getTenantKey, tenantKey);
|
|
|
|
|
// lambdaQueryWrapper.eq(InsuranceAccountBatchPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
// if (StringUtils.isNotBlank(startTime)) {
|
|
|
|
|
// lambdaQueryWrapper.ge(InsuranceAccountBatchPO::getBillMonth, startTime);
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(endTime)) {
|
|
|
|
|
// lambdaQueryWrapper.le(InsuranceAccountBatchPO::getBillMonth, endTime);
|
|
|
|
|
// }
|
|
|
|
|
// lambdaQueryWrapper.orderByDesc(InsuranceAccountBatchPO::getBillMonth);
|
|
|
|
|
// return lambdaQueryWrapper;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
public static List<InsuranceAccountBatchListDTO> buildAccountBatchDTOList(Collection<InsuranceAccountBatchPO> list) {
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
return list.stream().map(e -> InsuranceAccountBatchListDTO.builder()
|
|
|
|
|
.id(e.getId())
|
|
|
|
|
.accountant(e.getAccountant())
|
|
|
|
|
.billMonth(e.getBillMonth())
|
2023-06-27 15:05:07 +08:00
|
|
|
.billStatus(queryLabelId(e.getBillStatus()).getDefaultLabel())
|
|
|
|
|
// .billStatus(e.getBillStatus().toString())
|
2022-04-11 19:07:35 +08:00
|
|
|
.fundNum(e.getFundNum())
|
|
|
|
|
.fundPay(SalaryEntityUtil.thousandthConvert(e.getFundPay()))
|
|
|
|
|
.lastTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(e.getUpdateTime()))
|
|
|
|
|
.otherNum(e.getOtherNum())
|
|
|
|
|
.otherPay(SalaryEntityUtil.thousandthConvert(e.getOtherPay()))
|
|
|
|
|
.remarks(e.getRemarks())
|
|
|
|
|
.socialNum(e.getSocialNum())
|
|
|
|
|
.socialPay(SalaryEntityUtil.thousandthConvert(e.getSocialPay()))
|
2022-06-09 18:31:36 +08:00
|
|
|
.paymentOrganization(e.getPaymentOrganization() != null ? MapperProxyFactory.getProxy(TaxAgentMapper.class).getById(e.getPaymentOrganization()).getName() : "")
|
|
|
|
|
.paymentOrganizationId(e.getPaymentOrganization())
|
2022-11-16 14:05:43 +08:00
|
|
|
.creator(e.getCreator())
|
2022-04-11 19:07:35 +08:00
|
|
|
.build()
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static BillStatusEnum queryLabelId(Integer value) {
|
|
|
|
|
return SalaryEnumUtil.enumMatchByValue(value, BillStatusEnum.values(), BillStatusEnum.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// public static Wrapper<InsuranceAccountDetailPO> buildBillWrapper(String billMonth, PaymentStatusEnum paymentStatusEnum, Long employeeId, String tenantKey) {
|
|
|
|
|
// LambdaQueryWrapper<InsuranceAccountDetailPO> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getTenantKey, tenantKey);
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getBillMonth, billMonth);
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getPaymentStatus, paymentStatusEnum.getValue());
|
|
|
|
|
// queryWrapper.orderByDesc(InsuranceAccountDetailPO::getUpdateTime);
|
|
|
|
|
// return queryWrapper;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// public static Wrapper<InsuranceAccountDetailPO> buildPersonBillWrapper(String startMonth, String endMonth, Long employeeId, String tenantKey) {
|
|
|
|
|
// LambdaQueryWrapper<InsuranceAccountDetailPO> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getTenantKey, tenantKey);
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
// queryWrapper.eq(InsuranceAccountDetailPO::getEmployeeId, employeeId);
|
|
|
|
|
// if (StringUtils.isNotBlank(startMonth) && StringUtils.isNotBlank(endMonth)) {
|
|
|
|
|
// queryWrapper.between(InsuranceAccountDetailPO::getBillMonth, startMonth, endMonth);
|
|
|
|
|
// }
|
|
|
|
|
// queryWrapper.orderByDesc(InsuranceAccountDetailPO::getBillMonth);
|
|
|
|
|
// return queryWrapper;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|