diff --git a/imt-server/imt-framework/imt-common/src/main/java/com/inspur/framework/common/util/date/DateMappingUtils.java b/imt-server/imt-framework/imt-common/src/main/java/com/inspur/framework/common/util/date/DateMappingUtils.java new file mode 100644 index 0000000..cfc85bb --- /dev/null +++ b/imt-server/imt-framework/imt-common/src/main/java/com/inspur/framework/common/util/date/DateMappingUtils.java @@ -0,0 +1,49 @@ +package com.inspur.framework.common.util.date; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.Date; + +/** + * @Author xusd + * @Date 2024/9/10 13:55 + **/ +public class DateMappingUtils { + + /** + * 将 LocalDateTime 转换成 Date + * + * @param date LocalDateTime + * @return LocalDateTime + */ + public static Date of(LocalDateTime date) { + if (date == null) { + return null; + } + // 将此日期时间与时区相结合以创建 ZonedDateTime + ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault()); + // 本地时间线 LocalDateTime 到即时时间线 Instant 时间戳 + Instant instant = zonedDateTime.toInstant(); + // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间 + return Date.from(instant); + } + + /** + * 将 Date 转换成 LocalDateTime + * + * @param date Date + * @return LocalDateTime + */ + public static LocalDateTime of(Date date) { + if (date == null) { + return null; + } + // 转为时间戳 + Instant instant = date.toInstant(); + // UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间 + return LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); + } + +} diff --git a/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java b/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java index 059fe97..c09cb94 100644 --- a/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java +++ b/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/controller/admin/definition/BpmProcessDefinitionController.java @@ -19,6 +19,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.flowable.bpmn.model.BpmnModel; import org.flowable.bpmn.model.UserTask; import org.flowable.engine.repository.Deployment; +import org.flowable.engine.repository.Model; import org.flowable.engine.repository.ProcessDefinition; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -84,11 +85,15 @@ public class BpmProcessDefinitionController { return success(Collections.emptyList()); } + // 获得 Category Map + Map categoryMap = categoryService.getCategoryMap( + convertSet(list, ProcessDefinition::getCategory)); + // 获得 BpmProcessDefinitionInfoDO Map Map processDefinitionMap = processDefinitionService.getProcessDefinitionInfoMap( convertSet(list, ProcessDefinition::getId)); return success(BpmProcessDefinitionConvert.INSTANCE.buildProcessDefinitionList( - list, null, processDefinitionMap, null, null)); + list, null, processDefinitionMap, null, categoryMap)); } @GetMapping ("/get") diff --git a/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/convert/task/BpmActivityConvert.java b/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/convert/task/BpmActivityConvert.java index 2b93f5a..6f65fcd 100644 --- a/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/convert/task/BpmActivityConvert.java +++ b/imt-server/imt-module-bpm/imt-module-bpm-biz/src/main/java/com/inspur/module/bpm/convert/task/BpmActivityConvert.java @@ -1,6 +1,6 @@ package com.inspur.module.bpm.convert.task; -import com.inspur.framework.common.util.date.DateUtils; +import com.inspur.framework.common.util.date.DateMappingUtils; import com.inspur.module.bpm.controller.admin.task.vo.activity.BpmActivityRespVO; import org.flowable.engine.history.HistoricActivityInstance; import org.mapstruct.Mapper; @@ -15,7 +15,7 @@ import java.util.List; * * @author 芋道源码 */ -@Mapper(uses = DateUtils.class) +@Mapper(uses = DateMappingUtils.class) public interface BpmActivityConvert { BpmActivityConvert INSTANCE = Mappers.getMapper(BpmActivityConvert.class); diff --git a/imt-ui/package.json b/imt-ui/package.json index a1c2b49..f8c47ee 100644 --- a/imt-ui/package.json +++ b/imt-ui/package.json @@ -42,6 +42,7 @@ }, "dependencies": { "@babel/parser": "7.18.4", + "@form-create/element-ui": "^2.5.19", "@riophae/vue-treeselect": "0.4.0", "axios": "0.27.2", "benz-amr-recorder": "^1.1.5", @@ -49,6 +50,7 @@ "clipboard": "2.0.8", "core-js": "^3.26.0", "crypto-js": "^4.0.0", + "dayjs": "^1.11.13", "echarts": "5.4.0", "element-ui": "2.15.12", "file-saver": "2.0.5", diff --git a/imt-ui/src/api/bpm/definition.js b/imt-ui/src/api/bpm/definition.js index fad8c7b..52a31a5 100644 --- a/imt-ui/src/api/bpm/definition.js +++ b/imt-ui/src/api/bpm/definition.js @@ -16,9 +16,10 @@ export function getProcessDefinitionList(query) { }) } -export function getProcessDefinitionBpmnXML(id) { +export function getProcessDefinitionBpmnXML(id,key) { return request({ - url: '/bpm/process-definition/get?id=' + id, - method: 'get' + url: '/bpm/process-definition/get', + method: 'get', + params: { id, key } }) } diff --git a/imt-ui/src/api/bpm/processInstance.js b/imt-ui/src/api/bpm/processInstance.js index 58c456f..09dc9d9 100644 --- a/imt-ui/src/api/bpm/processInstance.js +++ b/imt-ui/src/api/bpm/processInstance.js @@ -18,7 +18,7 @@ export function createProcessInstance(data) { export function cancelProcessInstance(id, reason) { return request({ - url: '/bpm/process-instance/cancel', + url: '/bpm/process-instance/cancel-by-start-user', method: 'DELETE', data: { id, diff --git a/imt-ui/src/api/bpm/task.js b/imt-ui/src/api/bpm/task.js index 1bfd0b8..fd9c98c 100644 --- a/imt-ui/src/api/bpm/task.js +++ b/imt-ui/src/api/bpm/task.js @@ -64,7 +64,7 @@ export function getTaskListByProcessInstanceId(processInstanceId) { export function getReturnList(taskId) { return request({ - url: '/bpm/task/return-list?taskId='+ taskId, + url: '/bpm/task/list-by-return?id='+ taskId, method: 'get', }) } diff --git a/imt-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/imt-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index 2021662..e139e8c 100644 --- a/imt-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/imt-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -9,6 +9,7 @@