Compare commits

..

No commits in common. "c160793d93cfe3df7a80a97f5bf900f1eef98308" and "aa7f9612da1b41ecabfe872248b915f26566f1e2" have entirely different histories.

3 changed files with 5 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import cn.edu.hfut.rmdjzz.projectmanagement.entity.vo.GroupPositionVO;
import cn.edu.hfut.rmdjzz.projectmanagement.exception.BadRequestException;
import cn.edu.hfut.rmdjzz.projectmanagement.exception.ForbiddenException;
import cn.edu.hfut.rmdjzz.projectmanagement.service.IProjectGroupService;
import cn.edu.hfut.rmdjzz.projectmanagement.service.IStaffService;
import cn.edu.hfut.rmdjzz.projectmanagement.service.ITaskService;
import cn.edu.hfut.rmdjzz.projectmanagement.utils.TokenUtils;
import cn.edu.hfut.rmdjzz.projectmanagement.utils.ValidateUtils;
@ -64,14 +63,11 @@ public class ProjectGroupController {
if (projectGroupService.getProjectAccessLevel(token, projectId) == 0) {
throw new ForbiddenException(IProjectGroupService.UNABLE_TO_ACCESS_PROJECT);
}
ProjectGroup designatedStaff = projectGroupService.getOne(
return ResponseMap.ofSuccess(projectGroupService.getOne(
Wrappers.<ProjectGroup>lambdaQuery()
.eq(ProjectGroup::getStaffId, staffId)
.eq(ProjectGroup::getProjectId, projectId));
if (designatedStaff == null) { //说明是超级管理员
designatedStaff = new ProjectGroup(staffId, projectId, IStaffService.LEVEL_1, 1);
}
return ResponseMap.ofSuccess(designatedStaff);
.eq(ProjectGroup::getProjectId, projectId)
));
}
@Operation(description = "body中只传staffUsername和projectStaffPosition")

View File

@ -16,7 +16,6 @@ import java.util.Map;
public interface IStaffService extends IService<Staff> {
String STAFF_DOES_NOT_EXIST = "用户不存在";
String LEVEL_1 = "超级管理员";
Map<String, Object> login(String requestIpAddress, String username, String password) throws BadRequestException, TokenException, ForbiddenException;

View File

@ -7,7 +7,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.util.DigestUtils;
import org.springframework.web.multipart.MultipartFile;
/**
@ -24,8 +23,7 @@ public class ExcelTests {
@Test
public void importTest() {
MultipartFile excelFile = new MockMultipartFile("账户导入模板.xlsx",
FileUtils.class.getClassLoader().getResourceAsStream("/static/public/账户导入模板.xlsx"));
//staffService.multiImport("", excelFile);
System.out.println(DigestUtils.md5DigestAsHex(excelFile.getBytes()));
FileUtils.class.getClassLoader().getResourceAsStream("static/public/账户导入模板.xlsx"));
staffService.multiImport("", excelFile);
}
}