Commit e7be5828 authored by fangxinjiang's avatar fangxinjiang

Merge branch 'develop'

parents 2d72121b 95c95f22
......@@ -390,4 +390,8 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description = "选中的idList")
private List<String> idList;
// 划转前的老项目id,调整社保公积金使用
@TableField(exist = false)
private String odlDeptId;
}
......@@ -11,8 +11,6 @@ import lombok.Data;
public class EmpIdCardAndDeptVo {
// 身份证
private String idCard;
// 项目id
private String deptId;
// 项目编码:薪资使用的,只有编码
private String deptNo;
// 状态
......
......@@ -71,6 +71,6 @@ public class EmployeeConstants {
* @Date: 2022/11/25 16:42
* @return:
**/
public static final String CONTRACT_NAME[] = {"标准合同","劳派遣合同","其他"};
public static final String CONTRACT_NAME[] = {"标准合同","劳派遣合同","其他"};
}
......@@ -317,11 +317,11 @@ public class TEmployeeProjectController {
}
/**
* @Description: 更新人员档案、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022-11-23 17:17:59
**/
@Operation(summary = "更新人员档案、项目档案的商险状态", description = "更新人员档案、项目档案的商险状态")
@Operation(summary = "更新项目档案的商险状态", description = "更新项目档案的商险状态")
@Inner
@PostMapping("/inner/updateEmployeeInsuranceStatus")
public Boolean updateEmployeeInsuranceStatus(@RequestBody EmpStatusVo vo) {
......
......@@ -193,7 +193,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
/**
* @param vo
* @Description: 更新人员档案、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022/11/23 17:20
* @return: java.lang.Boolean
......
......@@ -114,12 +114,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
updateTEmployeeProject.setOdlDeptId(tEmployeeProjectOld.getDeptId());
tEmployeeProjectService.updateById(updateTEmployeeProject);
tEmpChangeInfo.setProId(updateTEmployeeProject.getId());
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject);
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setOldDeptId(updateTEmployeeProject.getOdlDeptId());
updateSocialFoundVo.setEmpIdcard(updateTEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(updateTEmployeeProject.getDeptNo());
updateSocialFoundVo.setSettleDomainId(updateTEmployeeProject.getDeptId());
......@@ -225,6 +227,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 +247,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());
......
......@@ -445,6 +445,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
private void updateEmployeeContractStatus(TEmployeeContractInfo tEmployeeContractInfo) {
if (!CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getInUse())) {
// 非作废、终止,本条变为在用
if (Common.isEmpty(tEmployeeContractInfo.getSituation())
|| (!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())
&& !EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()))) {
// 其他变为不在用
baseMapper.updateInUseStatusById(tEmployeeContractInfo.getEmpId(), tEmployeeContractInfo.getDeptNo(), tEmployeeContractInfo.getId(), CommonConstants.ONE_STRING);
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
baseMapper.updateById(tEmployeeContractInfo);
} else {
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
if (Common.isNotNull(tEmployeeContractInfo.getOldContractId())) {
TEmployeeContractInfo old = this.getById(tEmployeeContractInfo.getOldContractId());
if (old != null && Common.isNotNull(old.getId()) && CommonConstants.ZERO_STRING.equals(old.getInUse())) {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
}
}
}
TEmployeeInfo employeeInfo = tEmployeeInfoMapper.selectById(tEmployeeContractInfo.getEmpId());
if (employeeInfo != null) {
employeeInfo.setContractStatus(CommonConstants.ONE_INT);
......@@ -1000,14 +1021,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @return: void
**/
private void judgeAuditStatus(TEmployeeContractInfo insert) {
if (insert.getAuditStatus() != CommonConstants.TWO_INT
if (insert.getAuditStatus() == CommonConstants.ONE_INT
&& (EmployeeConstants.CONTRACT_NAME[0].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[1].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[2].equals(insert.getContractName()))) {
//
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) {
......
......@@ -1354,7 +1354,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
/**
* @Description: 更新人员、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022/11/23 17:45
* @return: java.lang.Boolean
......@@ -1366,7 +1366,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
for (EmpIdCardAndDeptVo emp : vo.getEmpInfo()) {
baseMapper.updateEmployeeInsuranceStatus(emp);
tEmployeeInfoMapper.updateEmployeeInfoInsuranceStatus(emp);
}
return true;
}
......
......@@ -852,7 +852,7 @@
<!-- 更新项目档案商险状态 -->
<update id="updateEmployeeInsuranceStatus" >
update t_employee_project a set a.INSURANCE_STATUS = #{emp.status} where a.EMP_IDCARD = #{emp.idCard} and a.DEPT_ID = #{emp.deptId}
update t_employee_project a set a.INSURANCE_STATUS = #{emp.status} where a.EMP_IDCARD = #{emp.idCard} and a.DEPT_NO = #{emp.deptNo}
</update>
<!-- 更新项目档案薪资状态 -->
......
......@@ -311,7 +311,7 @@ public class ArchivesDaprUtil {
}
/**
* @Description: 更新人员档案与项目档案,状态一致。商险的status 0无2正常3失效4处理中
* @Description: 更新项目档案的商险状态。商险的status 0无2正常3失效4处理中
* @Author: hgw
* @Date: 2022/11/23 15:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
......@@ -322,7 +322,7 @@ public class ArchivesDaprUtil {
,"/temployeeproject/inner/updateEmployeeInsuranceStatus"
, JSON.toJSONString(empStatusVo) , Boolean.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("更新【人员档案、项目档案】的商险状态失败!");
return R.failed("更新【项目档案】的商险状态失败!");
}
return res;
}
......
......@@ -26,4 +26,6 @@ public class UpdateSocialFoundVo {
private String socialCreateMonth;
private String flag;
private String oldDeptId;
}
......@@ -659,31 +659,6 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
}
}
/**
* @param isDept true :含项目,要分割字符串; false:不含项目,直接用身份证,仅更新人员档案
* @Description: 提取方法,塞值
* @Author: hgw
* @Date: 2022/11/23 16:48
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo
**/
private EmpStatusVo getEmpStatusVo(Map<String, Integer> empStatusMap, boolean isDept) {
EmpStatusVo empStatusVo = new EmpStatusVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
List<EmpIdCardAndDeptVo> voList = new ArrayList<>();
for (Map.Entry<String, Integer> entry : empStatusMap.entrySet()) {
if (isDept) {
empIdCardAndDeptVo.setIdCard(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[0]);
empIdCardAndDeptVo.setDeptId(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[1]);
} else {
empIdCardAndDeptVo.setIdCard(entry.getKey());
}
empIdCardAndDeptVo.setStatus(String.valueOf(entry.getValue()));
voList.add(empIdCardAndDeptVo);
}
empStatusVo.setEmpInfo(voList);
return empStatusVo;
}
/**
* @Description: 添加流程进展明细
* @Author: hgw
......
......@@ -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);
}
......@@ -1349,10 +1349,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo)){
fund.setEmpId(empVo.getId());
fund.setEmpNo(empVo.getEmpNo());
fund.setSettleDomain(empVo.getDeptId());
fund.setEmpIdcard(empVo.getEmpIdcard());
fund.setEmpName(empVo.getEmpName());
}else {
fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName());
}
fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName());
fund.setTrustRemark(excel.getTrustRemark());
fund.setUnitProvidengCardinal(excel.getProvidentCardinal());
fund.setPersonalProvidentCardinal(excel.getProvidentCardinal());
......
......@@ -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