|
|
@ -1,7 +1,10 @@ |
|
|
|
package com.yipin.liuwanr.service; |
|
|
|
package com.yipin.liuwanr.service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.yipin.liuwanr.mapper.StaffGradeMapper; |
|
|
|
|
|
|
|
import com.yipin.liuwanr.mapper.StaffMapper; |
|
|
|
import org.jboss.logging.Logger; |
|
|
|
import org.jboss.logging.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -17,6 +20,11 @@ public class StaffProfessionalArchitectureService { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private StaffProfessionalArchitectureMapper staffProfessionalArchitectureMapper; |
|
|
|
private StaffProfessionalArchitectureMapper staffProfessionalArchitectureMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private StaffGradeMapper staffGradeMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private StaffMapper staffMapper; |
|
|
|
|
|
|
|
|
|
|
|
public HashMap<String, Object> addStaffProfessionalArchitecture(StaffProfessionalArchitecture staffProfessionalArchitecture){ |
|
|
|
public HashMap<String, Object> addStaffProfessionalArchitecture(StaffProfessionalArchitecture staffProfessionalArchitecture){ |
|
|
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
|
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
try { |
|
|
@ -78,7 +86,19 @@ public class StaffProfessionalArchitectureService { |
|
|
|
public HashMap<String, Object> deleteStaffProfessionalArchitecture(Integer staffProfessionalArchitectureId){ |
|
|
|
public HashMap<String, Object> deleteStaffProfessionalArchitecture(Integer staffProfessionalArchitectureId){ |
|
|
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
|
|
HashMap<String, Object> resp = new HashMap<String, Object>(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
//删除员工专业一级组织架构
|
|
|
|
staffProfessionalArchitectureMapper.deleteStaffProfessionalArchitecture(staffProfessionalArchitectureId); |
|
|
|
staffProfessionalArchitectureMapper.deleteStaffProfessionalArchitecture(staffProfessionalArchitectureId); |
|
|
|
|
|
|
|
//根据一级架构id删除staff_grade表中二级组织架构(假删)
|
|
|
|
|
|
|
|
staffGradeMapper.delStaffGradeByArchId(staffProfessionalArchitectureId); |
|
|
|
|
|
|
|
//根据staffProfessionalArchitectureId查询staff表中的userId,然后调用批量删除员工信息接口
|
|
|
|
|
|
|
|
List<Integer> userIds =staffMapper.queryUserIdsByArchId(staffProfessionalArchitectureId); |
|
|
|
|
|
|
|
if(userIds.size()>0){//说明年级架构下面存在用户
|
|
|
|
|
|
|
|
staffGradeMapper.deleteStaffGrade(userIds); |
|
|
|
|
|
|
|
staffGradeMapper.deleteStaffArch(staffProfessionalArchitectureId); |
|
|
|
|
|
|
|
}else{//如果组织架构下面没有员工,则只删除组织架构
|
|
|
|
|
|
|
|
staffGradeMapper.deleteStaffArch(staffProfessionalArchitectureId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resp.put("retcode", 200); |
|
|
|
resp.put("retcode", 200); |
|
|
|
} catch (RuntimeException e) { |
|
|
|
} catch (RuntimeException e) { |
|
|
|
logger.error(e.getMessage()); |
|
|
|
logger.error(e.getMessage()); |
|
|
|