多部门负责人BUG修复

pull/111/head
dxfeng 2 years ago
parent f237400510
commit b7938cfb6b

@ -162,7 +162,12 @@ public class DepartmentBO {
if (StringUtils.isBlank(departmentPrincipal)) { if (StringUtils.isBlank(departmentPrincipal)) {
return ""; return "";
} }
return MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.parseLong(departmentPrincipal)); List<Long> collect = Arrays.stream(departmentPrincipal.split(",")).map(Long::parseLong).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
return "";
}
List<String> employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect);
return StringUtils.join(employeeNameById, ",");
} }

@ -15,7 +15,7 @@ import java.util.Map;
**/ **/
public interface EmployeeMapper { public interface EmployeeMapper {
String getEmployeeNameById(@Param("employeeId") Long id); List<String> getEmployeeNameById(@Param("ids") Collection<Long> ids);
List<Long> getResourceIds(@Param("lastName") String lastName); List<Long> getResourceIds(@Param("lastName") String lastName);

@ -21,7 +21,10 @@
<select id="getEmployeeNameById" resultType="string"> <select id="getEmployeeNameById" resultType="string">
select t.lastname select t.lastname
from hrmresource t from hrmresource t
where id = #{employeeId} where id in
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select> </select>

@ -543,8 +543,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
//TODO new DepartmentTriggerRunnable(departmentPO.getId()).run(); //TODO new DepartmentTriggerRunnable(departmentPO.getId()).run();
} }
// 查询该部门一级岗位、更新岗位所属分部、所属部门 // 查询该部门一级岗位、更新岗位所属分部、所属部门
List<JobPO> firstChildJobList = getJobMapper().listJobsByDepartmentId(mergeParam.getId()); //List<JobPO> firstChildJobList = getJobMapper().listJobsByDepartmentId(mergeParam.getId());
firstChildJobList = firstChildJobList.stream().filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList()); //firstChildJobList = firstChildJobList.stream().filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList());
// 批量更新部门、所属分部 // 批量更新部门、所属分部
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String targetEcDeptId = targetDepartment.getId().toString(); String targetEcDeptId = targetDepartment.getId().toString();

@ -5,8 +5,10 @@ import com.engine.organization.entity.DeleteParam;
import com.engine.organization.mapper.employee.EmployeeMapper; import com.engine.organization.mapper.employee.EmployeeMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper; import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.util.db.MapperProxyFactory; import com.engine.organization.util.db.MapperProxyFactory;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -20,8 +22,15 @@ import java.util.stream.Collectors;
public class ManagerDetachTransMethod { public class ManagerDetachTransMethod {
public static String getManagerName(String ecManager) { public static String getManagerName(String ecManager) {
String managerName = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(Long.valueOf(ecManager)); if (org.apache.commons.lang.StringUtils.isBlank(ecManager)) {
return managerName; return "";
}
List<Long> collect = Arrays.stream(ecManager.split(",")).map(Long::parseLong).collect(Collectors.toList());
if (CollectionUtils.isEmpty(collect)) {
return "";
}
List<String> employeeNameById = MapperProxyFactory.getProxy(EmployeeMapper.class).getEmployeeNameById(collect);
return StringUtils.join(employeeNameById, ",");
} }

Loading…
Cancel
Save