工作流修改
This commit is contained in:
parent
8a1bd74fb9
commit
a4f484661c
@ -102,8 +102,8 @@ public interface SystemUserMapper extends BaseMapper<SystemUser> {
|
||||
*/
|
||||
@Select("SELECT u.user_id id, w.worker_name `name`, 'user' AS 'type', u.avatar FROM system_user u " +
|
||||
"left join worker_info w on u.worker_id = w.id " +
|
||||
" WHERE w.worker_name LIKE '%${py}%'")
|
||||
List<OrgTreeVo> selectUsersByPy(@Param("py") String py);
|
||||
" WHERE w.worker_name LIKE '%${py}%' AND w.project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectUsersByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
|
||||
Page<SystemUser> getSystemUserBySn(@Param("p") Map<String, Object> map, Page<SystemUser> page);
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ import com.zhgd.xmgl.modules.worker.mapper.TeamInfoMapper;
|
||||
import com.zhgd.xmgl.modules.xz.entity.XzProjectOrg;
|
||||
import com.zhgd.xmgl.modules.xz.mapper.XzProjectOrgMapper;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.tenant.TenantContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -127,7 +128,8 @@ public class FlowOrgRepositoryServiceImpl implements OrgRepositoryService {
|
||||
|
||||
@Override
|
||||
public List<OrgTreeVo> selectUsersByPy(String py) {
|
||||
return systemUserMapper.selectUsersByPy(py);
|
||||
String tenantId = TenantContextHolder.getTenantId();
|
||||
return systemUserMapper.selectUsersByPy(py, tenantId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -265,8 +267,20 @@ public class FlowOrgRepositoryServiceImpl implements OrgRepositoryService {
|
||||
|
||||
@Override
|
||||
public Map<String, UserDeptDo> getUserDeptInfos(Collection<String> userDeptIds) {
|
||||
return systemUserMapper.getUserDepInfosBatch(userDeptIds)
|
||||
.stream().collect(Collectors.toMap(UserDeptDo::getUserId, v -> v));
|
||||
List<UserDeptDo> list = new ArrayList<>();
|
||||
for (String userDeptId : userDeptIds) {
|
||||
UserDeptDo userDeptDo = new UserDeptDo();
|
||||
String[] split = userDeptId.split("_");
|
||||
UserDo user = this.getUserById(split[0]);
|
||||
DeptDo deptById = this.getDeptById(split[1]);
|
||||
userDeptDo.setUserId(user.getUserId());
|
||||
userDeptDo.setUserName(user.getUserName());
|
||||
userDeptDo.setAvatar(user.getAvatar());
|
||||
userDeptDo.setDeptId(deptById.getId());
|
||||
userDeptDo.setDeptName(deptById.getDeptName());
|
||||
list.add(userDeptDo);
|
||||
}
|
||||
return list.stream().collect(Collectors.toMap(UserDeptDo::getUserId, v -> v));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -274,13 +288,26 @@ public class FlowOrgRepositoryServiceImpl implements OrgRepositoryService {
|
||||
int p = parentId.indexOf("P");
|
||||
String id = parentId.substring(0, p);
|
||||
String projectSn = parentId.substring(p + 1);
|
||||
List<OrgTreeVo> orgTreeVos = new ArrayList<>();
|
||||
if (id.equals("0")) {
|
||||
orgTreeVos = enterpriseInfoMapper.selectByProject(projectSn);
|
||||
} else {
|
||||
orgTreeVos = teamInfoMapper.selectByEnterprise(id, projectSn);
|
||||
List<OrgTreeVo> orgTreeVos = enterpriseInfoMapper.selectByProject(projectSn, id);
|
||||
orgTreeVos.addAll(teamInfoMapper.selectByEnterprise(id, projectSn));
|
||||
orgTreeVos.addAll(departmentInfoMapper.selectByEnterprise(id, projectSn));
|
||||
return orgTreeVos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgTreeVo> selectEnterpriseByPy(String py) {
|
||||
String tenantId = TenantContextHolder.getTenantId();
|
||||
List<OrgTreeVo> orgTreeVos = new ArrayList<>();
|
||||
orgTreeVos = enterpriseInfoMapper.selectByPy(py, tenantId);
|
||||
orgTreeVos.addAll(teamInfoMapper.selectByPy(py, tenantId));
|
||||
orgTreeVos.addAll(departmentInfoMapper.selectByPy(py, tenantId));
|
||||
return orgTreeVos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrgTreeVo> selectDeptByPy(String py) {
|
||||
String tenantId = TenantContextHolder.getTenantId();
|
||||
List<OrgTreeVo> orgTreeVos = xzProjectOrgMapper.selectByPy(py, tenantId);
|
||||
return orgTreeVos;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,6 +45,14 @@ public interface DepartmentInfoMapper extends BaseMapper<DepartmentInfo> {
|
||||
* 查询企业下的部门信息
|
||||
*
|
||||
*/
|
||||
@Select("SELECT id id, department_name `name`, 'enterprise' AS 'type' FROM department_info WHERE enterprise_id = #{enterpriseId} AND project_sn = #{projectSn}")
|
||||
@Select("SELECT id id, department_name `name`, 'department' AS 'type' FROM department_info WHERE enterprise_id = #{enterpriseId} AND project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectByEnterprise(@Param("enterpriseId") String enterpriseId, @Param("projectSn") String projectSn);
|
||||
|
||||
/**
|
||||
* 查询企业下的部门信息
|
||||
*
|
||||
*/
|
||||
@Select("SELECT id id, department_name `name`, 'department' AS 'type' FROM department_info " +
|
||||
"WHERE department_name LIKE '%${py}%' AND project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
}
|
||||
|
||||
@ -51,6 +51,12 @@ public interface EnterpriseInfoMapper extends BaseMapper<EnterpriseInfo> {
|
||||
*
|
||||
*/
|
||||
@Select("SELECT e.id id, e.enterprise_name `name`, 'enterprise' AS 'type' FROM enterprise_info e " +
|
||||
"LEFT JOIN project_enterprise p ON e.id = p.enterprise_id WHERE p.project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectByProject(@Param("projectSn") String projectSn);
|
||||
"LEFT JOIN project_enterprise p ON e.id = p.enterprise_id WHERE p.project_sn = #{projectSn}" +
|
||||
" AND p.parent_enterprise_id = #{id}")
|
||||
List<OrgTreeVo> selectByProject(@Param("projectSn") String projectSn, @Param("id") String id);
|
||||
|
||||
@Select("SELECT e.id id, e.enterprise_name `name`, 'enterprise' AS 'type' FROM enterprise_info e " +
|
||||
"LEFT JOIN project_enterprise p ON e.id = p.enterprise_id WHERE p.project_sn = #{projectSn}" +
|
||||
" AND e.enterprise_name LIKE '%${py}%'")
|
||||
List<OrgTreeVo> selectByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
}
|
||||
|
||||
@ -48,6 +48,14 @@ public interface TeamInfoMapper extends BaseMapper<TeamInfo> {
|
||||
* 查询企业下的班组信息
|
||||
*
|
||||
*/
|
||||
@Select("SELECT id id, team_name `name`, 'enterprise' AS 'type' FROM team_info WHERE enterprise_id = #{enterpriseId} AND project_sn = #{projectSn}")
|
||||
@Select("SELECT id id, team_name `name`, 'team' AS 'type' FROM team_info WHERE enterprise_id = #{enterpriseId} AND project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectByEnterprise(@Param("enterpriseId") String enterpriseId, @Param("projectSn") String projectSn);
|
||||
|
||||
/**
|
||||
* 查询企业下的班组信息
|
||||
*
|
||||
*/
|
||||
@Select("SELECT id id, team_name `name`, 'team' AS 'type' FROM team_info " +
|
||||
"WHERE team_name LIKE '%${py}%' AND project_sn = #{projectSn}")
|
||||
List<OrgTreeVo> selectByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
}
|
||||
|
||||
@ -34,4 +34,8 @@ public interface XzProjectOrgMapper extends BaseMapper<XzProjectOrg> {
|
||||
*/
|
||||
@Select("SELECT id id, dept_name `name`, 'dept' AS 'type' FROM xz_project_org WHERE parent_id=#{deptId} AND project_sn = #{projectSn} AND status = 0")
|
||||
List<OrgTreeVo> selectByDept(@Param("deptId") String deptId, @Param("projectSn") String projectSn);
|
||||
|
||||
@Select("SELECT id id, dept_name `name`, 'dept' AS 'type' FROM xz_project_org " +
|
||||
"WHERE dept_name LIKE '%${py}%' AND project_sn = #{projectSn} AND status = 0")
|
||||
List<OrgTreeVo> selectByPy(@Param("py") String py, @Param("projectSn") String projectSn);
|
||||
}
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user