From ace2b710732d6ca2aa401283694fb286b5ffb0de Mon Sep 17 00:00:00 2001 From: zhanli <719901725@qq.com> Date: Wed, 7 Aug 2024 00:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=9C=80=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/WfProcessController.java | 6 +- .../service/impl/WfProcessServiceImpl.java | 33 +- .../service/impl/WfTaskServiceImpl.java | 12 +- ruoyi-ui/src/api/scientific/application.js | 7 + ruoyi-ui/src/api/scientific/handbook.js | 10 +- .../scientific/project_application_plan.js | 64 + ruoyi-ui/src/router/index.js | 138 +- .../src/views/project/application/declare.vue | 62 +- .../src/views/project/application/index.vue | 54 +- .../src/views/scientific/handbook/detail.vue | 476 ++ .../scientific/handbook/handbookApply.vue | 164 + .../src/views/scientific/handbook/index.vue | 312 +- .../src/views/scientific/handbook_apply.vue | 117 - ...dbook_query.vue => handbook_query_bak.vue} | 0 .../src/views/scientific/project/index.vue | 404 +- .../views/scientific/project/projectApply.vue | 163 + .../src/views/scientific/projectApply.vue | 116 - .../project_application_plan/detail.vue | 476 ++ .../project_application_plan/index.vue | 492 ++ .../project_application_plan/planApply.vue | 175 + .../src/views/workflow/work/approval2.vue | 297 ++ .../views/workflow/work/declare_details.vue | 149 + ruoyi-ui/src/views/workflow/work/my_proj.vue | 410 +- ruoyi-ui/src/views/workflow/work/own.vue | 4 +- ruoyi-ui/src/views/workflow/work/proj_app.vue | 145 + .../controller/ActProjectController.java | 108 - .../ProjectApplicationController.java | 12 +- .../controller/ProjectHandbookController.java | 34 +- .../controller/ProjectPlanController.java | 106 + .../ruoyi/scientific/domain/ActProject.java | 49 - .../scientific/domain/ProjectApplication.java | 20 + .../scientific/domain/ProjectHandbook.java | 51 +- .../ruoyi/scientific/domain/ProjectPlan.java | 105 + .../scientific/domain/bo/ActProjectBo.java | 68 - .../domain/bo/ProjectApplicationBo.java | 25 +- .../domain/bo/ProjectHandbookBo.java | 66 +- .../scientific/domain/bo/ProjectPlanBo.java | 116 + .../scientific/domain/vo/ActProjectVo.java | 71 - .../domain/vo/ProjectApplicationVo.java | 20 + .../domain/vo/ProjectHandbookVo.java | 74 +- .../scientific/domain/vo/ProjectPlanVo.java | 113 + .../listener/BudgetUpdateTaskListener.java | 2 + .../listener/HandbookUpdateListener.java | 58 + .../listener/PlanUpdateListener.java | 76 + .../ProjectAppStatusUpdateListener.java | 41 + .../ProjectDeclareStatusListener.java | 45 + .../scientific/mapper/ActProjectMapper.java | 15 - .../mapper/ProjectHandbookMapper.java | 6 +- .../scientific/mapper/ProjectPlanMapper.java | 15 + .../service/IActProjectService.java | 49 - .../service/IProjectApplicationService.java | 14 + .../service/IProjectHandbookService.java | 26 +- .../service/IProjectPlanService.java | 53 + .../service/impl/ActProjectServiceImpl.java | 113 - .../impl/ProjectApplicationServiceImpl.java | 52 +- .../impl/ProjectHandbookServiceImpl.java | 53 +- .../service/impl/ProjectPlanServiceImpl.java | 131 + .../mapper/scientific/ActProjectMapper.xml | 17 - .../scientific/ProjectApplicationMapper.xml | 3 + .../scientific/ProjectHandbookMapper.xml | 15 +- .../mapper/scientific/ProjectPlanMapper.xml | 26 + .../sql/mysql/ruoyi-flowable-plus-240612.sql | 2447 ++++++++++ script/sql/mysql/ry-flowable-plus-240703.sql | 3022 ++++++++++++ script/sql/mysql/ry-flowable-plus-240709.sql | 3153 +++++++++++++ script/sql/mysql/ry-flowable-plus-240712.sql | 3251 +++++++++++++ script/sql/mysql/ry-flowable-plus-240714.sql | 3057 +++++++++++++ script/sql/mysql/ry-flowable-plus-jzq.sql | 2830 ++++++++++++ .../sql/mysql/ry-flowable-plus-jzq240714.sql | 3563 +++++++++++++++ .../sql/mysql/ry-flowable-plus-jzq240715.sql | 3332 ++++++++++++++ ...-0725.sql => ry-flowable-plus-zl-0802.sql} | 641 ++- script/sql/mysql/ry-flowable-plus-zl-0807.sql | 4033 +++++++++++++++++ 71 files changed, 33855 insertions(+), 1608 deletions(-) create mode 100644 ruoyi-ui/src/api/scientific/project_application_plan.js create mode 100644 ruoyi-ui/src/views/scientific/handbook/detail.vue create mode 100644 ruoyi-ui/src/views/scientific/handbook/handbookApply.vue delete mode 100644 ruoyi-ui/src/views/scientific/handbook_apply.vue rename ruoyi-ui/src/views/scientific/{handbook_query.vue => handbook_query_bak.vue} (100%) create mode 100644 ruoyi-ui/src/views/scientific/project/projectApply.vue delete mode 100644 ruoyi-ui/src/views/scientific/projectApply.vue create mode 100644 ruoyi-ui/src/views/scientific/project_application_plan/detail.vue create mode 100644 ruoyi-ui/src/views/scientific/project_application_plan/index.vue create mode 100644 ruoyi-ui/src/views/scientific/project_application_plan/planApply.vue create mode 100644 ruoyi-ui/src/views/workflow/work/approval2.vue create mode 100644 ruoyi-ui/src/views/workflow/work/declare_details.vue create mode 100644 ruoyi-ui/src/views/workflow/work/proj_app.vue delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/controller/ActProjectController.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/controller/ProjectPlanController.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/ActProject.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/ProjectPlan.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/bo/ActProjectBo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/bo/ProjectPlanBo.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/vo/ActProjectVo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/domain/vo/ProjectPlanVo.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/listener/HandbookUpdateListener.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/listener/PlanUpdateListener.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/listener/ProjectAppStatusUpdateListener.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/listener/ProjectDeclareStatusListener.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/mapper/ActProjectMapper.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/mapper/ProjectPlanMapper.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/IActProjectService.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/IProjectPlanService.java delete mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/impl/ActProjectServiceImpl.java create mode 100644 scientific/src/main/java/com/ruoyi/scientific/service/impl/ProjectPlanServiceImpl.java delete mode 100644 scientific/src/main/resources/mapper/scientific/ActProjectMapper.xml create mode 100644 scientific/src/main/resources/mapper/scientific/ProjectPlanMapper.xml create mode 100644 script/sql/mysql/ruoyi-flowable-plus-240612.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240703.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240709.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240712.sql create mode 100644 script/sql/mysql/ry-flowable-plus-240714.sql create mode 100644 script/sql/mysql/ry-flowable-plus-jzq.sql create mode 100644 script/sql/mysql/ry-flowable-plus-jzq240714.sql create mode 100644 script/sql/mysql/ry-flowable-plus-jzq240715.sql rename script/sql/mysql/{ry-flowable-plus-0725.sql => ry-flowable-plus-zl-0802.sql} (81%) create mode 100644 script/sql/mysql/ry-flowable-plus-zl-0807.sql diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java index bc0bf81..bc51597 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/workflow/WfProcessController.java @@ -276,7 +276,11 @@ public class WfProcessController extends BaseController { public R detail(String procInsId, String taskId) { return R.ok(processService.queryProcessDetail(procInsId, taskId)); } - + /** + * zqjia: 批量查询流程实例详情 + * + * @param procInsIds 流程实例ID列表 + */ @PostMapping("/details") public TableDataInfo details(@RequestBody List procInsIds) { List processDetails = new ArrayList<>(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java index f173cc6..4261bbd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfProcessServiceImpl.java @@ -1222,16 +1222,37 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce WfDetailVo detailVo = queryProcessDetail(task.getProcInsId(), ""); // 获取表单列表 List processFormList = detailVo.getProcessFormList(); - // 获取项目名字 + + // 这里获得是流程信息的Title名字, 但是不同的流程可能的Title的字段名可能不一样,可能是一个数组 + // 并按照逗号进行分隔 + // @author zhanli 2024/07/31 if(pageQuery.getDetailTitleName() != null){ - String res = getFormData(processFormList, pageQuery.getDetailTitleName(), pageQuery); - taskVo.setProcessTitle(res); + // getDetailTitleName可能是一个数组,先进行分割 + String[] queryTitleList = pageQuery.getDetailTitleName().split(","); + // 遍历结果数组, 依次请求流程的中字段的关键信息,如果查询不为空就返回 + for (String queryTitle : queryTitleList) { + String res = getFormData(processFormList, queryTitle, pageQuery); + if(!res.equals("")){ + taskVo.setProcessTitle(res); + break; + } + } } + // 获取项目负责人名字 if(pageQuery.getDetailDirectorName() != null){ - String director = getFormData(processFormList, pageQuery.getDetailDirectorName(), pageQuery); - taskVo.setDirector(director); + String[] queryTitleList = pageQuery.getDetailDirectorName().split(","); + // 遍历结果数组, 依次请求流程的中字段的关键信息,如果查询不为空就返回 + for (String queryTitle : queryTitleList) { + String res = getFormData(processFormList, queryTitle, pageQuery); + if(!res.equals("")){ + taskVo.setDirector(res); + break; + } + } } + + targetList.add(taskVo); } @@ -1272,4 +1293,6 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce } return ""; } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfTaskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfTaskServiceImpl.java index 2dd29ed..716ed9d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfTaskServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/workflow/service/impl/WfTaskServiceImpl.java @@ -84,9 +84,17 @@ public class WfTaskServiceImpl extends FlowServiceFactory implements IWfTaskServ // 获取模型信息 String localScopeValue = ModelUtils.getUserTaskAttributeValue(bpmnModel, task.getTaskDefinitionKey(), ProcessConstants.PROCESS_FORM_LOCAL_SCOPE); boolean localScope = Convert.toBool(localScopeValue, false); - taskService.complete(taskBo.getTaskId(), taskBo.getVariables(), localScope); + Map mapTmp = taskBo.getVariables(); + mapTmp.put("review", "1"); + if (!StringUtils.isNotBlank(taskBo.getNextUserIds())) { + taskService.complete(taskBo.getTaskId(), mapTmp, localScope); + } } else { - taskService.complete(taskBo.getTaskId()); + Map mapTmp = new HashMap<>(); + mapTmp.put("review", "1"); + if (!StringUtils.isNotBlank(taskBo.getNextUserIds())) { + taskService.complete(taskBo.getTaskId(), mapTmp); + } } } // 设置任务节点名称 diff --git a/ruoyi-ui/src/api/scientific/application.js b/ruoyi-ui/src/api/scientific/application.js index dcae562..ac98585 100644 --- a/ruoyi-ui/src/api/scientific/application.js +++ b/ruoyi-ui/src/api/scientific/application.js @@ -50,4 +50,11 @@ export function confirmFundsReceived(data) { method: 'post', data: data }) +} +// 查询已申报项目 +export function listDeclaredApplications() { + return request({ + url: '/scientific/application/declared', + method: 'get' + }) } \ No newline at end of file diff --git a/ruoyi-ui/src/api/scientific/handbook.js b/ruoyi-ui/src/api/scientific/handbook.js index 13d2a6d..1ed34fb 100644 --- a/ruoyi-ui/src/api/scientific/handbook.js +++ b/ruoyi-ui/src/api/scientific/handbook.js @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 查询项目申报v2列表 +// 查询项目申报指南列表 export function listHandbook(query) { return request({ url: '/scientific/handbook/list', @@ -9,7 +9,7 @@ export function listHandbook(query) { }) } -// 查询项目申报v2详细 +// 查询项目申报指南详细 export function getHandbook(handbookId) { return request({ url: '/scientific/handbook/' + handbookId, @@ -17,7 +17,7 @@ export function getHandbook(handbookId) { }) } -// 新增项目申报v2 +// 新增项目申报指南 export function addHandbook(data) { return request({ url: '/scientific/handbook', @@ -26,7 +26,7 @@ export function addHandbook(data) { }) } -// 修改项目申报v2 +// 修改项目申报指南 export function updateHandbook(data) { return request({ url: '/scientific/handbook', @@ -35,7 +35,7 @@ export function updateHandbook(data) { }) } -// 删除项目申报v2 +// 删除项目申报指南 export function delHandbook(handbookId) { return request({ url: '/scientific/handbook/' + handbookId, diff --git a/ruoyi-ui/src/api/scientific/project_application_plan.js b/ruoyi-ui/src/api/scientific/project_application_plan.js new file mode 100644 index 0000000..94de37d --- /dev/null +++ b/ruoyi-ui/src/api/scientific/project_application_plan.js @@ -0,0 +1,64 @@ +import request from '@/utils/request' + +// 查询项目申报v2列表 +export function listPlan(query) { + return request({ + url: '/scientific/plan/list', + method: 'get', + params: query + }) +} + +// 查询项目申报v2详细 +export function getPlan(handbookId) { + return request({ + url: '/scientific/plan/' + handbookId, + method: 'get' + }) +} + +// 新增项目申报v2 +export function addPlan(data) { + return request({ + url: '/scientific/plan', + method: 'post', + data: data + }) +} + +// 修改项目申报v2 +export function updatePlan(data) { + return request({ + url: '/scientific/plan', + method: 'put', + data: data + }) +} + +// 删除项目申报计划 +export function delPlan(planId) { + return request({ + url: '/scientific/plan/' + planId, + method: 'delete' + }) +} + +// 封装寻找最新 表单 的函数,返回 Promise +export function findLatestDeploymentTimeIndex(response) { + return new Promise((resolve, reject) => { + let latestIndex = 0; + let latestTime = new Date(response.rows[0].deploymentTime); + + response.rows.forEach((row, index) => { + const currentTime = new Date(row.deploymentTime); + + if (currentTime > latestTime) { + latestTime = currentTime; + latestIndex = index; + } + }); + + // 返回最新的索引 + resolve(latestIndex); + }); +} diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 76b8e14..9229127 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -206,30 +206,146 @@ export const dynamicRoutes = [ component: () => import('@/views/workflow/work/proj_update'), name: 'ProjectInfoUpdate', meta: { title: '项目信息变更', icon: ''} + }, + // logzhan:这里用于项目的申报 + { + path: 'declare_details/:deployId([\\w|\\-]+)', + component: () => import('@/views/workflow/work/declare_details'), + name: 'ProjecDeclareInfo', + meta: { title: '项目信息申报', icon: ''} + }, + { + path: 'proj_app/:deployId([\\w|\\-]+)', + component: () => import('@/views/workflow/work/proj_app'), + name: 'ProjectInfoApp', + meta: { title: '项目立项', icon: ''} } ] }, + // zqjia:用三级路由会出问题,就通过这种形式区分不同模块吧 + // 申报计划路由 { - path: '/scientific', + path: '/scientific/project_application_plan', component: Layout, hidden: true, - permissions: ['scientific:projectApply'], + permissions: ['scientific:plan'], children: [ + // zqjia:这个路由是菜单管理里的起作用 + // { + // path: 'list', + // component: () => import('@/views/scientific/project_application_plan/index'), + // name: 'planList', + // meta: { title: '项目申报计划', icon: '' } + // }, { - path: 'projectApply/:deployId([\\w|\\-]+)', - component: () => import('@/views/scientific/projectApply'), + path: 'detail/:planProcId([\\w|\\-]+)', + component: () => import('@/views/scientific/project_application_plan/detail'), + name: 'planDetail', + meta: { title: '申报计划详情' } + }, + { + path: 'planApply', + component: () => import('@/views/scientific/project_application_plan/planApply'), + name: 'planApply', + meta: { title: '项目申报', icon: '' } + }, + ] + }, + // 项目路由 + { + path: '/scientific/project', + component: Layout, + hidden: true, + permissions: ['scientific:project'], + children: [ + // zqjia:这个路由是菜单管理里的起作用 + // { + // path: 'list', + // component: () => import('@/views/scientific/project/index'), + // name: 'projectList', + // meta: { title: '项目', icon: '' } + // }, + // zqjia:项目详情还没写 + { + path: 'detail/:planProcId([\\w|\\-]+)', + component: () => import('@/views/scientific/project_application_plan/detail'), + name: 'planDetail', + meta: { title: '申报计划详情' } + }, + { + path: 'planProjectQuery/:planId([\\w|\\-]+)', + // permissions: ['scientific:application:list'], + component: () => import('@/views/scientific/project/index'), + name: 'planProjectQuery', + meta: { title: '已申报项目' } + }, + { + path: 'projectApply', + component: () => import('@/views/scientific/project/projectApply'), name: 'ProjectApply', meta: { title: '项目申报', icon: '' } }, - { - path: 'handbookProjectQuery/:handbookId([\\w|\\-]+)', - component: () => import('@/views/scientific/handbookProject_query'), - name: 'handbookProjectQuery', - meta: { title: '已申报项目' } - // meta: { title: '已申报项目', activeMenu: '/work/own' } - } ] }, + // 指南路由 + { + path: '/scientific/handbook', + component: Layout, + hidden: true, + permissions: ['scientific:handbook'], + children: [ + // zqjia:这个路由是菜单管理里的起作用 + // { + // path: 'list', + // component: () => import('@/views/scientific/project/index'), + // name: 'projectList', + // meta: { title: '项目', icon: '' } + // }, + // zqjia:项目详情还没写 + { + path: 'detail/:planProcId([\\w|\\-]+)', + component: () => import('@/views/scientific/handbook/detail'), + name: 'handbookDetail', + meta: { title: '申报计划详情' } + }, + // { + // path: 'planProjectQuery/:planId([\\w|\\-]+)', + // // permissions: ['scientific:application:list'], + // component: () => import('@/views/scientific/project/index'), + // name: 'planProjectQuery', + // meta: { title: '已申报项目' } + // }, + // { + // path: 'projectApply/:deployId([\\w|\\-]+)', + // component: () => import('@/views/scientific/project/projectApply.vue'), + // name: 'ProjectApply', + // meta: { title: '项目申报', icon: '' } + // }, + ] + }, + // // 申报路由 + // { + // path: '/project/application', + // component: Layout, + // hidden: true, + // //permissions: ['scientific:handbook'], + // children: [ + // // zqjia:这个路由是菜单管理里的起作用 + // // { + // // path: 'list', + // // component: () => import('@/views/scientific/project/index'), + // // name: 'projectList', + // // meta: { title: '项目', icon: '' } + // // }, + // // zqjia:项目详情还没写 + // { + // path: 'detail/:planProcId([\\w|\\-]+)', + // component: () => import('@/views/scientific/handbook/detail'), + // name: 'handbookDetail', + // meta: { title: '申报计划详情' } + // }, + // ] + // }, ] // 防止连续点击多次路由报错 diff --git a/ruoyi-ui/src/views/project/application/declare.vue b/ruoyi-ui/src/views/project/application/declare.vue index 5824eea..dbc54c4 100644 --- a/ruoyi-ui/src/views/project/application/declare.vue +++ b/ruoyi-ui/src/views/project/application/declare.vue @@ -143,36 +143,33 @@ - - - - - - + +