diff --git a/ant-design-vue-jeecg/src/views/task/TaskList.vue b/ant-design-vue-jeecg/src/views/task/TaskList.vue
index 881c9fe..337636d 100644
--- a/ant-design-vue-jeecg/src/views/task/TaskList.vue
+++ b/ant-design-vue-jeecg/src/views/task/TaskList.vue
@@ -81,6 +81,33 @@
+
+
+
+
+
+
+ 发布
+
+
+
+ 开始
+
+
+ 提交
+
+
+
+
+ 撤回
+
+
+ BUG反馈
+
+
+ 审核
+
+
编辑
@@ -108,6 +135,7 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TaskModal from './modules/TaskModal'
+ import {getAction} from "@api/manage";
export default {
name: 'TaskList',
@@ -138,17 +166,17 @@
{
title:'责任人',
align:"center",
- dataIndex: 'managerUsers'
+ dataIndex: 'managerUsers_dictText',
},
{
title:'任务等级',
align:"center",
- dataIndex: 'workLevel'
+ dataIndex: 'workLevel_dictText'
},
{
title:'任务状态',
align:"center",
- dataIndex: 'workStatus'
+ dataIndex: 'workStatus_dictText'
},
{
title:'发布时间',
@@ -176,6 +204,22 @@
align:"center",
dataIndex: 'createTime'
},
+ {
+ title: '管理',
+ dataIndex: 'actionDevelop',
+ align: "center",
+ fixed: "right",
+ width:98,
+ scopedSlots: {customRender: 'actionDevelop'}
+ },
+ {
+ title: '功能',
+ dataIndex: 'actionManage',
+ align: "center",
+ fixed: "right",
+ width:147,
+ scopedSlots: {customRender: 'actionManage'}
+ },
{
title: '操作',
dataIndex: 'action',
@@ -206,6 +250,67 @@
},
},
methods: {
+ shenhe(record) {
+ getAction('/task/task/shenhe', {id: record.id}).then((res) => {
+ if (res.success) {
+ //重新计算分页问题
+ this.$message.success(res.result);
+ this.loadData();
+ } else {
+ this.$message.warning(res.message);
+ }
+ })
+ },
+ bugfankui: function (record) {
+ console.log('aaaaaaaaaaaa')
+ // this.$refs.BugxModal.add(record.id);
+ // this.$refs.BugxModal.title = "BUG反馈";
+ // this.$refs.BugxModal.disableSubmit = false;
+ },
+ chehui(record) {
+ getAction('/task/task/chehui', {id: record.id}).then((res) => {
+ if (res.success) {
+ //重新计算分页问题
+ this.$message.success(res.result);
+ this.loadData();
+ } else {
+ this.$message.warning(res.message);
+ }
+ })
+ },
+ tijiao(record) {
+ getAction('/task/task/tijiao', {id: record.id}).then((res) => {
+ if (res.success) {
+ //重新计算分页问题
+ this.$message.success(res.result);
+ this.loadData();
+ } else {
+ this.$message.warning(res.message);
+ }
+ })
+ },
+ kaishi(record) {
+ getAction('/task/task/kaishi', {id: record.id}).then((res) => {
+ if (res.success) {
+ //重新计算分页问题
+ this.$message.success(res.result);
+ this.loadData();
+ } else {
+ this.$message.warning(res.message);
+ }
+ })
+ },
+ fabu(record) {
+ getAction('/task/task/fabu', {id: record.id}).then((res) => {
+ if (res.success) {
+ //重新计算分页问题
+ this.$message.success(res.result);
+ this.loadData();
+ }else {
+ this.$message.warning(res.message);
+ }
+ })
+ },
initDictConfig(){
},
getSuperFieldList(){
diff --git a/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue b/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
index a4b9b23..5c8dec2 100644
--- a/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
+++ b/ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
@@ -10,17 +10,28 @@
-
+
+
+
+
+
-
+
+
+
+
-
+
+
@@ -49,11 +60,13 @@
import { httpAction, getAction } from '@api/manage'
import { validateDuplicateValue } from '@/utils/util'
import JVxeDateCell from "@comp/jeecg/JVxeTable/components/cells/JVxeDateCell";
+ import JMultiSelectTag from "@/components/dict/JMultiSelectTag"
export default {
name: 'TaskForm',
components: {
- JVxeDateCell
+ JVxeDateCell,
+ JMultiSelectTag
},
props: {
//表单禁用
@@ -66,6 +79,8 @@
data () {
return {
model:{
+ workLevel: 2,
+ workStatus: 0,
},
labelCol: {
xs: { span: 24 },
@@ -100,6 +115,7 @@
},
edit (record) {
this.model = Object.assign({}, record);
+ console.log('this.model-------',this.model)
this.visible = true;
},
submitForm () {
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
index 01b214e..28b5a1d 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
@@ -1,6 +1,7 @@
package org.jeecg.modules.task.controller;
+import java.awt.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -8,8 +9,11 @@ import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
+import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
@@ -21,6 +25,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.task.entity.Task;
+import org.jeecg.modules.task.mapper.TaskMapper;
import org.jeecg.modules.task.service.ITaskService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -29,6 +34,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -71,6 +77,8 @@ public class TaskController extends JeecgController {
QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap());
Page page = new Page(pageNo, pageSize);
IPage pageList = taskService.page(page, queryWrapper);
+ //责任人回显
+ pageList.getRecords().forEach(task1 -> task1.setManagerUsers_dictText(taskService.getManagerUsers(task1.getManagerUsers())));
return Result.OK(pageList);
}
@@ -84,6 +92,10 @@ public class TaskController extends JeecgController {
@ApiOperation(value="任务管理-添加", notes="任务管理-添加")
@PostMapping(value = "/add")
public Result> add(@RequestBody Task task) {
+ Task one = taskService.getOne(new LambdaQueryWrapper().like(Task::getFunctionTemplateName, task.getFunctionTemplateName()));
+ if (!ObjectUtils.isEmpty(one)){
+ return Result.error("名字重复");
+ }
taskService.save(task);
return Result.OK("添加成功!");
}
@@ -170,4 +182,28 @@ public class TaskController extends JeecgController {
return super.importExcel(request, response, Task.class);
}
-}
+ @GetMapping(value = "/chehui")
+ public Result> chehui(@RequestParam(name = "id") String id) {
+ return taskService.chehui(id);
+ }
+ @GetMapping(value = "/shenhe")
+ public Result> shenhe(@RequestParam(name = "id") String id) {
+ return taskService.shenhe(id);
+ }
+ @GetMapping(value = "/tijiao")
+ public Result> tijiao(@RequestParam(name = "id") String id) {
+ return taskService.tijiao(id);
+ }
+ @GetMapping(value = "/kaishi")
+ public Result> kaishi(@RequestParam(name = "id") String id) {
+ return taskService.kaishi(id);
+ }
+ @GetMapping(value = "/fabu")
+ public Result> fabu(@RequestParam(name = "id") String id) {
+ return taskService.fabu(id);
+ }
+
+
+
+
+ }
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java
index 66c64de..e3ad6cc 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java
@@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -63,13 +64,17 @@ public class Task implements Serializable {
@Excel(name = "责任人", width = 15)
@ApiModelProperty(value = "责任人")
private String managerUsers;
+ @TableField(exist = false)
+ private String managerUsers_dictText;
/**任务等级*/
@Excel(name = "任务等级", width = 15)
@ApiModelProperty(value = "任务等级")
+ @Dict(dicCode = "task_type_level")
private Integer workLevel;
/**任务状态*/
@Excel(name = "任务状态", width = 15)
@ApiModelProperty(value = "任务状态")
+ @Dict(dicCode = "work_status")
private Integer workStatus;
/**发布时间*/
@Excel(name = "发布时间", width = 15, format = "yyyy-MM-dd")
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/mapper/TaskMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/mapper/TaskMapper.java
index b7a3e35..be2b681 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/mapper/TaskMapper.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/mapper/TaskMapper.java
@@ -5,6 +5,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.task.entity.Task;
/**
@@ -15,4 +16,6 @@ import org.jeecg.modules.task.entity.Task;
*/
public interface TaskMapper extends BaseMapper {
+ @Select("select realname from sys_user where id = #{managerUsers}")
+ String getUserName(String managerUsers);
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java
index dfc1f70..ad95872 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java
@@ -1,6 +1,7 @@
package org.jeecg.modules.task.service;
import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.task.entity.Task;
/**
@@ -11,4 +12,16 @@ import org.jeecg.modules.task.entity.Task;
*/
public interface ITaskService extends IService {
+ //责任人回显
+ String getManagerUsers(String managerUsers);
+
+ Result> chehui(String id);
+
+ Result> shenhe(String id);
+
+ Result> tijiao(String id);
+
+ Result> kaishi(String id);
+
+ Result> fabu(String id);
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java
index bc3122e..7d9b70a 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java
@@ -1,13 +1,23 @@
package org.jeecg.modules.task.service.impl;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.modulex.entity.Modulex;
import org.jeecg.modules.task.entity.Task;
import org.jeecg.modules.task.mapper.TaskMapper;
import org.jeecg.modules.task.service.ITaskService;
+import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
/**
* @Description: 任务管理
* @Author: jeecg-boot
@@ -16,5 +26,106 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
*/
@Service
public class TaskServiceImpl extends ServiceImpl implements ITaskService {
+ @Resource
+ private TaskMapper taskMapper;
+
+ //责任人回显
+ @Override
+ public String getManagerUsers(@NotNull String managerUsers) {
+// List users = Arrays.asList(managerUsers.split(","));
+// List strings = new ArrayList<>();
+// users.forEach(user -> strings.add(taskMapper.getUserName(user)));
+// return strings.toString();
+ List userList = Arrays.stream(managerUsers.split(","))
+ .map(taskMapper::getUserName)
+ .collect(Collectors.toList());
+ return userList.toString().substring(1, userList.toString().length() - 1);
+
+ }
+
+ /**
+ * 撤回:项目负责人(管理员)使用,点击撤回,状态变为开发中。
+ */
+ @Override
+ public Result> chehui(String id) {
+ Task byId = this.getById(id);
+ if (byId.getWorkStatus() == 2) {
+ return Result.error("正处于开发中");
+ }
+ byId.setWorkStatus(2);
+ this.updateById(byId);
+ return Result.OK("撤回成功");
+ }
+
+ /**
+ * BUG反馈:项目负责人(管理员)使用,点击BUG反馈,状态变为DEBUG,下属功能状态不变,BUG管理增加一条记录,记录BUG内容。
+ * 审核:项目负责人(管理员)使用,点击完成,状态变为已审核。
+ */
+ @Override
+ public Result> shenhe(String id) {
+ Task byId = this.getById(id);
+ if (byId.getWorkStatus() == 4) {
+ return Result.error("已审核");
+ }
+ byId.setWorkStatus(4);
+ this.updateById(byId);
+ return Result.OK("审核通过");
+ }
+
+ /**-
+ * 提交:任务责任人(即开发者)使用的功能,点击提交按钮,表示任务完成,状态变为已提交,
+ * 提交时间设置为当前时间,并自动计算实际时长。
+ * 模块管理下属所有功能状态变成已完成才能点击提交按钮。
+ */
+ @Override
+ public Result> tijiao(String id) {
+ Task byId = this.getById(id);
+ if (byId.getWorkStatus() != 2) {
+ return Result.error("当前不处于开发中阶段,无法提交");
+ } else {
+ byId.setWorkStatus(3);
+
+ this.updateById(byId);
+
+ return Result.OK("提交成功!!");
+ }
+
+ }
+
+ /**
+ * 开始:任务责任人(即开发者)使用的功能,点击开始按钮,状态变为开发中,
+ * 表示任务开始,开始时间设置为当前时间。
+ */
+ @Override
+ public Result> kaishi(String id) {
+ Task byId = this.getById(id);
+ if (byId.getWorkStatus() != 1) {
+ return Result.error("当前不处于已发布阶段,无法开始,请先发布");
+ } else {
+ byId.setWorkStatus(2);
+ byId.setStartTime(new Date());
+ this.updateById(byId);
+
+ return Result.OK("任务开始成功");
+ }
+ }
+ /**
+ * 发布:点击发布按钮,状态变成已发布,
+ * 任务责任人(即开发者)可以操作开始、提交等功能;
+ * 模块管理下属所有功能状态变为已发布。
+ */
+ @Override
+ public Result> fabu(String id) {
+ Task 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("发布成功!!");
+ }
+ }
}