Merge remote-tracking branch 'remotes/origin/feature/v3-siAccountCompensation-1201' into release/2.3.2.2212.01

This commit is contained in:
sy 2022-12-08 16:25:28 +08:00
commit 0399731b9b
25 changed files with 1735 additions and 15 deletions

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.TypeReference;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.cache.SalaryCacheKey;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.siaccount.InsuranceAccountDetailPOEncrypt;
@ -16,10 +17,7 @@ import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.dto.SIAccountUtilDTO;
import com.engine.salary.entity.siaccount.param.*;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailTempPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siaccount.po.*;
import com.engine.salary.entity.siarchives.po.*;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
@ -33,8 +31,10 @@ import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SalaryAcctProgressService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.SalaryAcctProgressServiceImpl;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
@ -53,6 +53,7 @@ import com.wbi.util.StringUtil;
import dm.jdbc.util.IdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import weaver.hrm.User;
@ -109,6 +110,14 @@ public class SIAccountBiz extends Service {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
private InsuranceCompensationMapper getInsuranceCompensationMapper() {
return MapperProxyFactory.getProxy(InsuranceCompensationMapper.class);
}
private SalaryAcctProgressService getSalaryAcctProgressService(User user) {
return (SalaryAcctProgressService) ServiceUtil.getService(SalaryAcctProgressServiceImpl.class, user);
}
public PageInfo<InsuranceAccountBatchPO> listPage(InsuranceAccountBatchParam queryParam) {
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
List<InsuranceAccountBatchPO> list = getInsuranceAccountBatchMapper().list(queryParam);
@ -221,10 +230,20 @@ public class SIAccountBiz extends Service {
public void accounting(AccountParam param, Long employeeId, String tenantKey, String currentUserName) {
//薪资核算进度暂未实现
// SalaryAcctProgressDTO salaryAcctProgressDTO = salaryAcctProgressService.getProgress(tenantKey + param.getBillMonth(), employeeId, tenantKey);
// if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
// return;
// }
SalaryAcctProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth());
if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
return;
}
// 初始化进度
SalaryAcctProgressDTO initProgress = new SalaryAcctProgressDTO()
.setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中"))
.setTitleLabelId(97515L)
.setTotalQuantity(NumberUtils.INTEGER_ONE)
.setCalculatedQuantity(NumberUtils.INTEGER_ZERO)
.setProgress(BigDecimal.ZERO)
.setStatus(true)
.setMessage(StringUtils.EMPTY);
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), initProgress);
doAccounting(param, employeeId, tenantKey, currentUserName);
}
@ -290,11 +309,23 @@ public class SIAccountBiz extends Service {
}
if (CollectionUtils.isEmpty(ids)) {
//salaryAcctProgressService.fail(tenantKey + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员"));
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员"));
return;
}
SalaryAcctProgressDTO salaryAcctProgressDTO = new SalaryAcctProgressDTO(SalaryI18nUtil.getI18nLabel(97515, "核算中"), 97515L, ids.size(), 0,
BigDecimal.ZERO, true, "", true);
// SalaryAcctProgressDTO salaryAcctProgressDTO = new SalaryAcctProgressDTO(SalaryI18nUtil.getI18nLabel(97515, "核算中"), 97515L, ids.size(), 0,
// BigDecimal.ZERO, true, "", true);
//salaryAcctProgressService.initProgress(tenantKey + param.getBillMonth(), salaryAcctProgressDTO, employeeId, tenantKey);
// 初始化进度
SalaryAcctProgressDTO initProgress = new SalaryAcctProgressDTO()
.setTitle(SalaryI18nUtil.getI18nLabel(97515, "核算中"))
.setTitleLabelId(97515L)
.setTotalQuantity(ids.size())
.setCalculatedQuantity(NumberUtils.INTEGER_ZERO)
.setProgress(BigDecimal.ZERO)
.setStatus(true)
.setMessage(StringUtils.EMPTY);
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), initProgress);
/* List<List<Long>> partition = Lists.partition(ids, 100);
CountDownLatch countDownLatch = new CountDownLatch(partition.size());
BlockingDeque<Boolean> results = new LinkedBlockingDeque<>(partition.size());*/
@ -309,7 +340,12 @@ public class SIAccountBiz extends Service {
/* if (allSuccess) {*/
handleData(ids, param, employeeId, tenantKey, currentUserName);
/*}*/
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelAccountTempDetails(ids, param.getBillMonth());
List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
partition.forEach(part -> {
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization());
});
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true);
} catch (Exception e) {
log.error("account run fail", e);
List<InsuranceAccountBatchPO> list = Lists.newArrayList(getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()));
@ -323,6 +359,7 @@ public class SIAccountBiz extends Service {
//薪资核算进度暂未实现
//salaryAcctProgressService.del(tenantKey + param.getBillMonth(), employeeId, tenantKey);
//logger.error("welfare account error:{}", e.getMessage(), e);
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), e.getMessage());
}
}
@ -364,8 +401,15 @@ public class SIAccountBiz extends Service {
count++;
if (count % 50 == 0 || count >= ids.size()) {
//salaryAcctProgressService.getAndAddCalculatedQty(tenantKey + billMonth, count >= ids.size() ? count % 50 : 50);
getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth, count >= ids.size() ? count % 50 : 50);
}
}
//临时表入库前先对可能存在的历史数据进行删除
List<List<Long>> partition = Lists.partition((List<Long>) ids, 100);
partition.forEach(part -> {
MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization);
});
//临时表数据入库
if (CollectionUtils.isNotEmpty(list)) {
InsuranceAccountDetailTempPOEncrypt.encryptInsuranceAccountDetailTempPOList(list);
List<List<InsuranceAccountDetailTempPO>> lists = splitList(list, 40);
@ -411,8 +455,16 @@ public class SIAccountBiz extends Service {
log.info("bill_detail入库前删除数据数量{}", ids.size());
for (List<Long> part : partitionIds) {
getInsuranceAccountDetailMapper().batchDelAccountDetails(part, billMonth, param.getPaymentOrganization(), paymentStatus);
//删除账单月份+个税扣缴义务人+人员id下的调差数据
getInsuranceCompensationMapper().deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO.builder()
.billMonth(billMonth)
.paymentOrganization(param.getPaymentOrganization())
.employeeIds(part)
.build());
}
//生成bill_detail入库数据
List<InsuranceAccountDetailPO> collect = list.stream().map(item -> {
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();
BeanUtils.copyProperties(item, insuranceAccountDetailPO);
@ -903,6 +955,9 @@ public class SIAccountBiz extends Service {
// }
getInsuranceAccountBatchMapper().deleteById(insuranceAccountBatchPO.getId());
getInsuranceAccountDetailMapper().batchDeleteNotFile(param.getBillMonth(), param.getPaymentOrganization());
//删除账单月份+个税扣缴义务人下的调差数据
getInsuranceCompensationMapper().deleteByBillMonthAndPayOrg(param.getBillMonth(), param.getPaymentOrganization());
// LoggerContext insuranceSchemeContext = new LoggerContext();
// insuranceSchemeContext.setTargetId(String.valueOf(insuranceAccountBatchPO.getId()));
// insuranceSchemeContext.setTargetName(insuranceAccountBatchPO.getBillMonth());

View File

@ -884,6 +884,11 @@ public class SIArchivesBiz {
request.setDepartmentIds(Arrays.stream(param.getDepartmentIdsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList()));
}
if (StringUtils.isNotBlank(param.getSubcompanyIdsStr())) {
request.setSubcompanyIds(Arrays.stream(param.getSubcompanyIdsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList()));
}
if (StringUtils.isNotBlank(param.getPositionsStr())) {
request.setPositions(Arrays.stream(param.getPositionsStr().split(",")).map(BigDecimal::new).collect(Collectors.toList()));
}

View File

@ -20,4 +20,7 @@ public class HrmInfoDTO {
//姓名
private String username;
private Long target;
}

View File

@ -18,10 +18,13 @@ import java.util.Collection;
@AllArgsConstructor
public class HrmQueryParam {
String userName;
private String userName;
private int pageNum;
private int pageSize;
private Collection<Long> ids;
private String billMonth;
private Long paymentOrganization;
}

View File

@ -0,0 +1,97 @@
package com.engine.salary.entity.siaccount.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
import java.util.Map;
/**
* @Author: sy
* @Description: 福利台账-调差
* @Date: 2022/11/23
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsuranceCompensationDTO {
/**
* 主键id
*/
private Long id;
/**
* 前端自定义id
*/
private String originId;
/**
* 只读true为实际调差记录false为调差配置数据非实际调差记录
*
*/
private Boolean status;
/**
* 缴纳组织
*/
private Long paymentOrganization;
/**
* 员工id
*/
private Long employeeId;
/**
* 统计调差福利
*/
private Integer welfareType;
/**
* 统计调差福利类型
*/
private String categoryType;
/**
* 统计调差福利类型选项
*/
private List<Map<String,String>> categoryTypeOptions;
/**
* 国家核算金额
*/
private String countryTotal;
/**
* 公司核算金额
*/
private String companyTotal;
/**
* 应调差额
*/
private String adjustmentTotal;
/**
* 调差到
*/
private Long adjustTo;
/**
* 对象
*/
private Long target;
/**
* 对象选项
*/
private Map<String,String> targetOptions;
/**
* 账单月份
*/
private String billMonth;
}

View File

@ -0,0 +1,48 @@
package com.engine.salary.entity.siaccount.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: sy
* @Description: 福利台账-调差请求参数
* @Date: 2022/11/23
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CompensationParam {
/**
* 缴纳组织
*/
private Long paymentOrganization;
/**
* 对象指InsuranceAccountDetailPO.id
*/
private Long target;
/**
* 指被调差的人员id
*/
private String employeeId;
/**
* 账单月份
*/
private String billMonth;
/**
* 统计调差福利
*/
private Integer welfareType;
/**
* 统计调差福利项即社保公积金其他福利类型下的具体项目
*/
private String categoryType;
}

View File

@ -0,0 +1,80 @@
package com.engine.salary.entity.siaccount.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @Author: sy
* @Description: 社保福利台账-调差配置表
* @Date: 2022/11/28
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_compensation_config
public class InsuranceCompensationConfigPO {
/**
* 主键id
*/
private Long id;
/**
* 缴纳组织
*/
private Long paymentAgency;
/**
* 个税扣缴义务人
*/
private Long paymentOrganization;
/**
* 创建人id
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 租户key
*/
private String tenantKey;
/**
* 统计调差福利
*/
private Integer welfareType;
/**
* 统计调差福利类型
*/
private String categoryType;
/**
* 调差到
*/
private Long adjustTo;
/**
* 员工id
*/
private Long employeeId;
}

View File

@ -0,0 +1,106 @@
package com.engine.salary.entity.siaccount.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Collection;
import java.util.Date;
/**
* @Author: sy
* @Description: 社保福利台账-调差历史记录表
* @Date: 2022/11/23
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
//hrsa_compensation_log
public class InsuranceCompensationPO {
/**
* 主键id
*/
private Long id;
/**
* 缴纳组织
*/
private Long paymentAgency;
/**
* 个税扣缴义务人
*/
private Long paymentOrganization;
/**
* 创建人id
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 租户key
*/
private String tenantKey;
/**
* 员工id
*/
private Long employeeId;
/**
* 统计调差福利
*/
private Integer welfareType;
/**
* 统计调差福利类型
*/
private String categoryType;
/**
* 国家核算金额
*/
private String countryTotal;
/**
* 公司核算金额
*/
private String companyTotal;
/**
* 应调差额
*/
private String adjustmentTotal;
/**
* 调差到
*/
private Long adjustTo;
/**
* 账单月份
*/
private String billMonth;
//---------条件-------
private Collection<Long> ids;
private Collection<Long> employeeIds;
}

View File

@ -34,6 +34,7 @@ public class InsuranceArchivesListParam extends BaseQueryParam {
private List<BigDecimal> subcompanyIds;
private String departmentIdsStr;
private String subcompanyIdsStr;
//状态(多线)")
private List<String> statuses;

View File

@ -1,11 +1,9 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
@ -168,4 +166,9 @@ public interface InsuranceAccountDetailMapper {
* 删除退差数据(账单月份+退差月份+缴纳状态+人员id+个税扣缴义务人)
*/
void deleteRecessionData(InsuranceAccountDetailPO po);
/**
* 获取数据(账单月份+缴纳状态+人员id+个税扣缴义务人)
*/
InsuranceAccountDetailPO getOneByBpep(InsuranceAccountDetailPO po);
}

View File

@ -328,6 +328,7 @@
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
AND t.supplementary_month = #{supplementaryMonth}
AND t.payment_status = 1
</select>
<select id="querySupplementListByBillMonth" resultMap="BaseResultMap">
@ -1195,4 +1196,21 @@
AND supplementary_month = #{supplementaryMonth}
AND employee_id = #{employeeId}
</delete>
<select id="getOneByBpep" resultMap="BaseResultMap">
SELECT
t.id,t.employee_id,t.social_per_json,t.social_com_json,
t.fund_per_json,t.fund_com_json,t.other_per_json,
t.other_com_json,t.social_per_sum,t.social_com_sum,
t.fund_per_sum,t.fund_com_sum,t.other_per_sum,
t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization,
t.total, t.social_sum, t.fund_sum, t.other_sum
FROM
hrsa_bill_detail t
WHERE t.delete_type = 0
AND t.bill_month = #{billMonth}
AND t.payment_status = #{paymentStatus}
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
</select>
</mapper>

View File

@ -0,0 +1,19 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.po.InsuranceCompensationConfigPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface InsuranceCompensationConfigMapper {
void batchInsert(@Param("collection") Collection<InsuranceCompensationConfigPO> compensationConfigPOS);
void insert(InsuranceCompensationConfigPO compensationConfigPO);
void deleteByPayOrg(Long paymentOrganization);
List<InsuranceCompensationConfigPO> queryByPayOrg(@Param("paymentOrganization") Long paymentOrganization);
}

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.siaccount.InsuranceCompensationConfigMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.InsuranceCompensationConfigPO">
<result column="id" property="id"/>
<result column="payment_agency" property="paymentAgency"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="employee_id" property="employeeId"/>
<result column="welfare_type" property="welfareType"/>
<result column="category_type" property="categoryType"/>
<result column="adjust_to" property="adjustTo"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.payment_agency
, t.employee_id
, t.payment_organization
, t.welfare_type
, t.category_type
, t.adjust_to
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
<insert id="batchInsert">
INSERT INTO hrsa_compensation_config(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
adjust_to,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
VALUES
<foreach collection="collection" item="item" separator=",">
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.categoryType},
#{item.adjustTo},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.deleteType},
#{item.tenantKey}
)
</foreach>
</insert>
<insert id="batchInsert" databaseId="oracle">
INSERT INTO hrsa_compensation_config(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
adjust_to,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
<foreach collection="collection" item="item" separator="union all">
select
#{item.id,jdbcType=DOUBLE},
#{item.employeeId,jdbcType=DOUBLE},
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.welfareType,jdbcType=INTEGER},
#{item.categoryType,jdbcType=VARCHAR},
#{item.adjustTo,jdbcType=DOUBLE},
#{item.createTime,jdbcType=DATE},
#{item.updateTime,jdbcType=DATE},
#{item.creator,jdbcType=DOUBLE},
#{item.deleteType,jdbcType=INTEGER},
#{item.tenantKey,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
<insert id="batchInsert" databaseId="sqlserver">
<foreach collection="collection" item="item" separator=";">
INSERT INTO hrsa_compensation_config(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
adjust_to,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.categoryType},
#{item.adjustTo},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.deleteType},
#{item.tenantKey}
)
</foreach>
</insert>
<insert id="insert" parameterType="com.engine.salary.entity.siaccount.po.InsuranceCompensationConfigPO">
insert into hrsa_compensation_config (
id,
employee_id,
payment_organization,
welfare_type,
category_type,
adjust_to,
create_time,
update_time,
creator,
delete_type,
tenant_key)
VALUES (
#{id},
#{employeeId},
#{paymentOrganization},
#{welfareType},
#{categoryType},
#{adjustTo},
#{createTime},
#{updateTime},
#{creator},
#{deleteType},
#{tenantKey})
</insert>
<delete id="deleteByPayOrg">
UPDATE hrsa_compensation_config
SET delete_type = 1
WHERE payment_organization = #{paymentOrganization}
AND delete_type = 0
</delete>
<select id="queryByPayOrg" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_compensation_config t
WHERE t.payment_organization = #{paymentOrganization}
AND t.delete_type = 0
</select>
</mapper>

View File

@ -0,0 +1,28 @@
package com.engine.salary.mapper.siaccount;
import com.engine.salary.entity.siaccount.po.InsuranceCompensationPO;
import org.apache.ibatis.annotations.Param;
import java.util.Collection;
import java.util.List;
public interface InsuranceCompensationMapper {
void batchInsert(@Param("collection") Collection<InsuranceCompensationPO> insuranceCompensationPOS);
void insert(InsuranceCompensationPO insuranceCompensationPO);
InsuranceCompensationPO getById(Long id);
List<InsuranceCompensationPO> queryByBillMonthAndPayOrg(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
InsuranceCompensationPO getOneByBillMonthPayOrgEmpId(InsuranceCompensationPO insuranceCompensationPO);
List<InsuranceCompensationPO> getByBillMonthPayOrgEmpIds(InsuranceCompensationPO insuranceCompensationPO);
void deleteById(Long id);
void deleteByBillMonthAndPayOrg(@Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
void deleteByBillMonthPayOrgEmpIds(InsuranceCompensationPO insuranceCompensationPO);
}

View File

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.siaccount.InsuranceCompensationMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siaccount.po.InsuranceCompensationPO">
<result column="id" property="id"/>
<result column="payment_agency" property="paymentAgency"/>
<result column="payment_organization" property="paymentOrganization"/>
<result column="employee_id" property="employeeId"/>
<result column="welfare_type" property="welfareType"/>
<result column="category_type" property="categoryType"/>
<result column="country_total" property="countryTotal"/>
<result column="company_total" property="companyTotal"/>
<result column="adjustment_total" property="adjustmentTotal"/>
<result column="adjust_to" property="adjustTo"/>
<result column="bill_month" property="billMonth"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
t.id
, t.payment_agency
, t.employee_id
, t.payment_organization
, t.welfare_type
, t.category_type
, t.country_total
, t.company_total
, t.adjustment_total
, t.adjust_to
, t.bill_month
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
</sql>
<insert id="batchInsert">
INSERT INTO hrsa_compensation_log(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
country_total,
company_total,
adjustment_total,
adjust_to,
bill_month,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
VALUES
<foreach collection="collection" item="item" separator=",">
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.categoryType},
#{item.countryTotal},
#{item.companyTotal},
#{item.adjustmentTotal},
#{item.adjustTo},
#{item.billMonth},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.deleteType},
#{item.tenantKey}
)
</foreach>
</insert>
<insert id="batchInsert" databaseId="oracle">
INSERT INTO hrsa_compensation_log(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
country_total,
company_total,
adjustment_total,
adjust_to,
bill_month,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
<foreach collection="collection" item="item" separator="union all">
select
#{item.id,jdbcType=DOUBLE},
#{item.employeeId,jdbcType=DOUBLE},
#{item.paymentOrganization,jdbcType=DOUBLE},
#{item.welfareType,jdbcType=INTEGER},
#{item.categoryType,jdbcType=VARCHAR},
#{item.countryTotal,jdbcType=VARCHAR},
#{item.companyTotal,jdbcType=VARCHAR},
#{item.adjustmentTotal,jdbcType=VARCHAR},
#{item.adjustTo,jdbcType=DOUBLE},
#{item.billMonth,jdbcType=VARCHAR},
#{item.createTime,jdbcType=DATE},
#{item.updateTime,jdbcType=DATE},
#{item.creator,jdbcType=DOUBLE},
#{item.deleteType,jdbcType=INTEGER},
#{item.tenantKey,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
<insert id="batchInsert" databaseId="sqlserver">
<foreach collection="collection" item="item" separator=";">
INSERT INTO hrsa_compensation_log(
id,
employee_id,
payment_organization,
welfare_type,
category_type,
country_total,
company_total,
adjustment_total,
adjust_to,
bill_month,
create_time,
update_time,
creator,
delete_type,
tenant_key
)
VALUES
(
#{item.id},
#{item.employeeId},
#{item.paymentOrganization},
#{item.welfareType},
#{item.categoryType},
#{item.countryTotal},
#{item.companyTotal},
#{item.adjustmentTotal},
#{item.adjustTo},
#{item.billMonth},
#{item.createTime},
#{item.updateTime},
#{item.creator},
#{item.deleteType},
#{item.tenantKey}
)
</foreach>
</insert>
<insert id="insert" parameterType="com.engine.salary.entity.siaccount.po.InsuranceCompensationPO">
insert into hrsa_compensation_log (
id,
employee_id,
payment_organization,
welfare_type,
category_type,
country_total,
company_total,
adjustment_total,
adjust_to,
bill_month,
create_time,
update_time,
creator,
delete_type,
tenant_key)
VALUES (
#{id},
#{employeeId},
#{paymentOrganization},
#{welfareType},
#{categoryType},
#{countryTotal},
#{companyTotal},
#{adjustmentTotal},
#{adjustTo},
#{billMonth},
#{createTime},
#{updateTime},
#{creator},
#{deleteType},
#{tenantKey})
</insert>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_compensation_log t
WHERE t.id = #{id} AND t.delete_type = 0
</select>
<select id="queryByBillMonthAndPayOrg" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_compensation_log t
WHERE t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND t.delete_type = 0
</select>
<!-- 根据账单月份、个税扣缴义务人、人员id获取单条记录 -->
<select id="getOneByBillMonthPayOrgEmpId" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.siaccount.po.InsuranceCompensationPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_compensation_log t
WHERE t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND t.employee_id = #{employeeId}
AND t.delete_type = 0
</select>
<!-- 根据账单月份、个税扣缴义务人、人员ids获取记录list -->
<select id="getByBillMonthPayOrgEmpIds" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.siaccount.po.InsuranceCompensationPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_compensation_log t
WHERE t.bill_month = #{billMonth}
AND t.payment_organization = #{paymentOrganization}
AND t.delete_type = 0
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</select>
<delete id="deleteById">
UPDATE hrsa_compensation_log
SET delete_type = 1
WHERE id = #{id}
AND delete_type = 0
</delete>
<delete id="deleteByBillMonthAndPayOrg">
UPDATE hrsa_compensation_log
SET delete_type = 1
WHERE bill_month = #{billMonth}
AND payment_organization = #{paymentOrganization}
AND delete_type = 0
</delete>
<delete id="deleteByBillMonthPayOrgEmpIds" parameterType="com.engine.salary.entity.siaccount.po.InsuranceCompensationPO">
UPDATE hrsa_compensation_log
SET delete_type = 1
WHERE bill_month = #{billMonth}
AND payment_organization = #{paymentOrganization}
AND delete_type = 0
<if test="employeeIds != null and employeeIds.size()>0">
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
</delete>
</mapper>

View File

@ -21,6 +21,13 @@ public interface SIAccountDetailTempMapper {
*/
void batchDelAccountTempDetails(@Param("employeeIds") Collection<Long> employeeIds, @Param("billMonth") String billMonth);
/**
* 批量删除
* @param employeeIds
* @param billMonth
*/
void batchDelByEmpIdsAndMonthAndPayOrg(@Param("employeeIds") Collection<Long> employeeIds, @Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization);
/**
* 批量保存
* @param accounts

View File

@ -111,6 +111,19 @@
</foreach>
</delete>
<!-- 批量删除 -->
<delete id="batchDelByEmpIdsAndMonthAndPayOrg">
UPDATE hrsa_bill_detail_temp
SET delete_type = 1
WHERE delete_type = 0
AND bill_month = #{billMonth}
AND payment_organization = #{paymentOrganization}
AND employee_id IN
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</delete>
<insert id="batchSaveAccountTempDetails">
INSERT INTO hrsa_bill_detail_temp

View File

@ -3,6 +3,7 @@ package com.engine.salary.service;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO;
import com.engine.salary.entity.siaccount.po.InsuranceCompensationPO;
import java.util.List;
@ -26,5 +27,10 @@ public interface ColumnBuildService {
List<WeaTableColumn> buildCommonColumns(List<InsuranceAccountDetailPO> pos);
List<WeaTableColumn> buildInspectColumns(List<InsuranceAccountInspectPO> pos, Long paymentOrganization);
/**
* 调差详情表头元素
*/
List<WeaTableColumn> buildCompensationColumns();
}

View File

@ -0,0 +1,36 @@
package com.engine.salary.service;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
import com.engine.salary.entity.siaccount.param.CompensationParam;
import com.engine.salary.util.page.PageInfo;
import java.util.List;
import java.util.Map;
public interface SICompensationService {
List<HrmInfoDTO> getEmployeeListToCompensation(HrmQueryParam param);
List<Map<String, String>> compensationCategoryType(Long id);
List<Map<String, String>> compensationComTotal(List<CompensationParam> paramList);
Map<String, Object> compensationAccount(List<InsuranceCompensationDTO> list);
/**
* 保存社保调差默认配置
*/
String compensationConfigSave(List<InsuranceCompensationDTO> param);
/**
* 社保调差撤回
*/
String compensationRevert(InsuranceCompensationDTO param);
/**
* 社保调差历史记录列表
*/
Map<String, Object> compensationList(String billMonth, Long paymentOrganization);
}

View File

@ -388,4 +388,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic
result.put(WelfareTypeEnum.OTHER.getValue(), otherColumns);
return result;
}
@Override
public List<WeaTableColumn> buildCompensationColumns() {
List<WeaTableColumn> list = new ArrayList<>();
WeaTableColumn weaTableNameColumn = new WeaTableColumn("300px",SalaryI18nUtil.getI18nLabel( 87000, "调差对象"), "target");
weaTableNameColumn.setFixed("left");
list.add(weaTableNameColumn);
list.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 87001, "统计调差福利"), "welfareType"));
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87001, "统计调差福利类型(单位)"), "categoryType"));
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87002, "国家核算金额(单位)"), "countryTotal"));
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87003, "公司核算金额(单位)"), "companyTotal"));
list.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 87004, "应调差金额"), "adjustmentTotal"));
list.add(new WeaTableColumn("200px",SalaryI18nUtil.getI18nLabel( 87005, "调差到(单位)"), "adjustTo"));
return list;
}
}

View File

@ -0,0 +1,562 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.alipay.oceanbase.jdbc.StringUtils;
import com.cloudstore.eccom.pc.table.WeaTable;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.siaccount.InsuranceAccountDetailPOEncrypt;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
import com.engine.salary.entity.siaccount.param.CompensationParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siaccount.po.InsuranceCompensationConfigPO;
import com.engine.salary.entity.siaccount.po.InsuranceCompensationPO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.siaccount.PaymentStatusEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.datacollection.EmployMapper;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siaccount.InsuranceCompensationConfigMapper;
import com.engine.salary.mapper.siaccount.InsuranceCompensationMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.service.ColumnBuildService;
import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SICategoryService;
import com.engine.salary.service.SICompensationService;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.Column;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator;
import org.springframework.beans.BeanUtils;
import weaver.hrm.User;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @Author: sy
* @Description: 福利台账-调差实现类
* @Date: 2022/11/23
**/
public class SICompensationServiceImpl extends Service implements SICompensationService {
private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() {
return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class);
}
private EmployMapper getEmployMapper() {
return MapperProxyFactory.getProxy(EmployMapper.class);
}
public SICategoryService getSICategoryService(User user) {
return ServiceUtil.getService(SICategoryServiceImpl.class, user);
}
private SIAccountService getSIAccountService(User user) {
return ServiceUtil.getService(SIAccountServiceImpl.class, user);
}
private InsuranceCompensationMapper getInsuranceCompensationMapper() {
return MapperProxyFactory.getProxy(InsuranceCompensationMapper.class);
}
private InsuranceCompensationConfigMapper getInsuranceCompensationConfigMapper() {
return MapperProxyFactory.getProxy(InsuranceCompensationConfigMapper.class);
}
public ColumnBuildService getColumnBuildService(User user) {
return ServiceUtil.getService(ColumnBuildServiceImpl.class, user);
}
/**
* 可调差人员
*/
@Override
public List<HrmInfoDTO> getEmployeeListToCompensation(HrmQueryParam param) {
// 当前登录人员
Long currentEmployeeId = (long) user.getUID();
//查询账单月份+个税扣缴义务人下的社保福利正常缴纳人员列表
List<InsuranceAccountDetailPO> normalDataList = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
List<Long> empIds = normalDataList.stream().map(InsuranceAccountDetailPO::getEmployeeId).collect(Collectors.toList());
//生成人员id和bill_detail.id的对应map
Map<Long, Long> empIdToTargetMap = SalaryEntityUtil.convert2Map(normalDataList, InsuranceAccountDetailPO::getEmployeeId, InsuranceAccountDetailPO::getId);
List<HrmInfoDTO> resultData = new ArrayList<>();
if (empIds.size() > 0) {
List<List<Long>> partition = Lists.partition(empIds, 1000);
partition.forEach(p -> {
param.setIds(p);
resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param));
});
}
List<HrmInfoDTO> finalResultData = new ArrayList<>();
for (HrmInfoDTO dto : resultData) {
dto.setTarget(empIdToTargetMap.get(dto.getEmployeeId()));
finalResultData.add(dto);
}
return finalResultData;
}
// public PageInfo<HrmInfoDTO> getEmployeeListToCompensation(HrmQueryParam param) {
// // 当前登录人员
// Long currentEmployeeId = (long) user.getUID();
//
// //查询账单月份+个税扣缴义务人下的社保福利正常缴纳人员列表
// List<InsuranceAccountDetailPO> normalDataList = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(param.getBillMonth(), param.getPaymentOrganization());
// List<Long> empIds = normalDataList.stream().map(InsuranceAccountDetailPO::getEmployeeId).collect(Collectors.toList());
//
// List<HrmInfoDTO> resultData = new ArrayList<>();
// if (empIds.size() > 0) {
// List<List<Long>> partition = Lists.partition(empIds, 1000);
// partition.forEach(p -> {
// param.setIds(p);
// resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param));
// });
//
// }
//
// // 分页
// PageInfo<HrmInfoDTO> page = new PageInfo<>();
// if (resultData.size() == 0) {
// return page;
// }
// page.setTotal(resultData.size());
//
// page.setList(SalaryPageUtil.subList(param.getPageNum(), param.getPageSize(), resultData));
// page.setPageSize(param.getPageSize());
// page.setPageNum(param.getPageNum());
//
//
// return page;
// }
/**
* 调差福利项
* @param id InsuranceAccountDetailPO.id
*/
@Override
public List<Map<String, String>> compensationCategoryType(Long id) {
SalaryAssert.notNull(id, SalaryI18nUtil.getI18nLabel(120999, "调差对象必选"));
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(id);
if (insuranceAccountDetailPO == null) {
return Lists.newArrayList();
}
InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
List<Map<String, String>> result = new ArrayList<>();
String socialComJson = insuranceAccountDetailPO.getSocialComJson();
if (StringUtils.isNotBlank(socialComJson)) {
Map<String, String> categoryIdNameMap = getSICategoryService(user).categoryIdNameMap();
Map<String, String> socialJson = JSON.parseObject(socialComJson, new HashMap<String, String>().getClass());
for (Map.Entry<String, String> entry : socialJson.entrySet()) {
Map<String, String> temp = new HashMap<>();
String insuranceId = entry.getKey();
if (StringUtils.isNotBlank(categoryIdNameMap.get(insuranceId))) {
temp.put("id", insuranceId);
temp.put("content", categoryIdNameMap.get(insuranceId));
result.add(temp);
}
}
}
return result;
}
/**
* 获取当前调差福利类型-公司方支出总计
*/
@Override
public List<Map<String, String>> compensationComTotal(List<CompensationParam> paramList) {
List<Map<String, String>> resultList = new ArrayList<>();
paramList.forEach(compensation -> {
Map<String, String> temp = new HashMap<>();
temp.put("employeeId", compensation.getEmployeeId());
if (StringUtils.isBlank(compensation.getCategoryType()) || compensation.getTarget() == null) {
temp.put("error", SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
temp.put("totalNum", "0");
} else {
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(compensation.getTarget());
if (insuranceAccountDetailPO == null) {
temp.put("error", SalaryI18nUtil.getI18nLabel(121038, "当前月在该缴纳组织下没有核算记录"));
temp.put("totalNum", "0");
} else {
InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
//判断是否已有调差数据个税扣缴义务人+账单月份+人员id
InsuranceCompensationPO nowCompensation = getInsuranceCompensationMapper().getOneByBillMonthPayOrgEmpId(InsuranceCompensationPO.builder()
.billMonth(insuranceAccountDetailPO.getBillMonth())
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization())
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.build());
if (nowCompensation != null) {
temp.put("error", SalaryI18nUtil.getI18nLabel(121039, "当前月在该缴纳组织下已存在调差数据"));
}
//处理调差数据
BigDecimal total = new BigDecimal("0");
List<String> categoryTypeList = Arrays.asList(compensation.getCategoryType().split(","));
if (nowCompensation == null && StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) {
Map<String, String> socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap<String, String>().getClass());
for (Map.Entry<String, String> entry : socialJson.entrySet()) {
String insuranceId = entry.getKey();
String num = entry.getValue();
if (categoryTypeList.contains(insuranceId)) {
total = total.add(new BigDecimal(num));
}
}
}
temp.put("totalNum", total.toPlainString());
}
}
resultList.add(temp);
});
// paramList.forEach((paymentOrganization, compensationList) -> {
// List<Map<String, String>> paymentList = new ArrayList<>();
// compensationList.forEach(compensation -> {
// Map<String, String> temp = new HashMap<>();
// temp.put("employeeId", compensation.getEmployeeId());
// if (StringUtils.isBlank(compensation.getCategoryType()) || compensation.getTarget() == null) {
// temp.put("error", SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
// temp.put("totalNum", "0");
// } else {
//
// InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(compensation.getTarget());
// if (insuranceAccountDetailPO == null) {
// temp.put("error", SalaryI18nUtil.getI18nLabel(121038, "当前月在该缴纳组织下没有核算记录"));
// }
// InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
// BigDecimal total = new BigDecimal("0");
// List<String> categoryTypeList = Arrays.asList(compensation.getCategoryType().split(","));
//
// if (StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) {
// Map<String, String> socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap<String, String>().getClass());
// for (Map.Entry<String, String> entry : socialJson.entrySet()) {
// String insuranceId = entry.getKey();
// String num = entry.getValue();
// if (categoryTypeList.contains(insuranceId)) {
// total = total.add(new BigDecimal(num));
// }
// }
// }
//
// temp.put("totalNum", total.toPlainString());
// }
// paymentList.add(temp);
// });
// result.put(paymentOrganization, paymentList);
// });
return resultList;
}
@Override
public Map<String, Object> compensationAccount(List<InsuranceCompensationDTO> list) {
long currentEmployeeId = user.getUID();
List<DataCollectionEmployee> allEmployees = getEmployMapper().listAll();
Map<Long, String> usernameMap = SalaryEntityUtil.convert2Map(allEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
Map<String, Object> result = new HashMap<>();
List<String> errorList = new ArrayList<>();
List<Long> idList = new ArrayList<>();
//过滤
list = list.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() ->
new TreeSet<>(Comparator.comparing(InsuranceCompensationDTO::getTarget))), ArrayList::new));
for (InsuranceCompensationDTO param : list) {
if (StringUtils.isBlank(param.getAdjustmentTotal()) || "0".equals(param.getAdjustmentTotal()) || "0.00".equals(param.getAdjustmentTotal())) {
errorList.add(usernameMap.get(param.getEmployeeId()) + "-调差失败:调差数额不正确!");
continue;
}
if (StringUtils.isBlank(param.getCompanyTotal()) || "0".equals(param.getCompanyTotal()) || "0.00".equals(param.getCompanyTotal())) {
errorList.add(usernameMap.get(param.getEmployeeId()) + "-调差失败公司核算金额为0请检查数据是否属实或者当前人员已存在该月调差数据");
continue;
}
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(param.getTarget());
if (insuranceAccountDetailPO == null) {
errorList.add(usernameMap.get(param.getEmployeeId()) + "-调差失败:调差对象不存在!");
continue;
}
InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
if (StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) {
Map<String, String> socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap<String, String>().getClass());
for (Map.Entry<String, String> entry : socialJson.entrySet()) {
String insuranceId = entry.getKey();
String num = entry.getValue();
if (Objects.equals(String.valueOf(param.getAdjustTo()), insuranceId)) {
BigDecimal adjustmentTo = new BigDecimal(param.getAdjustmentTotal());
// 调差单位缴纳明细
BigDecimal insuranceNum = new BigDecimal(num);
insuranceNum = insuranceNum.add(adjustmentTo);
socialJson.replace(insuranceId, insuranceNum.toPlainString());
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialJson));
// 调差单位合计
BigDecimal comSum = new BigDecimal(insuranceAccountDetailPO.getComSum());
comSum = comSum.add(adjustmentTo);
insuranceAccountDetailPO.setComSum(comSum.toPlainString());
// 调差社保单位合计
BigDecimal socialComSum = new BigDecimal(insuranceAccountDetailPO.getSocialComSum());
socialComSum = socialComSum.add(adjustmentTo);
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
// 调差社保合计
BigDecimal socialSum = new BigDecimal(insuranceAccountDetailPO.getSocialSum());
socialSum = socialSum.add(adjustmentTo);
insuranceAccountDetailPO.setSocialSum(socialSum.toPlainString());
// 调差合计
BigDecimal totalSum = new BigDecimal(insuranceAccountDetailPO.getTotal());
totalSum = totalSum.add(adjustmentTo);
insuranceAccountDetailPO.setTotal(totalSum.toPlainString());
//更新社保调差后的明细
InsuranceAccountDetailPOEncrypt.encryptItem(insuranceAccountDetailPO);
getInsuranceAccountDetailMapper().updateById(insuranceAccountDetailPO);
//新建调差记录
InsuranceCompensationPO insuranceCompensationPO = new InsuranceCompensationPO();
insuranceCompensationPO.setId(IdGenerator.generate());
insuranceCompensationPO.setAdjustmentTotal(param.getAdjustmentTotal());
insuranceCompensationPO.setAdjustTo(param.getAdjustTo());
insuranceCompensationPO.setBillMonth(param.getBillMonth());
insuranceCompensationPO.setCompanyTotal(param.getCompanyTotal());
insuranceCompensationPO.setCreator(currentEmployeeId);
insuranceCompensationPO.setCategoryType(param.getCategoryType());
insuranceCompensationPO.setCreateTime(new Date());
insuranceCompensationPO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
insuranceCompensationPO.setCountryTotal(param.getCountryTotal());
insuranceCompensationPO.setEmployeeId(insuranceAccountDetailPO.getEmployeeId());
insuranceCompensationPO.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization());
insuranceCompensationPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
insuranceCompensationPO.setWelfareType(param.getWelfareType());
insuranceCompensationPO.setUpdateTime(new Date());
getInsuranceCompensationMapper().insert(insuranceCompensationPO);
idList.add(insuranceCompensationPO.getId());
// result.put(param.getOriginId(), insuranceCompensationPO.getId().toString());
}
}
}
}
//刷新bill_detail统计数据
getSIAccountService(user).refreshBillBatch(list.get(0).getPaymentOrganization(), list.get(0).getBillMonth());
if (errorList.size() == 0) {
result.put("data", "全部调差成功!");
} else {
result.put("data", "存在调差失败项!");
}
result.put("errorMessage", errorList);
result.put("successIds", idList);
return result;
}
@Override
public String compensationConfigSave(List<InsuranceCompensationDTO> param) {
long currentEmployeeId = user.getUID();
SalaryAssert.notEmpty(param, SalaryI18nUtil.getI18nLabel(143746, "默认调差配置数据为空"));
// 清除历史默认配置
getInsuranceCompensationConfigMapper().deleteByPayOrg(param.get(0).getPaymentOrganization());
// 保存历史默认配置
List<InsuranceCompensationConfigPO> configList = param.stream().map(config -> {
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getById(config.getTarget());
SalaryAssert.notNull(insuranceAccountDetailPO, SalaryI18nUtil.getI18nLabel(138849, "调差对象不存在"));
return InsuranceCompensationConfigPO.builder()
.id(IdGenerator.generate())
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.adjustTo(config.getAdjustTo())
.createTime(new Date())
.updateTime(new Date())
.categoryType(config.getCategoryType())
.paymentOrganization(config.getPaymentOrganization())
.welfareType(config.getWelfareType())
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.creator(currentEmployeeId).build();
}).collect(Collectors.toList());
configList.forEach(config -> getInsuranceCompensationConfigMapper().insert(config));
return "配置成功";
}
/**
* 社保调差撤回
*/
@Override
public String compensationRevert(InsuranceCompensationDTO param) {
InsuranceCompensationPO insuranceCompensationPO = getInsuranceCompensationMapper().getById(param.getId());
SalaryAssert.notNull(insuranceCompensationPO, SalaryI18nUtil.getI18nLabel(121112, "当前补差记录不存在"));
InsuranceAccountDetailPO insuranceAccountDetailPO = getInsuranceAccountDetailMapper().getOneByBpep(InsuranceAccountDetailPO.builder()
.billMonth(insuranceCompensationPO.getBillMonth())
.paymentStatus(PaymentStatusEnum.COMMON.getValue())
.employeeId(insuranceCompensationPO.getEmployeeId())
.paymentOrganization(insuranceCompensationPO.getPaymentOrganization())
.build());
SalaryAssert.notNull(insuranceAccountDetailPO, SalaryI18nUtil.getI18nLabel(121108, "补差对象不存在"));
InsuranceAccountDetailPOEncrypt.decryptItem(insuranceAccountDetailPO);
if (StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) {
Map<String, String> socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap<String, String>().getClass());
for (Map.Entry<String, String> entry : socialJson.entrySet()) {
String insuranceId = entry.getKey();
String num = entry.getValue();
if (Objects.equals(String.valueOf(insuranceCompensationPO.getAdjustTo()), insuranceId)) {
BigDecimal adjustmentTo = new BigDecimal(insuranceCompensationPO.getAdjustmentTotal());
//回退调差单位缴纳明细
BigDecimal insuranceNum = new BigDecimal(num);
insuranceNum = insuranceNum.subtract(adjustmentTo);
socialJson.replace(insuranceId, insuranceNum.toPlainString());
insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialJson));
//回退调差单位合计
BigDecimal comSum = new BigDecimal(insuranceAccountDetailPO.getComSum());
comSum = comSum.subtract(adjustmentTo);
insuranceAccountDetailPO.setComSum(comSum.toPlainString());
//回退调差社保单位合计
BigDecimal socialComSum = new BigDecimal(insuranceAccountDetailPO.getSocialComSum());
socialComSum = socialComSum.subtract(adjustmentTo);
insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString());
//回退调差社保合计
BigDecimal socialSum = new BigDecimal(insuranceAccountDetailPO.getSocialSum());
socialSum = socialSum.subtract(adjustmentTo);
insuranceAccountDetailPO.setSocialSum(socialSum.toPlainString());
//回退调差合计
BigDecimal totalSum = new BigDecimal(insuranceAccountDetailPO.getTotal());
totalSum = totalSum.subtract(adjustmentTo);
insuranceAccountDetailPO.setTotal(totalSum.toPlainString());
//更新社保调差后的明细
InsuranceAccountDetailPOEncrypt.encryptItem(insuranceAccountDetailPO);
getInsuranceAccountDetailMapper().updateById(insuranceAccountDetailPO);
//删除调差记录
getInsuranceCompensationMapper().deleteById(param.getId());
}
}
//刷新bill_detail统计数据
getSIAccountService(user).refreshBillBatch(param.getPaymentOrganization(), param.getBillMonth());
}
return "撤回成功";
}
@Override
public Map<String, Object> compensationList(String billMonth, Long paymentOrganization) {
Map<String, Object> datas = new HashMap<>();
//入参判断
if (paymentOrganization == null || StringUtils.isBlank(billMonth)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
}
//设置调差详情列表头
List<WeaTableColumn> weaTableColumn = getColumnBuildService(user).buildCompensationColumns();
WeaTable table = new WeaTable();
table.setPageUID(UUID.randomUUID().toString());
table.setColumns(weaTableColumn);
List<Column> columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList());
//处理调差数据
List<InsuranceCompensationDTO> compensationDTOList = dealCompensationData(billMonth, paymentOrganization);
datas.put("columns", columns);
datas.put("data", compensationDTOList);
return datas;
}
private List<InsuranceCompensationDTO> dealCompensationData(String billMonth, Long paymentOrganization) {
//获取调差历史记录数据
List<InsuranceCompensationPO> compensationPOList = getInsuranceCompensationMapper().queryByBillMonthAndPayOrg(billMonth, paymentOrganization);
//获取调差配置数据
List<InsuranceCompensationConfigPO> compensationConfigPOList = getInsuranceCompensationConfigMapper().queryByPayOrg(paymentOrganization);
List<InsuranceCompensationDTO> compensationDTOList = new ArrayList<>();
List<InsuranceAccountDetailPO> detailPOList = getInsuranceAccountDetailMapper().queryNormalListByBillMonth(billMonth, paymentOrganization);
Map<Long, InsuranceAccountDetailPO> detailPOMap = detailPOList.stream().collect(Collectors.toMap(InsuranceAccountDetailPO::getEmployeeId, Function.identity()));
List<DataCollectionEmployee> allEmployees = getEmployMapper().listAll();
Map<Long, String> usernameMap = SalaryEntityUtil.convert2Map(allEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
List<ICategoryPO> allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll();
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
boolean haveCompensation = compensationPOList != null && compensationPOList.size() > 0;
//存在调差历史记录时输出记录数据
if (haveCompensation) {
for (InsuranceCompensationPO po : compensationPOList) {
InsuranceCompensationDTO dto = new InsuranceCompensationDTO();
BeanUtils.copyProperties(po, dto);
dto.setStatus(true);
//设置targetOptions
Map<String,String> targetOptions = new HashMap<>();
targetOptions.put("name", usernameMap.get(po.getEmployeeId()));
targetOptions.put("id", detailPOMap.get(po.getEmployeeId()).getId().toString());
dto.setTargetOptions(targetOptions);
//设置categoryTypeOptions
List<Map<String,String>> categoryTypeOptions = new ArrayList<>();
List<String> categoryTypeList = Arrays.asList(po.getCategoryType().split(","));
for (String categoryType : categoryTypeList) {
Map<String,String> categoryTypeMap = new HashMap<>();
categoryTypeMap.put("id", categoryType);
categoryTypeMap.put("content", categoryNameMap.get(Long.valueOf(categoryType)));
categoryTypeOptions.add(categoryTypeMap);
}
dto.setCategoryTypeOptions(categoryTypeOptions);
compensationDTOList.add(dto);
}
}
//不存在调差历史记录时输出调差配置数据
if (!haveCompensation && compensationConfigPOList.size() > 0) {
for (InsuranceCompensationConfigPO configPO : compensationConfigPOList) {
InsuranceCompensationDTO dto = new InsuranceCompensationDTO();
BeanUtils.copyProperties(configPO, dto);
dto.setStatus(false);
//设置targetOptions
Map<String,String> targetOptions = new HashMap<>();
targetOptions.put("name", usernameMap.get(configPO.getEmployeeId()));
targetOptions.put("id", detailPOMap.get(configPO.getEmployeeId()).getId().toString());
dto.setTargetOptions(targetOptions);
//设置categoryTypeOptions
List<Map<String,String>> categoryTypeOptions = new ArrayList<>();
List<String> categoryTypeList = Arrays.asList(configPO.getCategoryType().split(","));
for (String categoryType : categoryTypeList) {
Map<String,String> categoryTypeMap = new HashMap<>();
categoryTypeMap.put("id", categoryType);
categoryTypeMap.put("content", categoryNameMap.get(Long.valueOf(categoryType)));
categoryTypeOptions.add(categoryTypeMap);
}
dto.setCategoryTypeOptions(categoryTypeOptions);
compensationDTOList.add(dto);
}
}
return compensationDTOList;
}
}

View File

@ -357,7 +357,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic
// 分页
PageInfo<HrmInfoDTO> page = new PageInfo<>();
if (null == resultData) {
if (resultData.size() == 0) {
return page;
}
page.setTotal(resultData.size());

View File

@ -1228,6 +1228,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100);
// socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
socialSchemePOS = socialSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
List<InsuranceArchivesSocialSchemePO> insuranceArchivesSocialSchemePOS = InsuranceArchivesSocialSchemePOEncrypt.encryptList(socialSchemePOS);
List<List<InsuranceArchivesSocialSchemePO>> partition = Lists.partition(insuranceArchivesSocialSchemePOS, 100);
partition.forEach(getSocialSchemeMapper()::batchSave);
@ -1241,6 +1245,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100);
// fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
fundSchemePOS = fundSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
List<InsuranceArchivesFundSchemePO> insuranceArchivesFundSchemePOS = InsuranceArchivesFundSchemePOEncrypt.encryptList(fundSchemePOS);
List<List<InsuranceArchivesFundSchemePO>> partition = Lists.partition(insuranceArchivesFundSchemePOS, 100);
partition.forEach(getFundSchemeMapper()::batchSave);
@ -1254,6 +1262,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
// List<Long> otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList());
// List<List<Long>> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100);
// otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds);
//去除员工id+个税扣缴义务人下重复的数据
otherSchemePOS = otherSchemePOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
List<InsuranceArchivesOtherSchemePO> insuranceArchivesOtherSchemePOS = InsuranceArchivesOtherSchemePOEncrypt.encryptList(otherSchemePOS);
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100);
partition.forEach(getOtherSchemeMapper()::batchSave);
@ -1262,6 +1274,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
List<InsuranceArchivesBaseInfoPO> baseInfoPOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getBaseInfo).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(baseInfoPOS)) {
// baseInfoPOS = baseInfoPOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesBaseInfoPO::getEmployeeId))), ArrayList::new));
//去除员工id+个税扣缴义务人下重复的数据
baseInfoPOS = baseInfoPOS.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getPaymentOrganization() + "-" + f.getEmployeeId()))), ArrayList::new));
//根据人员id和个税扣缴义务人id删除对应档案
baseInfoPOS.forEach(getInsuranceBaseInfoMapper()::deleteByEmployeeIdAndPayOrg);
//分批批量删除

View File

@ -7,6 +7,7 @@ import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceAcctDetailImportFieldDTO;
import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
import com.engine.salary.entity.siaccount.param.*;
import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
@ -698,4 +699,91 @@ public class SIAccountController {
}
// **********************************退差 end*********************************/
// **********************************调差 start*********************************/
/**
* 获取当前登录人所控制的人员范围
*/
@POST
@Path("/getEmployeeListToCompensation")
@Produces(MediaType.APPLICATION_JSON)
public String getEmployeeListToCompensation(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody HrmQueryParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<HrmQueryParam, List<HrmInfoDTO>>(user).run(getSIAccountWrapper(user)::getEmployeeListToCompensation, param);
}
/**
* 通过id获取InsuranceAccountDetailPO中的社保福利项
*/
@GET
@Path("/compensationCategoryType")
@Produces(MediaType.APPLICATION_JSON)
public String compensationCategoryType(@Context HttpServletRequest request, @Context HttpServletResponse response,
@QueryParam("id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::compensationCategoryType, id);
}
/**
* 获取当前调差福利类型-公司方支出总计
*/
@POST
@Path("/compensationComTotal")
@Produces(MediaType.APPLICATION_JSON)
public String compensationComTotal(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody List<CompensationParam> paramList) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<List<CompensationParam>, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::compensationComTotal, paramList);
}
/**
* 社保调差保存
*/
@POST
@Path("/compensationSave")
@Produces(MediaType.APPLICATION_JSON)
public String compensationSave(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody List<InsuranceCompensationDTO> param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<List<InsuranceCompensationDTO>, Map<String, Object>>(user).run(getSIAccountWrapper(user)::compensationSave, param);
}
/**
* 社保调差默认配置保存
*/
@POST
@Path("/compensationConfigSave")
@Produces(MediaType.APPLICATION_JSON)
public String compensationConfigSave(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody List<InsuranceCompensationDTO> param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<List<InsuranceCompensationDTO>, String>(user).run(getSIAccountWrapper(user)::compensationConfigSave, param);
}
/**
* 社保调差撤回
*/
@POST
@Path("/compensationBack")
@Produces(MediaType.APPLICATION_JSON)
public String compensationBack(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody InsuranceCompensationDTO param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceCompensationDTO, String>(user).run(getSIAccountWrapper(user)::compensationBack, param);
}
/**
* 社保调差列表
*/
@POST
@Path("/compensationList")
@Produces(MediaType.APPLICATION_JSON)
public String compensationList(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody InsuranceCompensationDTO param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceCompensationDTO, Map<String, Object>>(user).run(getSIAccountWrapper(user)::compensationList, param);
}
// **********************************调差 end*********************************/
}

View File

@ -5,13 +5,19 @@ import com.engine.core.impl.Service;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
import com.engine.salary.entity.siaccount.param.CompensationParam;
import com.engine.salary.entity.siaccount.param.RecessionParam;
import com.engine.salary.service.SICompensationService;
import com.engine.salary.service.SIRecessionService;
import com.engine.salary.service.impl.SICompensationServiceImpl;
import com.engine.salary.service.impl.SIRecessionServiceImpl;
import com.engine.salary.util.page.PageInfo;
import weaver.hrm.User;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @Author weaver_cl
@ -24,6 +30,10 @@ public class SIAccountWrapper extends Service {
return (SIRecessionService) ServiceUtil.getService(SIRecessionServiceImpl.class, user);
}
private SICompensationService getSICompensationService(User user) {
return (SICompensationService) ServiceUtil.getService(SICompensationServiceImpl.class, user);
}
/**
* 新增退差数据
* @param param 退差请求体
@ -42,8 +52,66 @@ public class SIAccountWrapper extends Service {
getSIRecessionService(user).del(ids, currentEmployeeId);
}
/**
* 可退差人员列表
*/
public PageInfo<HrmInfoDTO> getEmployeeListByTaxAgent(HrmQueryParam param) {
return getSIRecessionService(user).getEmployeeListByTaxAgent(param);
}
/**
* 可调差人员列表
*/
public List<HrmInfoDTO> getEmployeeListToCompensation(HrmQueryParam hrmQueryParam) {
return getSICompensationService(user).getEmployeeListToCompensation(hrmQueryParam);
}
/**
* 获取社保福利项
*/
public List<Map<String, String>> compensationCategoryType(Long id) {
return getSICompensationService(user).compensationCategoryType(id);
}
/**
* 获取当前调差福利类型-公司方支出总计
*/
public List<Map<String, String>> compensationComTotal(List<CompensationParam> paramList) {
return getSICompensationService(user).compensationComTotal(paramList);
}
/**
* 社保调差保存
*/
public Map<String, Object> compensationSave(List<InsuranceCompensationDTO> param) {
return getSICompensationService(user).compensationAccount(param);
}
/**
* 社保调差默认配置保存
*/
public String compensationConfigSave(List<InsuranceCompensationDTO> param) {
return getSICompensationService(user).compensationConfigSave(param);
}
/**
* 社保调差撤回
*/
public String compensationBack(InsuranceCompensationDTO param) {
return getSICompensationService(user).compensationRevert(param);
}
/**
* 社保调差列表
*/
public Map<String, Object> compensationList(InsuranceCompensationDTO param) {
return getSICompensationService(user).compensationList(param.getBillMonth(), param.getPaymentOrganization());
}
}