|
|
@ -1,10 +1,12 @@ |
|
|
|
package com.daqing.financial.hrms.service.impl; |
|
|
|
package com.daqing.financial.hrms.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.daqing.financial.hrms.dao.*; |
|
|
|
import com.daqing.financial.hrms.dao.*; |
|
|
|
|
|
|
|
import com.daqing.financial.hrms.feign.GuaranteeFeignService; |
|
|
|
import com.daqing.financial.hrms.service.EmployeeService; |
|
|
|
import com.daqing.financial.hrms.service.EmployeeService; |
|
|
|
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest; |
|
|
|
import com.daqing.framework.domain.crms.request.EmployeeDisableRequest; |
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
|
import com.daqing.framework.domain.crms.response.CrmsCode; |
|
|
@ -24,7 +26,6 @@ import com.daqing.framework.util.Md5Util; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.PageUtils; |
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
import com.daqing.framework.utils.excel.ExcelUtil; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import net.sf.json.JSONArray; |
|
|
|
|
|
|
|
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.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -55,6 +56,9 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private RoleDao roleDao; |
|
|
|
private RoleDao roleDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private GuaranteeFeignService guaranteeFeignService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 列表 |
|
|
|
* 列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -88,6 +92,10 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity |
|
|
|
ExceptionCast.cast(HrmsCode.EMPLOYEE_IS_NULL); |
|
|
|
ExceptionCast.cast(HrmsCode.EMPLOYEE_IS_NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
this.getBaseMapper().deleteRoleByUserId(user_ids); |
|
|
|
this.getBaseMapper().deleteRoleByUserId(user_ids); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Integer> userIds = JSONArray.parseArray(user_ids.toString(),Integer.class); |
|
|
|
|
|
|
|
//删除员工信息的同时要删除审批流程可见信息
|
|
|
|
|
|
|
|
guaranteeFeignService.delBatchUserVisual(userIds); |
|
|
|
return this.getBaseMapper().deleteByIds(user_ids); |
|
|
|
return this.getBaseMapper().deleteByIds(user_ids); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -326,6 +334,13 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity |
|
|
|
Boolean result4 = this.getBaseMapper().insertPosition(employeeInfoVO.getId(), employeeInfoVO.getPositionIds()); |
|
|
|
Boolean result4 = this.getBaseMapper().insertPosition(employeeInfoVO.getId(), employeeInfoVO.getPositionIds()); |
|
|
|
Boolean result5 = this.getBaseMapper().insertRole(userId, employeeInfoVO.getRoleIds()); |
|
|
|
Boolean result5 = this.getBaseMapper().insertRole(userId, employeeInfoVO.getRoleIds()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改,则先要将该用户对应得审批模板都删除
|
|
|
|
|
|
|
|
guaranteeFeignService.delUserVisual(employeeInfoVO.getId().intValue()); |
|
|
|
|
|
|
|
//如果新增的角色包含超管,则要设置该用户可以看到审批模板
|
|
|
|
|
|
|
|
if(employeeInfoVO.getRoleIds().contains(1)){ |
|
|
|
|
|
|
|
ResponseResult result = guaranteeFeignService.updateManagerVisual(employeeInfoVO.getId().intValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result1 && result2 && result3 && result4 && result5; |
|
|
|
return result1 && result2 && result3 && result4 && result5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -393,6 +408,10 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity |
|
|
|
return result3 && result4 && result5; |
|
|
|
return result3 && result4 && result5; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//如果新增的角色包含超管,则要设置该用户可以看到审批模板
|
|
|
|
|
|
|
|
if(employeeInfoVO.getRoleIds().contains(1)){ |
|
|
|
|
|
|
|
ResponseResult result = guaranteeFeignService.updateManagerVisual(employeeInfoVO.getId().intValue()); |
|
|
|
|
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|