Merge branch 'repair'

This commit is contained in:
xyc 2025-07-31 15:08:29 +08:00
commit 028dd45b4c
9 changed files with 79 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.workReport.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.common.SystemEnum;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
@ -174,6 +175,9 @@ public class WorkReportServiceImpl extends ServiceImpl<WorkReportMapper, WorkRep
public List<UserDTO> queryReportTo(String dictType) {
//根据dictType查询角色
List<DictDataRespDTO> roleList = dictDataApi.getDictDataList(dictType);
if (CollUtil.isEmpty(roleList)) {
throw new RuntimeException("暂未分配汇报对象");
}
List<String> codes = roleList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
//根据角色查询用户

View File

@ -220,6 +220,15 @@ public class InspectionFileController extends BaseController {
return success(inspectionFileService.queryTreeFolderForJx());
}
/**
* 查询文件夹树
* @return
*/
@GetMapping("/queryTreeFolderByServicePackageId")
public CommonResult<?> queryTreeFolderByServicePackageId(@RequestParam String servicePackageId){
return success(inspectionFileService.queryTreeFolderByServicePackageId(servicePackageId));
}
/**
* 提醒
*/

View File

@ -123,6 +123,7 @@ public interface IInspectionFileService extends IService<InspectionFile> {
*/
List<TreeCommonResult> queryTreeFolder();
List<TreeCommonResult> queryTreeFolderForJx();
List<TreeCommonResult> queryTreeFolderByServicePackageId(String servicePackageId);
void warnReminder();
}

View File

@ -589,6 +589,17 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
return buildTree(inspectionFiles);
}
@Override
public List<TreeCommonResult> queryTreeFolderByServicePackageId(String servicePackageId) {
//查询出所有文件夹
List<InspectionFile> inspectionFiles = baseMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getType, InspectionConstants.INSPECTION_FOLDER).eq(InspectionFile::getServicePackageId,servicePackageId)
.orderBy(false, false, InspectionFile::getCreateTime));
//组成属性结构
return buildTree(inspectionFiles);
}
/**
* 文件提醒
*/

View File

@ -127,6 +127,15 @@ public class RoleController {
return success(roleService.selectListByRoleIdJX(role));
}
/**
* 通过角色id查询角色
* @return
*/
@GetMapping("/selectListByRoleIdRepair")
public CommonResult selectListByRoleIdRepair(RolePageReqVO role){
return success(roleService.selectListByRoleIdRepair(role));
}
/**
* 通过角色code查询用户
* @param code

View File

@ -43,6 +43,7 @@ public interface UserRoleMapper extends BaseMapperX<UserRoleDO> {
IPage<UserDTO> selectListByRoleId(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJX(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdRepair(@Param("page") Page<UserDTO> page,@Param("role") RolePageReqVO role);
List<UserDTO> selectByRoleId(Integer roleId);

View File

@ -173,6 +173,7 @@ public interface RoleService {
IPage<UserDTO> selectListByRoleId(RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdJX(RolePageReqVO role);
IPage<UserDTO> selectListByRoleIdRepair(RolePageReqVO role);
/**
* 根据用户id查询角色

View File

@ -369,6 +369,12 @@ public class RoleServiceImpl implements RoleService {
return userRoleMapper.selectListByRoleIdJX(page,role);
}
@Override
public IPage<UserDTO> selectListByRoleIdRepair(RolePageReqVO role) {
Page<UserDTO> page = new Page<>(role.getPageNo(), role.getPageSize());
return userRoleMapper.selectListByRoleIdRepair(page,role);
}
/**
* 根据用户id查询角色
*

View File

@ -77,6 +77,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by su.nickname
</select>
<select id="selectListByRoleIdRepair" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO"
parameterType="cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO">
select
su.id,
su.username,
su.nickname,
su.user_type,
su.remark,
su.dept_id,
su.mobile,
su.password,
su.sex,
su.open_id,
su.tenant_id,
su.status,
su.avatar AS avatar,
GROUP_CONCAT(DISTINCT sr2.name SEPARATOR ',') AS roleNames
from system_users su
left join system_user_role sr on su.id = sr.user_id and sr.deleted = 0
left join system_role sr2 on sr.role_id = sr2.id
INNER JOIN dl_repair_worker dsc ON dsc.user_id = su.id
<where>
su.deleted = 0 and sr2.service_package_id = 'weixiu'
<if test="role.nickname != null">
and (su.nickname like CONCAT('%',#{role.nickname},'%') OR su.username like
CONCAT('%',#{role.nickname},'%'))
</if>
</where>
group by su.id
<if test="role.roleId != null">
HAVING SUM(sr.role_id = #{role.roleId}) > 0
</if>
order by su.nickname
</select>
<select id="userCodes" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserRoleDTO">
SELECT
su.id AS userId,sr.code AS roleCode,sr.id AS roleId, sr.service_package_id