diff --git a/pom.xml b/pom.xml index 91d05ba..31dcb85 100644 --- a/pom.xml +++ b/pom.xml @@ -9,10 +9,10 @@ com.pdxm - project_maagement-1 + projectManagement 0.0.1-SNAPSHOT - war - project_maagement-1 + jar + projectManagement 我的第一个springboot程序 diff --git a/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java similarity index 83% rename from src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java rename to src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java index 03dc735..2c365c5 100644 --- a/src/main/java/com/yipin/liuwanr/controller/Project_ManagementController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java @@ -3,6 +3,7 @@ package com.yipin.liuwanr.controller; import java.util.HashMap; import java.util.List; +import com.yipin.liuwanr.entity.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -16,21 +17,17 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import com.yipin.liuwanr.entity.Judgment_Points; -import com.yipin.liuwanr.entity.ManagementAndPointVo; -import com.yipin.liuwanr.entity.Project_Management; -import com.yipin.liuwanr.entity.Response; -import com.yipin.liuwanr.entity.Role; -import com.yipin.liuwanr.service.Project_ManagementService; +import com.yipin.liuwanr.entity.ProjectManagement; +import com.yipin.liuwanr.service.ProjectManagementService; @Api(value = "项目管理", tags = "项目管理相关方法") @RestController @RequestMapping("/ProjectManagement") @CrossOrigin -public class Project_ManagementController { +public class ProjectManagementController { @Autowired - private Project_ManagementService service; + private ProjectManagementService service; /** * 查询用户角色 @@ -67,16 +64,17 @@ public class Project_ManagementController { */ @ApiOperation(value = "项目管理列表", notes = "项目管理列表") @GetMapping("/queryAllManagements") - Response queryAllManagements(@ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = false) @RequestParam(required = false) Integer projectPermissions, - @ApiParam(name = "founder", value = "项目创建人(0、系统 1、老师)", required = false) @RequestParam(required = false) Integer founder, - @ApiParam(name = "state", value = "项目状态(0、草稿箱 1、已发布)", required = false) @RequestParam(required = false) Integer state, - @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName, - @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam Integer systemId, - @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, - @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, - @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize) { + Response queryAllManagements( + @ApiParam(name = "projectPermissions", value = "项目权限(0、练习 1、考核 2、竞赛)", required = false) @RequestParam(required = false) Integer projectPermissions, + @ApiParam(name = "founder", value = "项目创建人(0、系统 1、老师)", required = false) @RequestParam(required = false) Integer founder, + @ApiParam(name = "state", value = "项目状态(0、草稿箱 1、已发布)", required = false) @RequestParam(required = false) Integer state, + @ApiParam(name = "projectName", value = "项目名称", required = false) @RequestParam(required = false) String projectName, + @ApiParam(name = "systemId", value = "系统id", required = true) @RequestParam Integer systemId, + @ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, + @ApiParam(name = "pageNo", value = "第几页,页码", required = true) @RequestParam Integer pageNo, + @ApiParam(name = "pageSize", value = "每页展示的数据条数", required = true) @RequestParam Integer pageSize) { Response resp = new Response(); - Project_Management vo = new Project_Management(); + ProjectManagement vo = new ProjectManagement(); if (null != projectPermissions) { vo.setProjectPermissions(projectPermissions); } @@ -110,14 +108,14 @@ public class Project_ManagementController { /** * 批量删除 * - * @param point 项目id集合 + * @param projectId 项目id集合 * @return */ @ApiOperation(value = "批量删除", notes = "批量删除") @PostMapping("/removeProjectManagement") - Response removeProjectManagement(@ApiParam(name = "point", value = "项目主键Id", required = true) @RequestBody List point) { + Response removeProjectManagement(@ApiParam(name = "projectId", value = "项目主键Id", required = true) @RequestBody List projectId) { Response resp = new Response(); - HashMap ret = service.deleteProjectManagement(point); + HashMap ret = service.deleteProjectManagement(projectId); int status = (int) ret.get("retcode"); if (status == 200) { resp.setStatus(status); @@ -310,7 +308,7 @@ public class Project_ManagementController { @PostMapping("/addProjectManagement") Response insertProjectManagement(@RequestBody @ApiParam(name = "新建项目管理所需类", value = "传入json格式", required = true) ManagementAndPointVo vo) { Response resp = new Response(); - Project_Management pro = vo.getManagement(); + ProjectManagement pro = vo.getManagement(); List points = vo.getPooints(); List roles = vo.getRoleId(); if (StringUtils.isEmpty(pro)) { @@ -344,6 +342,28 @@ public class Project_ManagementController { return resp; } + /** + * 查询单个项目判分点信息,根据项目id + * + * @param projectId 项目id + * @return + */ + @ApiOperation(value = "查询单个项目判分点信息", notes = "查询单个项目判分点信息") + @GetMapping("/getJudgmentPoints") + Response getJudgmentPoints(@ApiParam(name = "projectId", value = "项目id", required = true) @RequestParam Integer projectId) { + Response resp = new Response(); + HashMap ret = service.getJudgmentPoints(projectId); + int status = (int) ret.get("retcode"); + if (status == 200) { + resp.setStatus(status); + resp.setMessage(ret.get("retvalue")); + } else { + resp.setStatus(status); + resp.setErrmessage(ret.get("retvalue").toString()); + } + return resp; + } + /** * 修改项目管理信息 * @@ -354,24 +374,24 @@ public class Project_ManagementController { @PostMapping("/updateProjectManagement") Response updateProjectManagement(@ApiParam(name = "新建项目管理所需类", value = "传入json格式", required = true) @RequestBody ManagementAndPointVo vo) { Response resp = new Response(); - Project_Management pro = vo.getManagement(); + ProjectManagement pro = vo.getManagement(); List points = vo.getPooints(); List roles = vo.getRoleId(); if (StringUtils.isEmpty(pro)) { resp.setStatus(300); - resp.setMessage("management cannot be empty"); + resp.setMessage("项目管理为空,修改失败!"); return resp; } if (points.isEmpty() || points.size() <= 0) { resp.setStatus(300); - resp.setMessage("pooints cannot be empty"); + resp.setMessage("判分点为空,修改失败!"); return resp; } if (pro.getIsstartexperimental() == 0) {//开启实验数据 if (roles.isEmpty() || roles.size() <= 0) { resp.setStatus(300); - resp.setMessage("roleId cannot be empty"); + resp.setMessage("角色id为空,修改失败!"); return resp; } } diff --git a/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointVo.java b/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointVo.java index a4a37c1..7cca797 100644 --- a/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointVo.java +++ b/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointVo.java @@ -8,7 +8,7 @@ import java.util.List; @ApiModel(value = "ManagementAndPointVo对象", description = "添加项目管理对象ManagementAndPointVo") public class ManagementAndPointVo { @ApiModelProperty(value = "项目管理实体类", name = "management", required = true) - private Project_Management management;//项目管理 + private ProjectManagement management;//项目管理 //@ApiModelProperty(value = "判分点信息列表,key:判分点主键 value:分数", name = "pooints", example = "[{\"judgmentPointsId\":184,\"judgmentPointsName\":\"列表——元素的修改 \",\"experimentalRequirements\":\"新学期开始,老师组织了学习小组,该学习小组有A,B,C,D五个学生\\nList1=[''A'',''B'',''C'',''D'']\\n列表元素-修改-请使用下标索引\\n第三天上课,老师发现把E同学的名字打错了,应该T。请修改并打印本小组的全体学生\",\"score\":\"100\"}]", required = true) @ApiModelProperty(value = "判分点信息列表,key:判分点主键 value:分数", name = "pooints", required = true) @@ -17,11 +17,11 @@ public class ManagementAndPointVo { @ApiModelProperty(value = "角色id列表", name = "roleId", example = "[403]", required = true) private List roleId;//存储角色id - public Project_Management getManagement() { + public ProjectManagement getManagement() { return management; } - public void setManagement(Project_Management management) { + public void setManagement(ProjectManagement management) { this.management = management; } diff --git a/src/main/java/com/yipin/liuwanr/entity/Project_Management.java b/src/main/java/com/yipin/liuwanr/entity/ProjectManagement.java similarity index 79% rename from src/main/java/com/yipin/liuwanr/entity/Project_Management.java rename to src/main/java/com/yipin/liuwanr/entity/ProjectManagement.java index fac0bd7..70b3ca4 100644 --- a/src/main/java/com/yipin/liuwanr/entity/Project_Management.java +++ b/src/main/java/com/yipin/liuwanr/entity/ProjectManagement.java @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty; * @author 86151 */ @ApiModel(value = "Project_Management对象", description = "项目管理对象Project_Management") -public class Project_Management { +public class ProjectManagement { @ApiModelProperty(value = "项目主键ID,编辑项目需要传,新增项目不需要传", name = "projectId", example = "223") private Integer projectId;// 项目主键ID @@ -47,6 +47,12 @@ public class Project_Management { @ApiModelProperty(value = "绑定服务配置ID", name = "systemId", example = "1", required = true) private Integer systemId;// 绑定服务配置ID + @ApiModelProperty(value = "知识点", name = "knowledgePoints", example = "一加一等于二", required = true) + private String knowledgePoints; // 知识点 + + @ApiModelProperty(value = "实验介绍", name = "experimentIntroduction", example = "一加一等于二", required = true) + private String experimentIntroduction; // 实验介绍 + @ApiModelProperty(hidden = true) private Integer isdel; @@ -59,10 +65,30 @@ public class Project_Management { @ApiModelProperty(value = "是否启用实验提示(0启用 1不启用)", name = "isstartexperimentSuggests", example = "0", required = true) private Integer isstartexperimentSuggests; - @ApiModelProperty(value = "用户ID", name = "userId", example = "4", required = true) private Integer userId; + @ApiModelProperty(value = "知识点是否启用(0、启用 1、不展示)", name = "knowledgePointsIsEnable", example = "0", required = true) + private Integer knowledgePointsIsEnable; + + @ApiModelProperty(value = "实验介绍是否启用(0、启用 1、不展示)", name = "userId", example = "0", required = true) + private Integer experimentIntroductionIsEnable; + + public Integer getKnowledgePointsIsEnable() { + return knowledgePointsIsEnable; + } + + public void setKnowledgePointsIsEnable(Integer knowledgePointsIsEnable) { + this.knowledgePointsIsEnable = knowledgePointsIsEnable; + } + + public Integer getExperimentIntroductionIsEnable() { + return experimentIntroductionIsEnable; + } + + public void setExperimentIntroductionIsEnable(Integer experimentIntroductionIsEnable) { + this.experimentIntroductionIsEnable = experimentIntroductionIsEnable; + } public Integer getUserId() { return userId; @@ -88,6 +114,22 @@ public class Project_Management { this.isstartexperimentSuggests = isstartexperimentSuggests; } + public String getKnowledgePoints() { + return knowledgePoints; + } + + public void setKnowledgePoints(String knowledgePoints) { + this.knowledgePoints = knowledgePoints; + } + + public String getExperimentIntroduction() { + return experimentIntroduction; + } + + public void setExperimentIntroduction(String experimentIntroduction) { + this.experimentIntroduction = experimentIntroduction; + } + public Integer getProjectId() { return projectId; } @@ -203,7 +245,7 @@ public class Project_Management { @Override public String toString() { - return "Project_Management{" + + return "ProjectManagement{" + "projectId=" + projectId + ", projectName='" + projectName + '\'' + ", projectPermissions=" + projectPermissions + diff --git a/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java similarity index 80% rename from src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java rename to src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java index eb7c9a0..03eea6b 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/Project_ManagementMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java @@ -2,6 +2,7 @@ package com.yipin.liuwanr.mapper; import java.util.List; +import com.yipin.liuwanr.entity.ProjectManagement; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; import org.apache.ibatis.annotations.Options; @@ -10,7 +11,6 @@ import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import com.yipin.liuwanr.entity.Judgment_Points; -import com.yipin.liuwanr.entity.Project_Management; import com.yipin.liuwanr.entity.Role; /** @@ -18,7 +18,7 @@ import com.yipin.liuwanr.entity.Role; * * @author 86151 */ -public interface Project_ManagementMapper { +public interface ProjectManagementMapper { /** * 查询项目名称 @@ -46,20 +46,21 @@ public interface Project_ManagementMapper { * " ORDER BY creationTime desc", */ @Select({""}) - List queryManagements(Project_Management management); + List queryManagements(ProjectManagement management); /** @@ -68,8 +69,8 @@ public interface Project_ManagementMapper { * @param projectId * @return */ - @Select("select projectId,projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,isstartexperimental,isstartexperimentSuggests,userId from hr_project_management where isdel=0 and projectId=#{projectId}") - Project_Management getProjectId(Integer projectId); + @Select("select projectId,projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,isstartexperimental,isstartexperimentSuggests,userId,knowledgePoints,experimentIntroduction from hr_project_management where isdel=0 and projectId=#{projectId}") + ProjectManagement getProjectId(Integer projectId); /** * 根据实验项目id查询项目名称 @@ -85,10 +86,10 @@ public interface Project_ManagementMapper { * * @param projectId */ - @Update("") - void deleteProjectManagement(@Param("point") List projectId); + void deleteProjectManagement(Integer projectId); /** @@ -119,7 +120,7 @@ public interface Project_ManagementMapper { */ @Update("") void updateRoleProjectId(@Param("ids") List ids, @Param("projectId") Integer projectId); @@ -140,6 +141,18 @@ public interface Project_ManagementMapper { List getByRoleId(@Param("role") List role); + /** + * 查询单个项目判分点信息,根据项目id + * + * @param projectId 项目id + * @return + */ + @Select({""}) + List getJudgmentPoints(@Param("projectId") Integer projectId); + + /** * 点击具体某个项目信息的编辑按钮, * 跳转到编辑项目管理页面的实验数据的信息展示 @@ -199,6 +212,7 @@ public interface Project_ManagementMapper { @Select("select projectId,experimentalRequirements from hr_judgment_points where judgmentPointsId=#{judgmentPointsId}") Judgment_Points getByjudgmentPointsId(Integer judgmentPointsId); + /** * 点击保存按按,需要修改判分点表中对应的项目id,实验要求 * @@ -212,16 +226,15 @@ public interface Project_ManagementMapper { ""}) void updateProject(String projectId, String experimentalRequirements, Integer judgmentPointsId); - /** * 添加项目管理信息 * * @param management */ - @Insert("INSERT INTO hr_project_management(projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,founder,systemId,creationTime,isstartexperimental,isstartexperimentSuggests,userId)" - + " VALUES (#{projectName},#{projectPermissions},#{experimentalGoal},#{caseDescription},#{experimentSuggests},#{state},#{founder},#{systemId},now(),#{isstartexperimental},#{isstartexperimentSuggests},#{userId})") + @Insert("INSERT INTO hr_project_management(projectName,projectPermissions,experimentalGoal,caseDescription,experimentSuggests,state,founder,systemId,creationTime,isstartexperimental,isstartexperimentSuggests,userId,knowledgePoints,experimentIntroduction,knowledgePointsIsEnable,experimentIntroductionIsEnable)" + + " VALUES (#{projectName},#{projectPermissions},#{experimentalGoal},#{caseDescription},#{experimentSuggests},#{state},#{founder},#{systemId},now(),#{isstartexperimental},#{isstartexperimentSuggests},#{userId},#{knowledgePoints},#{experimentIntroduction},#{knowledgePointsIsEnable},#{experimentIntroductionIsEnable})") @Options(useGeneratedKeys = true, keyProperty = "projectId", keyColumn = "projectId") - void insertProjectManagement(Project_Management management); + void insertProjectManagement(ProjectManagement management); /** * 修改项目管理信息 @@ -229,8 +242,8 @@ public interface Project_ManagementMapper { * @param management */ @Update("update hr_project_management set projectName=#{projectName},projectPermissions=#{projectPermissions},experimentalGoal=#{experimentalGoal},caseDescription=#{caseDescription},experimentSuggests=#{experimentSuggests},state=#{state}," - + "isstartexperimental=#{isstartexperimental},isstartexperimentSuggests=#{isstartexperimentSuggests} where projectId=#{projectId}") - void updateProjectManagement(Project_Management management); + + "isstartexperimental=#{isstartexperimental},isstartexperimentSuggests=#{isstartexperimentSuggests},knowledgePoints=#{knowledgePoints},experimentIntroduction=#{experimentIntroduction},knowledgePointsIsEnable=#{knowledgePointsIsEnable},experimentIntroductionIsEnable=#{experimentIntroductionIsEnable} where projectId=#{projectId}") + void updateProjectManagement(ProjectManagement management); /** * 根据项目id,查询出该项目所有的判分点id diff --git a/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java b/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java similarity index 92% rename from src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java rename to src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java index bfea4c1..4ed8177 100644 --- a/src/main/java/com/yipin/liuwanr/service/Project_ManagementService.java +++ b/src/main/java/com/yipin/liuwanr/service/ProjectManagementService.java @@ -15,16 +15,16 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.yipin.liuwanr.helper.UserUtil; -import com.yipin.liuwanr.mapper.Project_ManagementMapper; +import com.yipin.liuwanr.mapper.ProjectManagementMapper; import com.yipin.liuwanr.mapper.ScoreIndexMapper; @Service -public class Project_ManagementService { +public class ProjectManagementService { - private static Logger logger = Logger.getLogger(Project_ManagementService.class); + private static Logger logger = Logger.getLogger(ProjectManagementService.class); @Autowired - private Project_ManagementMapper mapper; + private ProjectManagementMapper mapper; @Autowired private ScoreIndexMapper indexMapper; @@ -74,7 +74,7 @@ public class Project_ManagementService { * @param vo * @return */ - public HashMap queryAllManagements(Project_Management vo, Integer pageNo, Integer pageSize) { + public HashMap queryAllManagements(ProjectManagement vo, Integer pageNo, Integer pageSize) { HashMap resp = new HashMap(); try { //获取用户的角色信息 @@ -83,7 +83,7 @@ public class Project_ManagementService { //角色不对(学生没有权限) if (roleId == 4) { resp.put("retcode", 300); - resp.put("retvalue", "Role does not meet the requirements"); + resp.put("retvalue", "抱歉,您的权限不能访问该地址!"); return resp; } //角色等于管理员或者超级管理员 @@ -93,8 +93,8 @@ public class Project_ManagementService { } PageHelper.startPage(pageNo, pageSize); //条件查询 - List list = mapper.queryManagements(vo); - PageInfo info = new PageInfo(list); + List list = mapper.queryManagements(vo); + PageInfo info = new PageInfo(list); resp.put("retvalue", new PageResult(info.getTotal(), list)); resp.put("retcode", 200); } catch (Exception e) { @@ -110,14 +110,14 @@ public class Project_ManagementService { /** * 批量删除 * - * @param point:项目管理id + * @param projectId:项目管理id * @return */ @Transactional - public HashMap deleteProjectManagement(List point) { + public HashMap deleteProjectManagement(List projectId) { HashMap resp = new HashMap(); try { - for (Integer po : point) { + for (Integer po : projectId) { //判分点 List points = mapper.queryProjectIds(po); for (int i = 0; i < points.size(); i++) { @@ -142,7 +142,11 @@ public class Project_ManagementService { indexMapper.removeAllprojectId(po); mapper.deleteRole(po); } - mapper.deleteProjectManagement(point); + int size = projectId.size(); + for (int i = 0;i getJudgmentPoints(Integer projectId) { + HashMap resp = new HashMap(); + try { + resp.put("retvalue", mapper.getJudgmentPoints(projectId)); + resp.put("retcode", 200); + } catch (Exception e) { + logger.error(e.getMessage()); + resp.put("retcode", 500); + resp.put("retvalue", "Inquiry Failed"); + return resp; + } + return resp; + } + + /** + * 查询单个项目判分点信息 * * @param roleId 角色ID * @return @@ -401,7 +425,7 @@ public class Project_ManagementService { * @return */ @Transactional - public HashMap insertProjectManagement(Project_Management pro, List points, List roles) { + public HashMap insertProjectManagement(ProjectManagement pro, List points, List roles) { HashMap resp = new HashMap(); try { // 添加项目信息 @@ -470,7 +494,7 @@ public class Project_ManagementService { HashMap resp = new HashMap(); try{ Integer count = mapper.getByprojectName(projectName); - if(count>1){ + if(count>=1){ resp.put("retcode", 300); resp.put("retvalue", "该项目名称已存在"); }else{ @@ -491,8 +515,8 @@ public class Project_ManagementService { * @return */ @Transactional - public HashMap updateProjectManagement(Project_Management pro, List points, - List roles) { + public HashMap updateProjectManagement(ProjectManagement pro, List points, + List roles) { HashMap resp = new HashMap(); //项目id diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a6633d5..9230663 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1,11 @@ -spring.datasource.url=jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true +spring.datasource.url=jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai spring.datasource.username=super spring.datasource.password=huoran888 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jackson.default-property-inclusion=non-null +server.port=1010 +server.servlet.context-path= + logging.level.com.yipin.liuwanr.mapper=debug diff --git a/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java b/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java index d1ca2cd..4cb1957 100644 --- a/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java +++ b/src/test/java/com/yipin/liuwanr/Project_ManagementTest.java @@ -1,8 +1,8 @@ package com.yipin.liuwanr; import com.yipin.liuwanr.entity.*; -import com.yipin.liuwanr.mapper.Project_ManagementMapper; -import com.yipin.liuwanr.service.Project_ManagementService; +import com.yipin.liuwanr.mapper.ProjectManagementMapper; +import com.yipin.liuwanr.service.ProjectManagementService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -17,10 +17,10 @@ import java.util.List; public class Project_ManagementTest { @Autowired - private Project_ManagementService managementService; + private ProjectManagementService managementService; @Autowired - private Project_ManagementMapper projectManagementMapper; + private ProjectManagementMapper projectManagementMapper; /** * 查询用户角色信息 @@ -49,7 +49,7 @@ public class Project_ManagementTest { Integer systemId = 1; Integer userId = 4; - Project_Management vo = new Project_Management(); + ProjectManagement vo = new ProjectManagement(); if (null != projectPermissions) { vo.setProjectPermissions(projectPermissions); } @@ -85,7 +85,7 @@ public class Project_ManagementTest { System.out.println("total = " + total); - List rows = (List) pageResult.getRows(); + List rows = (List) pageResult.getRows(); rows.forEach(item -> { System.out.println(item.toString()); @@ -228,7 +228,7 @@ public class Project_ManagementTest { @Transactional //在单元测试中 Transaction注解会对数据库的更新(insert update delete)进行回滚 ,以保证数据不污染 @Test public void testInsertProjectManagement() { - /*Project_Management pro = new Project_Management(); + /*ProjectManagement pro = new ProjectManagement(); pro.setProjectName("简单加法计算"); pro.setProjectPermissions(1); pro.setExperimentalGoal("本项目将会帮助学生了解简单的加法计算"); @@ -248,7 +248,7 @@ public class Project_ManagementTest { points.add(judgmentPoints); List roles = new ArrayList<>(); roles.add(433);*/ - Project_Management pro = projectManagementMapper.getProjectId(302); + ProjectManagement pro = projectManagementMapper.getProjectId(302); pro.setProjectId(null); pro.setFounder(0); List points = projectManagementMapper.queryProjectIds(302); @@ -275,7 +275,7 @@ public class Project_ManagementTest { @Transactional @Test public void testUpdateProjectManagement() { - /*Project_Management pro = new Project_Management(); + /*ProjectManagement pro = new ProjectManagement(); pro.setProjectId(302); pro.setProjectName("简单加法计算"); pro.setProjectPermissions(1); @@ -296,7 +296,7 @@ public class Project_ManagementTest { points.add(judgmentPoints); List roles = new ArrayList<>(); roles.add(433);*/ - Project_Management pro = projectManagementMapper.getProjectId(302); + ProjectManagement pro = projectManagementMapper.getProjectId(302); pro.setFounder(0); List points = projectManagementMapper.queryProjectIds(302); List roles = projectManagementMapper.getByRoleProjectId(302);