薪酬系统-福利档案,删除待办功能(待减员页面)

This commit is contained in:
sy 2022-12-12 15:43:12 +08:00
parent ae72d25431
commit 1b376464c4
11 changed files with 118 additions and 1 deletions

View File

@ -74,4 +74,10 @@ public interface FundSchemeMapper {
void batchUpdateEndTime(@Param("ids")List<Long> ids, @Param("endTime")String endTime);
int updateById(InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO);
/**
* 批量更新最后缴纳月为null
* @param ids
*/
void batchUpdateEndTimeToNull(@Param("ids")List<Long> ids);
}

View File

@ -300,4 +300,17 @@
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 批量更新最后缴纳月为null -->
<update id="batchUpdateEndTimeToNull">
UPDATE hrsa_fund_archives
SET fund_end_time = null
WHERE delete_type = 0
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

View File

@ -23,12 +23,17 @@ public interface InsuranceBaseInfoMapper {
List<InsuranceArchivesBaseInfoPO> listAll();
/**
* 查询对应id记录
* 查询对应id集合的记录
*
* @return 返回集合没有返回空List
*/
List<InsuranceArchivesBaseInfoPO> listByIds(@Param("ids")Collection<Long> ids);
/**
* 查询对应id的记录
*/
InsuranceArchivesBaseInfoPO getById(@Param("id")Long id);
/**
* 获取当前福利档案基础信息由当前的社保公积金其他福利信息表获取
* 当设置employeeIds时则是通过人员id社保公积金其他福利信息表获取指定人员的福利档案基础信息

View File

@ -52,6 +52,14 @@
</foreach>
</select>
<select id="getById" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_insurance_base_info t
WHERE id = #{id}
AND delete_type = 0
</select>
<select id="getInsuranceBaseInfoListByInsuranceDetail" resultType="com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO">
SELECT social.employee_id,
social.id AS socialArchivesId,

View File

@ -67,4 +67,10 @@ public interface OtherSchemeMapper {
void batchUpdateEndTime(@Param("ids")List<Long> ids, @Param("endTime")String endTime);
int updateById(InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO);
/**
* 批量更新最后缴纳月为null
* @param ids
*/
void batchUpdateEndTimeToNull(@Param("ids")List<Long> ids);
}

View File

@ -280,4 +280,17 @@
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 批量更新最后缴纳月为null -->
<update id="batchUpdateEndTimeToNull">
UPDATE hrsa_other_archives
SET other_end_time = null
WHERE delete_type = 0
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

View File

@ -102,4 +102,10 @@ public interface SocialSchemeMapper {
* @return
*/
int updateById(InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO);
/**
* 批量更新最后缴纳月为null
* @param ids
*/
void batchUpdateEndTimeToNull(@Param("ids")List<Long> ids);
}

View File

@ -673,4 +673,17 @@
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 批量更新最后缴纳月为null -->
<update id="batchUpdateEndTimeToNull">
UPDATE hrsa_social_archives
SET social_end_time = null
WHERE delete_type = 0
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
</update>
</mapper>

View File

@ -85,4 +85,10 @@ public interface SIArchivesService {
* 批量增员
*/
Map<String, Object> stayAddToPay(Collection<Long> ids);
/**
* 删除待办
* 入参runStatus来区分待增员和待减员页面的删除待办
*/
void cancelStayDelOrStayAdd(InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO);
}

View File

@ -944,5 +944,38 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
}
}
/**
* 删除待办
* 入参runStatus来区分待增员和待减员页面的删除待办
*/
@Override
public void cancelStayDelOrStayAdd(InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO) {
if (insuranceArchivesBaseInfoPO.getIds() == null || StringUtils.isBlank(insuranceArchivesBaseInfoPO.getRunStatus())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
}
if (insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())) {
List<InsuranceArchivesBaseInfoPO> nowList = getInsuranceBaseInfoMapper().listByIds(insuranceArchivesBaseInfoPO.getIds());
//置空社保公积金其他福利档案的最后缴纳月信息并将福利档案基础信息表的状态置为正在缴纳
if (nowList.size() > 0) {
List<Long> socialIds = nowList.stream()
.map(InsuranceArchivesBaseInfoPO::getSocialArchivesId).collect(Collectors.toList());
List<Long> fundIds = nowList.stream()
.map(InsuranceArchivesBaseInfoPO::getFundArchivesId).collect(Collectors.toList());
List<Long> otherIds = nowList.stream()
.map(InsuranceArchivesBaseInfoPO::getOtherArchivesId).collect(Collectors.toList());
getSocialSchemeMapper().batchUpdateEndTimeToNull(socialIds);
getFundSchemeMapper().batchUpdateEndTimeToNull(fundIds);
getOtherSchemeMapper().batchUpdateEndTimeToNull(otherIds);
insuranceArchivesBaseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue());
getInsuranceBaseInfoMapper().updateRunStatusByIds(insuranceArchivesBaseInfoPO);
}
}
}
}

View File

@ -151,6 +151,14 @@ public class SIArchivesController {
* 删除待办
* 入参runStatus来区分待增员和待减员页面的删除待办
*/
@POST
@Path("/cancelStayDelOrStayAdd")
@Produces(MediaType.APPLICATION_JSON)
public String cancelStayDelOrStayAdd(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody InsuranceArchivesBaseInfoPO po) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<InsuranceArchivesBaseInfoPO, String>(user).run(getService(user)::cancelStayDelOrStayAdd, po);
}
@POST
@Path("/updateRunStatus")
@Produces(MediaType.APPLICATION_JSON)