Commit 35bb2ae9 authored by hongguangwu's avatar hongguangwu

划转

parent d9a351e8
......@@ -390,4 +390,8 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description = "选中的idList")
private List<String> idList;
// 划转前的老项目id,调整社保公积金使用
@TableField(exist = false)
private String odlDeptId;
}
......@@ -225,6 +225,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitName(tSettleDomain.getCustomerName());
updateTEmployeePro.setChangeStartMonth(excel.getChangeStartMonth());
updateTEmployeePro.setUnsettleDeal(CommonConstants.IS_NO_CHANGE);
updateTEmployeePro.setOdlDeptId(tEmployeeProjectOld.getDeptId());
updateList.add(updateTEmployeePro);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
......@@ -244,6 +245,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
tEmployeeProjectService.updateBatchById(updateList);
for (TEmployeeProject tEmployeeProject: updateList) {
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setOldDeptId(tEmployeeProject.getOdlDeptId());
updateSocialFoundVo.setEmpIdcard(tEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(tEmployeeProject.getDeptNo());
updateSocialFoundVo.setSettleDomainId(tEmployeeProject.getDeptId());
......
......@@ -1028,7 +1028,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//
TSocialFundInfo sf = new TSocialFundInfo();
sf.setEmpIdcard(insert.getEmpIdcard());
sf.setSettleDomainCode(insert.getDeptNo());
sf.setSettleDomain(insert.getSettleDomain());
R<Integer> socialFundR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tsocialfundinfo/inner/selectSocialFoundByContract", sf, Integer.class, SecurityConstants.FROM_IN);
if (socialFundR != null && socialFundR.getData() != null && socialFundR.getData() > 0) {
......
......@@ -26,4 +26,6 @@ public class UpdateSocialFoundVo {
private String socialCreateMonth;
private String flag;
private String oldDeptId;
}
......@@ -67,6 +67,22 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
void updateSocialAndFoundInfoF(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* @Description: 划转同步更新社保
* @Author: hgw
* @Date: 2022/11/30 17:36
* @return: void
**/
void updateSocialInfo(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* @Description: 划转同步更新公积金
* @Author: hgw
* @Date: 2022/11/30 17:36
* @return: void
**/
void updateFundInfo(@Param("infoVo") UpdateSocialFoundVo infoVo);
int selectSocialFoundByContract(@Param("tSocialFundInfo") TSocialFundInfo tSocialFundInfo);
}
......@@ -784,8 +784,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
if (Common.isNotNull(infoVo) && Common.isNotNull(infoVo.getFlag())) {
if (CommonConstants.ZERO_STRING.equals(infoVo.getFlag())) {
baseMapper.updateSocialAndFoundInfo(infoVo);
baseMapper.updateSocialInfo(infoVo);
}else {
baseMapper.updateSocialAndFoundInfoF(infoVo);
baseMapper.updateFundInfo(infoVo);
}
}
}
......
......@@ -1071,17 +1071,34 @@
where EMP_IDCARD = #{infoVo.empIdcard}
</update>
<update id="updateSocialInfo">
update t_social_info
set SETTLE_DOMAIN = #{infoVo.settleDomainId}
where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN = #{infoVo.oldDeptId}
</update>
<update id="updateFundInfo">
update t_provident_fund
set SETTLE_DOMAIN = #{infoVo.settleDomainId}
where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN = #{infoVo.oldDeptId}
</update>
<!--获取count,合同使用-->
<select id="selectSocialFoundByContract" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_social_fund_info a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and
(
(a.SETTLE_DOMAIN_CODE = #{tSocialFundInfo.settleDomainCode} and a.SOCIAL_REDUCE_STATUS='2' and (a.SETTLE_DOMAIN_CODE_FUND is null or a.SETTLE_DOMAIN_CODE_FUND != #{tSocialFundInfo.settleDomainCode} or a.FUND_REDUCE_STATUS='2'))
or
(a.SETTLE_DOMAIN_CODE_FUND = #{tSocialFundInfo.settleDomainCode} and a.FUND_REDUCE_STATUS='2' and (a.SETTLE_DOMAIN_CODE is null or a.SETTLE_DOMAIN_CODE != #{tSocialFundInfo.settleDomainCode} or a.SOCIAL_REDUCE_STATUS='2'))
)
select count(1) from
(SELECT
a.EMP_IDCARD,a.HANDLE_STATUS social_status
FROM t_social_info a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1) a
left join
(SELECT
a.EMP_IDCARD,a.HANDLE_STATUS fund_status
FROM t_provident_fund a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1) b
on a.EMP_IDCARD=b.EMP_IDCARD
where
(a.social_status='3' and b.fund_status='3' )
or (a.social_status='3' and b.fund_status is null )
or (a.social_status is null and b.fund_status ='3' )
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment