Commit f5e9ac94 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 2520b185 702da3e5
package com.yifu.cloud.plus.v1.yifu.insurances.util;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* @author licancan
* @description easyExcel时间转换类 (Can not find ‘Converter‘ support class LocalDate)
* @date 2022-11-10 14:41:42
*/
public class LocalDateConverter implements Converter<LocalDate> {
@Override
public Class<LocalDate> supportJavaTypeKey() {
return LocalDate.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
@Override
public LocalDate convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return LocalDate.parse(cellData.getStringValue(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
@Override
public WriteCellData<String> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new WriteCellData<>(value.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateConverter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
......@@ -23,48 +29,48 @@ public class InsuredListVo implements Serializable {
* 主键
*/
@Schema(description = "主键")
@ExcelIgnore
private String id;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工身份证号")
private String empIdcardNo;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "投保类型")
@ExcelAttribute(name = "投保类型", readConverterExp = "1=新增,3=批增,4=替换")
private String buyType;
/**
* 项目名称
*/
@Schema(description = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "项目")
private String projectName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "岗位")
private String post;
/**
......@@ -72,6 +78,9 @@ public class InsuredListVo implements Serializable {
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单开始日期",converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate policyStart;
/**
......@@ -79,60 +88,81 @@ public class InsuredListVo implements Serializable {
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单结束日期",converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate policyEnd;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保险公司")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "购买标准(元)")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "医保(万元)")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "身故或残疾(万元)")
private String dieDisableQuota;
/**
* 预估保费
*/
@Schema(description = "预估保费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "预估保费(元)")
private BigDecimal estimatePremium;
/**
* 实际保费
*/
@Schema(description = "实际保费")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "实际保费(元)")
private BigDecimal actualPremium;
/**
* 保单号
*/
@Schema(description = "保单号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单号")
private String policyNo;
/**
* 发票号
*/
@Schema(description = "发票号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "发票号")
private String invoiceNo;
/**
......@@ -140,103 +170,149 @@ public class InsuredListVo implements Serializable {
*/
@Schema(description = "保单生效日期")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单生效日期",converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate policyEffect;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
@ExcelIgnore
private Integer reduceHandleStatus;
/**
* 项目编码
*/
@Schema(description = "项目编码")
@ExcelIgnore
private String deptNo;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
@ExcelIgnore
private Integer insuranceProvince;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
@ExcelIgnore
private String insuranceProvinceName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
@ExcelIgnore
private Integer insuranceCity;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险购买地")
private String insuranceCityName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
@ExcelIgnore
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
@ExcelIgnore
private String insuranceHandleProvinceName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
@ExcelIgnore
private Integer insuranceHandleCity;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "商险办理地")
private String insuranceHandleCityName;
/**
* 是否出险 0未出险 1已出险
*/
@Schema(description = "是否出险 0未出险 1已出险")
private Integer isUse;
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "是否出险", readConverterExp = "0=未出险,1=已出险")
@ExcelProperty(value = "是否出险")
private String isUse;
/**
* 是否有效 0有效 1无效
* 是否过期 0未过期 1已过期
*/
@Schema(description = "是否有效 0有效 1无效")
private Integer isEffect;
@Schema(description = "是否过期 0未过期 1已过期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "是否过期", readConverterExp = "0=未过期,1=已过期")
@ExcelProperty(value = "是否过期")
private String isOverdue;
/**
* 是否过期 0未过期 1已过期
* 是否有效 0有效 1无效
*/
@Schema(description = "是否过期 0未过期 1已过期")
private Integer isOverdue;
@Schema(description = "是否有效 0有效 1无效")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelAttribute(name = "是否有效 ", readConverterExp = "0=有效,1=无效")
@ExcelProperty(value = "是否有效")
private String isEffect;
/**
* 派单日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "派单日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "派单日期",converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate createTime;
/**
* 派单人
*/
@Schema(description = "创建人(派单人)")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "派单人")
private String createName;
/**
* 购买月数
*/
@Schema(description = "购买月数")
@ExcelIgnore
private Long buyMonth;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
@ExcelIgnore
private String createUserDeptName;
/**
* 封面抬头
*/
@Schema(description = "封面抬头")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "封面抬头")
private String invoiceTitle;
......
......@@ -120,4 +120,15 @@ public class InsuredParam extends BaseEntity implements Serializable {
@Schema(description = "减员状态 1待减员 2减员中3减员退回,4减员成功")
private Integer reduceHandleStatus;
/**
* @Author fxj
* 查询数据起
**/
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
private int limitEnd;
}
......@@ -21,6 +21,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.List;
......@@ -357,13 +358,14 @@ public class TInsuranceDetailController {
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List<InsuredListVo>>}
* @param response 相应参数
* @return void
*/
@Operation(summary = "已投保列表不分页查询", description = "已投保列表不分页查询")
@PostMapping("/getInsuredList")
@PreAuthorize("@pms.hasPermission('insurance_custserve_insured_export')")
public R getInsuredList(@RequestBody InsuredParam param) {
return tInsuranceDetailService.getInsuredList(param);
public void getInsuredList(@RequestBody InsuredParam param, HttpServletResponse response) {
tInsuranceDetailService.getInsuredList(param,response);
}
/**
......
......@@ -113,6 +113,15 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
List<InsuredListVo> getInsuredList(@Param("param") InsuredParam param);
/**
* 已投保列表不分页查询统计(excel导出统计)
*
* @author licancan
* @param param
* @return {@link long}
*/
long getInsuredListCount(@Param("param") InsuredParam param);
/**
* 已减员列表分页查询
*
......
......@@ -10,6 +10,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -204,9 +205,10 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuredListVo>}
* @param response 相应参数
* @return void
*/
R getInsuredList(InsuredParam param);
void getInsuredList(InsuredParam param, HttpServletResponse response);
/**
* 已减员列表分页查询
......
......@@ -538,9 +538,9 @@
a.INVOICE_NO as invoiceNo,
a.POLICY_EFFECT as policyEffect,
a.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
a.INSURANCE_CITY_NAME as insuranceCityName,
CONCAT(a.INSURANCE_PROVINCE_NAME,'/',a.INSURANCE_CITY_NAME) as insuranceCityName,
a.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
a.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
CONCAT(a.INSURANCE_HANDLE_PROVINCE_NAME,'/',a.INSURANCE_HANDLE_CITY_NAME) as insuranceHandleCityName,
a.IS_USE as isUse,
a.IS_EFFECT as isEffect,
a.IS_OVERDUE as isOverdue,
......@@ -608,6 +608,77 @@
${param.authSql}
</if>
ORDER BY a.CREATE_TIME DESC
<if test="param != null">
<if test="param.limitStart != null">
limit #{param.limitStart},#{param.limitEnd}
</if>
</if>
</select>
<select id="getInsuredListCount" resultType="java.lang.Long">
select
count(1)
from
t_insurance_detail a
where
a.DELETE_FLAG = 0
and
a.BUY_HANDLE_STATUS = 3
<if test="param.createName != null and param.createName.trim() != ''">
and a.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyType != null">
and a.BUY_TYPE = #{param.buyType}
</if>
<if test="param.reduceHandleStatus != null">
and a.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo}
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''">
AND a.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00')
</if>
<if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''">
AND a.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')
</if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(a.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, ' 00:00:00') and a.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR
(a.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and a.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR
(a.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and a.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''">
AND a.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, ' 00:00:00')
</if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND a.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59')
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
and a.INVOICE_NO like concat('%',replace(replace(#{param.invoiceNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.isUse != null">
and a.IS_USE = #{param.isUse}
</if>
<if test="param.isOverdue != null ">
and a.IS_OVERDUE = #{param.isOverdue}
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
ORDER BY a.CREATE_TIME DESC
</select>
<!-- 已减员列表分页查询-->
<select id="getInsuranceRefundPageList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceRefundListVo">
......
......@@ -30,6 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLDecoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -995,10 +996,10 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
|| SalaryConstants.ENTERPRISE_ANNUITY_JAVA.equals(item.getJavaFiedName())
|| SalaryConstants.WITHHOLIDING_PERSON_SOCIAL.equals(item.getJavaFiedName())
|| SalaryConstants.WITHHOLIDING_PERSON_FUND.equals(item.getJavaFiedName())) {
sum = sum.add(item.getSalaryMoney()).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
sum = sum.add(item.getSalaryMoney()).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
}
sum = realSalary.subtract(sum).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
sum = realSalary.subtract(sum).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
if (sum.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
sum = SalaryConstants.B_ZERO;
}
......@@ -1104,7 +1105,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
**/
private BigDecimal getSocialFundMoney(TSalaryAccount a, List<TPaymentBySalaryVo> estmateList, boolean isSocial
, boolean isPerson, Set<String> socialList, Set<String> fundList, BigDecimal money, BigDecimal sub) {
money = money.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
money = money.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
for (TPaymentBySalaryVo m : estmateList) {
if (Common.isNotNull(a.getEmpIdcard()) && a.getEmpIdcard().equals(m.getEmpIdcard())) {
//社保
......@@ -1276,7 +1277,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
if (res.compareTo(SalaryConstants.B_ZERO) < SalaryConstants.EQUAL) {
return SalaryConstants.B_ZERO;
}
res = res.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
res = res.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
a.setSalaryTax(res);
return res;
}
......@@ -1340,12 +1341,12 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.32")), new BigDecimal("7000"))
, new BigDecimal("0.68"));
}
nowTax = nowTax.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
nowTax = nowTax.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
nowTax = BigDecimalUtils.safeSubtract(nowTax, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
nowTax = BigDecimalUtils.safeSubtract(nowTax, sumTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
BigDecimal relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
BigDecimal relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
// 本次个人应发合计
TSalaryAccountItem sai = new TSalaryAccountItem();
sai.setCnName(SalaryConstants.RELAY_SALARY);
......@@ -1656,6 +1657,8 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal actualSalarySum = BigDecimal.ZERO;
// 历史个税合计
BigDecimal sumTax = BigDecimal.ZERO;
// 个人承担部分历史个税合计
BigDecimal sumOtherTax;
// 历史应发合计
BigDecimal sumSalaryTax = BigDecimal.ZERO;
// 本次实发
......@@ -1683,33 +1686,42 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimal nowTaxY;
BigDecimal relaySalary;
BigDecimal salaryTax = BigDecimal.ZERO;
if (SalaryConstants.IS_PERSON_OTHER.equals(a.getIsPersonTax())) {
// 1个人承担部分
if (SalaryConstants.IS_PERSON_TAX_ARR[1].equals(a.getIsPersonTax())) {
nowTaxT = getNowTax(actualSalarySumNow);
if (actualSalarySum.compareTo(actualSalarySumNow) != 0) {
actualSalarySumT = BigDecimalUtils.safeAdd(nowTaxT, sumSalaryTax, actualSalarySumNow).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
//计算历史税费
sumOtherTax = getNowTaxNew(sumSalaryTax);
//计算本月实发合计
actualSalarySumT = BigDecimalUtils.safeAdd(nowTaxT, sumSalaryTax, actualSalarySumNow).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
//累计税费
nowTaxY = getNowTaxNew(actualSalarySumT);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
if (sumOtherTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
salaryTax = BigDecimalUtils.safeSubtract(nowTaxY, nowTaxT);
} else {
nowTaxY = nowTaxT;
}
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
//公司应发
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
a.setSalaryTax(salaryTax);
a.setSalaryTaxUnit(nowTaxT);
a.setActualSalary(BigDecimalUtils.safeSubtract(actualSalarySumNow, salaryTax));
} else if (SalaryConstants.IS_COMPANY.equals(a.getIsPersonTax())) {
getNowTax(actualSalarySumNow);
} else if (SalaryConstants.IS_PERSON_TAX_ARR[0].equals(a.getIsPersonTax())) {
// 0公司承担全部
nowTaxY = getNowTax(actualSalarySum);
a.setActualSalary(actualSalarySumNow);
if (sumTax.compareTo(BigDecimal.ZERO) != 0) {
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumTax).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
if (sumSalaryTax.compareTo(BigDecimal.ZERO) != 0) {
//历史应发税费
sumOtherTax = getNowTax(sumSalaryTax);
nowTaxY = BigDecimalUtils.safeSubtract(nowTaxY, sumOtherTax).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
}
a.setSalaryTaxUnit(nowTaxY);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
relaySalary = BigDecimalUtils.safeAdd(actualSalarySumNow, nowTaxY).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
} else {
// 2个人承担全部
// TODO-@胡 :个人承担全部税费,实发要变为应发,推算出实发、个税
......@@ -1753,7 +1765,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.32")), new BigDecimal("7000"))
, new BigDecimal("0.68"));
}
nowTax = nowTax.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
nowTax = nowTax.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
return nowTax;
}
......@@ -1776,7 +1788,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
nowTax = BigDecimalUtils.safeSubtract(BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.32"))
, new BigDecimal("7000"));
}
nowTax = nowTax.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
nowTax = nowTax.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
return nowTax;
}
......@@ -1930,7 +1942,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//个人税费
BigDecimal nowTaxT = getNowTaxRemu(actualSalarySumNow);
BigDecimal relaySalary;
relaySalary = BigDecimalUtils.safeSubtract(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
relaySalary = BigDecimalUtils.safeSubtract(actualSalarySumNow, nowTaxT).setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
a.setSalaryTax(nowTaxT);
a.setActualSalary(relaySalary);
a.setRelaySalaryUnit(actualSalarySumNow);
......@@ -1957,7 +1969,7 @@ public class SalaryUploadServiceImpl extends ServiceImpl<TSalaryStandardMapper,
//x*0.16*0.7
nowTax = BigDecimalUtils.safeMultiply(actualSalarySum, new BigDecimal("0.112"));
}
nowTax = nowTax.setScale(SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP);
nowTax = nowTax.setScale(SalaryConstants.PLACES, RoundingMode.HALF_UP);
return nowTax;
}
......
......@@ -55,6 +55,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
......@@ -200,7 +201,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsBonusImportVo.class).build();
int index = 0;
//个税配置
List<TSalaryTaxConfig> personTax = tSalaryTaxConfigService.getTaxConfigByPersonList(new TSalaryTaxConfig());
//年终奖配置
......@@ -245,13 +245,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
isTax = BigDecimal.ZERO;
twlSalaryTax = BigDecimal.ZERO;
//12月是否发薪
Boolean isSend = false;
boolean isSend = false;
//年终奖单独扣税12月税费
finalSalaryNoSalary = BigDecimal.ZERO;
//年终奖合并扣税12月税费
finalSalaryWithSalary = BigDecimal.ZERO;
//12月份应纳税所得额扣除费用
BigDecimal deductTaxSalary = infoVo.getDeductTaxSalary();
//12月社保公积金扣费
socialFundTax = BigDecimal.ZERO;
//专项扣除列表
......@@ -523,30 +522,29 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
//本次薪资纳税额
res = BigDecimal.ZERO;
//本次年终奖纳税额
anRes = BigDecimal.ZERO;;
anRes = BigDecimal.ZERO;
//年终奖金额
BigDecimal annous = BigDecimalUtils.safeSubtract(wSalary,i);
//计算个税
if (i.compareTo(BigDecimal.ZERO) == SalaryConstants.MORE_THAN ) {
if (i.compareTo(BigDecimal.ZERO) > 0 ) {
BigDecimal sumI = BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(i,ySalary),
BigDecimalUtils.safeAdd(sumDeductSalary));
for (TSalaryTaxConfig sub : personTax) {
if (sumI.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
if (sumI.compareTo(sub.getMinIncome()) > 0
&& sumI.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
//sumI = realDeduSalary * ((double) ((i.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
//累计个税
res = BigDecimalUtils.safeSubtract(sumI.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)), sub.getQuickDeducation());
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, RoundingMode.HALF_UP)), sub.getQuickDeducation());
//本次个税
BigDecimal bcTax = res.subtract(BigDecimalUtils.safeAdd(sumTax,twlSalaryTax));
if (bcTax.compareTo(BigDecimal.ZERO) == SalaryConstants.MORE_THAN ||
if (bcTax.compareTo(BigDecimal.ZERO) > 0 ||
bcTax.compareTo(BigDecimal.ZERO) == SalaryConstants.EQUAL) {
res = BigDecimalUtils.safeAdd(bcTax,twlSalaryTax);
} else {
res = BigDecimalUtils.safeAdd(twlSalaryTax,sumTax);
}
res = BigDecimalUtils.safeSubtract(sumI.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP)),
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, RoundingMode.HALF_UP)),
BigDecimalUtils.safeAdd(sumTax,sub.getQuickDeducation()));
break;
}
......@@ -556,15 +554,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
//计算年终奖税
//年终奖
if (annous != null && annous.compareTo(SalaryConstants.B_ZERO) == SalaryConstants.MORE_THAN
if (annous != null && annous.compareTo(SalaryConstants.B_ZERO) > 0
&& annousTax != null && annousTax.size() > CommonConstants.ZERO_INT) {
BigDecimal month = annous.divide(SalaryConstants.B_TWELVE, SalaryConstants.TAX_FEE_PLACES, BigDecimal.ROUND_HALF_UP);
BigDecimal month = annous.divide(SalaryConstants.B_TWELVE, SalaryConstants.TAX_FEE_PLACES, RoundingMode.HALF_UP);
// 应纳税额
for (TSalaryTaxConfig sub : annousTax) {
if (month.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
if (month.compareTo(sub.getMinIncome()) > 0
&& month.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
anRes = annous.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.TAX_FEE_PLACES, BigDecimal.ROUND_HALF_UP))
SalaryConstants.B_ONEHUNDRED, SalaryConstants.TAX_FEE_PLACES, RoundingMode.HALF_UP))
.subtract(sub.getQuickDeducation());
break;
}
......
......@@ -170,7 +170,7 @@ public class SalaryAccountUtil implements Serializable {
}
if (SalaryConstants.RELAY_SALARY_JAVA.equals(scs.getJavaFiedName())) {
try {
relaySalary = new BigDecimal(cellValueStr);
relaySalary = new BigDecimal(cellValueStr.replace(",",""));
sai = new TSalaryAccountItemVo();
sai.setCnName(dbFiedName);
sai.setJavaFiedName(scs.getJavaFiedName());
......@@ -186,7 +186,7 @@ public class SalaryAccountUtil implements Serializable {
}
if (SalaryConstants.ACTUAL_SALARY_SUM_JAVA.equals(scs.getJavaFiedName())) {
try {
actualSalarySum = new BigDecimal(cellValueStr);
actualSalarySum = new BigDecimal(cellValueStr.replace(",",""));
entity.setActualSalary(actualSalarySum);
} catch (Exception e) {
errorFlag = false;
......@@ -196,12 +196,15 @@ public class SalaryAccountUtil implements Serializable {
}
}
if (SalaryConstants.PDEDUCTION_JAVA.equals(scs.getJavaFiedName())
|| SalaryConstants.UDEDUCTION_JAVA.equals(scs.getJavaFiedName())) {
|| SalaryConstants.UDEDUCTION_JAVA.equals(scs.getJavaFiedName())
|| SalaryConstants.ENTERPRISE_ANNUITY_JAVA.equals(scs.getJavaFiedName())
|| SalaryConstants.ENTERPRISE_ANNUITY_UNIT_JAVA.equals(scs.getJavaFiedName())
|| scs.getJavaFiedName().contains(SalaryConstants.WITHHOLIDING)) {
try {
new BigDecimal(cellValueStr);
new BigDecimal(cellValueStr.replace(",",""));
} catch (Exception ex) {
errorFlag = false;
error = "第" + (i + 2) + "行:个人、单位代扣,只能是金额!";
error = "第" + (i + 2) + "行:代扣、企业年金,只能是金额!";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
......@@ -236,6 +239,12 @@ public class SalaryAccountUtil implements Serializable {
salaryGiveTimeFlag = false;
entity.setSalaryGiveTime(CommonConstants.ONE_STRING);
}
if (SalaryConstants.IS_PERSON.equals(cellValueStr)) {
errorFlag = false;
error = "第" + (i + 2) + "行:个人承担全部税费,正在开发中,下周见~";
errorList.add(new ErrorMessage((i + 2), error));
continue;
}
field = fieldsMap.get(scs.getJavaFiedName());
if (field == null) {
sai = new TSalaryAccountItemVo();
......@@ -247,7 +256,7 @@ public class SalaryAccountUtil implements Serializable {
sai.setIsTax(CommonConstants.ZERO_INT);
}
try {
cellValueBig = new BigDecimal(cellValueStr);
cellValueBig = new BigDecimal(cellValueStr.replace(",",""));
cellValueBig = cellValueBig.setScale(2, BigDecimal.ROUND_HALF_UP); //四舍五入
if (cellValueBig.toString().length() > 11) {
if (cellValueBig.toString().length() > 500) {
......
......@@ -432,6 +432,9 @@ public class SalaryCommonUtil implements Serializable {
if (cellValueStr.indexOf('%') != -1) {
cellValueStr = cellValueStr.replace("%", "");
}
if (cellValueStr.indexOf(',') != -1) {
cellValueStr = cellValueStr.replace(",", "");
}
field.set(entity, BigDecimal.valueOf(Double.valueOf(cellValueStr)));
}
......@@ -518,26 +521,4 @@ public class SalaryCommonUtil implements Serializable {
entity.setFormType(salaryType);
}
/**
* @Description: 简单的Set转化为String
* @Author: hgw
* @Date: 2022-1-11 11:16:50
* @return: java.lang.String
**/
public static String setToStrEasy(Set<String> strSet) {
String result = "";
if (strSet != null && !strSet.isEmpty()) {
int i = 0;
for (String str : strSet) {
if (i == 0) {
result = str;
} else {
result = result.concat(",").concat(str);
}
i++;
}
}
return result;
}
}
......@@ -142,8 +142,6 @@ public class SalaryConstants {
public static final String ACTUAL_SALARY_SUM = "个人实发合计";
//个人实发合计
public static final String ACTUAL_SALARY_SUM_JAVA = "actualSalarySum";
// 是否个人承担部分税费
public static final String IS_PERSON_TAX = "isPersonTax";
// 是否个人承担部分税费数组
public static final String IS_PERSON_TAX_ARR[] = {"0","1","2"};
// 公司承担全部税费0
......@@ -154,12 +152,15 @@ public class SalaryConstants {
public static final String IS_PERSON = "个人承担全部税费";
//个人代扣
public static final String PDEDUCTION_JAVA = "pdeduction";
// 代扣前缀
public static final String WITHHOLIDING = "withholiding";
//单位代扣
public static final String UDEDUCTION_JAVA = "udeduction";
//免个税个人代扣
public static final String EXEMPTION_PERSION_TAX_JAVA = "exemptionPersionTax";
//企业(职业)年金
public static final String ENTERPRISE_ANNUITY_JAVA = "enterpriseAnnuity";
public static final String ENTERPRISE_ANNUITY_UNIT_JAVA = "enterpriseAnnuityUnit";
//风险抵押金
public static final String RISK_MORTGAGE_MONEY_JAVA = "riskMortgageMoney";
//单位补足扣返
......
......@@ -157,7 +157,7 @@ public class FundHandleExportVo implements Serializable {
private String providentHouseholdName;
/**
*
*委托备注
*委托备注——2022-11-10 16:54:32与房工讨论,由于派增派减两个委托备注,只能取派单表里的委托备注,社保公积金的委托备注字段废弃
**/
@ExcelAttribute(name = "委托备注",needExport = true)
@HeadFontStyle(fontHeightInPoints = 11)
......
......@@ -386,7 +386,7 @@ public class SocialHandleExportVo implements Serializable {
private BigDecimal personalBigailmentMoney;
/**
*
*委托备注
*委托备注——2022-11-10 16:54:32与房工讨论,由于派增派减两个委托备注,只能取派单表里的委托备注,社保公积金的委托备注字段废弃
**/
@ExcelAttribute(name = "委托备注",needExport = true)
@Schema(description = "委托备注")
......
......@@ -737,6 +737,7 @@
<result property="fundCity" column="FUND_CITY"/>
<result property="fundTown" column="FUND_TOWN"/>
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
<result property="fundTrustRemark" column="TRUST_REMARK"/>
</resultMap>
<!--tDispatchInfo 社保花名册数据查询-->
......@@ -785,7 +786,7 @@
s.UNIT_BIGAILMENT_CARDINAL,
s.UNIT_BIGAILMENT_MONEY,
s.PERSONAL_BIGAILMENT_MONEY,
s.TRUST_REMARK socailTrustRemark,
a.TRUST_REMARK,
a.REDUCE_REASON
<include refid="where_getSocialRecordRoster"/>
</select>
......@@ -844,7 +845,8 @@
f.PERSONAL_PROVIDENT_FEE,
f.FUND_PROVINCE,
f.FUND_CITY,
f.FUND_TOWN
f.FUND_TOWN,
a.TRUST_REMARK
<include refid="where_getFundRecord"/>
</select>
......@@ -868,7 +870,7 @@
</if>
left join t_social_info s on a.SOCIAL_ID = s.id
<where>
1=1 and s.DELETE_FLAG = 0
s.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
......@@ -982,7 +984,7 @@
</if>
left join t_provident_fund f on a.FUND_ID = f.id
<where>
1=1 and a.DELETE_FLAG = 0
a.DELETE_FLAG = 0
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment