From 466d0f0b4b3b4f56dd49dffdbf8cc39687ea8a98 Mon Sep 17 00:00:00 2001 From: "rong.liu" Date: Thu, 8 Apr 2021 14:51:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E5=A4=A7=E9=A1=B9=E7=9B=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=8A=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectManagementController.java | 158 +++++++- .../liuwanr/entity/HrProjectManagement.java | 325 ++++++++++++++++ .../entity/ManagementAndPointByKDVo.java | 46 +++ .../mapper/ProjectManagementMapper.java | 38 +- .../service/ProjectManagementService.java | 354 ++++++++++++++++-- 5 files changed, 874 insertions(+), 47 deletions(-) create mode 100644 src/main/java/com/yipin/liuwanr/entity/HrProjectManagement.java create mode 100644 src/main/java/com/yipin/liuwanr/entity/ManagementAndPointByKDVo.java diff --git a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java index c55c987..5defed8 100644 --- a/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java +++ b/src/main/java/com/yipin/liuwanr/controller/ProjectManagementController.java @@ -102,6 +102,68 @@ public class ProjectManagementController { } return r; } + + + /** + * 首页面查询(科大) + *

updateProjectManagement + * + * @param projectPermissions:权限 + * @param founder:创建人 + * @param state:状态 + * @param projectName:项目名称 + * @param systemId + * @return + */ + @ApiOperation(value = "项目管理列表(科大)", notes = "项目管理列表(科大)") + @GetMapping("/queryAllManagementsByKD") + R queryAllManagementsByKD( + @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) String 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) { + R r = new R(); + HrProjectManagement vo = new HrProjectManagement(); + if (null != projectPermissions) { + vo.setProjectPermissions(projectPermissions); + } + if (null != founder && founder != "") { + vo.setFounder(founder); + } + if (null != state) { + vo.setState(state); + } + if (null != systemId) { + vo.setSystemId(systemId); + } + if (null != projectName && projectName != "") { + vo.setProjectName(projectName); + } + if (null != userId) { + vo.setUserId(userId); + } + if (null != pageNo) { + vo.setPageNo(pageNo); + } + if (null != pageSize) { + vo.setPageSize(pageSize); + } + HashMap ret = service.queryAllManagementsByKD(vo); + int status = (int) ret.get("retcode"); + if (status == 200) { + r.put("status", 200); + r.put("pageInfo", ret.get("pageInfo")); + } else { + R.error(500, ret.get("retvalue").toString()); + } + return r; + } + + // /** // * 首页面查询 // *

@@ -241,7 +303,6 @@ public class ProjectManagementController { } - /** * 批量删除 * @@ -525,7 +586,7 @@ public class ProjectManagementController { /** - * 添加创建项目管理信息 + * 添加创建项目管理信息(职站项目) * * @param vo 项目管理信息 * @return @@ -567,6 +628,50 @@ public class ProjectManagementController { return resp; } + + /** + * 添加创建项目管理信息(科大) + * + * @param vo 项目管理信息 + * @return + */ + @ApiOperation(value = "科大创建项目", notes = "科大创建项目") + @PostMapping("/newProjectManagementByKD") + Response newAddProjectManagementByKD(@RequestBody @ApiParam(name = "新建项目管理所需类", value = "传入json格式", required = true) ManagementAndPointByKDVo vo) { + Response resp = new Response(); + HrProjectManagement pro = vo.getManagement(); + List points = vo.getPooints(); + List roles = vo.getRoleId(); + if (StringUtils.isEmpty(pro)) { + resp.setStatus(300); + resp.setMessage("management cannot be empty"); + return resp; + } + if (points.isEmpty() || points.size() <= 0) { + resp.setStatus(300); + resp.setMessage("pooints cannot be empty"); + return resp; + } + + if (pro.getIsstartexperimental() == 0) {//开启实验数据 + if (roles.isEmpty() || roles.size() <= 0) { + resp.setStatus(300); + resp.setMessage("roleId cannot be empty"); + return resp; + } + } + HashMap ret = service.newAddProjectManagementByKD(pro, points, roles); + 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; + } + /** * 添加交易类判分点项目管理信息 * @@ -728,12 +833,12 @@ public class ProjectManagementController { /** - * 修改项目管理信息 + * 修改项目管理信息(职站) * * @param vo * @return */ - @ApiOperation(value = "编辑项目", notes = "编辑项目") + @ApiOperation(value = "编辑项目(职站)", notes = "编辑项目(职站)") @PostMapping("/newUpdateProjectManagement") Response newUpdateProjectManagement(@ApiParam(name = "新建项目管理所需类", value = "传入json格式", required = true) @RequestBody ManagementAndPointVo vo) { Response resp = new Response(); @@ -770,6 +875,51 @@ public class ProjectManagementController { return resp; } + + /** + * 修改项目管理信息(科大) + * + * @param vo + * @return + */ + @ApiOperation(value = "编辑项目(科大)", notes = "编辑项目(科大)") + @PostMapping("/newUpdateProjectManagementByKD") + Response newUpdateProjectManagementByKD(@ApiParam(name = "新建项目管理所需类", value = "传入json格式", required = true) @RequestBody ManagementAndPointByKDVo vo) { + Response resp = new Response(); + HrProjectManagement pro = vo.getManagement(); + List points = vo.getPooints(); + List roles = vo.getRoleId(); + if (StringUtils.isEmpty(pro)) { + resp.setStatus(300); + resp.setMessage("项目管理为空,修改失败!"); + return resp; + } + if (points.isEmpty() || points.size() <= 0) { + resp.setStatus(300); + resp.setMessage("判分点为空,修改失败!"); + return resp; + } + + if (pro.getIsstartexperimental() == 0) {//开启实验数据 + if (roles.isEmpty() || roles.size() <= 0) { + resp.setStatus(300); + resp.setMessage("角色id为空,修改失败!"); + return resp; + } + } + HashMap ret = service.newUpdateProjectManagementByKD(pro, points, roles); + 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; + } + + /** * 川大查询项目管理 *

diff --git a/src/main/java/com/yipin/liuwanr/entity/HrProjectManagement.java b/src/main/java/com/yipin/liuwanr/entity/HrProjectManagement.java new file mode 100644 index 0000000..dabf932 --- /dev/null +++ b/src/main/java/com/yipin/liuwanr/entity/HrProjectManagement.java @@ -0,0 +1,325 @@ +package com.yipin.liuwanr.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * @描述:项目管理 + * @作者: Rong + * @日期: 2021-04-08 + */ + +@ApiModel(value = "项目管理") +@TableName("hr_project_management") +public class HrProjectManagement implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + @ApiModelProperty(value = "项目主键ID") + private Integer projectId; + + @ApiModelProperty(value = "项目名称") + private String projectName; + + @ApiModelProperty(value = "模式(0基础模式,1挑战模式)") + private Integer pattern; + + @ApiModelProperty(value = "项目权限(0、练习 1、考核 2、竞赛)") + private Integer projectPermissions; + + @ApiModelProperty(value = "绑定服务配置ID") + private Integer systemId; + + @ApiModelProperty(value = "绑定用户id") + private Integer userId; + + @ApiModelProperty(value = "是否删除(0、未删除 1、已删除)") + private Integer isdel; + + @ApiModelProperty(value = "创建人角色(0、系统 1、老师)") + private String founder; + + @ApiModelProperty(value = "创建时间") + private String creationTime; + + @ApiModelProperty(value = "状态(0、草稿箱 1、已发布)") + private Integer state; + + @ApiModelProperty(value = "实验目标") + private String experimentalGoal; + + @ApiModelProperty(value = "案例描述") + private String caseDescription; + + @ApiModelProperty(value = "实验任务") + private String experimentTask; + + @ApiModelProperty(value = "绑定实验数据ID") + private String experimentalDataId; + + @ApiModelProperty(value = "绑定角色Id(已弃用)") + private String roleId; + + @ApiModelProperty(value = "实验提示") + private String experimentSuggests; + + @ApiModelProperty(value = "是否展示(0、展示 1、不展示)") + private Boolean isShow; + + @ApiModelProperty(value = "是否启用实验数据(0启用 1不启用) ") + private Integer isstartexperimental; + + @ApiModelProperty(value = "是否启用实验提示(0启用 1不启用) ") + private Integer isstartexperimentSuggests; + + @ApiModelProperty(value = "知识点") + private String knowledgePoints; + + @ApiModelProperty(value = "实验介绍") + private String experimentIntroduction; + + @ApiModelProperty(value = "知识点是否启用(0、启用 1、不展示)") + private Integer knowledgePointsIsEnable; + + @ApiModelProperty(value = "实验介绍是否启用(0、启用 1、不展示)") + private Integer experimentIntroductionIsEnable; + + @ApiModelProperty(value = "是否启用,0:启用,1:禁用") + private Integer enable; + + + private Integer pageNo;// 第几页,页码 + + private Integer pageSize;// 每页展示的数据条数 + + private String queryName;// 模糊查询名称,与数据库字段区分 + + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public Integer getPageNo() { + return pageNo; + } + + public void setPageNo(Integer pageNo) { + this.pageNo = pageNo; + } + + public Integer getPageSize() { + return pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize; + } + + public String getQueryName() { + return queryName; + } + + public void setQueryName(String queryName) { + this.queryName = queryName; + } + + public Integer getProjectId() { + return projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public Integer getPattern() { + return pattern; + } + + public void setPattern(Integer pattern) { + this.pattern = pattern; + } + + public Integer getProjectPermissions() { + return projectPermissions; + } + + public void setProjectPermissions(Integer projectPermissions) { + this.projectPermissions = projectPermissions; + } + + public Integer getSystemId() { + return systemId; + } + + public void setSystemId(Integer systemId) { + this.systemId = systemId; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getIsdel() { + return isdel; + } + + public void setIsdel(Integer isdel) { + this.isdel = isdel; + } + + public String getFounder() { + return founder; + } + + public void setFounder(String founder) { + this.founder = founder; + } + + public String getCreationTime() { + return creationTime; + } + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + public Integer getState() { + return state; + } + + public void setState(Integer state) { + this.state = state; + } + + public String getExperimentalGoal() { + return experimentalGoal; + } + + public void setExperimentalGoal(String experimentalGoal) { + this.experimentalGoal = experimentalGoal; + } + + public String getCaseDescription() { + return caseDescription; + } + + public void setCaseDescription(String caseDescription) { + this.caseDescription = caseDescription; + } + + public String getExperimentTask() { + return experimentTask; + } + + public void setExperimentTask(String experimentTask) { + this.experimentTask = experimentTask; + } + + public String getExperimentalDataId() { + return experimentalDataId; + } + + public void setExperimentalDataId(String experimentalDataId) { + this.experimentalDataId = experimentalDataId; + } + + public String getRoleId() { + return roleId; + } + + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + public String getExperimentSuggests() { + return experimentSuggests; + } + + public void setExperimentSuggests(String experimentSuggests) { + this.experimentSuggests = experimentSuggests; + } + + public Boolean getShow() { + return isShow; + } + + public void setShow(Boolean show) { + isShow = show; + } + + public Integer getIsstartexperimental() { + return isstartexperimental; + } + + public void setIsstartexperimental(Integer isstartexperimental) { + this.isstartexperimental = isstartexperimental; + } + + public Integer getIsstartexperimentSuggests() { + return isstartexperimentSuggests; + } + + public void setIsstartexperimentSuggests(Integer isstartexperimentSuggests) { + 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 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 getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } +} \ No newline at end of file diff --git a/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointByKDVo.java b/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointByKDVo.java new file mode 100644 index 0000000..b4e6441 --- /dev/null +++ b/src/main/java/com/yipin/liuwanr/entity/ManagementAndPointByKDVo.java @@ -0,0 +1,46 @@ +package com.yipin.liuwanr.entity; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.util.List; + + +@ApiModel(value = "ManagementAndPointVo对象", description = "添加项目管理对象ManagementAndPointVo") +public class ManagementAndPointByKDVo { + @ApiModelProperty(value = "项目管理实体类", name = "management", required = true) + private HrProjectManagement 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) + private List pooints;//判分点信息 + + @ApiModelProperty(value = "角色id列表", name = "roleId", example = "[403]", required = true) + private List roleId;//存储角色id + + + public HrProjectManagement getManagement() { + return management; + } + + public void setManagement(HrProjectManagement management) { + this.management = management; + } + + public List getPooints() { + return pooints; + } + + public void setPooints(List pooints) { + this.pooints = pooints; + } + + public List getRoleId() { + return roleId; + } + + public void setRoleId(List roleId) { + this.roleId = roleId; + } + +} diff --git a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java index 35f64d9..ef94a85 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/ProjectManagementMapper.java @@ -49,6 +49,21 @@ public interface ProjectManagementMapper { " ORDER BY creationTime desc", ""}) List queryManagements(ProjectManagement management); + + + @Select({""}) + List queryManagementsByKD(HrProjectManagement management); // @Select({"