From 9c3acad106be19b162efbd70e2eb5175d24c8758 Mon Sep 17 00:00:00 2001 From: yitonglei Date: Fri, 24 Feb 2023 10:53:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B7=A5=E4=BD=9C=E6=B5=81=E5=85=83=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BF=9D=E5=AD=98=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=A4=84=E7=90=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=AD?= =?UTF-8?q?=E9=80=94=E5=85=83=E6=B5=81=E7=A8=8B=E4=B8=AD=E6=AD=A2=EF=BC=8C?= =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE=E4=B9=9F=E4=BC=9A=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E3=80=82=202.=E5=B7=A5=E4=BD=9C=E6=B5=81model=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E6=9D=A1=E4=BB=B6=EF=BC=8C=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=91=E8=B5=B7=E7=9A=84=E5=B7=A5=E4=BD=9C=E6=B5=81=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E4=B8=AD=E9=97=B4=E8=8A=82=E7=82=B9=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=88=B0=E2=80=9C=E8=BF=90=E7=BB=B4=E5=85=AC=E5=8F=B8=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E4=BB=BB=E5=8A=A1=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HomePageServiceImpl.java | 18 +++++---- .../impl/AutoStartModelServiceImpl.java | 1 + .../workbench/util/RepeatMonthClass.java | 15 +------- .../workbench/util/RepeatQuarterClass.java | 15 +------- .../workbench/util/RepeatWeekClass.java | 37 +------------------ .../plugin/workbench/vo/AutoStartModelVO.java | 4 ++ 6 files changed, 19 insertions(+), 71 deletions(-) diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/service/impl/HomePageServiceImpl.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/service/impl/HomePageServiceImpl.java index 89f26ad..676f059 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/service/impl/HomePageServiceImpl.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/service/impl/HomePageServiceImpl.java @@ -2,6 +2,7 @@ package org.springblade.plugin.homepage.service.impl; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import liquibase.pro.packaged.E; import lombok.AllArgsConstructor; import org.apache.commons.lang.StringUtils; import org.flowable.engine.HistoryService; @@ -172,13 +173,16 @@ public class HomePageServiceImpl implements IHomePageService { for(Task task : listNeedDo){ String executionId = task.getExecutionId(); - System.out.println("executionid--" + executionId); Map variables = runtimeService.getVariables(task.getExecutionId()); - - Date qiwangwanchengshijian = DateUtil.parse(variables.get("qiwangwanchengshijian").toString(), "yyyy-MM-dd HH:mm:ss"); - Duration between = DateUtil.between(qiwangwanchengshijian, DateUtil.now()); - if(!between.isNegative()){ //between.isNegative() true ,现在时间小于任务结束时间,false消灾时间大于任务结束时间 - expireNum ++; + try { + Date qiwangwanchengshijian = DateUtil.parse(variables.get("qiwangwanchengshijian").toString(), "yyyy-MM-dd HH:mm:ss"); + Duration between = DateUtil.between(qiwangwanchengshijian, DateUtil.now()); + if (!between.isNegative()) { //between.isNegative() true ,现在时间小于任务结束时间,false消灾时间大于任务结束时间 + expireNum++; + } + }catch (Exception e){ + e.printStackTrace(); + continue; } } @@ -474,7 +478,7 @@ public class HomePageServiceImpl implements IHomePageService { if(StringUtils.contains(historicActivityInstance.getActivityName(), "审批")){ map.put("审批中", map.get("审批中") == null ? 1 : map.get("审批中") + 1); }else{ - map.put("运行中", map.get("运行中") == null ? 1 : map.get("运行中") + 1); + map.put("进行中", map.get("进行中") == null ? 1 : map.get("进行中") + 1); } // map.put(historicActivityInstance.getActivityName(), map.get(historicActivityInstance.getActivityName()) == null ? 1 : map.get(historicActivityInstance.getActivityName()) + 1); } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/service/impl/AutoStartModelServiceImpl.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/service/impl/AutoStartModelServiceImpl.java index 7cd7cfc..8079032 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/service/impl/AutoStartModelServiceImpl.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/service/impl/AutoStartModelServiceImpl.java @@ -109,6 +109,7 @@ public class AutoStartModelServiceImpl extends BaseServiceImpl{ - // identityService.setAuthenticatedUserId(map.get("applyUser").toString()); - //开始时间 - String start = map.get("start").toString(); //definitationid String processDefId = map.get("defid").toString(); //defnationkey String defKey = map.get("defkey").toString(); - //重复次数 - Integer repeatNum = Integer.parseInt(map.get("repeatnum").toString()); - //实例id - String processinstanceId = map.get("processinstanceid").toString(); - //角色名称 - String createRoleName = map.get("createRoleName").toString(); map.remove("defid"); map.remove("defkey"); map.remove("repeatnum"); map.remove("processinstanceid"); - //如果是技术员发起的一般任务,直接指定assignee = 公司 - if(Func.equals(createRoleName, WfProcessConstant.COMMENT_ROLE_NAME) && Func.equals(map.get("$renwudengji"), WfProcessConstant.COMMENT_TASK_LEVEL)){ - map.put("assignee",map.get("yunweigongsi")); - } + wfProcessService.autoStartProcessInstanceById(processDefId, defKey, map); - wfProcessService.autoStartProcessInstanceById(processDefId,defKey,map); }); } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatQuarterClass.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatQuarterClass.java index 013ea95..b848c46 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatQuarterClass.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatQuarterClass.java @@ -42,32 +42,19 @@ public class RepeatQuarterClass implements RepeatOperation{ if(now.equals(localDate)){ list.forEach(map ->{ - // + identityService.setAuthenticatedUserId(map.get("applyUser").toString()); - //开始时间 - String start = map.get("start").toString(); //definitationid String processDefId = map.get("defid").toString(); //defnationkey String defKey = map.get("defkey").toString(); - //重复次数 - Integer repeatNum = Integer.parseInt(map.get("repeatnum").toString()); - //实例id - String processinstanceId = map.get("processinstanceid").toString(); - //角色名称 - String createRoleName = map.get("createRoleName").toString(); map.remove("defid"); map.remove("defkey"); map.remove("repeatnum"); map.remove("processinstanceid"); - //如果是技术员发起的一般任务,直接指定assignee = 公司 - if(Func.equals(createRoleName, WfProcessConstant.COMMENT_ROLE_NAME) && Func.equals(map.get("$renwudengji"), WfProcessConstant.COMMENT_TASK_LEVEL)){ - map.put("assignee",map.get("yunweigongsi")); - } - wfProcessService.autoStartProcessInstanceById(processDefId,defKey,map); }); diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatWeekClass.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatWeekClass.java index 77ad13e..ee6c013 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatWeekClass.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/util/RepeatWeekClass.java @@ -55,47 +55,12 @@ public class RepeatWeekClass implements RepeatOperation{ //defnationkey String defKey = map.get("defkey").toString(); - //实例id - String processinstanceId = map.get("processinstanceid").toString(); - //角色名称 - String createRoleName = map.get("createRoleName").toString(); - map.remove("defid"); map.remove("defkey"); map.remove("repeatnum"); map.remove("processinstanceid"); - //如果是技术员发起的一般任务,直接指定assignee = 公司 - if(Func.equals(createRoleName, WfProcessConstant.COMMENT_ROLE_NAME) && Func.equals(map.get("$renwudengji"), WfProcessConstant.COMMENT_TASK_LEVEL)){ - map.put("assignee",map.get("yunweigongsi")); - } - - String processInstanceId = wfProcessService.autoStartProcessInstanceById(processDefId, defKey, map); - ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); - - -// boolean b = false; -// while(!b){ -// List list1 = taskService.createTaskQuery().processInstanceId(processInstanceId).list(); -// while(list1.size() > 0){ -// for(Task task :list1){ -// String name = task.getName(); -// if(!StringUtils.contains(name,"运维公司执行任务")){ -// taskService.complete(task.getId()); -// try { -// Thread.sleep(2000); -// }catch (Exception e){ -// e.printStackTrace(); -// } -// }else{ -// b = true; -// } -// } -// } -// } - - - + wfProcessService.autoStartProcessInstanceById(processDefId, defKey, map); }); } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/vo/AutoStartModelVO.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/vo/AutoStartModelVO.java index 4b8f919..85b20c3 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/vo/AutoStartModelVO.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workbench/vo/AutoStartModelVO.java @@ -32,4 +32,8 @@ public class AutoStartModelVO implements Serializable { private String taskId; + private Integer isBreak; + + private Date breakTime; + }