完善oa代码
This commit is contained in:
parent
70e8af9edd
commit
43d40f5373
@ -37,9 +37,9 @@ public class OaRouteController extends DefaultBaseController {
|
||||
return mv;
|
||||
}
|
||||
|
||||
@GetMapping("list-log")
|
||||
@GetMapping("list-process-log")
|
||||
public ModelAndView listLog() {
|
||||
ModelAndView mv = new ModelAndView("oa/list-log");
|
||||
ModelAndView mv = new ModelAndView("oa/list-process-log");
|
||||
return mv;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,18 @@ public class OaHistoryTaskDTO {
|
||||
private String formKey;
|
||||
private String formCode;
|
||||
private Integer formVersion;
|
||||
private String reportUid;
|
||||
private String processInstanceId;
|
||||
private String processName;
|
||||
private String processStartTime;
|
||||
private String processEndTime;
|
||||
private String mainTitle;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String startUserId;
|
||||
private String startUserName;
|
||||
private String startUserDepartmentIds;
|
||||
private String startUserDepartmentNames;
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId == null ? "" : taskId.trim();
|
||||
@ -68,6 +79,14 @@ public class OaHistoryTaskDTO {
|
||||
this.formVersion = formVersion;
|
||||
}
|
||||
|
||||
public String getReportUid() {
|
||||
return reportUid == null ? "" : reportUid.trim();
|
||||
}
|
||||
|
||||
public void setReportUid(String reportUid) {
|
||||
this.reportUid = reportUid;
|
||||
}
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId == null ? "" : processInstanceId.trim();
|
||||
}
|
||||
@ -75,4 +94,84 @@ public class OaHistoryTaskDTO {
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getProcessName() {
|
||||
return processName == null ? "" : processName.trim();
|
||||
}
|
||||
|
||||
public void setProcessName(String processName) {
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public String getMainTitle() {
|
||||
return mainTitle == null ? "" : mainTitle.trim();
|
||||
}
|
||||
|
||||
public void setMainTitle(String mainTitle) {
|
||||
this.mainTitle = mainTitle;
|
||||
}
|
||||
|
||||
public String getProcessStartTime() {
|
||||
return processStartTime == null ? "" : processStartTime.trim();
|
||||
}
|
||||
|
||||
public void setProcessStartTime(String processStartTime) {
|
||||
this.processStartTime = processStartTime;
|
||||
}
|
||||
|
||||
public String getProcessEndTime() {
|
||||
return processEndTime == null ? "" : processEndTime.trim();
|
||||
}
|
||||
|
||||
public void setProcessEndTime(String processEndTime) {
|
||||
this.processEndTime = processEndTime;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime == null ? "" : startTime.trim();
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime == null ? "" : endTime.trim();
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getStartUserId() {
|
||||
return startUserId == null ? "" : startUserId.trim();
|
||||
}
|
||||
|
||||
public void setStartUserId(String startUserId) {
|
||||
this.startUserId = startUserId;
|
||||
}
|
||||
|
||||
public String getStartUserName() {
|
||||
return startUserName == null ? "" : startUserName.trim();
|
||||
}
|
||||
|
||||
public void setStartUserName(String startUserName) {
|
||||
this.startUserName = startUserName;
|
||||
}
|
||||
|
||||
public String getStartUserDepartmentIds() {
|
||||
return startUserDepartmentIds == null ? "" : startUserDepartmentIds.trim();
|
||||
}
|
||||
|
||||
public void setStartUserDepartmentIds(String startUserDepartmentIds) {
|
||||
this.startUserDepartmentIds = startUserDepartmentIds;
|
||||
}
|
||||
|
||||
public String getStartUserDepartmentNames() {
|
||||
return startUserDepartmentNames == null ? "" : startUserDepartmentNames.trim();
|
||||
}
|
||||
|
||||
public void setStartUserDepartmentNames(String startUserDepartmentNames) {
|
||||
this.startUserDepartmentNames = startUserDepartmentNames;
|
||||
}
|
||||
}
|
||||
|
@ -27,19 +27,32 @@ public class OaTaskDTO {
|
||||
private String getFormKey;
|
||||
@ApiModelProperty(name = "reportUid", value = "上报表单UID")
|
||||
private String reportUid;
|
||||
@ApiModelProperty(name = "reportTitle", value = "上报表单标题")
|
||||
private String reportTitle;
|
||||
@ApiModelProperty(name = "mainTitle", value = "上报表单主标题")
|
||||
private String mainTitle;
|
||||
@ApiModelProperty(name = "owner", value = "所有者")
|
||||
private String owner;
|
||||
@ApiModelProperty(name = "taskDefinitionKey", value = "任务定义Key")
|
||||
private String taskDefinitionKey;
|
||||
@ApiModelProperty(name = "processDefinitionId", value = "流程定义ID")
|
||||
private String processDefinitionId;
|
||||
|
||||
@ApiModelProperty(name = "processInstanceId", value = "流程实例ID")
|
||||
private String processInstanceId;
|
||||
@ApiModelProperty(name = "processName", value = "流程名称")
|
||||
private String processName;
|
||||
@ApiModelProperty(name = "isNeedClaim", value = "是否需要认领")
|
||||
private Integer isNeedClaim;
|
||||
@ApiModelProperty(name = "startUserId", value = "发起人用户ID")
|
||||
private String startUserId;
|
||||
@ApiModelProperty(name = "startUserName", value = "发起人昵称")
|
||||
private String startUserName;
|
||||
@ApiModelProperty(name = "startUserDepartmentIds", value = "发起人部门ID")
|
||||
private String startUserDepartmentIds;
|
||||
@ApiModelProperty(name = "startUserDepartmentNames", value = "发起人部门名称")
|
||||
private String startUserDepartmentNames;
|
||||
@ApiModelProperty(name = "createTime", value = "创建时间")
|
||||
private String createTime;
|
||||
@ApiModelProperty(name = "processStartTime", value = "流程开始时间")
|
||||
private String processStartTime;
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId == null ? "" : taskId.trim();
|
||||
@ -97,12 +110,12 @@ public class OaTaskDTO {
|
||||
this.reportUid = reportUid;
|
||||
}
|
||||
|
||||
public String getReportTitle() {
|
||||
return reportTitle == null ? "" : reportTitle.trim();
|
||||
public String getMainTitle() {
|
||||
return mainTitle == null ? "" : mainTitle.trim();
|
||||
}
|
||||
|
||||
public void setReportTitle(String reportTitle) {
|
||||
this.reportTitle = reportTitle;
|
||||
public void setMainTitle(String mainTitle) {
|
||||
this.mainTitle = mainTitle;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
@ -137,6 +150,14 @@ public class OaTaskDTO {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getProcessName() {
|
||||
return processName == null ? "" : processName.trim();
|
||||
}
|
||||
|
||||
public void setProcessName(String processName) {
|
||||
this.processName = processName;
|
||||
}
|
||||
|
||||
public Integer getIsNeedClaim() {
|
||||
return isNeedClaim == null ? 0 : isNeedClaim;
|
||||
}
|
||||
@ -144,4 +165,52 @@ public class OaTaskDTO {
|
||||
public void setIsNeedClaim(Integer isNeedClaim) {
|
||||
this.isNeedClaim = isNeedClaim;
|
||||
}
|
||||
|
||||
public String getStartUserId() {
|
||||
return startUserId == null ? "" : startUserId.trim();
|
||||
}
|
||||
|
||||
public void setStartUserId(String startUserId) {
|
||||
this.startUserId = startUserId;
|
||||
}
|
||||
|
||||
public String getStartUserName() {
|
||||
return startUserName == null ? "" : startUserName.trim();
|
||||
}
|
||||
|
||||
public void setStartUserName(String startUserName) {
|
||||
this.startUserName = startUserName;
|
||||
}
|
||||
|
||||
public String getStartUserDepartmentIds() {
|
||||
return startUserDepartmentIds == null ? "" : startUserDepartmentIds.trim();
|
||||
}
|
||||
|
||||
public void setStartUserDepartmentIds(String startUserDepartmentIds) {
|
||||
this.startUserDepartmentIds = startUserDepartmentIds;
|
||||
}
|
||||
|
||||
public String getStartUserDepartmentNames() {
|
||||
return startUserDepartmentNames == null ? "" : startUserDepartmentNames.trim();
|
||||
}
|
||||
|
||||
public void setStartUserDepartmentNames(String startUserDepartmentNames) {
|
||||
this.startUserDepartmentNames = startUserDepartmentNames;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime == null ? "" : createTime.trim();
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getProcessStartTime() {
|
||||
return processStartTime == null ? "" : processStartTime.trim();
|
||||
}
|
||||
|
||||
public void setProcessStartTime(String processStartTime) {
|
||||
this.processStartTime = processStartTime;
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ public interface IOaFormReportService {
|
||||
String KEY_FORM_VERSION = "formVersion";
|
||||
String KEY_REPORT_UID = "reportUid";
|
||||
String KEY_ASSIGNEE_USER = "assigneeUser";
|
||||
String KEY_START_ASSIGNEE_USER = "startAssigneeUser";
|
||||
String KEY_ASSIGNEES = "assignees";
|
||||
String KEY_SELECT_TYPE = "selectType";
|
||||
String KEY_IS_NEXT_END_EVENT = "isNextEndEvent";
|
||||
@ -112,6 +113,16 @@ public interface IOaFormReportService {
|
||||
*/
|
||||
List<Map<String, Object>> list(String formCode, Integer formVersion, Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param formCode 表单编码
|
||||
* @param formVersion 表单版本
|
||||
* @param uids uie列表
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> list(String formCode, Integer formVersion, List<String> uids);
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
|
@ -8,6 +8,7 @@ import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import org.activiti.engine.IdentityService;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
@ -35,6 +36,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
private RuntimeService runtimeService;
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
@Autowired
|
||||
private IdentityService identityService;
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, Map<String, Object> params) {
|
||||
@ -67,7 +70,8 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
variables.put(KEY_FORM_CODE, formCode);
|
||||
variables.put(KEY_FORM_VERSION, formVersion);
|
||||
variables.put(KEY_REPORT_UID, uid);
|
||||
variables.put(KEY_ASSIGNEE_USER, userId);
|
||||
variables.put(KEY_START_ASSIGNEE_USER, userId);
|
||||
identityService.setAuthenticatedUserId(userId);
|
||||
LOG.debug("发起流程");
|
||||
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, variables);
|
||||
LOG.debug("更新表单数据的流程实例ID");
|
||||
@ -151,6 +155,13 @@ public class OaFormReportServiceImpl extends DefaultBaseService implements IOaFo
|
||||
return formReportService.list(formCode, formVersion, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> list(String formCode, Integer formVersion, List<String> uids) {
|
||||
Map<String, Object> params = getHashMap(6);
|
||||
params.put("uids", uids);
|
||||
return formReportService.list(formCode, formVersion, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<Map<String, Object>>> listPage(String formCode, Integer formVersion, ListPage page) {
|
||||
return formReportService.listPage(formCode, formVersion, page);
|
||||
|
@ -1,6 +1,8 @@
|
||||
package ink.wgink.module.activiti.service.oa.impl;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.interfaces.department.IDepartmentBaseService;
|
||||
import ink.wgink.interfaces.department.IDepartmentUserBaseService;
|
||||
import ink.wgink.interfaces.user.IUserBaseService;
|
||||
import ink.wgink.module.activiti.enums.oa.ProcessTaskStatusEnum;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.OaHistoryTaskDTO;
|
||||
@ -10,16 +12,22 @@ import ink.wgink.module.activiti.pojo.dtos.oa.OaTaskDTO;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaService;
|
||||
import ink.wgink.module.form.pojo.dtos.design.FormDTO;
|
||||
import ink.wgink.module.form.service.design.IFormDesignService;
|
||||
import ink.wgink.module.form.service.design.IFormService;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentDTO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.util.ArrayListUtil;
|
||||
import ink.wgink.util.date.DateUtil;
|
||||
import ink.wgink.util.string.WStringUtil;
|
||||
import org.activiti.engine.*;
|
||||
import org.activiti.engine.history.HistoricProcessInstance;
|
||||
import org.activiti.engine.history.HistoricTaskInstance;
|
||||
import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.repository.ProcessDefinitionQuery;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.IdentityLink;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.activiti.engine.task.TaskQuery;
|
||||
@ -54,6 +62,12 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
private IFormService iFormService;
|
||||
@Autowired
|
||||
private IUserBaseService userBaseService;
|
||||
@Autowired
|
||||
private IDepartmentBaseService departmentBaseService;
|
||||
@Autowired
|
||||
private IDepartmentUserBaseService departmentUserBaseService;
|
||||
@Autowired
|
||||
private IOaFormReportService oaFormReportService;
|
||||
|
||||
@Override
|
||||
public List<OaProcdefDTO> listProcdef() {
|
||||
@ -114,7 +128,7 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
public List<OaTaskDTO> listTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
List<Task> tasks = taskQuery.list();
|
||||
List<Task> tasks = taskQuery.includeProcessVariables().list();
|
||||
return listOaTask(tasks);
|
||||
}
|
||||
|
||||
@ -122,7 +136,7 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(int page, int rows) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
List<Task> tasks = taskQuery.listPage(page - 1, rows);
|
||||
List<Task> tasks = taskQuery.includeProcessVariables().listPage(page - 1, rows);
|
||||
List<OaTaskDTO> oaTaskDTOs = listOaTask(tasks);
|
||||
return new SuccessResultList<>(oaTaskDTOs, page, taskQuery.count());
|
||||
}
|
||||
@ -135,10 +149,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
*/
|
||||
private List<OaTaskDTO> listOaTask(List<Task> tasks) {
|
||||
List<OaTaskDTO> oaTaskDTOs = new ArrayList<>();
|
||||
// 流程实例列表
|
||||
Set<String> processInstanceIdSet = new HashSet<>();
|
||||
// 发起人列表
|
||||
Set<String> startUserIdSet = new HashSet<>();
|
||||
|
||||
tasks.forEach(task -> {
|
||||
OaTaskDTO oaTaskDTO = new OaTaskDTO();
|
||||
oaTaskDTOs.add(oaTaskDTO);
|
||||
|
||||
processInstanceIdSet.add(task.getProcessInstanceId());
|
||||
|
||||
oaTaskDTO.setTaskId(task.getId());
|
||||
oaTaskDTO.setTaskName(task.getName());
|
||||
oaTaskDTO.setTaskDescription(task.getDescription());
|
||||
@ -147,15 +168,28 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
oaTaskDTO.setProcessDefinitionId(task.getProcessDefinitionId());
|
||||
oaTaskDTO.setProcessInstanceId(task.getProcessInstanceId());
|
||||
oaTaskDTO.setIsNeedClaim(StringUtils.isBlank(task.getAssignee()) ? 1 : 0);
|
||||
|
||||
Map<String, Object> variables = runtimeService.getVariables(task.getProcessInstanceId());
|
||||
oaTaskDTO.setCreateTime(DateUtil.getDateTime(task.getCreateTime()));
|
||||
Map<String, Object> variables = task.getProcessVariables();
|
||||
if (variables.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
oaTaskDTO.setFormCode(variables.get(IOaFormReportService.KEY_FORM_CODE).toString());
|
||||
oaTaskDTO.setFormVersion(Integer.parseInt(variables.get(IOaFormReportService.KEY_FORM_VERSION).toString()));
|
||||
oaTaskDTO.setReportUid(variables.get(IOaFormReportService.KEY_REPORT_UID).toString());
|
||||
String formCode = (String) variables.get(IOaFormReportService.KEY_FORM_CODE);
|
||||
Integer formVersion = (Integer) variables.get(IOaFormReportService.KEY_FORM_VERSION);
|
||||
String reportUid = (String) variables.get(IOaFormReportService.KEY_REPORT_UID);
|
||||
oaTaskDTO.setFormCode(formCode);
|
||||
oaTaskDTO.setFormVersion(formVersion);
|
||||
oaTaskDTO.setReportUid(reportUid);
|
||||
|
||||
String mainTitle = getMainTitle(formCode, formVersion, reportUid);
|
||||
if (StringUtils.isBlank(mainTitle)) {
|
||||
oaTaskDTO.setMainTitle("新任务需要处理");
|
||||
} else {
|
||||
oaTaskDTO.setMainTitle(mainTitle);
|
||||
}
|
||||
});
|
||||
|
||||
setProcessNameAndStartUserId(oaTaskDTOs, processInstanceIdSet, startUserIdSet);
|
||||
setStartUser(oaTaskDTOs, startUserIdSet);
|
||||
return oaTaskDTOs;
|
||||
}
|
||||
|
||||
@ -163,7 +197,7 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(userId);
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.list();
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.includeProcessVariables().finished().list();
|
||||
return listOaHistoryTask(historicTaskInstances);
|
||||
}
|
||||
|
||||
@ -171,7 +205,7 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
public SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(int page, int rows) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(userId);
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.listPage(page - 1, rows);
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.includeProcessVariables().finished().listPage(page - 1, rows);
|
||||
List<OaHistoryTaskDTO> oaHistoryTaskDTOs = listOaHistoryTask(historicTaskInstances);
|
||||
return new SuccessResultList<>(oaHistoryTaskDTOs, page, historicTaskInstanceQuery.count());
|
||||
}
|
||||
@ -243,14 +277,216 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
|
||||
private List<OaHistoryTaskDTO> listOaHistoryTask(List<HistoricTaskInstance> historicTaskInstances) {
|
||||
List<OaHistoryTaskDTO> oaHistoryTaskDTOs = new ArrayList<>();
|
||||
|
||||
// 流程实例列表
|
||||
Set<String> processInstanceIdSet = new HashSet<>();
|
||||
// 发起人列表
|
||||
Set<String> startUserIdSet = new HashSet<>();
|
||||
|
||||
historicTaskInstances.forEach(historicTaskInstance -> {
|
||||
OaHistoryTaskDTO oaHistoryTaskDTO = new OaHistoryTaskDTO();
|
||||
oaHistoryTaskDTOs.add(oaHistoryTaskDTO);
|
||||
|
||||
processInstanceIdSet.add(historicTaskInstance.getProcessInstanceId());
|
||||
|
||||
oaHistoryTaskDTO.setTaskId(historicTaskInstance.getId());
|
||||
oaHistoryTaskDTO.setTaskName(historicTaskInstance.getName());
|
||||
oaHistoryTaskDTO.setProcessInstanceId(historicTaskInstance.getProcessInstanceId());
|
||||
oaHistoryTaskDTOs.add(oaHistoryTaskDTO);
|
||||
oaHistoryTaskDTO.setStartTime(DateUtil.getDateTime(historicTaskInstance.getStartTime()));
|
||||
oaHistoryTaskDTO.setEndTime(DateUtil.getDateTime(historicTaskInstance.getEndTime()));
|
||||
|
||||
Map<String, Object> processVariables = historicTaskInstance.getProcessVariables();
|
||||
String formCode = (String) processVariables.get(IOaFormReportService.KEY_FORM_CODE);
|
||||
Integer formVersion = (Integer) processVariables.get(IOaFormReportService.KEY_FORM_VERSION);
|
||||
String reportUid = (String) processVariables.get(IOaFormReportService.KEY_REPORT_UID);
|
||||
String mainTitle = getMainTitle(formCode, formVersion, reportUid);
|
||||
oaHistoryTaskDTO.setFormCode(formCode);
|
||||
oaHistoryTaskDTO.setFormVersion(formVersion);
|
||||
oaHistoryTaskDTO.setReportUid(reportUid);
|
||||
if (StringUtils.isBlank(mainTitle)) {
|
||||
oaHistoryTaskDTO.setMainTitle("新任务需要处理");
|
||||
} else {
|
||||
oaHistoryTaskDTO.setMainTitle(mainTitle);
|
||||
}
|
||||
});
|
||||
|
||||
// 流程定义列表
|
||||
setHistoryProcessNameAndStartUserId(oaHistoryTaskDTOs, processInstanceIdSet, startUserIdSet);
|
||||
setHistoryStartUser(oaHistoryTaskDTOs, startUserIdSet);
|
||||
return oaHistoryTaskDTOs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置流程名称和发起人
|
||||
*
|
||||
* @param oaTaskDTOs
|
||||
* @param processInstanceIds
|
||||
* @param startUserIdSet
|
||||
*/
|
||||
private void setProcessNameAndStartUserId(List<OaTaskDTO> oaTaskDTOs, Set<String> processInstanceIdSet, Set<String> startUserIdSet) {
|
||||
if (oaTaskDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (processInstanceIdSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().processInstanceIds(processInstanceIdSet).list();
|
||||
oaTaskDTOs.forEach(oaTaskDTO -> {
|
||||
processInstances.forEach(processInstance -> {
|
||||
if (!StringUtils.equals(oaTaskDTO.getProcessInstanceId(), processInstance.getProcessInstanceId())) {
|
||||
return;
|
||||
}
|
||||
startUserIdSet.add(processInstance.getStartUserId());
|
||||
oaTaskDTO.setProcessName(processInstance.getProcessDefinitionName());
|
||||
oaTaskDTO.setProcessStartTime(DateUtil.getDateTime(processInstance.getStartTime()));
|
||||
oaTaskDTO.setStartUserId(processInstance.getStartUserId());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置发起人
|
||||
*
|
||||
* @param oaTaskDTOs
|
||||
* @param startUserIdSet
|
||||
*/
|
||||
private void setStartUser(List<OaTaskDTO> oaTaskDTOs, Set<String> startUserIdSet) {
|
||||
if (oaTaskDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (startUserIdSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<UserDTO> userDTOs = userBaseService.listByUserIds(startUserIdSet.stream().collect(Collectors.toList()));
|
||||
if (userDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> userIds = ArrayListUtil.listBeanStringIdValue(userDTOs, "userId", UserDTO.class);
|
||||
List<DepartmentUserDTO> departmentUserDTOs = departmentUserBaseService.listByUserIds(userIds);
|
||||
List<String> departmentIds = ArrayListUtil.listBeanStringIdValue(departmentUserDTOs, "departmentId", DepartmentUserDTO.class);
|
||||
List<DepartmentDTO> departmentDTOs = departmentBaseService.listByIds(departmentIds);
|
||||
for (OaTaskDTO oaTaskDTO : oaTaskDTOs) {
|
||||
for (DepartmentUserDTO departmentUserDTO : departmentUserDTOs) {
|
||||
if (!StringUtils.equals(oaTaskDTO.getStartUserId(), departmentUserDTO.getUserId())) {
|
||||
continue;
|
||||
}
|
||||
for (DepartmentDTO departmentDTO : departmentDTOs) {
|
||||
if (!StringUtils.equals(departmentUserDTO.getDepartmentId(), departmentDTO.getDepartmentId())) {
|
||||
continue;
|
||||
}
|
||||
String startUserDepartmentIds = oaTaskDTO.getStartUserDepartmentIds();
|
||||
String startUserDepartmentNames = oaTaskDTO.getStartUserDepartmentNames();
|
||||
if (!StringUtils.isBlank(startUserDepartmentIds)) {
|
||||
startUserDepartmentIds += ",";
|
||||
startUserDepartmentNames += ",";
|
||||
}
|
||||
startUserDepartmentIds += departmentDTO.getDepartmentId();
|
||||
startUserDepartmentNames += departmentDTO.getDepartmentName();
|
||||
oaTaskDTO.setStartUserDepartmentIds(startUserDepartmentIds);
|
||||
oaTaskDTO.setStartUserDepartmentNames(startUserDepartmentNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置流程名称和发起人
|
||||
*
|
||||
* @param oaHistoryTaskDTOs
|
||||
* @param processInstanceIdSet
|
||||
* @param startUserIdSet
|
||||
*/
|
||||
private void setHistoryProcessNameAndStartUserId(List<OaHistoryTaskDTO> oaHistoryTaskDTOs, Set<String> processInstanceIdSet, Set<String> startUserIdSet) {
|
||||
if (oaHistoryTaskDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (processInstanceIdSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<HistoricProcessInstance> historicProcessInstances = historyService.createHistoricProcessInstanceQuery().processInstanceIds(processInstanceIdSet).list();
|
||||
oaHistoryTaskDTOs.forEach(oaHistoryTaskDTO -> {
|
||||
historicProcessInstances.forEach(historicProcessInstance -> {
|
||||
if (!StringUtils.equals(oaHistoryTaskDTO.getProcessInstanceId(), historicProcessInstance.getId())) {
|
||||
return;
|
||||
}
|
||||
startUserIdSet.add(historicProcessInstance.getStartUserId());
|
||||
oaHistoryTaskDTO.setProcessName(historicProcessInstance.getProcessDefinitionName());
|
||||
oaHistoryTaskDTO.setProcessStartTime(DateUtil.getDateTime(historicProcessInstance.getStartTime()));
|
||||
oaHistoryTaskDTO.setProcessEndTime(historicProcessInstance.getEndTime() == null ? "" : DateUtil.getDateTime(historicProcessInstance.getEndTime()));
|
||||
historicProcessInstance.getEndTime();
|
||||
oaHistoryTaskDTO.setStartUserId(historicProcessInstance.getStartUserId());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置发起人
|
||||
*
|
||||
* @param oaHistoryTaskDTOs
|
||||
* @param startUserIdSet
|
||||
*/
|
||||
private void setHistoryStartUser(List<OaHistoryTaskDTO> oaHistoryTaskDTOs, Set<String> startUserIdSet) {
|
||||
if (oaHistoryTaskDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (startUserIdSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<UserDTO> userDTOs = userBaseService.listByUserIds(startUserIdSet.stream().collect(Collectors.toList()));
|
||||
if (userDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> userIds = ArrayListUtil.listBeanStringIdValue(userDTOs, "userId", UserDTO.class);
|
||||
List<DepartmentUserDTO> departmentUserDTOs = departmentUserBaseService.listByUserIds(userIds);
|
||||
List<String> departmentIds = ArrayListUtil.listBeanStringIdValue(departmentUserDTOs, "departmentId", DepartmentUserDTO.class);
|
||||
List<DepartmentDTO> departmentDTOs = departmentBaseService.listByIds(departmentIds);
|
||||
for (OaHistoryTaskDTO oaHistoryTaskDTO : oaHistoryTaskDTOs) {
|
||||
for (DepartmentUserDTO departmentUserDTO : departmentUserDTOs) {
|
||||
if (!StringUtils.equals(oaHistoryTaskDTO.getStartUserId(), departmentUserDTO.getUserId())) {
|
||||
continue;
|
||||
}
|
||||
for (DepartmentDTO departmentDTO : departmentDTOs) {
|
||||
if (!StringUtils.equals(departmentUserDTO.getDepartmentId(), departmentDTO.getDepartmentId())) {
|
||||
continue;
|
||||
}
|
||||
String startUserDepartmentIds = oaHistoryTaskDTO.getStartUserDepartmentIds();
|
||||
String startUserDepartmentNames = oaHistoryTaskDTO.getStartUserDepartmentNames();
|
||||
if (!StringUtils.isBlank(startUserDepartmentIds)) {
|
||||
startUserDepartmentIds += ",";
|
||||
startUserDepartmentNames += ",";
|
||||
}
|
||||
startUserDepartmentIds += departmentDTO.getDepartmentId();
|
||||
startUserDepartmentNames += departmentDTO.getDepartmentName();
|
||||
oaHistoryTaskDTO.setStartUserDepartmentIds(startUserDepartmentIds);
|
||||
oaHistoryTaskDTO.setStartUserDepartmentNames(startUserDepartmentNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表单上报主标题
|
||||
*
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
private String getMainTitle(String formCode, Integer formVersion, String uid) {
|
||||
Map<String, Object> reportFormMap = oaFormReportService.get(formCode, formVersion, uid);
|
||||
if (reportFormMap == null) {
|
||||
return null;
|
||||
}
|
||||
Object mainTitleObj = reportFormMap.get(IFormDesignService.FIELD_MAIN_TITLE);
|
||||
if (mainTitleObj == null) {
|
||||
return null;
|
||||
}
|
||||
String mainTitle = (String) mainTitleObj;
|
||||
if (StringUtils.isBlank(mainTitle)) {
|
||||
return null;
|
||||
}
|
||||
return mainTitle;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ var FormSelectWriteController = ['$scope', '$modal', function($scope, $modal) {
|
||||
}];
|
||||
|
||||
var FormSelectController = ['$scope', function($scope) {
|
||||
var initiator = $scope.selectedItem.properties[4];
|
||||
|
||||
$scope.form = {};
|
||||
|
||||
@ -61,6 +62,10 @@ var FormSelectController = ['$scope', function($scope) {
|
||||
$scope.property.value = '';
|
||||
$scope.property.value = $scope.form.formId;
|
||||
$scope.updatePropertyInModel($scope.property);
|
||||
|
||||
console.log(initiator);
|
||||
initiator.value = 'startAssigneeUser';
|
||||
$scope.updatePropertyInModel(initiator);
|
||||
$scope.close();
|
||||
};
|
||||
|
||||
|
@ -33,8 +33,8 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
|
||||
var MULTI_INSTANCE_VARIABLE = 'assignee';
|
||||
var NR_OF_COMPLETED_INSTANCES = 'nrOfCompletedInstances';
|
||||
var NR_OF_INSTANCES = 'nrOfInstances';
|
||||
var START_ASSIGNEE = '${startAssignee}';
|
||||
var ASSIGNEE_USER = '${assigneeUser}';
|
||||
var START_ASSIGNEE_USER = '${startAssigneeUser}';
|
||||
|
||||
$scope.oaNodeManage = {
|
||||
assignee: {
|
||||
@ -378,6 +378,15 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
|
||||
|
||||
// 更新代理人与候选人信息
|
||||
function updateAssignment() {
|
||||
// 更新手动指定单选代理人
|
||||
function updateStartAssignee() {
|
||||
assigneeProperty.value = {};
|
||||
assigneeProperty.value.assignment = {
|
||||
assignee: START_ASSIGNEE_USER,
|
||||
candidateUsers: []
|
||||
}
|
||||
$scope.updatePropertyInModel(assigneeProperty);
|
||||
}
|
||||
// 更新手动指定单选代理人
|
||||
function updateAssignee() {
|
||||
assigneeProperty.value = {};
|
||||
@ -453,6 +462,10 @@ var OaNodeManagePopupCtrl = ['$scope', '$timeout', '$http', function ($scope, $t
|
||||
}
|
||||
|
||||
var assignee = $scope.oaNodeManage.assignee;
|
||||
if($scope.isFirstUserTask) {
|
||||
updateStartAssignee();
|
||||
return;
|
||||
}
|
||||
// 普通节点
|
||||
if (assignee.nodeType === 'normal') {
|
||||
// 清空多实例选项
|
||||
|
@ -66,6 +66,15 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'taskName', width:200, title: '流程名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'taskName', width:200, title: '任务名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
@ -75,10 +84,55 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'mainTitle', width:300, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'processStartTime', width:180, title: '流程创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'processEndTime', width:180, title: '流程结束时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'startTime', width:180, title: '任务开始时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'endTime', width:180, title: '任务结束时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 100, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
return '<div class="layui-btn-group">' +
|
||||
'<button class="layui-btn layui-btn-xs" lay-event="logEvent">流转日志</button>'+
|
||||
'<button class="layui-btn layui-btn-xs layui-btn-primary" lay-event="logEvent">流转日志</button>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
@ -119,13 +173,12 @@
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
if(layEvent === 'logEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa/list-log?processInstanceId={processInstanceId}', [data.processInstanceId]),
|
||||
url: top.restAjax.path('route/oa/list-process-log?processInstanceId={processInstanceId}', [data.processInstanceId]),
|
||||
title: '流转日志',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
|
@ -1,101 +0,0 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">流转日志</li>
|
||||
<li>流转图</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<ul class="layui-timeline">
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">8月18日</h3>
|
||||
<p>
|
||||
layui 2.0 的一切准备工作似乎都已到位。发布之弦,一触即发。
|
||||
<br>不枉近百个日日夜夜与之为伴。因小而大,因弱而强。
|
||||
<br>无论它能走多远,抑或如何支撑?至少我曾倾注全心,无怨无悔 <i class="layui-icon"></i>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">8月16日</h3>
|
||||
<p>杜甫的思想核心是儒家的仁政思想,他有“<em>致君尧舜上,再使风俗淳</em>”的宏伟抱负。个人最爱的名篇有:</p>
|
||||
<ul>
|
||||
<li>《登高》</li>
|
||||
<li>《茅屋为秋风所破歌》</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h3 class="layui-timeline-title">8月15日</h3>
|
||||
<p>
|
||||
中国人民抗日战争胜利72周年
|
||||
<br>常常在想,尽管对这个国家有这样那样的抱怨,但我们的确生在了最好的时代
|
||||
<br>铭记、感恩
|
||||
<br>所有为中华民族浴血奋战的英雄将士
|
||||
<br>永垂不朽
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">过去</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<div>
|
||||
<img id="runtimeProcessImage" alt="流转图" style="width: 100%"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate'], function(){
|
||||
var $ = layui.$;
|
||||
var win = $(window)
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var processInstanceId = params.processInstanceId;
|
||||
|
||||
function init() {
|
||||
$('#runtimeProcessImage').attr('src', 'route/activiti/model/get-runtime-process-image/'+ processInstanceId);
|
||||
new Viewer(document.getElementById('runtimeProcessImage'));
|
||||
}
|
||||
init();
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,153 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<base th:href="${#request.getContextPath() + '/'}">
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||
<style>
|
||||
#runtimeProcessImageBox {position: relative;}
|
||||
#operationBtnBox {position: absolute; top: 0; left: 0;}
|
||||
.row-title {background-color: #f2f2f2;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-anim layui-anim-fadein">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">流转日志</li>
|
||||
<li>流转图</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div id="processLog" class="layui-tab-item layui-show"></div>
|
||||
<div class="layui-tab-item" style="position: relative; text-align: center;">
|
||||
<div id="runtimeProcessImageBox">
|
||||
<img id="runtimeProcessImage" alt="流转图" style="height: 100%"/>
|
||||
</div>
|
||||
<div id="operationBtnBox" class="layui-btn-group">
|
||||
<button id="searchPlus" type="button" class="layui-btn layui-btn-xs" title="放大">
|
||||
<i class="fa fa-search-plus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchMinus" type="button" class="layui-btn layui-btn-xs layui-btn-default" title="缩小">
|
||||
<i class="fa fa-search-minus" aria-hidden="true"></i>
|
||||
</button>
|
||||
<button id="searchDefault" type="button" class="layui-btn layui-btn-xs layui-btn-primary" title="还原">
|
||||
<i class="fa fa-search" aria-hidden="true"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script>
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/' //静态资源所在路径
|
||||
}).extend({
|
||||
index: 'lib/index' //主入口模块
|
||||
}).use(['index', 'form', 'laydate'], function(){
|
||||
var $ = layui.$;
|
||||
var win = $(window)
|
||||
var params = top.restAjax.params(window.location.href);
|
||||
var processInstanceId = params.processInstanceId;
|
||||
var processImageEnlargeScale = 0;
|
||||
|
||||
function initLog() {
|
||||
top.restAjax.get(top.restAjax.path('api/oa/list-process-log/process-instance-id/{processInstanceId}', [processInstanceId]), {}, null, function(code, data) {
|
||||
var ul = '<ul class="layui-timeline">';
|
||||
for(var i = 0, item; item = data[i++];) {
|
||||
var li = [
|
||||
'<li class="layui-timeline-item">',
|
||||
' <i class="layui-icon layui-timeline-axis"></i>',
|
||||
' <div class="layui-timeline-content layui-text">',
|
||||
' <h3 class="layui-timeline-title">'+ item.startTime +'</h3>',
|
||||
' <table class="layui-table">',
|
||||
' <colgroup>',
|
||||
' <col width="100">',
|
||||
' <col>',
|
||||
' </colgroup>',
|
||||
' <tbody>',
|
||||
' <tr>',
|
||||
' <td class="row-title">任务名称</td>',
|
||||
' <td>'+ item.taskName +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">节点状态</td>',
|
||||
' <td>'+ (item.taskStatus == 'alreadyDone' ? '已办' : '待办') +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">结束时间</td>',
|
||||
' <td>'+ item.endTime +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">耗时</td>',
|
||||
' <td>'+ item.usedTime +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">处理人</td>',
|
||||
' <td>'+ item.userNames +'</td>',
|
||||
' </tr>',
|
||||
' <tr>',
|
||||
' <td class="row-title">表单内容</td>',
|
||||
' <td>' +
|
||||
' <pre>'+ JSON.stringify(item.taskVariables, null, 2) +'</pre>' +
|
||||
' </td>',
|
||||
' </tr>',
|
||||
' </tbody>',
|
||||
' </table>',
|
||||
' </div>',
|
||||
'</li>'
|
||||
].join('');
|
||||
ul += li;
|
||||
}
|
||||
ul += '</ul>';
|
||||
$('#processLog').append(ul);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
function initRuntimeProcessImage() {
|
||||
$('#runtimeProcessImage').attr('src', 'route/activiti/model/get-runtime-process-image/'+ processInstanceId);
|
||||
}
|
||||
|
||||
function init() {
|
||||
$('.layui-tab-item, #runtimeProcessImageBox').css({
|
||||
height: (win.height() - 82) +'px',
|
||||
overflow: 'auto'
|
||||
});
|
||||
initLog();
|
||||
initRuntimeProcessImage();
|
||||
}
|
||||
init();
|
||||
|
||||
function setProcessImageSize() {
|
||||
$('#runtimeProcessImage').css('height', 100 + processImageEnlargeScale +'%');
|
||||
}
|
||||
|
||||
$('#searchPlus').click(function() {
|
||||
processImageEnlargeScale += 10;
|
||||
setProcessImageSize();
|
||||
})
|
||||
$('#searchMinus').click(function() {
|
||||
processImageEnlargeScale -= 10;
|
||||
setProcessImageSize();
|
||||
})
|
||||
$('#searchDefault').click(function() {
|
||||
processImageEnlargeScale = 0;
|
||||
setProcessImageSize();
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -57,7 +57,16 @@
|
||||
cols: [
|
||||
[
|
||||
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field:'taskId', width:150, title: '主键', align:'center',
|
||||
{field:'taskId', width:150, title: '任务主键', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'processName', width:150, title: '流程名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -75,13 +84,41 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 100, title: '操作', align:'center', fixed: 'right',
|
||||
{field:'mainTitle', width:300, title: '标题', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'createTime', width:180, title: '任务创建时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field:'processStartTime', width:180, title: '流程开始时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'form', width: 150, title: '操作', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(!row.formCode || !row.formVersion) {
|
||||
return '-';
|
||||
}
|
||||
return '<div class="layui-btn-group">' +
|
||||
'<button class="layui-btn layui-btn-xs" lay-event="handleEvent">处理</button>'+
|
||||
'<button class="layui-btn layui-btn-xs layui-btn-primary" lay-event="logEvent">流转日志</button>'+
|
||||
'</div>';
|
||||
}
|
||||
}
|
||||
@ -122,7 +159,6 @@
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
@ -136,6 +172,14 @@
|
||||
reloadTable();
|
||||
}
|
||||
});
|
||||
} else if(layEvent === 'logEvent') {
|
||||
top.dialog.open({
|
||||
url: top.restAjax.path('route/oa/list-process-log?processInstanceId={processInstanceId}', [data.processInstanceId]),
|
||||
title: '流转日志',
|
||||
width: '800px',
|
||||
height: '80%',
|
||||
onClose: function() {}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -194,8 +194,7 @@ public class FormReportServiceImpl extends DefaultBaseService implements IFormRe
|
||||
queryParams.put(IFormDesignService.PARAM_QUERY_LIST, queryList);
|
||||
queryParams.put(IFormDesignService.PARAM_LIST_SHOW_FIELD, listShowField(formPO));
|
||||
|
||||
List<Map<String, Object>> mapList = formReportDao.list(queryParams);
|
||||
return mapList;
|
||||
return formReportDao.list(queryParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -74,6 +74,13 @@
|
||||
df_${formCode}_v${formVersion}
|
||||
WHERE
|
||||
is_delete = 0
|
||||
<if test="uids != null and uids.size > 0">
|
||||
AND
|
||||
uid IN
|
||||
<foreach collection="uids" index="index" open="(" separator="," close=")">
|
||||
#{uids[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<trim prefix="AND">
|
||||
<foreach collection="queryList" item="item" index="index" open="" separator="AND" close="">
|
||||
${item}
|
||||
|
Loading…
Reference in New Issue
Block a user