Compare commits
2 Commits
aa7f9612da
...
c160793d93
Author | SHA1 | Date |
---|---|---|
ArgonarioD | c160793d93 | |
ArgonarioD | aa086ea9cd |
|
@ -6,6 +6,7 @@ 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;
|
||||
|
@ -63,11 +64,14 @@ public class ProjectGroupController {
|
|||
if (projectGroupService.getProjectAccessLevel(token, projectId) == 0) {
|
||||
throw new ForbiddenException(IProjectGroupService.UNABLE_TO_ACCESS_PROJECT);
|
||||
}
|
||||
return ResponseMap.ofSuccess(projectGroupService.getOne(
|
||||
ProjectGroup designatedStaff = projectGroupService.getOne(
|
||||
Wrappers.<ProjectGroup>lambdaQuery()
|
||||
.eq(ProjectGroup::getStaffId, staffId)
|
||||
.eq(ProjectGroup::getProjectId, projectId)
|
||||
));
|
||||
.eq(ProjectGroup::getProjectId, projectId));
|
||||
if (designatedStaff == null) { //说明是超级管理员
|
||||
designatedStaff = new ProjectGroup(staffId, projectId, IStaffService.LEVEL_1, 1);
|
||||
}
|
||||
return ResponseMap.ofSuccess(designatedStaff);
|
||||
}
|
||||
|
||||
@Operation(description = "body中只传staffUsername和projectStaffPosition")
|
||||
|
|
|
@ -16,6 +16,7 @@ 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;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ 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;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +24,8 @@ public class ExcelTests {
|
|||
@Test
|
||||
public void importTest() {
|
||||
MultipartFile excelFile = new MockMultipartFile("账户导入模板.xlsx",
|
||||
FileUtils.class.getClassLoader().getResourceAsStream("static/public/账户导入模板.xlsx"));
|
||||
staffService.multiImport("", excelFile);
|
||||
FileUtils.class.getClassLoader().getResourceAsStream("/static/public/账户导入模板.xlsx"));
|
||||
//staffService.multiImport("", excelFile);
|
||||
System.out.println(DigestUtils.md5DigestAsHex(excelFile.getBytes()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue