fuliqi
2024-11-29 363cf83f55c886bacb8ccab451071442a3313e67
business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -25,10 +25,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -260,4 +257,19 @@
        fileService.saveBatch(fileList);
        return Result.ok();
    }
    @Override
    public Result getManagerFlag(Integer recordId) {
        ProjectInfo projectInfo = baseMapper.selectById(recordId);
        // 判断当前用户id是否在主管列表中
        String competentDepartment = projectInfo.getCompetentDepartment();
        List<String> list = Arrays.asList(competentDepartment.split(","));
        // 获得当前用户id
        Long userId = SecurityUtils.getUserId();
        if (list.contains(userId.toString())) {
            return Result.ok().data(true);
        } else {
            return Result.ok().data(false);
        }
    }
}