1.首页"种类统计"返回的数据增加颜色

2.技术员发起的普通任务开启流程的时候直接指定运维公司
3.审批节点的时候增加的上传文件也添加到流程变量中
main
yitonglei 3 years ago
parent 85e31bb6ec
commit 11a1a4aaf3
  1. 46
      lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/enumutil/TaskTypeColorEnum.java
  2. 21
      lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/homepage/service/impl/HomePageServiceImpl.java
  3. 2
      lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/model/WfProcess.java
  4. 5
      lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/process/service/impl/WfProcessService.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<String,String> getAllToMap() {
Map<String,String> re = new HashMap<>();
TaskTypeColorEnum[] values = values();
for(TaskTypeColorEnum r:values){
re.put(r.code, r.getValue());
}
return re;
}
}

@ -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<String,Integer> 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<String, Integer> 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);
}

@ -242,4 +242,6 @@ public class WfProcess implements Serializable {
*/
private String formSearch;
private List<Map<String,Object>> uploadrecord;
}

@ -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 { // 审核不通过

Loading…
Cancel
Save