From 764983e7d0ced22e301a3f7805d5132bb2aa61cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sun, 25 Feb 2024 01:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FlowBusinessKeyController.java | 29 ++ .../domain/flowable/FlowTaskEntity.java | 11 + .../mapper/flowable/FlowBusinessKeyMapper.xml | 4 + yanzhu-ui/src/App.vue | 28 ++ yanzhu-ui/src/api/flowable/businessKey.js | 64 +++ yanzhu-ui/src/layout/components/Navbar.vue | 4 +- .../src/layout/components/Sidebar/Item.vue | 4 + yanzhu-ui/src/layout/index.vue | 4 + yanzhu-ui/src/store/modules/flowtask.js | 51 ++ .../views/flowable/task/finished/index.vue | 234 ++++++--- .../task/myProcess/detail/detailDrawer.vue | 469 ++++++++++++++++++ .../task/myProcess/editTaskDrawer.vue | 379 ++++++++++++++ .../views/flowable/task/myProcess/index.vue | 79 ++- .../task/myProcess/initTaskDrawer.vue | 226 +++++++++ .../src/views/flowable/task/todo/index.vue | 168 +++++-- 15 files changed, 1628 insertions(+), 126 deletions(-) create mode 100644 yanzhu-ui/src/api/flowable/businessKey.js create mode 100644 yanzhu-ui/src/store/modules/flowtask.js create mode 100644 yanzhu-ui/src/views/flowable/task/myProcess/detail/detailDrawer.vue create mode 100644 yanzhu-ui/src/views/flowable/task/myProcess/editTaskDrawer.vue create mode 100644 yanzhu-ui/src/views/flowable/task/myProcess/initTaskDrawer.vue diff --git a/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java b/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java index 829be1e..5ed0b31 100644 --- a/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java +++ b/yanzhu-flowable/src/main/java/com/yanzhu/flowable/controller/FlowBusinessKeyController.java @@ -9,11 +9,15 @@ import com.yanzhu.system.domain.flowable.FlowTaskEntity; import com.yanzhu.system.service.ISysDeptService; import io.swagger.annotations.Api; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -113,4 +117,29 @@ public class FlowBusinessKeyController extends BaseController { flowTaskEntity.setAssigneeId(super.getUserId()); return getDataTable(flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity)); } + + /** + * 查询我的代办任务数量 + * @return AjaxResult 统计结果 + */ + @GetMapping(value = "/findMyTask") + public AjaxResult findMyTask() { + FlowTaskEntity flowTaskEntity = new FlowTaskEntity(); + //超管查询所有数据 + if(!SysUser.isAdmin(super.getUserId())){ + SysUser sysUser = super.getLoginUser().getUser(); + flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()); + flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList())); + } + flowTaskEntity.setActiveName("await"); + List> list = flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity); + Map data = new HashMap<>(); + if(CollectionUtils.isNotEmpty(list)){ + data.put("todo",list.size()); + }else{ + data.put("todo",0); + } + return success(data); + } + } diff --git a/yanzhu-system/src/main/java/com/yanzhu/system/domain/flowable/FlowTaskEntity.java b/yanzhu-system/src/main/java/com/yanzhu/system/domain/flowable/FlowTaskEntity.java index 242df66..a4ff5df 100644 --- a/yanzhu-system/src/main/java/com/yanzhu/system/domain/flowable/FlowTaskEntity.java +++ b/yanzhu-system/src/main/java/com/yanzhu/system/domain/flowable/FlowTaskEntity.java @@ -22,6 +22,9 @@ public class FlowTaskEntity extends BaseEntity { @ApiModelProperty("业务名称") private String businessKeyName; + @ApiModelProperty("项目名称") + private String businessKeyParName; + @ApiModelProperty("任务编号") private String taskId; @@ -314,6 +317,14 @@ public class FlowTaskEntity extends BaseEntity { this.deptAncestors = deptAncestors; } + public String getBusinessKeyParName() { + return businessKeyParName; + } + + public void setBusinessKeyParName(String businessKeyParName) { + this.businessKeyParName = businessKeyParName; + } + private List roleIds; public List getRoleIds() { diff --git a/yanzhu-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml b/yanzhu-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml index 85be12a..dc040eb 100644 --- a/yanzhu-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml +++ b/yanzhu-system/src/main/resources/mapper/flowable/FlowBusinessKeyMapper.xml @@ -18,6 +18,7 @@ fa.businessKey, fa.businessDeptId, fa.businessKeyName, + fa.businessKeyParName, fa.startUserId, fa.startUserName, fa.startDeptName, @@ -35,6 +36,7 @@ and fa.startDeptName like concat('%', #{startDeptName}, '%') and fa.startUserName like concat('%', #{startUserName}, '%') and fa.businessKeyName like concat('%', #{businessKeyName}, '%') + and fa.businessKeyParName like concat('%', #{businessKeyParName}, '%') and fa.category = #{category} and date(fa.createTime) between #{params.beginDate} and #{params.endDate} @@ -63,6 +65,7 @@ and fa.procDefName like concat('%', #{procDefName}, '%') and fa.businessKey = #{businessKey} and fa.businessKeyName like concat('%', #{businessKeyName}, '%') + and fa.businessKeyParName like concat('%', #{businessKeyParName}, '%') and fa.category = #{category} and date(fa.createTime) between #{params.beginDate} and #{params.endDate} @@ -94,6 +97,7 @@ and fa.procDefName like concat('%', #{procDefName}, '%') and fa.businessKey = #{businessKey} and fa.businessKeyName like concat('%', #{businessKeyName}, '%') + and fa.businessKeyParName like concat('%', #{businessKeyParName}, '%') and fa.category = #{category} and fa.endTime between #{params.beginDate} and #{params.endDate} order by fa.endTime desc diff --git a/yanzhu-ui/src/App.vue b/yanzhu-ui/src/App.vue index b92ea37..39c5696 100644 --- a/yanzhu-ui/src/App.vue +++ b/yanzhu-ui/src/App.vue @@ -26,3 +26,31 @@ export default { display: none; } + diff --git a/yanzhu-ui/src/api/flowable/businessKey.js b/yanzhu-ui/src/api/flowable/businessKey.js new file mode 100644 index 0000000..786312b --- /dev/null +++ b/yanzhu-ui/src/api/flowable/businessKey.js @@ -0,0 +1,64 @@ +import request from '@/utils/request' + +// 查询业务流程列表 +export function allList(query) { + return request({ + url: '/flowable/businessKey/allList', + method: 'get', + params: query + }) +} + +// 统计业务流程列表 +export function queryCount(query) { + return request({ + url: '/flowable/businessKey/queryCount', + method: 'get', + params: query + }) +} + +// 根据业务流程查询操作日志 +export function findCommentByProcInsId(query) { + return request({ + url: '/flowable/businessKey/findCommentByProcInsId', + method: 'get', + params: query + }) +} + +// 根据业务流程查询表单数据 +export function findFormDatasByProcInsId(query) { + return request({ + url: '/flowable/businessKey/findFormDatasByProcInsId', + method: 'get', + params: query + }) +} + +// 根据条件查询我的代办任务 +export function myAwaitFlowTaskList(query) { + return request({ + url: '/flowable/businessKey/myAwaitFlowTaskList', + method: 'get', + params: query + }) +} + +// 根据条件查询我的已办任务 +export function myFinishedFlowTaskList(query) { + return request({ + url: '/flowable/businessKey/myFinishedFlowTaskList', + method: 'get', + params: query + }) +} + +// 查询我的代办数量 +export function findMyTask(){ + return request({ + url: '/flowable/businessKey/findMyTask', + method: 'get' + }) +} + diff --git a/yanzhu-ui/src/layout/components/Navbar.vue b/yanzhu-ui/src/layout/components/Navbar.vue index f72bbdc..dec31e2 100644 --- a/yanzhu-ui/src/layout/components/Navbar.vue +++ b/yanzhu-ui/src/layout/components/Navbar.vue @@ -88,7 +88,9 @@ export default { }, methods: { toggleSideBar() { - this.$store.dispatch('app/toggleSideBar') + this.$store.dispatch('app/toggleSideBar'); + //查询任务tips + this.$store.dispatch('settingAwaitNum'); }, async logout() { this.$confirm('确定注销并退出系统吗?', '提示', { diff --git a/yanzhu-ui/src/layout/components/Sidebar/Item.vue b/yanzhu-ui/src/layout/components/Sidebar/Item.vue index be3285d..cce0739 100644 --- a/yanzhu-ui/src/layout/components/Sidebar/Item.vue +++ b/yanzhu-ui/src/layout/components/Sidebar/Item.vue @@ -26,6 +26,10 @@ export default { } else { vnodes.push({(title)}) } + let name=context?.parent?.item?.name; + if(['Todo','Task'].includes(name)){ + vnodes.push(h('span',{class:"todo_num_tips tips_"+name},1)) + } } return vnodes } diff --git a/yanzhu-ui/src/layout/index.vue b/yanzhu-ui/src/layout/index.vue index dba4393..7e73f5f 100644 --- a/yanzhu-ui/src/layout/index.vue +++ b/yanzhu-ui/src/layout/index.vue @@ -54,6 +54,10 @@ export default { return variables; } }, + mounted() { + //查询任务tips + this.$store.dispatch('settingAwaitNum'); + }, methods: { handleClickOutside() { this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) diff --git a/yanzhu-ui/src/store/modules/flowtask.js b/yanzhu-ui/src/store/modules/flowtask.js new file mode 100644 index 0000000..55b4640 --- /dev/null +++ b/yanzhu-ui/src/store/modules/flowtask.js @@ -0,0 +1,51 @@ +import { findMyTask } from "@/api/flowable/businessKey"; + +const flowtask = { + state: { + awaitTaskNum:0 + }, + + mutations: { + SET_AWAIT_TASK: (state, number) => { + state.awaitTaskNum = number + } + }, + + actions: { + // 设置代办任务 + settingAwaitNum({ commit }) { + return new Promise((resolve, reject) => { + //查询当前登录人的代办任务数量 + findMyTask({}).then(response => { + let todos=document.querySelectorAll(".tips_Todo"); + let tasks=document.querySelectorAll(".tips_Task"); + if(todos.length>0){ + todos.forEach(el=>{ + el.innerHTML=response.data.todo; + if(response.data.todo>0){ + el.style.display="inline"; + }else{ + el.style.display="none"; + } + }); + } + if(tasks.length>0){ + tasks.forEach(el=>{ + el.innerHTML=response.data.todo; + if(response.data.todo>0){ + el.style.display="inline"; + }else{ + el.style.display="none"; + } + }); + } + resolve() + }).catch(error => { + reject(error) + }); + }) + } + } + } + + export default flowtask \ No newline at end of file diff --git a/yanzhu-ui/src/views/flowable/task/finished/index.vue b/yanzhu-ui/src/views/flowable/task/finished/index.vue index 2d07914..a90a567 100644 --- a/yanzhu-ui/src/views/flowable/task/finished/index.vue +++ b/yanzhu-ui/src/views/flowable/task/finished/index.vue @@ -1,6 +1,12 @@