Merge branch 'develop' into dev-LeeD
This commit is contained in:
commit
dc541e8e00
|
|
@ -20,10 +20,7 @@ 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.siarchives.po.InsuranceArchivesAccountPO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
|
||||
import com.engine.salary.entity.siarchives.po.*;
|
||||
import com.engine.salary.entity.sicategory.po.ICategoryPO;
|
||||
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
|
|
@ -32,7 +29,7 @@ import com.engine.salary.enums.sicategory.*;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
import com.engine.salary.mapper.siaccount.*;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
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;
|
||||
|
|
@ -104,8 +101,8 @@ public class SIAccountBiz extends Service {
|
|||
return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class);
|
||||
}
|
||||
|
||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||
return MapperProxyFactory.getProxy(SocialSchemeMapper.class);
|
||||
private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
|
|
@ -899,9 +896,9 @@ public class SIAccountBiz extends Service {
|
|||
employeeIds = employeeIds.stream().filter(item -> !param.getExcludes().contains(item)).collect(Collectors.toList());
|
||||
}
|
||||
//校验补缴人员是否存在社保档案
|
||||
List<InsuranceArchivesSocialSchemePO> socialList = getSocialSchemeMapper().getSocialByPaymentOrganization(param.getPaymentOrganization());
|
||||
List<InsuranceArchivesBaseInfoPO> insuranceBaseInfoList = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(param.getPaymentOrganization());
|
||||
List<Long> finalEmployeeIds = employeeIds;
|
||||
List<InsuranceArchivesSocialSchemePO> filterList = socialList.stream().filter(e -> {
|
||||
List<InsuranceArchivesBaseInfoPO> filterList = insuranceBaseInfoList.stream().filter(e -> {
|
||||
for (Long uId : finalEmployeeIds) {
|
||||
if (e.getEmployeeId().equals(uId)) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -31,9 +31,11 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
|
|||
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
|
||||
import com.engine.salary.enums.sicategory.*;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
|
||||
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
|
|
@ -47,6 +49,7 @@ import com.engine.salary.util.db.MapperProxyFactory;
|
|||
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 lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
|
@ -79,6 +82,10 @@ public class SIArchivesBiz {
|
|||
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
||||
}
|
||||
|
||||
private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param welfareType
|
||||
* @param employeeId
|
||||
|
|
@ -708,6 +715,8 @@ public class SIArchivesBiz {
|
|||
|
||||
request.setOrderRule(param.getOrderRule());
|
||||
|
||||
request.setRunStatuses(param.getRunStatuses());
|
||||
|
||||
apidatas = listPageEmployeePOS(request, operateId);
|
||||
|
||||
return apidatas;
|
||||
|
|
@ -735,6 +744,9 @@ public class SIArchivesBiz {
|
|||
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
|
||||
List<InsuranceArchivesEmployeePO> page = new ArrayList<>();
|
||||
PageInfo<InsuranceArchivesEmployeePO> pageInfo = new PageInfo<>(InsuranceArchivesEmployeePO.class);
|
||||
//生成福利档案历史基础信息(在福利档案基础信息表为空时)
|
||||
createOldInsuranceBaseInfo(operateId);
|
||||
//获取福利档案列表数据
|
||||
if (needAuth) {
|
||||
Collection<Long> taxAgentEmployeeIds = param.getTaxAgentEmployeeIds();
|
||||
Collection<Long> taxAgentIds = param.getTaxAgentIds();
|
||||
|
|
@ -1211,4 +1223,32 @@ public class SIArchivesBiz {
|
|||
return encryptList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要生成历史福利档案基本信息
|
||||
*/
|
||||
private void createOldInsuranceBaseInfo(Long creator) {
|
||||
List<InsuranceArchivesBaseInfoPO> nowBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoList();
|
||||
if (nowBaseInfoList.size() == 0) {
|
||||
List<InsuranceArchivesBaseInfoPO> addBaseInfoList = new ArrayList<>();
|
||||
List<InsuranceArchivesBaseInfoPO> oldBaseInfoList = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(null);
|
||||
if (oldBaseInfoList.size() > 0) {
|
||||
//设置基本信息表字段
|
||||
for (InsuranceArchivesBaseInfoPO po : oldBaseInfoList) {
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setCreateTime(new Date());
|
||||
po.setDeleteType(0);
|
||||
po.setCreator(creator);
|
||||
po.setRunStatus(EmployeeStatusEnum.PAYING.getValue());
|
||||
po.setUpdateTime(new Date());
|
||||
po.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
|
||||
addBaseInfoList.add(po);
|
||||
}
|
||||
//将历史基本信息入库
|
||||
getInsuranceBaseInfoMapper().batchSave(addBaseInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,6 @@ public class InsuranceArchivesListParam extends BaseQueryParam {
|
|||
private Collection<Long> taxAgentEmployeeIds;
|
||||
//个税扣缴义务人
|
||||
private Collection<Long> taxAgentIds;
|
||||
//福利执行状态
|
||||
private List<String> runStatuses;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ public class InsuranceArchivesAccountPO {
|
|||
private InsuranceArchivesFundSchemePO fund;
|
||||
|
||||
private InsuranceArchivesOtherSchemePO other;
|
||||
|
||||
private InsuranceArchivesBaseInfoPO BaseInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.engine.salary.entity.siarchives.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: sy
|
||||
* @Description: 社保福利档案基础信息
|
||||
* @Date: 2022/10/8
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_insurance_base_info
|
||||
public class InsuranceArchivesBaseInfoPO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 员工id
|
||||
*/
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
*/
|
||||
private Long paymentOrganization;
|
||||
|
||||
/**
|
||||
* 社保档案id
|
||||
*/
|
||||
private Long socialArchivesId;
|
||||
|
||||
/**
|
||||
* 公积金档案id
|
||||
*/
|
||||
private Long fundArchivesId;
|
||||
|
||||
/**
|
||||
* 其他福利档案id
|
||||
*/
|
||||
private Long otherArchivesId;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 福利执行状态
|
||||
*/
|
||||
private String runStatus;
|
||||
}
|
||||
|
|
@ -429,9 +429,9 @@
|
|||
|
||||
<select id="selectEmpByPaymentOrg" resultType="java.lang.Long">
|
||||
SELECT employee_id
|
||||
from hrsa_social_archives social
|
||||
from hrsa_insurance_base_info base
|
||||
where delete_type = 0
|
||||
and social.payment_organization = #{paymentOrganization}
|
||||
and base.payment_organization = #{paymentOrganization}
|
||||
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.engine.salary.mapper.siarchives;
|
||||
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author sy
|
||||
* @Date 2022/10/08
|
||||
**/
|
||||
public interface InsuranceBaseInfoMapper {
|
||||
|
||||
/**
|
||||
* 获取当前福利档案基础信息(由当前的社保、公积金、其他福利信息表获取)
|
||||
* 当设置employeeIds时,则是通过人员id、社保、公积金、其他福利信息表获取指定人员的福利档案基础信息
|
||||
*/
|
||||
List<InsuranceArchivesBaseInfoPO> getInsuranceBaseInfoListByInsuranceDetail(@Param("employeeIds")List<Long> employeeIds);
|
||||
|
||||
/**
|
||||
* 获取当前福利档案基础信息(由福利档案基础信息表获取)
|
||||
*/
|
||||
List<InsuranceArchivesBaseInfoPO> getInsuranceBaseInfoList();
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*/
|
||||
void batchSave(@Param("infos") List<InsuranceArchivesBaseInfoPO> infos);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
void batchDeleteByEmployeeIds(@Param("employeeIds")List<Long> employeeIds);
|
||||
|
||||
/**
|
||||
* 根据个税扣缴义务人id获取基础信息列表
|
||||
* @param paymentOrganization
|
||||
* @return
|
||||
*/
|
||||
List<InsuranceArchivesBaseInfoPO> getSocialByPaymentOrganization(@Param("paymentOrganization")Long paymentOrganization);
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
<?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.siarchives.InsuranceBaseInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="employee_id" property="employeeId"/>
|
||||
<result column="payment_organization" property="paymentOrganization"/>
|
||||
<result column="social_archives_id" property="socialArchivesId"/>
|
||||
<result column="fund_archives_id" property="fundArchivesId"/>
|
||||
<result column="other_archives_id" property="otherArchivesId"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="run_status" property="runStatus"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.employee_id
|
||||
, t.payment_organization
|
||||
, t.social_archives_id
|
||||
, t.fund_archives_id
|
||||
, t.other_archives_id
|
||||
, t.run_status
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
<select id="getInsuranceBaseInfoListByInsuranceDetail" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
SELECT social.employee_id,
|
||||
social.id AS socialArchivesId,
|
||||
social.payment_organization,
|
||||
fund.id AS fundArchivesId,
|
||||
other.id AS otherArchivesId
|
||||
FROM hrsa_social_archives social
|
||||
LEFT JOIN( SELECT fund.employee_id, fund.id FROM hrsa_fund_archives fund WHERE fund.delete_type = 0 )fund ON social.employee_id = fund.employee_id
|
||||
LEFT JOIN( SELECT other.employee_id, other.id FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON social.employee_id = other.employee_id
|
||||
WHERE
|
||||
social.delete_type = 0
|
||||
<if test="employeeIds != null and employeeIds.size()>0">
|
||||
AND social.employee_id IN
|
||||
<foreach collection="employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getInsuranceBaseInfoList" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_insurance_base_info t
|
||||
WHERE
|
||||
t.delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="batchSave">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
VALUES
|
||||
<foreach collection="infos" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.paymentOrganization},
|
||||
#{item.socialArchivesId},
|
||||
#{item.fundArchivesId},
|
||||
#{item.otherArchivesId},
|
||||
#{item.tenantKey},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchSave" databaseId="oracle">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
<foreach collection="infos" item="item" separator="union all">
|
||||
select
|
||||
#{item.id,jdbcType=DOUBLE},
|
||||
#{item.employeeId,jdbcType=DOUBLE},
|
||||
#{item.paymentOrganization,jdbcType=DOUBLE},
|
||||
#{item.socialArchivesId,jdbcType=DOUBLE},
|
||||
#{item.fundArchivesId,jdbcType=DOUBLE},
|
||||
#{item.otherArchivesId,jdbcType=DOUBLE},
|
||||
#{item.tenantKey,jdbcType=VARCHAR},
|
||||
#{item.creator,jdbcType=DOUBLE},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus,jdbcType=VARCHAR}
|
||||
from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchSave" databaseId="sqlserver">
|
||||
<foreach collection="infos" item="item" separator=";">
|
||||
INSERT INTO hrsa_insurance_base_info
|
||||
(id,employee_id,payment_organization,social_archives_id,fund_archives_id,other_archives_id,tenant_key,creator,delete_type,create_time,update_time,run_status)
|
||||
VALUES
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.paymentOrganization},
|
||||
#{item.socialArchivesId},
|
||||
#{item.fundArchivesId},
|
||||
#{item.otherArchivesId},
|
||||
#{item.tenantKey},
|
||||
#{item.creator},
|
||||
#{item.deleteType},
|
||||
#{item.createTime},
|
||||
#{item.updateTime},
|
||||
#{item.runStatus}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="batchDeleteByEmployeeIds">
|
||||
UPDATE hrsa_insurance_base_info
|
||||
SET delete_type = 1
|
||||
WHERE 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>
|
||||
|
||||
<!-- 根据个税扣缴义务人id获取记录 -->
|
||||
<select id="getSocialByPaymentOrganization" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_insurance_base_info t
|
||||
WHERE delete_type = 0
|
||||
AND payment_organization = #{paymentOrganization}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -296,10 +296,11 @@
|
|||
d.departmentname AS departmentName, e.jobtitle AS position, e.STATUS AS userStatus,e.companystartdate AS hiredate,
|
||||
e.enddate as dimissionDate,
|
||||
social.siSchemeId,
|
||||
social.paymentOrganization,
|
||||
base.payment_organization AS paymentOrganization,
|
||||
fund.fundSchemeId,
|
||||
other.otherSchemeId
|
||||
FROM hrmresource e
|
||||
FROM hrsa_insurance_base_info base
|
||||
LEFT JOIN hrmresource e ON base.employee_id = e.id
|
||||
LEFT JOIN hrmdepartment d ON e.departmentid = d.ID
|
||||
LEFT JOIN hrmsubcompany c ON c.id = e.subcompanyid1
|
||||
LEFT JOIN( SELECT social.employee_id, social.social_scheme_id AS siSchemeId, social.payment_organization AS paymentOrganization FROM hrsa_social_archives social WHERE social.delete_type = 0 )social ON e.id = social.employee_id
|
||||
|
|
@ -307,6 +308,7 @@
|
|||
LEFT JOIN( SELECT other.employee_id, other.other_scheme_id AS otherSchemeId FROM hrsa_other_archives other WHERE other.delete_type = 0 )other ON e.id = other.employee_id
|
||||
WHERE
|
||||
1=1
|
||||
AND base.delete_type = 0
|
||||
<include refid="condition"></include>
|
||||
<if test="param.orderRule != null">
|
||||
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
|
||||
|
|
@ -367,6 +369,13 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
#{param.runStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.employeeIds != null and param.employeeIds.size() > 0">
|
||||
AND e.ID IN
|
||||
<foreach collection="param.employeeIds" open="(" separator="," item="item" close=")">
|
||||
|
|
@ -427,6 +436,12 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
#{runStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size() > 0">
|
||||
AND e.ID IN
|
||||
<foreach collection="param.employeeIds" open="(" separator="," item="item" close=")">
|
||||
|
|
@ -488,6 +503,12 @@
|
|||
<if test="param.otherSchemeId != null and param.otherSchemeId != 0">
|
||||
AND otherSchemeId = #{param.otherSchemeId}
|
||||
</if>
|
||||
<if test="param.runStatuses != null and param.runStatuses.size()>0">
|
||||
AND base.run_status IN
|
||||
<foreach collection="param.runStatuses" open="(" item="runStatus" separator="," close=")">
|
||||
#{param.runStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size() > 0">
|
||||
AND e.ID IN
|
||||
<foreach collection="param.employeeIds" open="(" separator="," item="item" close=")">
|
||||
|
|
|
|||
|
|
@ -479,6 +479,8 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// 新增考勤值数据
|
||||
if (CollectionUtils.isNotEmpty(values)) {
|
||||
log.info("考勤数据:{}", values);
|
||||
//去除空值
|
||||
values = values.stream().filter(po->StringUtils.isNotBlank(po.getDataValue())).collect(Collectors.toList());
|
||||
dataValueBiz.insertData(values);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
@Override
|
||||
public Map<String, Object> listPage(InsuranceArchivesListParam param) {
|
||||
long currentEmployeeId = user.getUID();
|
||||
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
param.setOrderRule(orderRule);
|
||||
|
|
@ -113,6 +112,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
Map<String, Object> apidatas = new HashMap<>(16);
|
||||
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
||||
apidatas = siArchivesBiz.listPage(param, (long) user.getUID());
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.biz.EmployBiz;
|
|||
import com.engine.salary.biz.SIArchivesBiz;
|
||||
import com.engine.salary.biz.SISchemeBiz;
|
||||
import com.engine.salary.cmd.sischeme.*;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.siarchives.InsuranceArchivesFundSchemePOEncrypt;
|
||||
import com.engine.salary.encrypt.siarchives.InsuranceArchivesOtherSchemePOEncrypt;
|
||||
|
|
@ -28,8 +29,10 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
|
|||
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
|
||||
import com.engine.salary.enums.sicategory.*;
|
||||
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
|
||||
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
import com.engine.salary.mapper.sicategory.ICategoryMapper;
|
||||
|
|
@ -132,6 +135,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() {
|
||||
return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Map<String, Object> params) {
|
||||
return commandExecutor.execute(new SISchemeGetFormCmd(params, user));
|
||||
|
|
@ -745,6 +753,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = null;
|
||||
InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO = null;
|
||||
InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO = null;
|
||||
|
||||
Map<String, Object> socialMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"));
|
||||
Map<String, Object> paymentMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"));
|
||||
Map<String, Object> fundMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"));
|
||||
|
|
@ -889,11 +898,13 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
isError = true;
|
||||
}
|
||||
}
|
||||
|
||||
//生成福利档案基础信息数据
|
||||
InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator);
|
||||
if (!isError) {
|
||||
insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO);
|
||||
insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO);
|
||||
insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO);
|
||||
insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO);
|
||||
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);
|
||||
}
|
||||
return isError;
|
||||
|
|
@ -1056,6 +1067,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
return insuranceArchivesOtherSchemePO;
|
||||
}
|
||||
|
||||
public InsuranceArchivesBaseInfoPO buildBaseInfoPO(Long employeeId, List<Map<String, Object>> singleAccount, Map<String, Long> paymentNameIdMap, Long creator) {
|
||||
if (employeeId == null) {
|
||||
return null;
|
||||
}
|
||||
InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = new InsuranceArchivesBaseInfoPO();
|
||||
insuranceArchivesBaseInfoPO.setEmployeeId(employeeId);
|
||||
insuranceArchivesBaseInfoPO.setId(IdGenerator.generate());
|
||||
insuranceArchivesBaseInfoPO.setCreateTime(new Date());
|
||||
insuranceArchivesBaseInfoPO.setDeleteType(0);
|
||||
insuranceArchivesBaseInfoPO.setCreator(creator);
|
||||
insuranceArchivesBaseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue());
|
||||
insuranceArchivesBaseInfoPO.setUpdateTime(new Date());
|
||||
insuranceArchivesBaseInfoPO.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
insuranceArchivesBaseInfoPO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人"))));
|
||||
|
||||
return insuranceArchivesBaseInfoPO;
|
||||
}
|
||||
|
||||
public void handleImportData(List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS) {
|
||||
//导入社保档案
|
||||
List<InsuranceArchivesSocialSchemePO> socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList());
|
||||
|
|
@ -1090,6 +1119,29 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|||
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePOS, 100);
|
||||
partition.forEach(getOtherSchemeMapper()::batchSave);
|
||||
}
|
||||
//导入福利档案基础信息
|
||||
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));
|
||||
//分批批量删除
|
||||
List<Long> baseInfoEmployeeIds = baseInfoPOS.stream().map(InsuranceArchivesBaseInfoPO::getEmployeeId).collect(Collectors.toList());
|
||||
List<List<Long>> employeeIdPartition = Lists.partition(baseInfoEmployeeIds, 100);
|
||||
employeeIdPartition.forEach(getInsuranceBaseInfoMapper()::batchDeleteByEmployeeIds);
|
||||
//查询目标人员的剩余的福利档案基础信息(社保、公积金、其他福利档案id)
|
||||
List<InsuranceArchivesBaseInfoPO> moreBaseInfoPOS = getInsuranceBaseInfoMapper().getInsuranceBaseInfoListByInsuranceDetail(baseInfoEmployeeIds);
|
||||
List<InsuranceArchivesBaseInfoPO> newInsuranceArchivesBaseInfoList = new ArrayList<>();
|
||||
//设置社保、公积金、其他福利档案id
|
||||
for (InsuranceArchivesBaseInfoPO po : baseInfoPOS) {
|
||||
InsuranceArchivesBaseInfoPO moreBaseInfo = moreBaseInfoPOS.stream().filter(s -> Objects.equals(s.getEmployeeId(), po.getEmployeeId())).findFirst().orElse(null);
|
||||
po.setSocialArchivesId(moreBaseInfo.getSocialArchivesId());
|
||||
po.setFundArchivesId(moreBaseInfo.getFundArchivesId());
|
||||
po.setOtherArchivesId(moreBaseInfo.getOtherArchivesId());
|
||||
newInsuranceArchivesBaseInfoList.add(po);
|
||||
}
|
||||
//分批批量入库
|
||||
List<List<InsuranceArchivesBaseInfoPO>> partition = Lists.partition(newInsuranceArchivesBaseInfoList, 100);
|
||||
partition.forEach(getInsuranceBaseInfoMapper()::batchSave);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -174,6 +174,11 @@ public class SISchemeController {
|
|||
if(StringUtils.isNotBlank(ids)){
|
||||
param.setEmployeeIds( Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
String runStatuses = request.getParameter("runStatuses");
|
||||
if(StringUtils.isNotBlank(runStatuses)){
|
||||
param.setRunStatuses( Arrays.stream(runStatuses.split(",")).map(String::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
XSSFWorkbook workbook = getService(user).export(param);
|
||||
String fileName = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue