服务顾问不做数据权限控制

This commit is contained in:
xiaofajia 2024-11-14 10:44:24 +08:00
parent bc79d9df53
commit 6c396bfbbd
3 changed files with 22 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.base.entity.RepairWorker;
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
@ -1246,7 +1247,11 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
repairTicketsReqVO.setSelectType("special");
// 维修服务顾问
if (userRoleCode.equals(RepairRoleEnum.ADVISOR.getCode())) {
repairTicketsReqVO.setNowRepairId(loginUserId);
// 查所有的服务顾问
List<UserDTO> userDTOS = roleApi.selectUserListByRoleCode(TenantContextHolder.getRequiredTenantId(), RepairRoleEnum.ADVISOR.getCode());
List<Long> ids = userDTOS.stream().map(UserDTO::getId).collect(Collectors.toList());
repairTicketsReqVO.setNowRepairIds(ids);
// repairTicketsReqVO.setNowRepairId(loginUserId);
// 因为完成状态需要在交车之后所以注掉这个
// repairTicketsReqVO.setIsFinish("1");
} else if (userRoleCode.equals(RepairRoleEnum.INSPECTION.getCode())) {

View File

@ -36,4 +36,7 @@ public class DlRepairTicketsReqVO extends DlRepairTickets {
/** 图片路径 */
private String image;
/** 当前操作人包含集合,主要用在服务顾问那儿 */
private List<Long> nowRepairIds;
}

View File

@ -235,13 +235,23 @@
</if>
<choose>
<when test="map.selectType=='special'">
-- 小李用的逻辑 --
<if test="map.isFinish != null and map.isFinish != ''">
-- 小李用的逻辑--isFinish不需要了 --
<!-- <if test="map.isFinish != null and map.isFinish != ''">
AND ( drt.is_finish = #{map.isFinish})
</if>
</if> -->
-- 总检查待处理还是用这个 --
<if test="map.nowRepairId != null and map.nowRepairId != ''">
AND ( drt.now_repair_id = #{map.nowRepairId})
</if>
-- 服务顾问查待处理(服务顾问之间可以相互查) --
<if test="map.nowRepairIds != null and map.nowRepairIds.size > 0">
AND (
drt.now_repair_id in
<foreach collection="map.nowRepairIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
</when>
<otherwise>
-- 正常查询用的逻辑 --