派单3.0

This commit is contained in:
2025-08-21 15:43:55 +08:00
parent ddf7c4c096
commit c50ee5e739
4 changed files with 12 additions and 2 deletions

View File

@ -20,6 +20,7 @@ import org.dromara.patch.domain.vo.PdMasterProgressVo;
import org.dromara.patch.enums.TaskStatusEnum; import org.dromara.patch.enums.TaskStatusEnum;
import org.dromara.patch.service.IPdMasterSonService; import org.dromara.patch.service.IPdMasterSonService;
import org.dromara.patch.service.IPdMasterUserService; import org.dromara.patch.service.IPdMasterUserService;
import org.dromara.system.domain.SysUser;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.dromara.patch.domain.bo.PdMasterBo; import org.dromara.patch.domain.bo.PdMasterBo;
import org.dromara.patch.domain.vo.PdMasterVo; import org.dromara.patch.domain.vo.PdMasterVo;
@ -206,6 +207,9 @@ public class PdMasterServiceImpl extends ServiceImpl<PdMasterMapper, PdMaster> i
bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress())); bigDecimal = bigDecimal.add(new BigDecimal(pdMasterSon.getProgress()));
} }
item.setCompletionProgress(bigDecimal+"%"); item.setCompletionProgress(bigDecimal+"%");
//执行人
PdMasterUser one1 = pdMasterUserService.getById(item.getId());
item.setSlaveName(one1.getSlaveName());
}); });
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }

View File

@ -122,4 +122,6 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
List<Long> thisAlldepIds(@Param("depId") Long deptId); List<Long> thisAlldepIds(@Param("depId") Long deptId);
} }

View File

@ -694,6 +694,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
public List<SysUser> findThis() { public List<SysUser> findThis() {
//1、获取当前用户部门 //1、获取当前用户部门
Long deptId = LoginHelper.getDeptId(); Long deptId = LoginHelper.getDeptId();
// //2、根据用户获取到对应部门的父
// SysDeptVo sysDeptVo = deptService.selectDeptById(deptId);
//2、查询当前用户所在部门 //2、查询当前用户所在部门
List<Long> longs = baseMapper.thisAlldepIds(deptId); List<Long> longs = baseMapper.thisAlldepIds(deptId);
//3、查询当前用户所在部门所有用户 //3、查询当前用户所在部门所有用户

View File

@ -71,6 +71,7 @@
<select id="thisAlldepIds" resultType="Long"> <select id="thisAlldepIds" resultType="Long">
WITH RECURSIVE dept_tree AS ( WITH RECURSIVE dept_tree AS (
-- 首先获取当前部门自身的记录
SELECT SELECT
dept_id, dept_id,
parent_id, parent_id,
@ -79,14 +80,15 @@
order_num, order_num,
status, status,
is_show, is_show,
1 as level 0 as level -- 自身级别设为0子部门从1开始
FROM sys_dept FROM sys_dept
WHERE parent_id = #{depId} WHERE dept_id = #{depId} -- 匹配当前部门ID
AND del_flag = '0' AND del_flag = '0'
AND status = '0' AND status = '0'
UNION ALL UNION ALL
-- 然后递归查询所有子部门
SELECT SELECT
d.dept_id, d.dept_id,
d.parent_id, d.parent_id,