完善功能

master
赵玉瑞 2 years ago
parent 719f14cae8
commit 914816a434
  1. 111
      ant-design-vue-jeecg/src/views/task/TaskList.vue
  2. 24
      ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
  3. 38
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
  4. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java
  5. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/mapper/TaskMapper.java
  6. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/ITaskService.java
  7. 111
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/service/impl/TaskServiceImpl.java

@ -81,6 +81,33 @@
</a-button>
</template>
<!--功能 开发者-->
<!--这里只能用v-else-if / v-else v-if -->
<span slot="actionManage" slot-scope="text, record">
<a @click="fabu(record)">发布</a>
<a-divider type="vertical"/>
<a @click="kaishi(record)">开始</a>
<a-divider type="vertical"/>
<a @click="tijiao(record)">提交</a>
</span>
<!--功能 管理员-->
<span slot="actionDevelop" slot-scope="text, record">
<a @click="chehui(record)">撤回</a>
<a-divider type="vertical"/>
<a @click="bugfankui(record)">BUG反馈</a>
<a-divider type="vertical"/>
<a @click="shenhe(record)">审核</a>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
@ -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(){

@ -10,17 +10,28 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="managerUsers">
<a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>
<!-- <a-input v-model="model.managerUsers" placeholder="请输入责任人" ></a-input>-->
<!-- <j-dict-select-tag type="list" v-model="model.managerUsers" placeholder="请选择任务等级"-->
<!-- dict-code="sys_user,realname,id" >-->
<!-- </j-dict-select-tag>-->
<j-multi-select-tag type="list_multi" v-model="model.managerUsers"
dictCode="sys_user,realname,id" placeholder="请选择责任人" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务等级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workLevel">
<a-input-number :min="1" :max="16" v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />
<!-- <a-input-number :min="1" :max="16" v-model="model.workLevel" placeholder="请输入任务等级" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workLevel" placeholder="请选择任务等级"
dict-code="task_type_level" style="width: 100%">
</j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="任务状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workStatus">
<a-input-number :min="1" :max="16" v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />
<!-- <a-input-number :min="1" :max="16" v-model="model.workStatus" placeholder="请输入任务状态" style="width: 100%" />-->
<j-dict-select-tag v-model="model.workStatus" dict-code="work_status"
placeholder="请输入任务状态" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -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 () {

@ -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<Task, ITaskService> {
QueryWrapper<Task> queryWrapper = QueryGenerator.initQueryWrapper(task, req.getParameterMap());
Page<Task> page = new Page<Task>(pageNo, pageSize);
IPage<Task> 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<Task, ITaskService> {
@ApiOperation(value="任务管理-添加", notes="任务管理-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Task task) {
Task one = taskService.getOne(new LambdaQueryWrapper<Task>().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<Task, ITaskService> {
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);
}
}

@ -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")

@ -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<Task> {
@Select("select realname from sys_user where id = #{managerUsers}")
String getUserName(String managerUsers);
}

@ -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<Task> {
//责任人回显
String getManagerUsers(String managerUsers);
Result<?> chehui(String id);
Result<?> shenhe(String id);
Result<?> tijiao(String id);
Result<?> kaishi(String id);
Result<?> fabu(String id);
}

@ -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<TaskMapper, Task> implements ITaskService {
@Resource
private TaskMapper taskMapper;
//责任人回显
@Override
public String getManagerUsers(@NotNull String managerUsers) {
// List<String> users = Arrays.asList(managerUsers.split(","));
// List<String> strings = new ArrayList<>();
// users.forEach(user -> strings.add(taskMapper.getUserName(user)));
// return strings.toString();
List<String> 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("发布成功!!");
}
}
}

Loading…
Cancel
Save