From a97678f2bd88de9bd40aa93a2be8b026ec081b8c Mon Sep 17 00:00:00 2001 From: mors <3067699729@qq.com> Date: Wed, 12 Apr 2023 14:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/bugx/controller/BugxController.java | 3 + .../modulex/controller/ModulexController.java | 21 ++---- .../modulex/service/IModulexService.java | 2 + .../service/impl/ModulexServiceImpl.java | 70 +++++++++++++++++++ 4 files changed, 82 insertions(+), 14 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java index 1428624..11f67c8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/bugx/controller/BugxController.java @@ -128,6 +128,9 @@ public class BugxController extends JeecgController { // code=bugxService.sort(bugx.getProjectId()); // projectxMapper.upDeBug(bugx.getProjectId()); // }else +// // + // BUG反馈:项目负责人(管理员)使用,点击BUG反馈,状态变为DEBUG,下属功能状态不变, + // BUG管理增加一条记录,记录BUG内容。 if (bugx.getModuleId() != null) { queryWrapper.eq("module_id", bugx.getModuleId()); queryWrapper.isNull("function_id"); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java index 1f2c9ce..51af5c1 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/controller/ModulexController.java @@ -58,30 +58,23 @@ public class ModulexController extends JeecgController } @GetMapping(value = "/fabu") - public Result fabu(@RequestParam(name="id",required=true) String id) { - Modulex byId = modulexService.getById(id); - if (byId.getWorkStatus() != 0){ - return Result.error("当前功能已发布!!!"); - }else { - byId.setWorkStatus(1); - modulexService.updateById(byId); - return Result.OK("发布成功!!"); - } - } + public Result fabu(@RequestParam(name="id") String id) { + return modulexService.fabu(id); + } @GetMapping(value = "/kaishi") - public Result kaishi(@RequestParam(name="id",required=true) String id) { + public Result kaishi(@RequestParam(name="id") String id) { return modulexService.kaishi(id); } @GetMapping(value = "/tijiao") - public Result tijiao(@RequestParam(name="id",required=true) String id) { + public Result tijiao(@RequestParam(name="id") String id) { return modulexService.tijiao(id); } @GetMapping(value = "/cehui") - public Result cehui(@RequestParam(name="id",required=true) String id) { + public Result cehui(@RequestParam(name="id") String id) { return modulexService.cehui(id); } @GetMapping(value = "/shenhe") - public Result shenhe(@RequestParam(name="id",required=true) String id) { + public Result shenhe(@RequestParam(name="id") String id) { return modulexService.shenhe(id); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java index 23ce969..708401c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/IModulexService.java @@ -18,6 +18,8 @@ public interface IModulexService extends IService { */ Integer getMaxVersion(Integer verison); + Result fabu(String id); + Result kaishi(String id); Result tijiao(String id); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index f03310c..e09c4ce 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java @@ -1,6 +1,9 @@ package org.jeecg.modules.modulex.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.demo.functionx.entity.Functionx; +import org.jeecg.modules.demo.functionx.mapper.FunctionxMapper; import org.jeecg.modules.modulex.entity.Modulex; import org.jeecg.modules.modulex.mapper.ModulexMapper; import org.jeecg.modules.modulex.service.IModulexService; @@ -8,6 +11,7 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import javax.annotation.Resource; import java.util.Date; import java.util.List; import java.util.Objects; @@ -22,6 +26,9 @@ import java.util.stream.Collectors; @Service public class ModulexServiceImpl extends ServiceImpl implements IModulexService { + @Resource + private FunctionxMapper functionxMapper; + /** * 得到最大的版本号 */ @@ -30,6 +37,31 @@ public class ModulexServiceImpl extends ServiceImpl impl return this.list().size(); } + /** + * 发布:点击发布按钮,状态变成已发布, + * 任务责任人(即开发者)可以操作开始、提交等功能; + * 模块管理下属所有功能状态变为已发布。 + * @param id modulex表的主键id + */ + @Override + public Result fabu(String id) { + Modulex byId = this.getById(id); + if (byId.getWorkStatus() != 0){ + return Result.error("当前功能已发布!!!"); + }else { + byId.setWorkStatus(1); + this.updateById(byId); + //模块管理下属所有功能状态变为已发布 + this.handleStatus(id,1); + return Result.OK("发布成功!!"); + } + } + + /** + * 开始:任务责任人(即开发者)使用的功能,点击开始按钮,状态变为开发中, + * 表示任务开始,开始时间设置为当前时间。 + * @param id modulex表的主键id + */ @Override public Result kaishi(String id) { Modulex byId = this.getById(id); @@ -39,10 +71,17 @@ public class ModulexServiceImpl extends ServiceImpl impl byId.setWorkStatus(2); byId.setStartTime(new Date()); this.updateById(byId); + return Result.OK("任务开始成功"); } } + /** + * 提交:任务责任人(即开发者)使用的功能,点击提交按钮,表示任务完成,状态变为已提交, + * 提交时间设置为当前时间,并自动计算实际时长。 + * 模块管理下属所有功能状态变成已完成才能点击提交按钮。 + * @param id modulex表的主键id + */ @Override public Result tijiao(String id) { Modulex byId = this.getById(id); @@ -52,11 +91,17 @@ public class ModulexServiceImpl extends ServiceImpl impl byId.setWorkStatus(3); byId.setSubmitTime(new Date()); this.updateById(byId); + + this.handleStatus(id,3); return Result.OK("提交成功!!"); } } + /** + * 撤回:项目负责人(管理员)使用,点击撤回,状态变为开发中。 + * @param id modulex表的主键id + */ @Override public Result cehui(String id) { Modulex byId = this.getById(id); @@ -68,6 +113,11 @@ public class ModulexServiceImpl extends ServiceImpl impl return Result.OK("撤回成功"); } + /** + * BUG反馈:项目负责人(管理员)使用,点击BUG反馈,状态变为DEBUG,下属功能状态不变,BUG管理增加一条记录,记录BUG内容。 + * 审核:项目负责人(管理员)使用,点击完成,状态变为已审核。 + * @param id modulex表的主键id + */ @Override public Result shenhe(String id) { Modulex byId = this.getById(id); @@ -78,4 +128,24 @@ public class ModulexServiceImpl extends ServiceImpl impl this.updateById(byId); return Result.OK("审核通过"); } + + + private void handleStatus(String id, Integer a){ + //先查字模块 先查询父id 等于 这个 id 的数据 + List modulexs = this.list(new LambdaQueryWrapper().eq(Modulex::getPid, id)); + if (modulexs.size()>0){ + modulexs.forEach(modulex -> { + modulex.setWorkStatus(a); + this.updateById(modulex); + }); + } + //再查下属功能 + List functionxs = functionxMapper.selectList(new LambdaQueryWrapper().eq(Functionx::getModuleId, id)); + if (functionxs.size()>0){ + functionxs.forEach(funcx -> { + funcx.setWorkStatus(a); + functionxMapper.updateById(funcx); + }); + } + } }