Commit f3ffcb63 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-派单暂存

parent cc836c66
...@@ -45,8 +45,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; ...@@ -45,8 +45,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
...@@ -118,6 +120,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -118,6 +120,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TGzEmpInfoMapper tGzEmpInfoMapper; private final TGzEmpInfoMapper tGzEmpInfoMapper;
private final CspDaprUtils cspDaprUtil;
/** /**
* 员工合同信息表简单分页查询 * 员工合同信息表简单分页查询
* *
...@@ -1818,6 +1822,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1818,6 +1822,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
return baseMapper.noPageCountDiy(searchVo); return baseMapper.noPageCountDiy(searchVo);
} }
// 审核或办理,更新离职待办
// isSuccess 0:失败;1:成功
private void sendLeave(String id, String doStatus, String isSuccess, String failRemark, YifuUser user) {
BaseServiceParamListVO updateVo = new BaseServiceParamListVO();
List<String> idList = new ArrayList<>();
idList.add(id);
updateVo.setListParam(idList);
updateVo.setDoType(CommonConstants.FOUR_STRING);
updateVo.setDoStatus(doStatus);
updateVo.setIsSuccess(isSuccess);
if (Common.isNotNull(isSuccess) && CommonConstants.ZERO_STRING.equals(isSuccess)) {
updateVo.setRemark(failRemark);
if (user != null && Common.isNotNull(user.getNickname())) {
updateVo.setUserName(user.getNickname());
}
}
cspDaprUtil.reduceHandleToLeave(updateVo);
}
/** /**
* @Author fxj * @Author fxj
* @Description 批量审核合同 * @Description 批量审核合同
...@@ -1846,6 +1869,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1846,6 +1869,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get( Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type"); CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
String auditRemark = contractAuditVo.getAuditRemark();
for (TEmployeeContractInfo contract : contractInfos) { for (TEmployeeContractInfo contract : contractInfos) {
i++; i++;
if (contract.getAuditStatus() != CommonConstants.ONE_INT) { if (contract.getAuditStatus() != CommonConstants.ONE_INT) {
...@@ -2113,6 +2137,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2113,6 +2137,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//审核通过瓜子合同状态更新成合同审核通过 //审核通过瓜子合同状态更新成合同审核通过
updateGzOfferStatus(contract,CommonConstants.THIRTEEN_STRING,CommonConstants.EIGHT_STRING,user.getId(),user.getNickname()); updateGzOfferStatus(contract,CommonConstants.THIRTEEN_STRING,CommonConstants.EIGHT_STRING,user.getId(),user.getNickname());
} }
if (EmployeeConstants.SITUATION_SEVEN.equals(contract.getSituation())) {
this.sendLeave(contract.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, auditRemark, user);
}
} }
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) { if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) {
//更新合同状态为3线下签审核不通过 //更新合同状态为3线下签审核不通过
...@@ -2124,6 +2152,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2124,6 +2152,9 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPre.setProcessStatus(CommonConstants.THREE_STRING); contractPre.setProcessStatus(CommonConstants.THREE_STRING);
contractPreMapper.updateById(contractPre); contractPreMapper.updateById(contractPre);
} }
if (EmployeeConstants.SITUATION_SEVEN.equals(contract.getSituation())) {
this.sendLeave(contract.getId(), CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, auditRemark, user);
}
} }
// 不是待提交,记录审核记录 // 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo); this.setAuditInfo(tEmployeeContractInfo);
......
...@@ -68,6 +68,8 @@ import org.springframework.cache.Cache; ...@@ -68,6 +68,8 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -671,12 +673,24 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -671,12 +673,24 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
private YifuUser getNewYifuUser(String userId, String userName) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser(userId, 1L, "", userName,
userName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null, null);
}
// 离职待办减少项目档案 // 离职待办减少项目档案
@Override @Override
public BaseSearchListVO leaveToReduceEmp(BaseSearchListVO paramVo) { public BaseSearchListVO leaveToReduceEmp(BaseSearchListVO paramVo) {
List<BaseSearchVO> listParam = paramVo.getListParam(); List<BaseSearchVO> listParam = paramVo.getListParam();
YifuUser newUser = paramVo.getNewUser(); YifuUser newUser = getNewYifuUser(paramVo.getUserId(), paramVo.getUserName());
// 合同ID,离职待办ID // 合同ID,离职待办ID
BaseSearchListVO baseSearchListVO = new BaseSearchListVO(); BaseSearchListVO baseSearchListVO = new BaseSearchListVO();
if (listParam != null && !listParam.isEmpty()) { if (listParam != null && !listParam.isEmpty()) {
......
...@@ -63,6 +63,8 @@ import lombok.extern.log4j.Log4j2; ...@@ -63,6 +63,8 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -605,11 +607,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -605,11 +607,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR); return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
} }
private YifuUser getNewYifuUser(String userId, String userName) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser(userId, 1L, "", userName,
userName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null, null);
}
// 离职待办减少项目档案 // 离职待办减少项目档案
@Override @Override
public BaseSearchListVO leaveToReduceProject(BaseSearchListVO paramVo) { public BaseSearchListVO leaveToReduceProject(BaseSearchListVO paramVo) {
List<BaseSearchVO> listParam = paramVo.getListParam(); List<BaseSearchVO> listParam = paramVo.getListParam();
YifuUser newUser = paramVo.getNewUser(); YifuUser newUser = getNewYifuUser(paramVo.getUserId(), paramVo.getUserName());
// 合同ID,离职待办ID // 合同ID,离职待办ID
BaseSearchListVO baseSearchListVO = new BaseSearchListVO(); BaseSearchListVO baseSearchListVO = new BaseSearchListVO();
if (listParam != null && !listParam.isEmpty()) { if (listParam != null && !listParam.isEmpty()) {
......
...@@ -37,6 +37,10 @@ public class ErrorMessage<T> implements Serializable { ...@@ -37,6 +37,10 @@ public class ErrorMessage<T> implements Serializable {
*/ */
private T data; private T data;
// 添加默认构造函数
public ErrorMessage() {
}
public ErrorMessage(Integer lineNum, String message) { public ErrorMessage(Integer lineNum, String message) {
this.lineNum = lineNum; this.lineNum = lineNum;
this.color = "red"; this.color = "red";
......
...@@ -36,7 +36,8 @@ public class BaseSearchListVO implements Serializable { ...@@ -36,7 +36,8 @@ public class BaseSearchListVO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private YifuUser newUser; private String userId;
private String userName;
// 商险使用 // 商险使用
private List<String> listStringParam = new ArrayList<>(); private List<String> listStringParam = new ArrayList<>();
......
...@@ -5,6 +5,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; ...@@ -5,6 +5,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationUpdateVo; import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCspProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCspProperties;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -45,4 +46,16 @@ public class CspDaprUtils { ...@@ -45,4 +46,16 @@ public class CspDaprUtils {
public R<Boolean> updateRegistCustomerUserInfo(EmployeeRegistrationCustomerUserUpdateVo updateVo) { public R<Boolean> updateRegistCustomerUserInfo(EmployeeRegistrationCustomerUserUpdateVo updateVo) {
return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId(),"/employeeregistration/inner/updateRegistCustomerUserInfo", JSON.toJSONString(updateVo), Boolean.class, SecurityConstants.FROM_IN); return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId(),"/employeeregistration/inner/updateRegistCustomerUserInfo", JSON.toJSONString(updateVo), Boolean.class, SecurityConstants.FROM_IN);
} }
/**
* @Description: 社保、公积金、商险、合同办理成功或失败,更新离职待办
* @Author: hgw
* @Date: 2025/11/24 16:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
public R<String> reduceHandleToLeave(BaseServiceParamListVO vo) {
return HttpDaprUtil.invokeMethodPost(daprCspProperties.getAppUrl(),daprCspProperties.getAppId()
,"/employeeregistrationleave/inner/reduceHandleToLeave"
, vo, String.class, SecurityConstants.FROM_IN);
}
} }
...@@ -425,7 +425,7 @@ public class SocialDaprUtils { ...@@ -425,7 +425,7 @@ public class SocialDaprUtils {
**/ **/
public R<BaseSearchListVO> leaveToReduceSocialAndFund(TDispatchReduceListVo paramVo) { public R<BaseSearchListVO> leaveToReduceSocialAndFund(TDispatchReduceListVo paramVo) {
R<BaseSearchListVO> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId() R<BaseSearchListVO> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId()
,"/tsocialfundinfo/inner/leaveToReduceSocialAndFund", paramVo, BaseSearchListVO.class, SecurityConstants.FROM_IN); ,"/tdispatchinfo/inner/leaveToReduceSocialAndFund", paramVo, BaseSearchListVO.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){ if (Common.isEmpty(res)){
return R.failed("离职待办调用的批量派减社保、公积金失败!"); return R.failed("离职待办调用的批量派减社保、公积金失败!");
} }
......
...@@ -1016,7 +1016,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1016,7 +1016,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
private YifuUser getNewYifuUser(Collection<? extends GrantedAuthority> authorities, String userName) { private YifuUser getNewYifuUser(Collection<? extends GrantedAuthority> authorities, String userName) {
return new YifuUser("7", 1L, "", userName, return new YifuUser("1", 1L, "", userName,
userName, "0", SecurityConstants.BCRYPT + "123456", userName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true, "12345678911", true, true, true,
true, true,
...@@ -1152,7 +1152,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1152,7 +1152,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 社保-完成 // 社保-完成
if (!socialOldList.isEmpty()) { if (!socialOldList.isEmpty()) {
TDispatchReduceListVo paramListVo = new TDispatchReduceListVo(); TDispatchReduceListVo paramListVo = new TDispatchReduceListVo();
paramListVo.setNewUser(user); paramListVo.setUserId(user.getId());
paramListVo.setUserName(user.getNickname());
paramListVo.setListParam(socialOldList); paramListVo.setListParam(socialOldList);
R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(paramListVo); R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(paramListVo);
// 成功+失败 // 成功+失败
...@@ -1187,7 +1188,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1187,7 +1188,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 公积金-完成 // 公积金-完成
if (!fundOldList.isEmpty()) { if (!fundOldList.isEmpty()) {
TDispatchReduceListVo paramListVo = new TDispatchReduceListVo(); TDispatchReduceListVo paramListVo = new TDispatchReduceListVo();
paramListVo.setNewUser(user); paramListVo.setUserId(user.getId());
paramListVo.setUserName(user.getNickname());
paramListVo.setListParam(fundOldList); paramListVo.setListParam(fundOldList);
R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(paramListVo); R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(paramListVo);
// 成功+失败 // 成功+失败
...@@ -1224,8 +1226,10 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1224,8 +1226,10 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// insuranceLeaveMap; // insuranceLeaveMap;
// 查找是 2待派单3发起失败9减员退回 的再去办 // 查找是 2待派单3发起失败9减员退回 的再去办
List<String> toDoList = leaveInsuranceMapper.getLeaveInsuranceListByIdAndStatus(insuranceOldList); List<String> toDoList = leaveInsuranceMapper.getLeaveInsuranceListByIdAndStatus(insuranceOldList);
if (toDoList != null && !toDoList.isEmpty()) {
BaseSearchListVO paramVoInsurance = new BaseSearchListVO(); BaseSearchListVO paramVoInsurance = new BaseSearchListVO();
paramVoInsurance.setNewUser(user); paramVoInsurance.setUserId(user.getId());
paramVoInsurance.setUserName(user.getNickname());
paramVoInsurance.setListStringParam(toDoList); paramVoInsurance.setListStringParam(toDoList);
R<BaseSearchListVO> listR = insuranceDaprUtil.leaveToReduceInsurance(paramVoInsurance); R<BaseSearchListVO> listR = insuranceDaprUtil.leaveToReduceInsurance(paramVoInsurance);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) {
...@@ -1235,8 +1239,10 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1235,8 +1239,10 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 商险id与错误原因 // 商险id与错误原因
Map<String, String> errorMap = new HashMap<>(); Map<String, String> errorMap = new HashMap<>();
for (ErrorMessage message : insuranceParamList) { for (ErrorMessage message : insuranceParamList) {
if (Common.isNotNull(message.getName())) {
errorMap.put(message.getName(), message.getMessage()); errorMap.put(message.getName(), message.getMessage());
} }
}
StringBuilder errorMsg; StringBuilder errorMsg;
// 错误的商险派单 // 错误的商险派单
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
...@@ -1284,10 +1290,12 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1284,10 +1290,12 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
} }
} }
}
// 合同-完成 // 合同-完成
if (!listParamContract.isEmpty()) { if (!listParamContract.isEmpty()) {
BaseSearchListVO paramVoContract = new BaseSearchListVO(); BaseSearchListVO paramVoContract = new BaseSearchListVO();
paramVoContract.setNewUser(user); paramVoContract.setUserId(user.getId());
paramVoContract.setUserName(user.getNickname());
paramVoContract.setListParam(listParamContract); paramVoContract.setListParam(listParamContract);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceContract(paramVoContract); R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceContract(paramVoContract);
// 成功+失败 // 成功+失败
...@@ -1322,7 +1330,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1322,7 +1330,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 项目-完成 // 项目-完成
if (!listParamProject.isEmpty()) { if (!listParamProject.isEmpty()) {
BaseSearchListVO paramVoProject = new BaseSearchListVO(); BaseSearchListVO paramVoProject = new BaseSearchListVO();
paramVoProject.setNewUser(user); paramVoProject.setUserId(user.getId());
paramVoProject.setUserName(user.getNickname());
paramVoProject.setListParam(listParamProject); paramVoProject.setListParam(listParamProject);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceProject(paramVoProject); R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceProject(paramVoProject);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) {
...@@ -1355,7 +1364,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1355,7 +1364,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 员工-完成 // 员工-完成
if (!listParamEmp.isEmpty()) { if (!listParamEmp.isEmpty()) {
BaseSearchListVO paramVoEmp = new BaseSearchListVO(); BaseSearchListVO paramVoEmp = new BaseSearchListVO();
paramVoEmp.setNewUser(user); paramVoEmp.setUserId(user.getId());
paramVoEmp.setUserName(user.getNickname());
paramVoEmp.setListParam(listParamEmp); paramVoEmp.setListParam(listParamEmp);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceEmp(paramVoEmp); R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceEmp(paramVoEmp);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) { if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())) {
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
a.insurance_id a.insurance_id
FROM employee_registration_leave_insurance a FROM employee_registration_leave_insurance a
<where> <where>
do_status_insurance in ('2','3','9') do_status_insurance in ('0','2','3','9')
<if test="idList != null"> <if test="idList != null">
AND a.insurance_id in AND a.insurance_id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<set> <set>
do_status_insurance = #{status} do_status_insurance = #{status}
</set> </set>
where do_status_insurance in ('2','3','9') and insurance_id in where do_status_insurance in ('0','2','3','9') and insurance_id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr} #{idStr}
</foreach> </foreach>
......
...@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*; ...@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator; import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
...@@ -61,6 +62,8 @@ import org.apache.commons.lang3.StringUtils; ...@@ -61,6 +62,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -164,6 +167,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -164,6 +167,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Autowired @Autowired
private WxConfig wxConfig; private WxConfig wxConfig;
@Autowired
private CspDaprUtils cspDaprUtil;
/***********************商险办理********************************/ /***********************商险办理********************************/
/** /**
* 每日定时刷新商险到期数据 * 每日定时刷新商险到期数据
...@@ -4835,17 +4841,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4835,17 +4841,31 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return list; return list;
} }
private YifuUser getNewYifuUser(String userId, String userName) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser(userId, 1L, "", userName,
userName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null, null);
}
// 离职导致的减员 // 离职导致的减员
@Override @Override
public BaseSearchListVO leaveToReduceInsurance(BaseSearchListVO paramVo) { public BaseSearchListVO leaveToReduceInsurance(BaseSearchListVO paramVo) {
List<String> insuranceList = paramVo.getListStringParam(); List<String> insuranceList = paramVo.getListStringParam();
YifuUser newUser = paramVo.getNewUser(); YifuUser newUser = getNewYifuUser(paramVo.getUserId(), paramVo.getUserName());
List<InsuranceExportListVO> oldList = baseMapper.getInsuranceExportListBySelect(insuranceList); List<InsuranceExportListVO> oldList = baseMapper.getInsuranceExportListBySelect(insuranceList);
List<InsuranceRefundCheck> insuranceRefundCheckList = new ArrayList<>(); List<InsuranceRefundCheck> insuranceRefundCheckList = new ArrayList<>();
InsuranceRefundCheck refund; InsuranceRefundCheck refund;
if (oldList != null && !oldList.isEmpty()) { if (oldList != null && !oldList.isEmpty()) {
for (InsuranceExportListVO vo : oldList) { for (InsuranceExportListVO vo : oldList) {
refund = new InsuranceRefundCheck(); refund = new InsuranceRefundCheck();
refund.setId(vo.getId());
refund.setEmpName(vo.getEmpName()); refund.setEmpName(vo.getEmpName());
// 员工姓名 员工身份证号码 保险公司名称 险种名称 购买标准(元) 保单开始日期 保单结束日期 // 员工姓名 员工身份证号码 保险公司名称 险种名称 购买标准(元) 保单开始日期 保单结束日期
refund.setEmpIdcardNo(vo.getEmpIdcardNo()); refund.setEmpIdcardNo(vo.getEmpIdcardNo());
...@@ -5343,11 +5363,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5343,11 +5363,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//批量更新 //批量更新
if (CollectionUtils.isNotEmpty(detailList)){ if (CollectionUtils.isNotEmpty(detailList)){
List<String> idList = new ArrayList<>();
for (TInsuranceDetail s : detailList) { for (TInsuranceDetail s : detailList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail :: getId,s.getId()).set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT); updateWrapper.eq(TInsuranceDetail :: getId,s.getId()).set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
update(updateWrapper); update(updateWrapper);
idList.add(s.getId());
} }
// 商险办理,更新离职待办
this.sendLeave(idList, CommonConstants.SIX_STRING, CommonConstants.ONE_STRING, null, user);
} }
//批量更新 //批量更新
if (CollectionUtils.isNotEmpty(refundList)){ if (CollectionUtils.isNotEmpty(refundList)){
...@@ -5412,8 +5436,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5412,8 +5436,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setIsOverdue(null); tInsuranceDetail.setIsOverdue(null);
tInsuranceDetail.setIsEffect(null); tInsuranceDetail.setIsEffect(null);
tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.FIVE_INT);
// 已减员
this.sendLeaveById(tInsuranceDetail.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, remark, user);
}else { }else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
// 9减员退回
this.sendLeaveById(tInsuranceDetail.getId(), CommonConstants.NINE_STRING, CommonConstants.ZERO_STRING, remark, user);
} }
tInsuranceDetail.setUpdateBy(user.getId()); tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setUpdateTime(LocalDateTime.now()); tInsuranceDetail.setUpdateTime(LocalDateTime.now());
...@@ -5506,13 +5536,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5506,13 +5536,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operate.setCreateBy(user.getId()); operate.setCreateBy(user.getId());
if(InsurancesConstants.SUCCESS.equals(param.getHandType())){ if(InsurancesConstants.SUCCESS.equals(param.getHandType())){
operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_SUCCESS); operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_SUCCESS);
// 商险办理,更新离职待办
this.sendLeaveById(param.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, param.getRemark(), user);
}else{ }else{
operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_FAILED); operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_FAILED);
// 商险办理,更新离职待办
this.sendLeaveById(param.getId(), CommonConstants.NINE_STRING, CommonConstants.ONE_STRING, param.getRemark(), user);
} }
operateList.add(operate); operateList.add(operate);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
} }
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
// 减员失效 // 减员失效
...@@ -9151,4 +9190,43 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9151,4 +9190,43 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
return returnVo; return returnVo;
} }
// 审核或办理,更新离职待办
// isSuccess 0:失败;1:成功
private void sendLeave(List<String> idList, String doStatus, String isSuccess, String failRemark, YifuUser user) {
BaseServiceParamListVO updateVo = new BaseServiceParamListVO();
updateVo.setListParam(idList);
updateVo.setDoType(CommonConstants.THREE_STRING);
updateVo.setDoStatus(doStatus);
updateVo.setIsSuccess(isSuccess);
if (Common.isNotNull(isSuccess) && CommonConstants.ZERO_STRING.equals(isSuccess)) {
updateVo.setRemark(failRemark);
if (user != null && Common.isNotNull(user.getNickname())) {
updateVo.setUserName(user.getNickname());
}
}
cspDaprUtil.reduceHandleToLeave(updateVo);
}
// 审核或办理,更新离职待办
// isSuccess 0:失败;1:成功
private void sendLeaveById(String id, String doStatus, String isSuccess, String failRemark, YifuUser user) {
BaseServiceParamListVO updateVo = new BaseServiceParamListVO();
List<String> idList = new ArrayList<>();
idList.add(id);
updateVo.setListParam(idList);
updateVo.setDoType(CommonConstants.THREE_STRING);
updateVo.setDoStatus(doStatus);
updateVo.setIsSuccess(isSuccess);
if (Common.isNotNull(isSuccess) && CommonConstants.ZERO_STRING.equals(isSuccess)) {
updateVo.setRemark(failRemark);
if (user != null && Common.isNotNull(user.getNickname())) {
updateVo.setUserName(user.getNickname());
}
}
cspDaprUtil.reduceHandleToLeave(updateVo);
}
} }
...@@ -33,8 +33,11 @@ import java.util.List; ...@@ -33,8 +33,11 @@ import java.util.List;
@Data @Data
public class TDispatchReduceListVo implements Serializable { public class TDispatchReduceListVo implements Serializable {
private YifuUser newUser; private static final long serialVersionUID = 1L;
List<TDispatchReduceVo> listParam; private String userId;
private String userName;
private List<TDispatchReduceVo> listParam;
} }
...@@ -508,8 +508,8 @@ public class TDispatchInfoController { ...@@ -508,8 +508,8 @@ public class TDispatchInfoController {
@SysLog("离职调用的派减社保或公积金") @SysLog("离职调用的派减社保或公积金")
@PostMapping("/inner/leaveToReduceSocialAndFund") @PostMapping("/inner/leaveToReduceSocialAndFund")
@Inner @Inner
public R<BaseSearchListVO> leaveToReduceSocialAndFund(@RequestBody TDispatchReduceListVo paramVo) { public BaseSearchListVO leaveToReduceSocialAndFund(@RequestBody TDispatchReduceListVo paramVo) {
return new R<>(tDispatchInfoService.leaveToReduceSocialAndFund(paramVo)); return tDispatchInfoService.leaveToReduceSocialAndFund(paramVo);
} }
/** /**
......
...@@ -53,11 +53,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock; ...@@ -53,11 +53,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO; import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseServiceParamListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CheckDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.config.*; import com.yifu.cloud.plus.v1.yifu.social.config.*;
...@@ -125,6 +123,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -125,6 +123,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final ArchivesDaprUtil archivesDaprUtil; private final ArchivesDaprUtil archivesDaprUtil;
private final CspDaprUtils cspDaprUtil;
private final TSocialFundInfoMapper socialFundMapper; private final TSocialFundInfoMapper socialFundMapper;
private final SysBaseSetInfoMapper baseSetMapper; private final SysBaseSetInfoMapper baseSetMapper;
...@@ -3133,6 +3133,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3133,6 +3133,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return this.judgeAllMessage(errorMessageList); return this.judgeAllMessage(errorMessageList);
} }
private YifuUser getNewYifuUser(String userId, String userName) {
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser(userId, 1L, "", userName,
userName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null, null);
}
// 离职待办调用的批量派减社保、公积金 // 离职待办调用的批量派减社保、公积金
@Override @Override
public BaseSearchListVO leaveToReduceSocialAndFund(TDispatchReduceListVo paramVo) { public BaseSearchListVO leaveToReduceSocialAndFund(TDispatchReduceListVo paramVo) {
...@@ -3153,8 +3166,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3153,8 +3166,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
rowLeaveMap.put(i, leaveId); rowLeaveMap.put(i, leaveId);
} }
cachedDataList.add(vo); cachedDataList.add(vo);
if (cachedDataList.size() >= batchCount) { if (cachedDataList.size() >= batchCount || i==excelVOList.size()) {
batchReduceDispatch(cachedDataList, errorMessageList, paramVo.getNewUser(), null, null); batchReduceDispatch(cachedDataList, errorMessageList, getNewYifuUser(paramVo.getUserId(), paramVo.getUserName()), null, null);
// 存储完成清理 list // 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(batchCount); cachedDataList = ListUtils.newArrayListWithExpectedSize(batchCount);
} }
...@@ -3814,6 +3827,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3814,6 +3827,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
// 各个明细项的可派减项为待办理 // 各个明细项的可派减项为待办理
initReduceStatus(sf, socialInfo); initReduceStatus(sf, socialInfo);
} }
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.FIVE_STRING, CommonConstants.ONE_STRING, auditRemark, user);
//派减审核不通过 需要处理预估数据 //派减审核不通过 需要处理预估数据
} else if (CommonConstants.ONE_INT == flag) { } else if (CommonConstants.ONE_INT == flag) {
// 作废更新:社保状态、同步预估数据 8 审核不通过直接作废 // 作废更新:社保状态、同步预估数据 8 审核不通过直接作废
...@@ -3830,6 +3846,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3830,6 +3846,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setSocialStatus(CommonConstants.THREE_STRING); sf.setSocialStatus(CommonConstants.THREE_STRING);
} }
sf.setSocialReduceDate(null); sf.setSocialReduceDate(null);
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, auditRemark, user);
} }
} }
//自动化处理,如果未配置还是人工处理 //自动化处理,如果未配置还是人工处理
...@@ -3911,6 +3930,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3911,6 +3930,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchInfoPre.setErrorBackInfo(null); dispatchInfoPre.setErrorBackInfo(null);
dispatchInfoPreMapper.updateById(dispatchInfoPre); dispatchInfoPreMapper.updateById(dispatchInfoPre);
} }
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.FIVE_STRING, CommonConstants.ONE_STRING, auditRemark, user);
// 审核不通过 // 审核不通过
} else if (CommonConstants.ONE_INT == flag) { } else if (CommonConstants.ONE_INT == flag) {
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据 // 作废更新:公积金状态、同步档案的公积金状态、同步预估数据
...@@ -3934,6 +3955,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3934,6 +3955,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sendDisFalureMessageToWx(dispatchInfoPre,socialAutoLog.getId()); sendDisFalureMessageToWx(dispatchInfoPre,socialAutoLog.getId());
} }
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, auditRemark, user);
} }
providentFund.setAuditTime(now); providentFund.setAuditTime(now);
providentFund.setAuditUser(user.getId()); providentFund.setAuditUser(user.getId());
...@@ -4705,6 +4728,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4705,6 +4728,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS); temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark)); temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo, temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark); initAuditInfo(auditInfo, temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
// 派减审核或办理,更新离职待办
if (Common.isNotNull(socialInfo.getHandleStatus()) && CommonConstants.SEVEN_STRING.equals(socialInfo.getHandleStatus())) {
// 部分失败是0
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.SIX_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else {
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, handleRemark, user);
}
} else { } else {
temp.setLength(CommonConstants.ZERO_INT); temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE); temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
...@@ -4712,8 +4743,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4712,8 +4743,19 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL); temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark)); temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo, temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark); initAuditInfo(auditInfo, temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
// 派减审核或办理,更新离职待办
// 7 派减部分办理失败
if (Common.isNotNull(socialInfo.getHandleStatus()) && CommonConstants.SEVEN_STRING.equals(socialInfo.getHandleStatus())) {
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.SIX_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else {
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.NINE_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
}
} }
auditInfo.setSocialId(dis.getId()); auditInfo.setSocialId(dis.getId());
} else { } else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName())); errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName()));
return true; return true;
...@@ -4750,9 +4792,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4750,9 +4792,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.ZERO_INT == flag) { if (CommonConstants.ZERO_INT == flag) {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), CommonConstants.SIX_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark); initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), CommonConstants.SIX_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.ONE_STRING); dis.setFundHandleStatus(CommonConstants.ONE_STRING);
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, handleRemark, user);
} else { } else {
initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark); initAuditInfo(auditInfo, (DispatchConstants.DISPATCH_FUND_REDUCE_FAIL + handleRemark), CommonConstants.FOUR_STRING, user, (DispatchConstants.DISPATCH_FUND_REDUCE_SUCCESS + handleRemark), remark);
dis.setFundHandleStatus(CommonConstants.TWO_STRING); dis.setFundHandleStatus(CommonConstants.TWO_STRING);
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.NINE_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} }
auditInfo.setProvidentId(dis.getId()); auditInfo.setProvidentId(dis.getId());
} else { } else {
...@@ -4923,6 +4970,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4923,6 +4970,28 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return false; return false;
} }
// 审核或办理,更新离职待办
// isSuccess 0:失败;1:成功
private void sendLeave(String id, String doType, String doStatus, String isSuccess, String failRemark, YifuUser user) {
BaseServiceParamListVO updateVo = new BaseServiceParamListVO();
List<String> idList = new ArrayList<>();
idList.add(id);
updateVo.setListParam(idList);
updateVo.setDoType(doType);
updateVo.setDoStatus(doStatus);
updateVo.setIsSuccess(isSuccess);
if (Common.isNotNull(isSuccess) && CommonConstants.ZERO_STRING.equals(isSuccess)) {
updateVo.setRemark(failRemark);
if (user != null && Common.isNotNull(user.getNickname())) {
updateVo.setUserName(user.getNickname());
}
}
cspDaprUtil.reduceHandleToLeave(updateVo);
}
/** /**
* @param dis * @param dis
* @Description: 获取办理/审核时,要变更的预估库的种类 * @Description: 获取办理/审核时,要变更的预估库的种类
...@@ -7065,6 +7134,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -7065,6 +7134,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
**/ **/
@Override @Override
public boolean haveRole(YifuUser user, long roleId) { public boolean haveRole(YifuUser user, long roleId) {
if (user.getClientRoleMap() == null) {
return true;
}
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP); List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) { for (Long role : roleList) {
if (role == roleId) { if (role == roleId) {
......
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