diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/enumutil/TaskTypeColorEnum.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/enumutil/TaskTypeColorEnum.java new file mode 100644 index 0000000..ad6cf66 --- /dev/null +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/enumutil/TaskTypeColorEnum.java @@ -0,0 +1,46 @@ +package org.springblade.plugin.homepage.enumutil; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description 首页种类统计,饼图中不同类型对应的颜色 + * @Author ytl + * @Date 2023/2/17 0017 17:10 + */ +public enum TaskTypeColorEnum { + 数据管理("1624972213268574210", "#2689FF"), + 网络终端维护("1624972340112715778", "#6F33FF"), + 办公系统维护("1624972396853260289", "#2356F7"), + 系统优化("1624972448317370369", "#00C374"), + 网站维护("1624972507981344769", "#00CFDC"), + 公众号APP维护("1624972606014812162", "#FD4D66"); + + + private String code; + private String value; + + TaskTypeColorEnum(String code, String value){ + this.code = code; + this.value = value; + } + + public String getCode(){ + return code; + } + + public String getValue(){ + return value; + } + + + public static Map getAllToMap() { + Map re = new HashMap<>(); + TaskTypeColorEnum[] values = values(); + for(TaskTypeColorEnum r:values){ + re.put(r.code, r.getValue()); + } + return re; + } + +} 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 c152485..cfe492b 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 @@ -12,15 +12,14 @@ import org.flowable.engine.history.HistoricProcessInstanceQuery; import org.flowable.task.api.Task; import org.flowable.task.api.TaskQuery; import org.flowable.variable.api.history.HistoricVariableInstance; -import org.flowable.variable.api.history.HistoricVariableInstanceQuery; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.plugin.homepage.enumutil.TaskTypeColorEnum; import org.springblade.plugin.homepage.service.IHomePageService; import org.springblade.plugin.workflow.core.utils.WfTaskUtil; import org.springblade.system.cache.DictBizCache; -import org.springblade.system.entity.DictBiz; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springframework.stereotype.Service; @@ -272,12 +271,12 @@ public class HomePageServiceImpl implements IHomePageService { LinkedHashMap map = new LinkedHashMap<>(); //根据工作流查询任务种类 collect.stream().forEach(his ->{ - HistoricVariableInstance renwuzhonglei = historyService.createHistoricVariableInstanceQuery().processInstanceId(his.getId()) - .variableName("$renwuzhonglei").singleResult(); - System.out.println("renwu zhonglei--" + renwuzhonglei); - if(!Func.isEmpty(renwuzhonglei)){ - if(renwuzhonglei.getValue() != null){ - Object renwuzhongleiValue = renwuzhonglei.getValue(); + HistoricVariableInstance renwufulei = historyService.createHistoricVariableInstanceQuery().processInstanceId(his.getId()) + .variableName("renwufulei").singleResult(); + System.out.println("renwu renwufulei--" + renwufulei); + if(!Func.isEmpty(renwufulei)){ + if(renwufulei.getValue() != null){ + Object renwuzhongleiValue = renwufulei.getValue(); map.put(String.valueOf(renwuzhongleiValue), map.get(String.valueOf(renwuzhongleiValue)) == null ? 1: map.get(String.valueOf(renwuzhongleiValue)) + 1); } } @@ -289,8 +288,12 @@ public class HomePageServiceImpl implements IHomePageService { Map.Entry next = iterator.next(); JSONObject jsonByDict = new JSONObject(); - jsonByDict.put("name",next.getKey()); + + jsonByDict.put("name", DictBizCache.getById(Long.parseLong(next.getKey())).getDictValue()); jsonByDict.put("value",next.getValue()); + JSONObject color = new JSONObject(); + color.put("color", TaskTypeColorEnum.getAllToMap().get(next.getKey())); + jsonByDict.put("itemStyle", color); result.add(jsonByDict); } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/model/WfProcess.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/model/WfProcess.java index bfb878e..da545fe 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/model/WfProcess.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/model/WfProcess.java @@ -242,4 +242,6 @@ public class WfProcess implements Serializable { */ private String formSearch; + private List> uploadrecord; + } diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/service/impl/WfProcessService.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/service/impl/WfProcessService.java index ca0787f..13ebef2 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/service/impl/WfProcessService.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/service/impl/WfProcessService.java @@ -576,6 +576,11 @@ public class WfProcessService implements IWfProcessService { process.setTaskDefinitionKey(task.getTaskDefinitionKey()); runtimeService.setVariable(task.getProcessInstanceId(), "wf_latest_task_assignee", WfTaskUtil.getTaskUser()); + //重新给上传附件赋值,把新增的上传加上 + if(!Func.isEmpty(process.getUploadrecord())){ + runtimeService.setVariable(task.getExecutionId(), "uploadrecord", process.getUploadrecord()); + } + if (process.isPass()) { // 审核通过 this.passTask(process, task); } else { // 审核不通过