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