Merge branch 'develop' of https://github.com/dibo-software/diboot-v2 into develop

This commit is contained in:
mazhicheng 2019-08-13 11:02:53 +08:00
commit e881e45ad5
6 changed files with 34 additions and 23 deletions

View File

@ -1,7 +1,8 @@
package com.diboot.example.config;
import com.diboot.example.entity.Department;
import com.diboot.example.entity.Organization;
import com.diboot.example.vo.DepartmentVO;
import com.diboot.example.vo.OrganizationVO;
import com.diboot.example.vo.PositionVO;
import java.util.HashMap;
import java.util.Map;
@ -14,19 +15,27 @@ public class Cons {
* 树图标常量
* */
public static enum TREE_ICON_LEVEL{
ONE,
TWO
ONE, //一级图标
TWO //二级图标
}
public static Map<String, Map<String, String>> ICON = new HashMap(){{
put(Organization.class.getSimpleName(), new HashMap(){{
put(TREE_ICON_LEVEL.ONE.name(), "");
put(TREE_ICON_LEVEL.TWO.name(), "");
//组织
put(OrganizationVO.class.getSimpleName(), new HashMap(){{
put(TREE_ICON_LEVEL.ONE.name(), "gold");
put(TREE_ICON_LEVEL.TWO.name(), "bank");
}}
);
put(Department.class.getSimpleName(), new HashMap(){{
put(TREE_ICON_LEVEL.ONE.name(), "");
put(TREE_ICON_LEVEL.TWO.name(), "");
//部门
put(DepartmentVO.class.getSimpleName(), new HashMap(){{
put(TREE_ICON_LEVEL.ONE.name(), "gold");
put(TREE_ICON_LEVEL.TWO.name(), "bank");
}}
);
//职位
put(PositionVO.class.getSimpleName(), new HashMap(){{
put(TREE_ICON_LEVEL.ONE.name(), "gold");
put(TREE_ICON_LEVEL.TWO.name(), "bank");
}}
);
}};

View File

@ -54,12 +54,16 @@ public class EmployeeServiceImpl extends BaseServiceImpl<EmployeeMapper, Employe
.eq(Department::getOrgId, orgId);
List<Department> deptList = departmentService.getEntityList(queryWrapper);
List<Long> deptIdList = getIdList(deptList);
if(V.isEmpty(deptIdList)){
return null;
}
queryWrapper = new LambdaQueryWrapper<EmployeePositionDepartment>()
.in(EmployeePositionDepartment::getDepartmentId, deptIdList);
List<EmployeePositionDepartment> epdList = employeePositionDepartmentService.getEntityList(queryWrapper);
List<Long> empIdList = getIdList(epdList, "getEmployeeId");
if(V.isEmpty(empIdList)){
return null;
}
wrapper.lambda().in(Employee::getId, empIdList);
List<Employee> empList = super.getEntityList(wrapper, pagination);
List<EmployeeVO> voList = RelationsBinder.convertAndBind(empList, EmployeeVO.class);

View File

@ -197,6 +197,9 @@ public class PositionServiceImpl extends BaseServiceImpl<PositionMapper, Positio
deptIdList.add(dept.getId());
}
}
if(V.isEmpty(deptIdList)){
return null;
}
//获取部门-职位对应信息
wrapper = new LambdaQueryWrapper<PositionDepartment>()
.in(PositionDepartment::getDepartmentId, deptIdList);
@ -207,6 +210,9 @@ public class PositionServiceImpl extends BaseServiceImpl<PositionMapper, Positio
positionIdList.add(pd.getPositionId());
}
}
if(V.isEmpty(positionIdList)){
return null;
}
//获取职位
List<Position> positionList = super.getEntityListByIds(positionIdList);
List<PositionVO> volist = RelationsBinder.convertAndBind(positionList, PositionVO.class);

View File

@ -27,12 +27,4 @@ public class DepartmentVO extends Department {
private List<DepartmentVO> children;
// 直接关联Entity
/*@BindEntity(entity = Organization.class, condition="this.org_id=id")
private Organization organization;*/
// 直接关联多个Entity
/*@BindEntityList(entity = Department.class, condition = "this.id=parent_id")
private List<Department> children;*/
}

View File

@ -19,10 +19,10 @@ public class EmployeeVO extends Employee {
@BindDict(type="GENDER", field="gender")
private String genderLabel;
@BindEntity(entity = Department.class, condition = "this.id = if_employee_position_department.employee_id AND if_employee_position_department.department_id = id")
@BindEntity(entity = Department.class, condition = "this.id = if_employee_position_department.employee_id AND if_employee_position_department.department_id = id AND if_employee_position_department.deleted = 0")
private Department department;
@BindEntity(entity = Position.class, condition = "this.id = if_employee_position_department.employee_id AND if_employee_position_department.position_id = id")
@BindEntity(entity = Position.class, condition = "this.id = if_employee_position_department.employee_id AND if_employee_position_department.position_id = id AND if_employee_position_department.deleted = 0")
private Position position;
private EmployeePositionDepartment empPosiDept;

View File

@ -27,7 +27,7 @@ public class PositionVO extends Position {
@BindEntity(entity = Position.class, condition = "this.parent_id = id")
private Position parentPosition;
@BindEntityList(entity = Department.class, condition = "this.id = if_position_department.position_id AND if_position_department.department_id = id")
@BindEntityList(entity = Department.class, condition = "this.id = if_position_department.position_id AND if_position_department.department_id = id AND if_position_department.deleted = 0")
private List<Department> departmentList;
private List<PositionVO> children;